Recharge API Callback URL Explained (with PHP Example)
Key takeaways
- A callback updates pending recharges automatically
- Update an order only if it is still pending
- Fall back to the status API if a callback is missed
Most recharges succeed or fail within seconds. A few stay pending while the operator confirms. Without a callback URL, someone on your team checks those by hand. With one, your system updates itself.
How the callback works
- You send a recharge with a unique order id.
- The response says Pending.
- When the operator confirms, A1Topup calls your callback URL with the order id, status and operator id.
- Your code updates the order and refunds the customer if it failed.
A simple PHP handler
<?php
$orderId = isset($_GET['txid']) ? $_GET['txid'] : '';
$status = isset($_GET['status']) ? $_GET['status'] : '';
$opid = isset($_GET['opid']) ? $_GET['opid'] : '';
// 1. find the order 2. update only if still pending
// 3. on Failure refund the wallet 4. reply 200
http_response_code(200); echo 'OK';
Write the callback so that running it twice gives the same result. Providers may retry, and your code should never refund the same order twice.
Rules that prevent double refunds
- Update an order only if its current status is pending
- Log every callback with the time and raw values
- Reply with HTTP 200 quickly; do heavy work after
- If no callback arrives, check the status API with the same order id
Conclusion
A callback URL is a few lines of code that saves hours of manual checking every week. Full details and samples are in the API documentation.
Integrating the recharge API?
Docs, code samples and a Postman collection.
Frequently asked questions
What is a callback URL in a recharge API?
What data does the callback send?
What if my server misses a callback?
Have a question? Talk to our team
Related articles
How to Start a Recharge API Business and Become an API Provider
Sell recharge API access under your own brand: what you need, how pricing works and how to find your first API clients.
Read more →Recharge API Price in India: What You Actually Pay (2026)
One-time fee, per-transaction charge or commission? How recharge API pricing really works, and how to compare providers.
Read more →Jio, Airtel and Vi Recharge API: Operator Codes, Circles and Common Errors
The operator codes developers actually need, how circles work, and the small mistakes behind most failed recharges.
Read more →