Code samples on GitHub
Recharge, balance, status and a callback handler, ready to copy into your project.
- PHP
- Node.js
- Python
- Callback handler
Integrate mobile recharge, DTH, postpaid, and utility bill payment services with our robust API. Support for all major operators across India with instant processing.
Everything a developer needs on one page: endpoints, parameters, responses, callback, codes and ready-to-run samples.
Choose a plan and complete KYC; you receive your API username and password.
Log in to your API account and add your server IP and callback URL in the API settings.
Use the sandbox URLs to test success, failure, pending and callbacks without real recharges. Then send one small live recharge.
Load your wallet and start sending recharges from your app or website.
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/.
| Live | Sandbox |
|---|---|
https://business.a1topup.com/recharge/api | https://business.a1topup.com/sandbox/api |
https://business.a1topup.com/recharge/status | https://business.a1topup.com/sandbox/status |
https://business.a1topup.com/recharge/balance | https://business.a1topup.com/sandbox/balance (always 10000.00) |
https://business.a1topup.com/sandbox/api?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&circlecode=0&operatorcode=RC&number=9876543218&amount=199&orderid=TEST1001&format=json&sandbox=1 added.9000. Each orderid can be used once, as in live. Records are kept for 30 days.orderid or an amount below ₹10 returns a Failure, as in live.Complete guide to integrate our recharge and bill payment API
GET/POST https://business.a1topup.com/recharge/apiSend requests from your server only. POST is recommended so your password does not appear in server logs.
| Parameter | Required | Description | Example |
|---|---|---|---|
username | Yes | Your API username | YOUR_USERNAME |
pwd | Yes | Your API password | YOUR_PASSWORD |
circlecode | Yes | Circle code of the number (list below). If you do not know it, send 0. | 2 (West Bengal) or 0 |
operatorcode | Yes | Operator code (see operator list below) | A (Airtel) |
number | Yes | Mobile number or consumer number | 9800000000 |
amount | Yes | Recharge amount | 10 |
orderid | Yes | Your unique order ID | 485668 |
format | No | json or xml. Leave it out for comma-separated text. | json |
commission | No | Send 1 with format=json to also get commission, debited and balance in the reply | 1 |
https://business.a1topup.com/recharge/api?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&circlecode=2&operatorcode=A&number=9800000000&amount=10&orderid=485668&format=jsonformat)1225,Success,WB22565584,9800000000,10,485668Reply fields, in this order:
txid is your own orderid)Success, Pending or Failure. Pending means the operator has not confirmed yet; do not resend, wait for the callback or use the Status API.{
"txid": "5804",
"status": "Success",
"opid": "RJ0317161622000269New",
"number": "9800000000",
"amount": "10",
"orderid": "485668"
}<Recharge>
<txid>5804</txid>
<status>Success</status>
<opid>RJ0317161622000269New</opid>
<number>9800000000</number>
<amount>10</amount>
<orderid>485668</orderid>
</Recharge>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.
GET/POST https://business.a1topup.com/recharge/balance| Parameter | Required | Description | Example |
|---|---|---|---|
username | Yes | Your API username | YOUR_USERNAME |
pwd | Yes | Your API password | YOUR_PASSWORD |
https://business.a1topup.com/recharge/balance?username=YOUR_USERNAME&pwd=YOUR_PASSWORD1542.50Returns your current wallet balance as a plain number.
GET/POST https://business.a1topup.com/recharge/status| Parameter | Required | Description | Example |
|---|---|---|---|
username | Yes | Your API username | YOUR_USERNAME |
pwd | Yes | Your API password | YOUR_PASSWORD |
orderid | Yes | Your unique order ID | 485668 |
format | No | json or xml. Leave it out for comma-separated text. | json |
commission | No | Send 1 with format=json to also get commission, debited and balance in the reply | 1 |
https://business.a1topup.com/recharge/status?username=YOUR_USERNAME&pwd=YOUR_PASSWORD&orderid=485668&format=json{
"txid": "5804",
"status": "Success",
"opid": "RJ0317161622000269New",
"number": "9800000000",
"amount": "10",
"orderid": "485668"
}Same fields as the Recharge API reply. Status can be Success, Pending or Failure.
With the callback URL, you will receive automatic status updates for your transactions.
www.yourdomain.com/yourfile?txid=YOUR_ORDER_ID&status=Success/Failure&opid=OPERATOR_ID| Parameter | Description |
|---|---|
txid | Your original orderid (the id you sent with the recharge) |
status | Success or Failure |
opid | Operator ID from the operator |
&sandbox=1 added.GET/POST https://business.a1topup.com/recharge/complain| Parameter | Required | Description |
|---|---|---|
username, pwd | Yes | Your credentials |
txid | Yes | A1Topup transaction ID from the recharge reply |
mobile | Yes | Recharged number |
amount | Yes | Recharge amount |
message | Yes | Short description of the issue |
Your Complain Has been RegisteredFor a JSON reply you can track, use the Dispute API v2.
GET/POST https://business.a1topup.com/api_dispute/raise| Parameter | Required | Description |
|---|---|---|
username, pwd | Yes | Your credentials (whitelisted IP needed, as for the Recharge API) |
txid or orderid | Yes | A1Topup transaction ID, or your own order ID |
remark | No | Short note, up to 200 characters |
{
"status": "success",
"dispute_id": 1287,
"txid": 5988945,
"orderid": "ORD123",
"dispute_status": "open",
"message": "Dispute registered successfully"
}GET/POST https://business.a1topup.com/api_dispute/statusSend username, pwd and one of dispute_id, txid or orderid.
{
"status": "success",
"dispute_id": 1287,
"txid": 5988945,
"orderid": "ORD123",
"dispute_status": "refunded",
"recharge_status": "Failure",
"provider_reply": "Complain Register Successfully",
"raised_at": "2026-11-13 10:15:02",
"resolved_at": "2026-11-13 14:40:11"
}| dispute_status | Meaning |
|---|---|
open | With the operator. The recharge shows Pending until settled. |
refunded | Accepted. Amount refunded; recharge is Failure. |
not_accepted | Not accepted. Recharge stays Success; no refund. |
rejected | The operator refused the request when it was raised (see message). |
Disputes can be raised within 10 days of the recharge, with up to 10 open at a time. The result also reaches your callback URL (status=Failure if refunded, status=Success if not accepted).
Copy, add your credentials and test in the sandbox first (only the path changes). Use a new order id for every request.
<?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 */ }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);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 "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 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| Status | Meaning | What your system should do |
|---|---|---|
| Success | The operator confirmed the recharge | Mark the order successful and store opid |
| Failure | The recharge was rejected | Refund your customer |
| Pending | Final status not received yet | Do not resend. Wait for the callback, or call the status API with the same order id |
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';These are the exact texts the API returns, so you can match them in your code.
| Reply | Meaning |
|---|---|
Authentication fail! | Wrong username or password, or the account is inactive |
Paramenter is missing | A required parameter is missing (often circlecode) |
Failure with opid Invalid IP x.x.x.x | Request came from an IP that is not whitelisted |
Failure with opid Low Balance | Not enough wallet balance |
Failure with opid Operator Down / Service Unavailable | Operator not available right now; try later |
All supported operators with their codes and service types. Search by name or code, or pick a service.
| Operator Name | Operator Code | Service Type |
|---|---|---|
| Airtel | A | Mobile |
| Vodafone | V | Mobile |
| BSNL - TOPUP | BT | Mobile |
| RELIANCE - JIO | RC | Mobile |
| Idea | I | Mobile |
| BSNL - STV | BR | Mobile |
| Airtel Digital DTH TV | ATV | DTH |
| SUNDIRECT DTH TV | STV | DTH |
| TATASKY DTH TV | TTV | DTH |
| VIDEOCON DTH TV | VTV | DTH |
| DISH TV | DTV | DTH |
| Airtel Postpaid | PAT | PostPaid |
| Idea Postpaid | IP | PostPaid |
| Vodafone Postpaid | VP | PostPaid |
| JIO PostPaid | JPP | PostPaid |
| BSNL PostPaid | BP | PostPaid |
| Tata Docomo Postpaid | DP | Postpaid |
| BSNL Landline | LBS | PostPaid |
| MTNL Delhi Landline | LMT | PostPaid |
| Airtel Landline | LAT | PostPaid |
| North Bihar Electricity | NBE | Electricity |
| JBVNL - Jharkhand | JBVNL | Electricity |
| Assam Power Distribution Company Ltd (RAPDR) | APDCLR | Electricity |
| Mangalore Electricity Supply Co. Ltd (MESCOM) - RAPDR | MESCOMR | Electricity |
| APDCL (Non-RAPDR) - Assam | APDCLN | Electricity |
| Mangalore Electricity Supply Co. Ltd (Non-RAPDR) | MESCOMNR | Electricity |
| BSES Rajdhani Power Limited - Delhi | BSES | Electricity |
| BSES Yamuna Power Limited - Delhi | BSESY | Electricity |
| Tata Power Delhi Limited - Delhi | TPD | Electricity |
| Tata Power - Mumbai | TPDM | Electricity |
| Hubli Electricity Supply Company Ltd. (HESCOM) | HESCOM | Electricity |
| South Bihar Electricity | SBE | Electricity |
| BEST Mumbai | BEST | Electricity |
| Ajmer Vidyut Vitran Nigam - Rajasthan | AJV | Electricity |
| Bangalore Electricity Supply Company (BESCOM) | BESCOM | Electricity |
| CESC - West Bengal | CESC | Electricity |
| Jaipur Vidyut Vitran Nigam - Rajasthan | JVV | Electricity |
| Jodhpur Vidyut Vitran Nigam - Rajasthan | JDVV | Electricity |
| MP Madhya Kshetra Vidyut Vitaran - Urban | MKV | Electricity |
| MSEDC - Maharashtra | MSEDC | Electricity |
| Noida Power - Noida | NP | Electricity |
| Paschim Kshetra Vitaran - Madhya Pradesh | PKV | Electricity |
| Southern Power - Andhra Pradesh | SPA | Electricity |
| Southern Power - Telangana | SPT | Electricity |
| Torrent Power Agra | TRP | Electricity |
| Central Power Distribution Company of Andhra Pradesh Ltd | APCPDCL | Electricity |
| Department of Power Arunachal Pradesh | ARPDOP | Electricity |
| Western Electricity Supply Co. of Orissa Ltd. | WESCO | Electricity |
| Paschim Gujarat Vij Company Ltd | PGVCL | Electricity |
| Bharatpur Electricity Services Ltd | BHES | Electricity |
| Muzaffarpur Vidyut Vitran | MVV | Electricity |
| Madhya Gujarat Vij Company Ltd | MGVCL | Electricity |
| Meghalaya Power Distribution (MEPDCL) | MEPDCL | Electricity |
| KEDL - Kota | KEDL | Electricity |
| Dakshin Gujarat Vij Company Ltd | DGVCL | Electricity |
| WBSEDCL - West Bengal | WBSEDCL | Electricity |
| SNDL Power - Nagpur | SNDL | Electricity |
| Bikaner Electricity Supply Limited | BESL | Electricity |
| India Power - West Bengal | IPWB | Electricity |
| Brihanmumbai Electric Supply & Transport (BEST) | BMESTU | Electricity |
| APEPDCL - Andhra Pradesh | APEPDCL | Electricity |
| TNEB - Tamil Nadu | TNEB | Electricity |
| UPPCL (Urban) - Uttar Pradesh | UPPCLU | Electricity |
| UPPCL (Rural) - Uttar Pradesh | UPPCLR | Electricity |
| Dakshin Haryana Bijli Vitran Nigam | DHBVN | Electricity |
| TSNPDCL - Telangana Northern Power | TSNPDCL | Electricity |
| Dadra & Nagar Haveli Power Distribution (DDCL) | DDCL | Electricity |
| Gulbarga Electricity Supply Company Ltd (GESCL) | GESCL | Electricity |
| India Power Corporation Limited | IPCL | Electricity |
| Jamshedpur Utilities and Services Company | JUSCL | Electricity |
| Chhattisgarh State Power Distribution Company Ltd | CSPDCL | Electricity |
| Goa Electricity | GOAELC | Electricity |
| Uttar Gujarat Vij Company Ltd | UGVCL | Electricity |
| Torrent Power Surat | TORRENTSUR | Electricity |
| Torrent Power Ahmedabad | TORRENTAHM | Electricity |
| Gift Power Company Limited | GPCL | Electricity |
| Himachal Pradesh State Electricity Board Ltd | HPSEBL | Electricity |
| Jammu & Kashmir Power Development Department | JKPDD | Electricity |
| Chamundeshwari Electricity Supply Corporation (CESC Mysore) | CESCOM | Electricity |
| North Delhi Power Limited | NDPL | Electricity |
| Municipal Corporation of Gurugram | MCG | Electricity |
| Punjab State Power Corporation Limited | PSPCL | Electricity |
| Tripura State Electricity Corporation Ltd | TSECL | Electricity |
| Uttar Haryana Bijli Vitran Nigam | UHBV | Electricity |
| Uttarakhand Power Corporation Limited | UKPCL | Electricity |
| Kerala State Electricity Board Ltd | KSEB | Electricity |
| Kannan Devan Hills Power | KDHPCPL | Electricity |
| Lakshadweep Electricity Department | LED | Electricity |
| MP Poorv Kshetra Vidyut Vitaran - Jabalpur | MPPKVVCLPU | Electricity |
| MP Poorv Kshetra Vidyut Vitaran - Rural | MPPKVVCLMR | Electricity |
| MP Poorv Kshetra Vidyut Vitaran - Urban | MPPKVVCL | Electricity |
| Reliance Energy | RELIANCE | Electricity |
| Torrent Power Shil | TORRENTSHI | Electricity |
| Torrent Power Bhivandi | TORRENTBHI | Electricity |
| Adani Power | AEML | Electricity |
| Manipur State Power Distribution Company Ltd (Prepaid) | MSPDCLPR | Electricity |
| Power & Electricity Department - Mizoram | MPED | Electricity |
| Department of Power - Nagaland | NDOP | Electricity |
| New Delhi Municipal Council (NDMC) - Electricity | NDMC | Electricity |
| NESCO Odisha | NESCO | Electricity |
| SOUTHCO Odisha | SOUTHCO | Electricity |
| TP Central Odisha Distribution Ltd | TPCODL | Electricity |
| Puducherry Electricity Department | PGPED | Electricity |
| TP Ajmer Distribution Ltd | TPADL | Electricity |
| Sikkim Power Rural | SPR | Electricity |
| Sikkim Power Urban | SPU | Electricity |
| Kanpur Electricity Supply Company (KESCO) | KESCO | Electricity |
| Torrent Power Dahej | TORRENTDAH | Electricity |
| Mahanagar Gas | MG | Gas |
| Adani Gas | AG | Gas |
| Gujarat Gas | GG | Gas |
| Indraprastha Gas | IG | Gas |
| HPCL Gas | HPCLGC | Gas |
| ICICI Prudential Insurance | ICP | Insurance |
| Tata AIA Insurance | TAI | Insurance |
| Jammu & Kashmir Bank FASTag | JKF | FASTag |
| Kotak Mahindra Bank FASTag | KMF | FASTag |
| IndusInd Bank FASTag | INDF | FASTag |
| Indian Highways Management Company Ltd FASTag | IHMCF | FASTag |
| IDFC First Bank FASTag | IFF | FASTag |
| ICICI Bank FASTag | ICF | FASTag |
| HDFC Bank FASTag | HDF | FASTag |
| Equitas Bank FASTag | EFF | FASTag |
| Bank of Baroda FASTag | BBF | FASTag |
| Axis Bank FASTag | AXF | FASTag |
| Federal Bank FASTag | FDF | FASTag |
| Paytm Payments Bank FASTag | PTF | FASTag |
| Airtel Payments Bank FASTag | APB | FASTag |
| IDBI Bank FASTag | IBF | FASTag |
| SBI Bank FASTag | SBF | FASTag |
| Google Play Gift Card | GLF | Voucher |
No operator matches your search.
Telecom circle codes for different states and regions
| State | Circle Code |
|---|---|
| Andhra Pradesh | 13 |
| Assam | 24 |
| Bihar | 17 |
| Chhattisgarh | 27 |
| Gujarat | 12 |
| Haryana | 20 |
| Himachal Pradesh | 21 |
| Jammu and Kashmir | 25 |
| Jharkhand | 22 |
| Karnataka | 9 |
| Kerala | 14 |
| Madhya Pradesh | 16 |
| Maharashtra | 4 |
| Orissa | 23 |
| Punjab | 1 |
| Rajasthan | 18 |
| Tamil Nadu | 8 |
| Uttar Pradesh East | 10 |
| Uttar Pradesh West | 11 |
| West Bengal | 2 |
| Mumbai | 3 |
| Delhi | 5 |
| Chennai | 7 |
| North East | 26 |
| Kolkata | 6 |
Same recharge endpoint; pass the extra values in value1 and value2.
| Biller | number | value1 | value2 |
|---|---|---|---|
| Airtel Landline | Landline number | STD code | - |
| BSNL Landline | Landline number | STD code | Account number |
| MTNL Delhi Landline | Landline number | CA number | - |
| Mahanagar Gas | Customer account number | Bill group number | - |
| MSEDC - Maharashtra | Consumer number | Billing unit | Processing cycle |
| Reliance Energy - Mumbai | Account number | Cycle number | - |
| Insurance | Policy number | Date 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.
Test for free, track every request and fix problems from your own panel, without waiting for support.
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.
Every request your software sent and our exact reply, for the last 30 days, under Developer > API Logs.
Every callback we sent, your server’s reply, and a resend button, under Developer > Callback Logs.
Raise a dispute from your software, follow it from open to refunded, and get the result on your callback URL.
Add commission=1 and each reply also shows your commission, the amount debited and your wallet balance.
A WhatsApp or email alert when your wallet goes below the limit you set, so recharges never stop on a busy evening.
Start from working samples instead of a blank file. Both are free and public.
Recharge, balance, status and a callback handler, ready to copy into your project.
All 9 endpoints with descriptions and variables. Fork it, add your credentials and press Send.
Your server IP must be whitelisted before live calls. Never put real credentials in a public workspace.
Import the collection, set username and pwd, and run the recharge, balance, status, sandbox and dispute requests.
On this page: the recharge, balance and status API, response formats, callback URL, operator and circle codes, code samples and a Postman collection.
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.
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.
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.
Comma-separated text by default (leave out format), JSON with format=json and XML with format=xml.
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.
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.
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.
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.
Use the Dispute API v2 (/api_dispute/raise) and track it with /api_dispute/status. The final result also comes to your callback URL.
Yes. Add commission=1 to a JSON request to get commission, debited and balance in the reply.
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.