Payment Gateway

POST  https://apxxxxxxxxxin/api/Aopay/Reseller/V1/PaymentGateway


Before integrating the AOP Payment Gateway API with your products, you need to send a request with the required parameters, including registration ID and amount. In response, you will receive a unique orderID, which acts as an identifier for the transaction

Body Parameters
{
 "RegistrationID":"AOP-***",  
 "Amount":200.00
}
Request Parameters
Name Type Mandatory Description
RegistrationID String Yes Aopay-issued customer / reseller registration identifier.
Amount Decimal Yes Payment amount in major currency units (e.g. rupees), not paise. The Aopay code multiplies this value by 100 before sending it to Aopay
Responses

200

200

Response

200

RESPONSE BODY

object

Response

401

RESPONSE BODY

returnMessage     string

401

401

412

412

Response

412

RESPONSE BODY

returnMessage     string


Did this page help you?     Yes    No

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

cURL

curl --location 'https://apxxxxxxxxxin/api/Aopay/Reseller/V1/PaymentGateway' \
--header 'Content-Type: application/json' \
--data  '{
   "RegistrationID": "AOP-***",
   "Amount": 200.00 
}'
                                
import requests
import json

url = 'https://apxxxxxxxxxin/api/Aopay/Reseller/V1/PaymentGateway'
payload = json.dumps({
   "RegistrationID": "AOP-***",
   "Amount": 200.00                              
})

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://apxxxxxxxxxin/api/Aopay/Reseller/V1/PaymentGateway',
  "headers" : {
    "Content-Type" : 'application/json'
  },
  body: JSON.stringify({
   "RegistrationID": "AOP-***",
   "Amount": 200.00
  }) 
}; 
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://apxxxxxxxxxin/api/Aopay/Reseller/V1/PaymentGateway')
var content = new StringContent(
  "{
   "RegistrationID": "AOP-***",
   "Amount": 200.00
  }",
  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://apxxxxxxxxxin/api/Aopay/Reseller/V1/PaymentGateway',
  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 =>  '{
   "RegistrationID": "AOP-***",
   "Amount": 200.00 
  }',
  CURLOPT_HTTPHEADER =>  array(
    'Content-Type: application/json'
  ),
));
$response =  curl_exec($curl);
curl_close($curl);
echo $response;
                                

RESPONSE

200

401

412

-Result

Example

{
    "status": "PENDING",
    "IntentUrl": "https://…",
    "OrderID": "MASKED_Aopay_ORDER_ID",
    "ExpiryAt": "1200",
    "MarchentOrderID": "AOP-****__********",
    "code": "200",
    "ErrorMessage": null                                  
}


 
 
{
    "returnMessage": "Unauthorized access. Please log in again."
}
                                
 
{
   "returnMessage": "Invalid registration ID"
}

                                
 
{
   "returnMessage": "Precondition failed. Please try again."
}