Do Recharge

Post  https://api.aopay.co.in/api/AOP/DoRecharge


In this API, you will submit the necessary service and user details, including operator information, consumer reference, transaction amount, a unique transaction identifier, and the associated registration reference. These inputs enable the system to process the request accurately and return the corresponding transaction status or response.

Body Parameters
{     
  "operator": 11,
  "canumber": "9999XXXXXX",
  "amount": "10",
  "referenceid": "12345678",
  "RegisterID": "AOP-554"
}
Request Parameters
Name Type Description
operator String Numeric code representing the service provider or operator.
canumber String Consumer Account Number – In this case, "9999XXXXXX" .
amount String The amount being paid by the customer in this transaction.
referenceid String A unique identifier used to track or reference a specific transaction, request, or process. In this case, "12345678" could be an order ID, payment ID, or service request ID.
RegisterID String Unique registration identifier, often tied to the user .
Responses

200

200

Response

200

RESPONSE BODY

object

status    boolean

response_code    integer

operatorid    integer

ackno    string

message    string

Response

401

RESPONSE BODY

object

status     boolean

response_code     integer

message     string

401

401

412

412

Response

412

RESPONSE BODY

Object

status     boolean

response_code     integer

message     string


Did this page help you?     Yes    No

Language
shell Shell
python Python
node Node
c# C#
php PHP

cURL

curl --location 'https://api.aopay.co.in/api/AOP/DoRecharge' \
--header 'Content-Type: application/json' \
--data  '{
  "operator": 11,
  "canumber": "9999XXXXXX",
  "amount": "10",
  "referenceid": "12345678",
  "RegisterID": "AOP-554"
}'
                                
import requests
import json

url = 'https://api.aopay.co.in/api/AOP/DoRecharge'
payload = json.dumps({
  "operator": 11,
  "canumber": "9999XXXXXX",
  "amount": "10",
  "referenceid": "12345678",
  "RegisterID": "AOP-554"
}) 

headers = {
  "Content-type" : "application/json"
}

response = requests.request("POST", url, headers=headers, data=payload)

print (response.text)
                                
var requests = require("request");
var options = { 
  "method" : "POST",
  "url" : 'https://api.aopay.co.in/api/AOP/DoRecharge',
  "headers" : {
    "Content-Type" : 'application/json'
  },
  body: JSON.stringify({
    "operator": 11,,
    "canumber": "9999XXXXXX",
    "amount": "10",
    "referenceid": "12345678",
    "RegisterID": "AOP-554"
  }) 
}; 
request(options, function(error, response){
   if(error) throw new Error(error);
   console.log(response.body); 
}); 
                                
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post,'https://api.aopay.co.in/api/AOP/DoRecharge')
var content = new StringContent(
  "{
    "operator": 11,,
    "canumber": "9999XXXXXX",
    "amount": "10",
    "referenceid": "12345678",
    "RegisterID": "AOP-554"
  }",
  null,"application/json"
); 

request.Content = content;
var response =  await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());
                                
<?php
$curl =  curl_init();
curl_setopt_array($curl, array(
  CURLOPT_URL =>  'https://api.aopay.co.in/api/AOP/DoRecharge',
  CURLOPT_RETURNTRANSFER =>  true,
  CURLOPT_ENCODING =>  '',
  CURLOPT_MAXREDIRS =>  "10",
  CURLOPT_TIMEOUT =>  0,
  CURLOPT_FOLLOWLOCATION =>  true,
  CURLOPT_HTTP_VERSION =>  CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST =>  'POST',
  CURLOPT_POSTFIELDS =>  '{
    "operator": 11,
    "canumber": "9999XXXXXX",
    "amount": "10",
    "referenceid": "12345678",
    "RegisterID": "AOP-554"
  }',
  CURLOPT_HTTPHEADER =>  array(
    'Content-Type: application/json'
  ),
));
$response =  curl_exec($curl);
curl_close($curl);
echo $response;
                                

RESPONSE

200

401

412

-Result

Example

{
  "status": true,
  "response_code": 1,
  "operatorid": 11,
  "ackno": "12345678",
  "message": "Recharge for Airtel of Amount 10 is successful"
}
                                
 
{
  "status": false,
  "response_code": 11,
  "message": "Duplicate Transaction"
}
                                
 
{
  "status": false,
  "response_code": 16,
  "message": "Authentication failed"
}

                                
 
{
  "status": false,
  "response_code": 15,
  "message": "Invalid signature encoding"
}