Skip to main content
Login

Recharge API Integration

Integrate mobile recharge, DTH, postpaid, and utility bill payment services with our robust API. Support for all major operators across India with instant processing.

  • ISO 9001:2015 certified
  • GST registered company
  • Phone & WhatsApp support
Recharge API Integration
Quick start

Integrate the recharge API in 4 steps

Everything a developer needs on one page: endpoints, parameters, responses, callback, codes and ready-to-run samples.

  1. 1

    Get API credentials

    Choose a plan and complete KYC; you receive your API username and password.

  2. 2

    Whitelist & configure

    Log in to your API account and add your server IP and callback URL in the API settings.

  3. 3

    Test in the sandbox (free)

    Use the sandbox URLs to test success, failure, pending and callbacks without real recharges. Then send one small live recharge.

  4. 4

    Go live

    Load your wallet and start sending recharges from your app or website.

Free test mode

Test mode (sandbox)

Test your integration without real recharges. Nothing is sent to the operator and no money moves from your wallet. Use the same parameters and formats as the live API; only the path changes from recharge/ to sandbox/.

LiveSandbox
https://business.a1topup.com/recharge/apihttps://business.a1topup.com/sandbox/api
https://business.a1topup.com/recharge/statushttps://business.a1topup.com/sandbox/status
https://business.a1topup.com/recharge/balancehttps://business.a1topup.com/sandbox/balance (always 10000.00)

Choose the result with the last digit of the number

0 to 6Reply: SuccessCallback: Success, right after the reply
7Reply: PendingCallback: Failure, after about a minute
8Reply: PendingCallback: Success, after about a minute
9Reply: FailureCallback: Failure, right after the reply
https://business.a1topup.com/sandbox/api?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&circlecode=0&operatorcode=RC&number=9876543218&amount=199&orderid=TEST1001&format=json
  • Works from any IP, so you can test from your laptop. The live API needs a whitelisted server IP.
  • Callbacks use the live format, with &sandbox=1 added.
  • Sandbox transaction IDs start with 9000. Each orderid can be used once, as in live. Records are kept for 30 days.
  • A duplicate orderid or an amount below ₹10 returns a Failure, as in live.
For developers

API Documentation

Complete guide to integrate our recharge and bill payment API

Recharge API Endpoint

GET/POST https://business.a1topup.com/recharge/api

Send requests from your server only. POST is recommended so your password does not appear in server logs.

Request Parameters

ParameterRequiredDescriptionExample
usernameYesYour API usernameYOUR_USERNAME
pwdYesYour API passwordYOUR_PASSWORD
circlecodeYesCircle code of the number (list below). If you do not know it, send 0.2 (West Bengal) or 0
operatorcodeYesOperator code (see operator list below)A (Airtel)
numberYesMobile number or consumer number9800000000
amountYesRecharge amount10
orderidYesYour unique order ID485668
formatNojson or xml. Leave it out for comma-separated text.json
commissionNoSend 1 with format=json to also get commission, debited and balance in the reply1

Sample Request

https://business.a1topup.com/recharge/api?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&circlecode=2&operatorcode=A&number=9800000000&amount=10&orderid=485668&format=json

Response Formats

Comma-separated text (default, no format)

1225,Success,WB22565584,9800000000,10,485668

Reply fields, in this order:

  1. txid - A1Topup transaction ID (in callbacks, txid is your own orderid)
  2. status - Success, Pending or Failure. Pending means the operator has not confirmed yet; do not resend, wait for the callback or use the Status API.
  3. opid - Operator ID
  4. number - Recharge number
  5. amount - Recharge amount
  6. orderid - Your order ID

JSON Format

{
  "txid": "5804",
  "status": "Success",
  "opid": "RJ0317161622000269New",
  "number": "9800000000",
  "amount": "10",
  "orderid": "485668"
}

XML Format

<Recharge>
  <txid>5804</txid>
  <status>Success</status>
  <opid>RJ0317161622000269New</opid>
  <number>9800000000</number>
  <amount>10</amount>
  <orderid>485668</orderid>
</Recharge>

Reply with commission (commission=1, JSON only)

{
  "txid": "5804",
  "status": "Success",
  "opid": "RJ0317161622000269New",
  "number": "9800000000",
  "amount": "10",
  "orderid": "485668",
  "commission": "0.10",
  "debited": "9.90",
  "balance": "1532.60"
}

