Recharge API Docs
Partner API

Recharge API

Mobile, DTH and prepaid recharge APIs. Use the flow below to fetch operator details, optional plans, perform recharge, and check status.

Authentication

Send your API key in the header on every request. Configure your key and whitelisted server IP in the partner dashboard.

HeaderValue
X-API-KEYYour partner API key
Acceptapplication/json
Your server IP must be whitelisted, otherwise the API returns 403. The Recharge service must be active on your account.

1. Operators List

Returns all recharge operators available for your account. Use the id from this list as operator_code in Do Recharge.

GET https://partner.codecraftsdigisoft.com/api/v1/recharge/operators

Example Request

curl --location 'https://partner.codecraftsdigisoft.com/api/v1/recharge/operators' \ --header 'X-API-KEY: YOUR_API_KEY' \ --header 'Accept: application/json'

Success Response

{ "status": true, "code": 200, "message": "Operators fetched successfully", "data": [ { "id": 1, "operator_name": "AIRTEL", "type": "prepaid" }, { "id": 6, "operator_name": "RELIANCE JIO", "type": "prepaid" } ] }

2. Fetch Operator

Detect operator and circle from a mobile number. Recommended before recharge when operator is not known.

POST https://partner.codecraftsdigisoft.com/api/v1/recharge/fetch_operator

Request Parameters

FieldRequiredDescription
mobileYes10–15 digit mobile number

Example Request

curl --location 'https://partner.codecraftsdigisoft.com/api/v1/recharge/fetch_operator' \ --header 'X-API-KEY: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{"mobile": "9876543210"}'

Success Response

{ "status": true, "code": 200, "message": "Operators fetched successfully", "data": { "id": 1, "operator_name": "AIRTEL", "circle": "Rajasthan", "type": "prepaid" } }
Use the exact circle string from this response in Fetch Plans. Example: Delhi numbers may return Delhi NCR, not Delhi.

3. Fetch Plans

Optional — fetch prepaid plans for an operator and circle. Available only for prepaid operators.

POST https://partner.codecraftsdigisoft.com/api/v1/recharge/fetch_plans

Request Parameters

FieldRequiredDescription
operatorYesOperator id from Operators List or Fetch Operator (e.g. 1 for AIRTEL)
circleYesCircle name string — use exact value from Fetch Operator (e.g. Rajasthan)

Example Request

curl --location 'https://partner.codecraftsdigisoft.com/api/v1/recharge/fetch_plans' \ --header 'X-API-KEY: YOUR_API_KEY' \ --header 'Accept: application/json' \ --data '{ "operator": 1, "circle": "Rajasthan" }'

Success Response

{ "status": true, "code": 200, "message": "Plans fetched successfully", "data": { "FULLTT": [ { "rs": "299", "desc": "Unlimited calls + 1.5GB/day", "validity": "28 days", "last_update": "04-06-2026" } ], "TOPUP": [ { "rs": "10", "desc": "Talktime : Rs 7.47", "validity": "N/A", "last_update": "04-06-2026" } ] } }
If plans are not available for a circle, the API returns 404 with message Plans not found. You can still proceed with Do Recharge using a known amount.

4. Do Recharge

Perform a recharge. Amount is debited from your e-wallet (recharge amount + service charge).

POST https://partner.codecraftsdigisoft.com/api/v1/recharge/do_recharge

Request Parameters

FieldRequiredDescription
mobileYes10–15 digit mobile / subscriber number
amountYesRecharge amount (minimum ₹1)
operator_codeYesOperator id from Operators List — not the vendor operator code
txn_idNoYour own unique transaction ID (max 40 chars; letters, numbers, _ and -). The same txn_id is used in the response, status check and callback. A repeated txn_id is rejected, so a retry never creates a second recharge. If not sent, we generate one and return it.
callback_urlNoYour server URL to receive the final status when a PENDING recharge becomes SUCCESS or FAILED (see Callback section)
Important: operator_code is the numeric id from the Operators API (e.g. 6 for JIO), not a vendor operator code. For DTH, skip Fetch Operator and Fetch Plans. Put the subscriber number in mobile and the DTH operator id in operator_code (type dth in the Operators list, for example 12 for AIRTEL DTH).

