API Documentation
Overview
Your server sends a recharge request. We check your api_token and server IP, create the order with our own reference number and give it to a free phone. The API waits for the phone's answer (default 10 seconds). If the phone has finished, the answer already has the final result. If not, the answer has all data with STATUS 3 (pending). When the phone answers later, the result is saved and your webhook URL is called. The answers are plain JSON.
Base URL: https://autolapu.adaptwind.in Method: GET or POST Answer: JSON only
Log in to see your own API token in the examples.
1. Recharge request
Endpoint: https://autolapu.adaptwind.in/recharge.php (the token goes in the URL or form fields, never in a header)
| Parameter | Required | Description |
|---|---|---|
api_token | Yes | Your secret token. Find it on the API & Webhook page. |
mobile | Yes | 10 digit mobile number to recharge (starts with 6, 7, 8 or 9). |
Operato | Yes | JIO, AIRTEL or VI. (operator is also accepted.) |
amount | Yes | Whole rupees, 1 to 10000. For Jio the plan with exactly this amount must exist. |
ClientId | Optional | Your own reference for this request: letters, numbers, _ . -, max 60 characters. Must be unique per request. The same ClientId sent again returns the first order and never recharges twice. Returned as CALLBACKID. |
circle | Optional | State / circle code, e.g. 05. Saved with the order. |
Example request
https://autolapu.adaptwind.in/recharge.php?api_token=YOUR_API_TOKEN&mobile=9800950021&Operato=JIO&amount=349&ClientId=ORDER1001&circle=05
cURL
curl "https://autolapu.adaptwind.in/recharge.php?api_token=YOUR_API_TOKEN&mobile=9800950021&Operato=JIO&amount=349&ClientId=ORDER1001&circle=05"
PHP
<?php $url = 'https://autolapu.adaptwind.in/recharge.php?api_token=YOUR_API_TOKEN&mobile=9800950021&Operato=JIO&amount=349&ClientId=ORDER1001&circle=05'; $res = json_decode(file_get_contents($url), true); echo $res['STATUS']; // 1 success, 2 failed, 3 pending echo $res['MEMBERREQID'];
What happens on our side
1) api_token is checked. 2) The calling server IP must be on your whitelist. If your whitelist is empty the answer asks you to add your server IP. 3) You must have an active plan for the operator (Plans page). 4) The reference number AWT + digits is generated and your ClientId, our reference and the order id are saved. 5) The order is given to a free phone. A phone that is still working on a recharge never gets a second one: the next order goes to another free phone, or waits until a phone has reported its result. 6) We wait for the phone (default 10 seconds), then answer.
2. Answer
The same JSON layout is used for the request answer, the status API and the data of the webhook.
| Field | Description | |
|---|---|---|
ERROR | "0" request accepted, "1" request rejected (see Errors). | |
STATUS | 1 success, 2 failed, 3 pending (the phone has not answered yet, or the robot could not confirm the result). | |
ORDERID | Our order id. | |
OPTRANSID | Transaction id from the operator app after a successful recharge (Airtel / Vi transaction id, Jio ORN No.). null until then. | |
MEMBERREQID | Our reference number for this call: AWT + digits, e.g. AWT5252825. | |
MESSAGE | Readable message. For success: Customer Balance Recharged Successfully. | |
COMMISSION | Reserved, currently null. | |
MOBILENO | The recharged mobile number. | |
AMOUNT | Recharge amount in rupees (string). | |
LAPUNO | The Lapu (retailer) number that made the recharge. null until a phone has done it. | |
OPNINGBAL | Lapu balance before the recharge. | |
CLOSINGBAL | Lapu balance after the recharge. | |
CALLBACKID | Your ClientId echoed back (null if you did not send one). | |
BUYERCOMMISSION | Reserved, currently 0.0. |
Pending (phone has not answered within the wait time)
{"ERROR":"0","STATUS":3,"ORDERID":"306751468","OPTRANSID":null,"MEMBERREQID":"AWT5252825","MESSAGE":"Recharge request accepted. Final status will be sent to your webhook.","COMMISSION":null,"MOBILENO":"9800950021","AMOUNT":"349","LAPUNO":null,"OPNINGBAL":null,"CLOSINGBAL":null,"CALLBACKID":"ORDER1001","BUYERCOMMISSION":0.0}Success
{"ERROR":"0","STATUS":1,"ORDERID":"306751468","OPTRANSID":"BR000E33PY4","MEMBERREQID":"AWT5252825","MESSAGE":"Customer Balance Recharged Successfully","COMMISSION":null,"MOBILENO":"9800950021","AMOUNT":"349","LAPUNO":"06000000000","OPNINGBAL":"2223.26","CLOSINGBAL":"1874.26","CALLBACKID":"ORDER1001","BUYERCOMMISSION":0.0}Failed
{"ERROR":"0","STATUS":2,"ORDERID":"306751469","OPTRANSID":null,"MEMBERREQID":"AWT7720418","MESSAGE":"Insufficient Lapu balance: 50.0","COMMISSION":null,"MOBILENO":"9800950021","AMOUNT":"349","LAPUNO":"06000000000","OPNINGBAL":"50.00","CLOSINGBAL":null,"CALLBACKID":"ORDER1002","BUYERCOMMISSION":0.0}Rejected (ERROR 1)
{"ERROR":"1","STATUS":2,"ORDERID":null,"OPTRANSID":null,"MEMBERREQID":null,"MESSAGE":"No server IP is whitelisted for your account. Please add your server IP in the panel (API & Webhook > Whitelisted IPs). This request came from IP 203.0.113.9","COMMISSION":null,"MOBILENO":null,"AMOUNT":null,"LAPUNO":null,"OPNINGBAL":null,"CLOSINGBAL":null,"CALLBACKID":null,"BUYERCOMMISSION":0.0}A recharge takes about one to two minutes on the phone, so the first answer is usually STATUS 3. The final result comes to your webhook.
3. Your reference numbers
| Number | Whose | Meaning |
|---|---|---|
ClientId = CALLBACKID | Yours | The reference you send. Saved so you can search for it. |
MEMBERREQID | Ours | Generated for every API call: AWT + digits. |
ORDERID | Ours | Our order id. |
OPTRANSID | Operator | Operator transaction id (Live ID), saved after a successful recharge. |
All four are saved in the database. Search any of them on the Transactions page.
4. Status API
Endpoint: https://autolapu.adaptwind.in/status.php. Same token and IP checks. Send one of the three ids.
| Parameter | Required | Description |
|---|---|---|
api_token | Yes | Your token. |
ClientId | One of | The ClientId you sent. |
MEMBERREQID | One of | Our reference, e.g. AWT5252825. |
ORDERID | One of | Our order id. |
https://autolapu.adaptwind.in/status.php?api_token=YOUR_API_TOKEN&ClientId=ORDER1001
The answer has the same JSON as above. If nothing matches: ERROR "1", MESSAGE Order not found (HTTP 404).
5. Webhook (the final result, sent to your server)
Set your URL on the API & Webhook page. When the phone has answered, we call it with GET and replace every {placeholder} with the real value:
https://yourdomain.in/callback_awtrobotic.php?ClientId={ClientId}&REQUEST_ID={REQUEST_ID}&TXNID={TXNID}&LIVEID={LIVEID}| Placeholder | Replaced by | |
|---|---|---|
{ClientId} | Your ClientId (CALLBACKID). | |
{REQUEST_ID} | Our reference (MEMBERREQID). | |
{TXNID} | Our order id (ORDERID). | |
{LIVEID} | Operator transaction id (OPTRANSID). | |
{STATUS} | 1 success, 2 failed, 3 pending. | |
{STATUS_TEXT} | SUCCESS, FAILED or PENDING. | |
{MOBILENO} {AMOUNT} {MESSAGE} {LAPUNO} {OPNINGBAL} {CLOSINGBAL} | The same values as in the answer. |
- Placeholders are only allowed after the host name. Values are URL-encoded. Without any placeholder we add
ClientId,REQUEST_ID,TXNID,LIVEIDandSTATUSto the URL. - Nothing else is sent: no authentication header. Your server should answer with HTTP
2xxand a simple JSON such as{"ok":true}. - Every call and your server's answer (HTTP code and text) are saved and shown on the Transactions page, where you can also send the callback again.
- If your server does not answer with 2xx we try again after 1, 5, 15, 60 and 180 minutes. The same result may arrive more than once: use
REQUEST_IDorClientIdto ignore duplicates. Redirects are not followed, so save the final URL.
Receiver example (PHP)
<?php
// callback_awtrobotic.php
$clientId = $_GET['ClientId'] ?? '';
$requestId = $_GET['REQUEST_ID'] ?? '';
$txnId = $_GET['TXNID'] ?? '';
$liveId = $_GET['LIVEID'] ?? '';
// save them in your database here
header('Content-Type: application/json');
echo json_encode(['ok' => true]);6. Errors
Rejected requests return ERROR "1", STATUS 2 and the reason in MESSAGE.
| HTTP | Message | |
|---|---|---|
401 | Invalid api_token | |
403 | No server IP is whitelisted for your account. Please add your server IP in the panel. The message includes the IP we saw. | |
403 | IP x.x.x.x is not whitelisted. Add that IP in the panel. | |
400 | Invalid mobile / Invalid operator / Invalid amount / Invalid ClientId / Invalid circle | |
403 | No active plan for this operator (buy a plan in the panel) | |
200 | Duplicate ClientId. Existing order returned. (ERROR "0", the first order is returned, no new recharge) | |
400 | Server error (try again, contact support if it repeats) |
Notes
- Only whole-rupee amounts are accepted.
- Priority: if you have several Lapus for one operator, give each a priority number on the Devices page (1 is tried first). A Lapu is used only if its balance is enough for the amount; otherwise the next priority is tried. If no Lapu can do it, the order fails.
- One phone works on one recharge at a time. While a phone has not reported success or failed, no other recharge (Jio, Airtel or Vi) is given to it. If only one phone is online, new orders wait and go to it one after the other.
- Recharges do not use your wallet. The wallet only pays for plans. A plan gives you a number of devices for one operator for some days; when it ends, the Lapus of that operator stop until you buy a plan again.
- If a failure is certain (nothing was sent) the order becomes failed (STATUS 2).
- If the phone cannot confirm the outcome, the order stays pending (STATUS 3) until it is checked by hand. A failed or unconfirmed order can be tried again from the Transactions page.
- Your IP whitelist, token, wait time and webhook are managed on the API & Webhook page.