commission is the commission on this recharge, debited the amount taken from your wallet, and balance your wallet balance at the time of the reply (not at the time of the recharge). Without commission=1 the reply is unchanged.

Code samples

Recharge API integration in PHP, Node.js, Python and cURL

Copy, add your credentials and test in the sandbox first (only the path changes). Use a new order id for every request.

PHP (cURL)

<?php
$params = array(
    'username'     => 'YOUR_USERNAME',
    'pwd'          => 'YOUR_PASSWORD',
    'circlecode'   => '0',            // circle code (list below); send 0 if you do not know it
    'operatorcode' => 'RC',           // RC = Jio, A = Airtel, V = Vodafone (list below)
    'number'       => '9800000000',
    'amount'       => '10',
    'orderid'      => 'ORD' . time(), // unique for every request
    'format'       => 'json',
);
$ch = curl_init('https://business.a1topup.com/recharge/api?' . http_build_query($params));
curl_setopt_array($ch, array(CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 60));
$res = json_decode(curl_exec($ch), true);
curl_close($ch);

if ($res && $res['status'] === 'Success')     { /* mark order successful, save $res['opid'] */ }
elseif ($res && $res['status'] === 'Failure') { /* refund your customer */ }
else                                           { /* pending: wait for the callback or call the status API */ }

Node.js

const params = new URLSearchParams({
  username: 'YOUR_USERNAME', pwd: 'YOUR_PASSWORD',
  circlecode: '0', operatorcode: 'RC', number: '9800000000',   // circlecode 0 = unknown
  amount: '10', orderid: 'ORD' + Date.now(), format: 'json'
});
const res = await fetch('https://business.a1topup.com/recharge/api?' + params);
const data = await res.json();   // { txid, status, opid, number, amount, orderid }
console.log(data.status);

Python

import requests, time
params = {"username": "YOUR_USERNAME", "pwd": "YOUR_PASSWORD", "circlecode": "0",  # 0 = circle not known
          "operatorcode": "RC", "number": "9800000000", "amount": "10",
          "orderid": f"ORD{int(time.time())}", "format": "json"}
data = requests.get("https://business.a1topup.com/recharge/api", params=params, timeout=60).json()
print(data["status"], data.get("opid"))

cURL

curl "https://business.a1topup.com/recharge/api?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&circlecode=0&operatorcode=RC&number=9800000000&amount=10&orderid=ORD1001&format=json"

# Test mode: same request, only the path changes from recharge/ to sandbox/
curl "https://business.a1topup.com/sandbox/api?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&circlecode=0&operatorcode=RC&number=9876543218&amount=199&orderid=TEST1001&format=json"

Status and balance API

// Status API (use the same order id you sent with the recharge)
https://business.a1topup.com/recharge/status?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&orderid=ORD1001&format=json

// Balance API (replies with a plain number, e.g. 1542.50)
https://business.a1topup.com/recharge/balance?username=YOUR_USERNAME&pwd=YOUR_PASSWORD
Responses

Handling responses and pending recharges

StatusMeaningWhat your system should do
SuccessThe operator confirmed the rechargeMark the order successful and store opid
FailureThe recharge was rejectedRefund your customer
PendingFinal status not received yetDo not resend. Wait for the callback, or call the status API with the same order id
  • Every request needs a unique order id; reuse it only to check status.
  • Keep a 60-second timeout; a timeout is treated as pending, not failed.
  • Log every request and response with the order id for reconciliation.
Callback URL

Recharge API callback URL: automatic status updates

When a pending or disputed transaction gets its final status, A1Topup calls your URL with the order id, status and operator id.

<?php
// callback.php - A1Topup calls: https://yourdomain.com/callback.php?txid=ORDER_ID&status=Success&opid=OPERATOR_ID
$orderId = isset($_GET['txid'])   ? $_GET['txid']   : '';   // your order id
$status  = isset($_GET['status']) ? $_GET['status'] : '';   // Success or Failure
$test    = isset($_GET['sandbox']);                          // present only for test-mode callbacks
$opid    = isset($_GET['opid'])   ? $_GET['opid']   : '';   // operator reference
// 1. find the order by $orderId   2. update it only if it is still pending
// 3. if Failure: refund the customer's wallet   4. respond with HTTP 200
http_response_code(200); echo 'OK';
Errors

Error replies and what they mean

