Setup Subscription (Penny Drop)

POST  https://collxxxxxxxxxxxxxxxxxxxxin/api/AOPay/Reseller/V1/SetupSubscription/Pennydrop


Creates a subscription mandate using customer, loan, EMI, and last due date details, returning the mandate status and payment intent URL.

Body Parameters
{
 "RegistrationID":"AOP-****",
 "customerCode":"CUST-****",
 "LoanCode": "LOAN-****",
 "LastEMIDueDate": "2027-12-05T00:00:00",
 "EMIAmount": 2500.00
}
Request Parameters
Name Type Mandatory Description
RegistrationID String Yes Aopay-issued reseller/customer registration identifier.
customerCode String Yes Masked customer reference/code
LoanCode String Yes Loan reference/code.
LastEMIDueDate DateTime Yes Last EMI due date; used to calculate mandate expiry timestamp.
EMIAmount Decimal Yes Mandate maximum amount. Must be at least 2 and have at most 2 decimal places; code checks maximum 1,500,000 paise (15,000).
Request Headers
Key Value
Content-Type application/json
Accept application/json
Authorization Handled by Aopay
X-MERCHANT-ID Handled by 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://collxxxxxxxxxxxxxxxxxxxxin/api/AOPay/Reseller/V1/SetupSubscription/Pennydrop' \
--header 'Content-Type: application/json' \
--data  '{
   "RegistrationID": "AOP-****", 
   "customerCode": "CUST-****", 
   "LoanCode": "LOAN-****", 
   "LastEMIDueDate": "2027-12-05T00:00:00", 
   "EMIAmount": 2500.00
}'
                                
import requests
import json

url = 'https://collxxxxxxxxxxxxxxxxxxxxin/api/AOPay/Reseller/V1/SetupSubscription/Pennydrop'
payload = json.dumps({
   "RegistrationID": "AOP-****", 
   "customerCode": "CUST-****", 
   "LoanCode": "LOAN-****", 
   "LastEMIDueDate": "2027-12-05T00:00:00", 
   "EMIAmount": 2500.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://collxxxxxxxxxxxxxxxxxxxxin/api/AOPay/Reseller/V1/SetupSubscription/Pennydrop',
  "headers" : {
    "Content-Type" : 'application/json'
  },
  body: JSON.stringify({
   "RegistrationID": "AOP-****", 
   "customerCode": "CUST-****", 
   "LoanCode": "LOAN-****", 
   "LastEMIDueDate": "2027-12-05T00:00:00", 
   "EMIAmount": 2500.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://collxxxxxxxxxxxxxxxxxxxxin/api/AOPay/Reseller/V1/SetupSubscription/Pennydrop')
var content = new StringContent(
  "{
   "RegistrationID": "AOP-****", 
   "customerCode": "CUST-****", 
   "LoanCode": "LOAN-****", 
   "LastEMIDueDate": "2027-12-05T00:00:00", 
   "EMIAmount": 2500.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://collxxxxxxxxxxxxxxxxxxxxin/api/AOPay/Reseller/V1/SetupSubscription/Pennydrop',
  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-****", 
   "customerCode": "CUST-****", 
   "LoanCode": "LOAN-****", 
   "LastEMIDueDate": "2027-12-05T00:00:00", 
   "EMIAmount": 2500.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": "300",
    "MarchentOrderID": "AOP-****_CUST-****_LOAN-****_********",
    "code": "200"                                 
}


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

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