AEPS Withdrawal API
Withdraws cash from the customer's bank account using Aadhaar and fingerprint authentication.
POST #BASEURL/transaction.php
BODY PARAMS
RAW_BODY
jsonHEADERS
📘
Request headers
Accept : application/json
Content-Type: application/json
Accept : application/json
Content-Type: application/json
Request Parameters
Send these parameters in the request body:
| Parameter | Type | Position | # | Description |
|---|---|---|---|---|
| token | string |
RAW_BODY |
Required |
Your API token from the ClubApi dashboard. Send it with every API request and keep it private. |
| urid | string |
RAW_BODY |
Required |
Your unique reference ID for this transaction, used to match it with our records. |
| operatorId | string |
RAW_BODY |
Required |
Operator ID. Get the list of operators from the Utility API section. |
| bankId | string |
RAW_BODY |
Required |
Bank ID. Get it from the AEPS Bank List API. |
| customerMobile | string |
RAW_BODY |
Required |
Customer's 10-digit mobile number. It does not need to be the Aadhaar-linked number. |
| outletMobile | string |
RAW_BODY |
Required |
10-digit mobile number of the outlet or agent with approved mini KYC. Use the Outlet KYC API to register an agent. |
| agentAadhaar | string |
RAW_BODY |
Required |
Agent's valid 12-digit Aadhaar number. |
| aadhaarNumber | string |
RAW_BODY |
Required |
Customer's valid 12-digit Aadhaar number. |
| deviceResponse | string |
RAW_BODY |
Required |
Biometric data returned by the fingerprint device after the customer scans their finger. Send it base64 encoded. |
Response
These fields are returned in the response:
| Parameter | Type | Description |
|---|---|---|
| orderId | string |
Our order ID for your urid. Save it to track the transaction status. |
| status | string |
Transaction status: SUCCESS, PENDING or FAILED. If no status is received (for example, because of a timeout between your server and ours), save the transaction as PENDING and confirm it later with the Transaction Status API. |
| mobile | string |
The Aadhaar number you sent in the request. |
| amount | string |
Always 0, because no amount is used in this request. |
| transId | string |
Bank transaction ID. |
| error_code | string |
Internal response code used by our support team. You do not need to save it. |
| service | string |
Service name. |
| bal | string |
Always empty. You do not need to save it. |
| creditUsed | string |
Amount debited from your account. |
| resText | string |
Error message, returned when the request fails. |
| gstMode | string |
Returned when the transaction status is SUCCESS. Update it in your system when it is not empty. |
| miniStatement | string |
Mini statement entries returned by the bank. |
| bankBal | string |
Customer's account balance returned by the bank. |
{"data":{"orderId":"240612203xxxxxxxx","status":"PENDING","mobile":"xxxxx","amount":"1200","transId":"","resCode":"","p2pBuyerBal":"xxxxxx.22","p2aBuyerBal":"xxxxxx.33","totalBuyerBal":"xxxxxx.55","creditUsed":"0","beneficiaryName":"","resText":""}}
curl 'https://api.clubapi.in/transaction.php' \
--max-time 10 \
-H 'accept: application/json' \
-H 'content-type: application/json' \
--data-raw '{"token":"xxxxx","operatorId":"741","amount":"1200","mobile":"xxxxx","urid":"xxxxx","outletMobile":"xxxxxx","agentAadhaar":"33441122xxxx","deviceResponse":"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGxxxxxxxxxx","bankId":"607094","aadhaarNumber":"90073xxxxxxx","customerMobile":"xxxxxxxx","latitude":"26.xxxxxx","longitude":"88.xxxxxx"}' \
<?php
$url = "https://api.clubapi.in/transaction.php";
$curl = curl_init($url);
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_CONNECTTIMEOUT, 10); // wait max 10 seconds to connect
curl_setopt($curl, CURLOPT_TIMEOUT, 10); // wait max 10 seconds for response
$headers = array(
"accept: application/json",
"content-type: application/json",
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
$data = '{"token":"xxxxx","operatorId":"741","amount":"1200","mobile":"xxxxx","urid":"xxxxx","outletMobile":"xxxxxx","agentAadhaar":"33441122xxxx","deviceResponse":"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGxxxxxxxxxx","bankId":"607094","aadhaarNumber":"90073xxxxxxx","customerMobile":"xxxxxxxx","latitude":"26.xxxxxx","longitude":"88.xxxxxx"}';
curl_setopt($curl, CURLOPT_POSTFIELDS, $data);
//for debug only!
curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);
$resp = curl_exec($curl);
curl_close($curl);
?>
URL url = new URL("https://api.clubapi.in/transaction.php");
HttpURLConnection http = (HttpURLConnection)url.openConnection();
http.setRequestMethod("POST");
http.setDoOutput(true);
http.setConnectTimeout(10000); // 10 seconds
http.setReadTimeout(10000); // 10 seconds
http.setRequestProperty("accept", "application/json");
http.setRequestProperty("content-type", "application/json");
String data = "{\"token\":\"xxxxx\",\"operatorId\":\"741\",\"amount\":\"1200\",\"mobile\":\"xxxxx\",\"urid\":\"xxxxx\",\"outletMobile\":\"xxxxxx\",\"agentAadhaar\":\"33441122xxxx\",\"deviceResponse\":\"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGxxxxxxxxxx\",\"bankId\":\"607094\",\"aadhaarNumber\":\"90073xxxxxxx\",\"customerMobile\":\"xxxxxxxx\",\"latitude\":\"26.xxxxxx\",\"longitude\":\"88.xxxxxx\"}";
byte[] out = data.getBytes(StandardCharsets.UTF_8);
var url = "https://api.clubapi.in/transaction.php";
var httpRequest = (HttpWebRequest)WebRequest.Create(url);
httpRequest.Method = "POST";
httpRequest.Timeout = 10000; // 10 seconds
httpRequest.Headers["accept"] = "application/json";
httpRequest.Headers["content-type"] = "application/json";
var data = "{\"token\":\"xxxxx\",\"operatorId\":\"741\",\"amount\":\"1200\",\"mobile\":\"xxxxx\",\"urid\":\"xxxxx\",\"outletMobile\":\"xxxxxx\",\"agentAadhaar\":\"33441122xxxx\",\"deviceResponse\":\"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGxxxxxxxxxx\",\"bankId\":\"607094\",\"aadhaarNumber\":\"90073xxxxxxx\",\"customerMobile\":\"xxxxxxxx\",\"latitude\":\"26.xxxxxx\",\"longitude\":\"88.xxxxxx\"}";
using (var streamWriter = new StreamWriter(httpRequest.GetRequestStream()))
{
streamWriter.Write(data);
}
var httpResponse = (HttpWebResponse)httpRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}
Console.WriteLine(httpResponse.StatusCode);