Mobile recharge API: what does a request look like?

The mobile recharge API lets your app or website recharge prepaid mobile numbers on the major Indian operators. This article walks through a typical recharge, from finding the operator to handling the final result. It is aimed at developers but explains each step in plain terms.

Before you start

  • You have an API key and a whitelisted server IP. See our quick start article if not.
  • Your wallet has enough balance (or you are using a test key).
  • You have the operator codes list from the API documentation.

Step 1: Identify the operator and circle (optional)

Customers often do not know or choose the wrong operator, especially after porting their number. An operator lookup call returns the likely operator and circle (the telecom region) for a number, which you can show as the default choice.

GET /api/services/v1/recharge/operator-lookup?number=98XXXXXX10

You can also use the plans API to show the current plans for that operator and circle. See the recharge plans API page.

Step 2: Send the recharge request

curl -X POST "https://www.pepploweb.com/api/services/v1/recharge/mobile" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "number": "98XXXXXX10",
    "operator": "OPERATOR_CODE",
    "circle": "CIRCLE_CODE",
    "amount": "299",
    "reference_id": "ORD10045"
  }'

The reference_id is your own unique ID for this order. Never reuse it. If a network problem makes you unsure whether the request arrived, the same reference ID lets you check its status without risking a double recharge.

Step 3: Read the response

There are three possible outcomes.

Success

{ "status": "success", "data": { "txn_id": "PW9F2A71", "reference_id": "ORD10045",
  "operator_ref": "OPREF12345", "amount": "299", "charged": "AMOUNT_AFTER_COMMISSION" } }

The recharge is complete. Show the operator reference to the customer as proof.

Failure

{ "status": "failed", "data": { "reference_id": "ORD10045", "reason": "Invalid amount for operator" } }

Nothing was charged, or the charge has been reversed. Show a clear message and let the customer try again with corrected details.

Pending

{ "status": "pending", "data": { "txn_id": "PW9F2A71", "reference_id": "ORD10045" } }

The operator has not yet confirmed. Tell the customer the recharge is being processed. Do not refund the customer or retry yet. Wait for the webhook or check the status later.

Step 4: Handle the final status

When a pending recharge completes, we send a webhook to your URL with the final status. Update the order, notify the customer, and, if it failed, refund the customer in your system. If no webhook arrives, use the status check API as a backup.

Practical tips

  • Validate the number (10 digits) and amount on your side before calling the API.
  • Set a generous timeout, for example 60 seconds, and treat a timeout as pending, not failed.
  • Debit the customer's own wallet in your app before calling the API, and reverse it only after a confirmed failure.
  • Store the transaction ID and operator reference for customer complaints.
  • Use the same flow for DTH and FASTag recharges, with their own operator codes.
The examples in this article are simplified to show the flow. Field names, endpoint paths and response formats can differ by service, so always follow the current reference in our API documentation.

Next steps

Read about the full service on our mobile recharge API page and check rates on API pricing. Want a ready-made platform instead of building your own? See our mobile recharge software.

Was this article helpful?

Still stuck? Open a support ticket and our team will help.


Related articles

← Back

Chat with us
Hi! Send us a message and we will reply here as soon as we can.
Security check image
Chat with us