These are the exact texts the API returns, so you can match them in your code.

ReplyMeaning
Authentication fail!Wrong username or password, or the account is inactive
Paramenter is missingA required parameter is missing (often circlecode)
Failure with opid Invalid IP x.x.x.xRequest came from an IP that is not whitelisted
Failure with opid Low BalanceNot enough wallet balance
Failure with opid Operator Down / Service UnavailableOperator not available right now; try later
Services

Operator Code List

All supported operators with their codes and service types. Search by name or code, or pick a service.

Operator NameOperator CodeService Type
AirtelAMobile
VodafoneVMobile
BSNL - TOPUPBTMobile
RELIANCE - JIORCMobile
IdeaIMobile
BSNL - STVBRMobile
Airtel Digital DTH TVATVDTH
SUNDIRECT DTH TVSTVDTH
TATASKY DTH TVTTVDTH
VIDEOCON DTH TVVTVDTH
DISH TVDTVDTH
Airtel PostpaidPATPostPaid
Idea PostpaidIPPostPaid
Vodafone PostpaidVPPostPaid
JIO PostPaidJPPPostPaid
BSNL PostPaidBPPostPaid
Tata Docomo PostpaidDPPostpaid
BSNL LandlineLBSPostPaid
MTNL Delhi LandlineLMTPostPaid
Airtel LandlineLATPostPaid
North Bihar ElectricityNBEElectricity
JBVNL - JharkhandJBVNLElectricity
Assam Power Distribution Company Ltd (RAPDR)APDCLRElectricity
Mangalore Electricity Supply Co. Ltd (MESCOM) - RAPDRMESCOMRElectricity
APDCL (Non-RAPDR) - AssamAPDCLNElectricity
Mangalore Electricity Supply Co. Ltd (Non-RAPDR)MESCOMNRElectricity
BSES Rajdhani Power Limited - DelhiBSESElectricity
BSES Yamuna Power Limited - DelhiBSESYElectricity
Tata Power Delhi Limited - DelhiTPDElectricity
Tata Power - MumbaiTPDMElectricity
Hubli Electricity Supply Company Ltd. (HESCOM)HESCOMElectricity
South Bihar ElectricitySBEElectricity
BEST MumbaiBESTElectricity
Ajmer Vidyut Vitran Nigam - RajasthanAJVElectricity
Bangalore Electricity Supply Company (BESCOM)BESCOMElectricity
CESC - West BengalCESCElectricity
Jaipur Vidyut Vitran Nigam - RajasthanJVVElectricity
Jodhpur Vidyut Vitran Nigam - RajasthanJDVVElectricity
MP Madhya Kshetra Vidyut Vitaran - UrbanMKVElectricity
MSEDC - MaharashtraMSEDCElectricity
Noida Power - NoidaNPElectricity
Paschim Kshetra Vitaran - Madhya PradeshPKVElectricity
Southern Power - Andhra PradeshSPAElectricity
Southern Power - TelanganaSPTElectricity
Torrent Power AgraTRPElectricity
Central Power Distribution Company of Andhra Pradesh LtdAPCPDCLElectricity
Department of Power Arunachal PradeshARPDOPElectricity
Western Electricity Supply Co. of Orissa Ltd.WESCOElectricity
Paschim Gujarat Vij Company LtdPGVCLElectricity
Bharatpur Electricity Services LtdBHESElectricity
Muzaffarpur Vidyut VitranMVVElectricity
Madhya Gujarat Vij Company LtdMGVCLElectricity
Meghalaya Power Distribution (MEPDCL)MEPDCLElectricity
KEDL - KotaKEDLElectricity
Dakshin Gujarat Vij Company LtdDGVCLElectricity
WBSEDCL - West BengalWBSEDCLElectricity
SNDL Power - NagpurSNDLElectricity
Bikaner Electricity Supply LimitedBESLElectricity
India Power - West BengalIPWBElectricity
Brihanmumbai Electric Supply & Transport (BEST)BMESTUElectricity
APEPDCL - Andhra PradeshAPEPDCLElectricity
TNEB - Tamil NaduTNEBElectricity
UPPCL (Urban) - Uttar PradeshUPPCLUElectricity
UPPCL (Rural) - Uttar PradeshUPPCLRElectricity
Dakshin Haryana Bijli Vitran NigamDHBVNElectricity
TSNPDCL - Telangana Northern PowerTSNPDCLElectricity
Dadra & Nagar Haveli Power Distribution (DDCL)DDCLElectricity
Gulbarga Electricity Supply Company Ltd (GESCL)GESCLElectricity
India Power Corporation LimitedIPCLElectricity
Jamshedpur Utilities and Services CompanyJUSCLElectricity
Chhattisgarh State Power Distribution Company LtdCSPDCLElectricity
Goa ElectricityGOAELCElectricity
Uttar Gujarat Vij Company LtdUGVCLElectricity
Torrent Power SuratTORRENTSURElectricity
Torrent Power AhmedabadTORRENTAHMElectricity
Gift Power Company LimitedGPCLElectricity
Himachal Pradesh State Electricity Board LtdHPSEBLElectricity
Jammu & Kashmir Power Development DepartmentJKPDDElectricity
Chamundeshwari Electricity Supply Corporation (CESC Mysore)CESCOMElectricity
North Delhi Power LimitedNDPLElectricity
Municipal Corporation of GurugramMCGElectricity
Punjab State Power Corporation LimitedPSPCLElectricity
Tripura State Electricity Corporation LtdTSECLElectricity
Uttar Haryana Bijli Vitran NigamUHBVElectricity
Uttarakhand Power Corporation LimitedUKPCLElectricity
Kerala State Electricity Board LtdKSEBElectricity
Kannan Devan Hills PowerKDHPCPLElectricity
Lakshadweep Electricity DepartmentLEDElectricity
MP Poorv Kshetra Vidyut Vitaran - JabalpurMPPKVVCLPUElectricity
MP Poorv Kshetra Vidyut Vitaran - RuralMPPKVVCLMRElectricity
MP Poorv Kshetra Vidyut Vitaran - UrbanMPPKVVCLElectricity
Reliance EnergyRELIANCEElectricity
Torrent Power ShilTORRENTSHIElectricity
Torrent Power BhivandiTORRENTBHIElectricity
Adani PowerAEMLElectricity
Manipur State Power Distribution Company Ltd (Prepaid)MSPDCLPRElectricity
Power & Electricity Department - MizoramMPEDElectricity
Department of Power - NagalandNDOPElectricity
New Delhi Municipal Council (NDMC) - ElectricityNDMCElectricity
NESCO OdishaNESCOElectricity
SOUTHCO OdishaSOUTHCOElectricity
TP Central Odisha Distribution LtdTPCODLElectricity
Puducherry Electricity DepartmentPGPEDElectricity
TP Ajmer Distribution LtdTPADLElectricity
Sikkim Power RuralSPRElectricity
Sikkim Power UrbanSPUElectricity
Kanpur Electricity Supply Company (KESCO)KESCOElectricity
Torrent Power DahejTORRENTDAHElectricity
Mahanagar GasMGGas
Adani GasAGGas
Gujarat GasGGGas
Indraprastha GasIGGas
HPCL GasHPCLGCGas
ICICI Prudential InsuranceICPInsurance
Tata AIA InsuranceTAIInsurance
Jammu & Kashmir Bank FASTagJKFFASTag
Kotak Mahindra Bank FASTagKMFFASTag
IndusInd Bank FASTagINDFFASTag
Indian Highways Management Company Ltd FASTagIHMCFFASTag
IDFC First Bank FASTagIFFFASTag
ICICI Bank FASTagICFFASTag
HDFC Bank FASTagHDFFASTag
Equitas Bank FASTagEFFFASTag
Bank of Baroda FASTagBBFFASTag
Axis Bank FASTagAXFFASTag
Federal Bank FASTagFDFFASTag
Paytm Payments Bank FASTagPTFFASTag
Airtel Payments Bank FASTagAPBFASTag
IDBI Bank FASTagIBFFASTag
SBI Bank FASTagSBFFASTag
Google Play Gift CardGLFVoucher