Example Request

curl --location 'https://partner.codecraftsdigisoft.com/api/v1/recharge/do_recharge' \ --header 'X-API-KEY: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "mobile": "9876543210", "amount": 299, "operator_code": "1", "txn_id": "ORD20261020001", "callback_url": "https://yourdomain.com/recharge/callback" }'

DTH Example

curl --location 'https://partner.codecraftsdigisoft.com/api/v1/recharge/do_recharge' \ --header 'X-API-KEY: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ "mobile": "1234567890", "amount": 299, "operator_code": "12" }'

Success Response

{ "status": true, "code": 200, "message": "Recharge Successful", "data": { "status": "SUCCESS", "txn_id": "ORD20261020001", "operator_txn_id": "SP123456789", "message": "Recharge successful", "mobile": "9876543210", "amount": 299, "operator": "AIRTEL" } }

Pending Response

{ "status": true, "code": 200, "message": "Recharge is in process!", "data": { "status": "PENDING", "txn_id": "ORD20261020001", "operator_txn_id": null, "message": "Recharge is in process!", "mobile": "9876543210", "amount": 299, "operator": "AIRTEL" } }

Failed Response

{ "status": false, "code": 200, "message": "Recharge Failed!", "data": { "status": "FAILED", "txn_id": "ORD20261020001", "operator_txn_id": null, "message": "Recharge Failed!", "mobile": "9876543210", "amount": 299, "operator": "AIRTEL" } }

5. Status Check

Check the final recharge status using the txn_id returned from Do Recharge.

POST https://partner.codecraftsdigisoft.com/api/v1/recharge/status_check

Request Parameters

FieldRequiredDescription
txn_idYesThe txn_id you sent in Do Recharge (or the one returned, if you did not send one)

Example Request

curl --location 'https://partner.codecraftsdigisoft.com/api/v1/recharge/status_check' \ --header 'X-API-KEY: YOUR_API_KEY' \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{"txn_id": "ORD20261020001"}'

Success Response

{ "status": true, "code": 200, "message": "Recharge status fetched successfully", "data": { "status": "SUCCESS", "txn_id": "ORD20261020001", "operator_txn_id": "SP123456789", "message": "Recharge successful", "mobile": "9876543210", "amount": 299, "operator": "AIRTEL" } }

6. Callback

If you send callback_url in Do Recharge, we send a GET request to it when a PENDING recharge gets its final status.

GET Your callback_url?txn_id=xxx&status=SUCCESS&operator_txn_id=xxx&mobile=xxx&amount=xxx

Callback Parameters

ParameterDescription
txn_idYour txn_id from Do Recharge
statusSUCCESS / FAILED
operator_txn_idOperator reference (on SUCCESS, may be empty otherwise)
mobileMobile / subscriber number
amountRecharge amount
If Do Recharge already returns SUCCESS or FAILED, no callback is sent. Your server should return HTTP 200. The callback is sent once; if you miss it, use status_check.

Integration Flow

  1. Call operators to get the operator list (or skip if you already know the operator id)
  2. Call fetch_operator with the mobile number to auto-detect operator and circle
  3. Optional: call fetch_plans using operator id and exact circle from step 2
  4. Call do_recharge with mobile, amount, and operator id as operator_code. For DTH, use the subscriber number and a dth operator id. Do not call fetch operator or plans.
  5. Save the returned txn_id — use it in status_check every 30–60 seconds while status is PENDING
  6. Stop polling when status becomes SUCCESS or FAILED

Status Values

PENDING Recharge is being processed — poll status_check

SUCCESS Recharge completed successfully

FAILED Recharge failed — amount refunded to e-wallet if debited

Amount is debited from the e-wallet. Wallet is charged recharge amount plus applicable service charge. On failure before debit, no wallet deduction occurs; on failure after debit, amount is refunded automatically via status check.