Circle Code List

Telecom circle codes for different states and regions

StateCircle Code
Andhra Pradesh13
Assam24
Bihar17
Chhattisgarh27
Gujarat12
Haryana20
Himachal Pradesh21
Jammu and Kashmir25
Jharkhand22
Karnataka9
Kerala14
Madhya Pradesh16
Maharashtra4
Orissa23
Punjab1
Rajasthan18
Tamil Nadu8
Uttar Pradesh East10
Uttar Pradesh West11
West Bengal2
Mumbai3
Delhi5
Chennai7
North East26
Kolkata6
Bills & landline

Extra parameters for landline, gas, electricity and insurance

Same recharge endpoint; pass the extra values in value1 and value2.

Billernumbervalue1value2
Airtel LandlineLandline numberSTD code-
BSNL LandlineLandline numberSTD codeAccount number
MTNL Delhi LandlineLandline numberCA number-
Mahanagar GasCustomer account numberBill group number-
MSEDC - MaharashtraConsumer numberBilling unitProcessing cycle
Reliance Energy - MumbaiAccount numberCycle number-
InsurancePolicy numberDate of birth (DD-MM-YYYY)-

Fetch the bill amount first with the bill fetch API, detect operators with the operator detection API, and show live plans with the recharge plan API.

Developer tools in your API panel

Test for free, track every request and fix problems from your own panel, without waiting for support.

Free test mode

A sandbox with the same parameters as live. Pick success, pending or failure with the last digit of the number. No operator, no money moved.

API Logs

Every request your software sent and our exact reply, for the last 30 days, under Developer > API Logs.

Callback Logs and resend

Every callback we sent, your server’s reply, and a resend button, under Developer > Callback Logs.

Dispute API with tracking

Raise a dispute from your software, follow it from open to refunded, and get the result on your callback URL.

Commission in the reply

Add commission=1 and each reply also shows your commission, the amount debited and your wallet balance.

Low balance alert

A WhatsApp or email alert when your wallet goes below the limit you set, so recharges never stop on a busy evening.

Developer tools

Integrate faster with ready code and a live collection

Start from working samples instead of a blank file. Both are free and public.

Code samples on GitHub

Recharge, balance, status and a callback handler, ready to copy into your project.

  • PHP
  • Node.js
  • Python
  • Callback handler

Postman collection

All 9 endpoints with descriptions and variables. Fork it, add your credentials and press Send.

  • Recharge
  • Balance
  • Status
  • +6 more

Your server IP must be whitelisted before live calls. Never put real credentials in a public workspace.

Postman

Test the API in Postman

Import the collection, set username and pwd, and run the recharge, balance, status, sandbox and dispute requests.

FAQ

Recharge API integration questions

Where is the A1Topup recharge API documentation?

On this page: the recharge, balance and status API, response formats, callback URL, operator and circle codes, code samples and a Postman collection.

How do I integrate a mobile recharge API in PHP?

Send a GET or POST request to the recharge endpoint with your username, password, circle code, operator code, number, amount and a unique order id, then read the JSON response. A complete PHP cURL example is on this page.

How do I check the status of a pending recharge?

Call the status API with the same order id you sent with the recharge. Do not send the recharge again while it is pending; set a callback URL to receive the final status automatically.

What is the callback URL in a recharge API?

A URL on your server that A1Topup calls with the order id, final status (Success or Failure) and operator id, so your system updates pending and reversed transactions without manual checks.

Which response formats does the API support?

Comma-separated text by default (leave out format), JSON with format=json and XML with format=xml.

Is the A1Topup recharge API free?

The API is available on a one-time plan, and you earn commission on every successful recharge. Plans and operator-wise commission are listed on the Recharge API commission page.

Does the same API work for DTH, postpaid and electricity bills?

Yes. Use the operator code of the service. Landline, gas, electricity and insurance billers need extra values in value1 and value2, as listed on this page.

What if the operator or circle is detected wrongly?

This usually happens with ported (MNP) numbers. Use the operator detection API to get the current operator and circle, let the user correct it if needed, and send the corrected operator code and circle code with the recharge.

Can I test the API without real money?

Yes. Use the sandbox URLs (/sandbox/api, /sandbox/status, /sandbox/balance). Nothing is sent to the operator and your wallet is not charged. The last digit of the number decides the result.

How do I raise a dispute from my software?

Use the Dispute API v2 (/api_dispute/raise) and track it with /api_dispute/status. The final result also comes to your callback URL.

Can I get my commission in the recharge reply?

Yes. Add commission=1 to a JSON request to get commission, debited and balance in the reply.

Get in touch

Ready to Get Started?

Sign up today and get your API credentials to start integrating recharge services into your application.


Rated 4.9/5 from 314 Google reviews by businesses.

We respect your privacy. Your details are only used to contact you about A1Topup.

WhatsApp