Subscription Setup

Post  https://api.bospay.co.in/api/v1/Aopay/Enach/SubscriptionSetup


The client initiates the eNACH setup through the AOPay API and must retain the subscription reference needed for future operations.

Body Parameters
{                    
  "registrationID": "AOP-XXX",
  "amount": 100,
  "authWorkflowType": "ZERO",
  "amountType": "FIXED",
  "maxAmount": 100,
  "frequency": "MONTHLY",
  "expireAt": "2026-09-05T12:47:11.710Z",
  "paymentMode": "ENACH_ACCOUNT",
  "authInstrumentType": "DEBIT_CARD",
  "redirectUrl": "https://www.google.com",
  "cancelRedirectUrl": "https://www.google.com",
  "accountNumber": "XXXXXXX01250",
  "ifsc": "HDXXXXXXXXX",
  "accountType": "SAVINGS",
  "bankCustomerName": "Davneet",
}                
Request Parameters
Name Type Description
RegistrationId String Registration ID provided during partner onboarding.
Amount Number Initial setup amount
AuthWorkflowType String Authentication method (e.g., ZERO)
AmountType String Type of recurring charge (e.g., FIXED or VARIABLE)
MaxAmount String Maximum limit for recurring debits
Frequency String Frequency of debit (e.g., ON_DEMAND, MONTHLY)
ExpireAt String Mandate expiry timestamp
PaymentMode String Payment method (e.g., ENACH_ACCOUNT)
AuthInstrumentType String Auth channel (e.g., NET_BANKING/DEBIT_CARD)
RedirectUrl String Success redirect URL
CancelRedirectUrl String Failure/Cancel redirect URL
AccountNumber String Customer bank account number
Ifsc String Bank IFSC code
AccountType String Account type (e.g., SAVINGS)
BankCustomerName String Name as per bank records
Request Headers
Key Value
Content-Type application/json
X-API-TOKEN AOP_XXXXXXXXXXXX286XXXXX
X-REGISTRATION-ID AOP-XXX
Responses

200

200

401

401


Did this page help you?     Yes    No

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

cURL

curl --location 'https://api.bospay.co.in/api/v1/Aopay/Enach/SubscriptionSetup' \
--header 'Content-Type: application/json' \
--header 'X-API-TOKEN: AOP_XXXXXXXXXXXX286XXXXX' \
--header 'X-REGISTRATION-ID: AOP-XXX' \
--data  '{
    "registrationID": "AOP-XXX",
    "amount": 100,
    "authWorkflowType": "ZERO",
    "amountType": "FIXED",
    "maxAmount": 100,
    "frequency": "MONTHLY",
    "expireAt": "2026-09-05T12:47:11.710Z",
    "paymentMode": "ENACH_ACCOUNT",
    "authInstrumentType": "DEBIT_CARD",
    "redirectUrl": "https://www.google.com",
    "cancelRedirectUrl": "https://www.google.com",
    "accountNumber": "XXXXXXX01250",
    "ifsc": "HDXXXXXXXXX",
    "accountType": "SAVINGS",
    "bankCustomerName": "Davneet"
}'
                                
import requests
import json

url = 'https://api.bospay.co.in/api/v1/Aopay/Enach/SubscriptionSetup'
payload = json.dumps({
    "registrationID": "AOP-XXX",
    "amount": 100,
    "authWorkflowType": "ZERO",
    "amountType": "FIXED",
    "maxAmount": 100,
    "frequency": "MONTHLY",
    "expireAt": "2026-09-05T12:47:11.710Z",
    "paymentMode": "ENACH_ACCOUNT",
    "authInstrumentType": "DEBIT_CARD",
    "redirectUrl": "https://www.google.com",
    "cancelRedirectUrl": "https://www.google.com",
    "accountNumber": "XXXXXXX01250",
    "ifsc": "HDXXXXXXXXX",
    "accountType": "SAVINGS",
    "bankCustomerName": "Davneet"
}) 
headers = {
  "Content-type" : "application/json"
  "X-API-TOKEN" : "AOP_XXXXXXXXXXXX286XXXXX",
  "X-REGISTRATION-ID" : "AOP-XXX"
}

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

print (response.text)
                                
var requests = require("request");
var options = { 
  "method" : "POST",
  "url" : 'https://api.bospay.co.in/api/v1/Aopay/Enach/SubscriptionSetup',
  "headers" : {
    "Content-Type" : 'application/json'
    "X-API-TOKEN" : "AOP_XXXXXXXXXXXX286XXXXX",
    "X-REGISTRATION-ID" : "AOP-XXX"
  },
  body: JSON.stringify({
    "registrationID": "AOP-XXX",
    "amount": 100,
    "authWorkflowType": "ZERO",
    "amountType": "FIXED",
    "maxAmount": 100,
    "frequency": "MONTHLY",
    "expireAt": "2026-09-05T12:47:11.710Z",
    "paymentMode": "ENACH_ACCOUNT",
    "authInstrumentType": "DEBIT_CARD",
    "redirectUrl": "https://www.google.com",
    "cancelRedirectUrl": "https://www.google.com",
    "accountNumber": "XXXXXXX01250",
    "ifsc": "HDXXXXXXXXX",
    "accountType": "SAVINGS",
    "bankCustomerName": "Davneet"
  }) 
}; 
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.bospay.co.in/api/v1/Aopay/Enach/SubscriptionSetup')

request.Headers.Add("Content-type", "application/json");
request.Headers.Add("X-API-TOKEN", "AOP_XXXXXXXXXXXX286XXXXX");
request.Headers.Add("X-REGISTRATION-ID", "AOP-XXX");

var content = new StringContent(
  "{
    "registrationID": "AOP-XXX",
    "amount": 100,
    "authWorkflowType": "ZERO",
    "amountType": "FIXED",
    "maxAmount": 100,
    "frequency": "MONTHLY",
    "expireAt": "2026-09-05T12:47:11.710Z",
    "paymentMode": "ENACH_ACCOUNT",
    "authInstrumentType": "DEBIT_CARD",
    "redirectUrl": "https://www.google.com",
    "cancelRedirectUrl": "https://www.google.com",
    "accountNumber": "XXXXXXX01250",
    "ifsc": "HDXXXXXXXXX",
    "accountType": "SAVINGS",
    "bankCustomerName": "Davneet"
  }",
  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.bospay.co.in/api/v1/Aopay/Enach/SubscriptionSetup',
  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-XXX",
    "amount": 100,
    "authWorkflowType": "ZERO",
    "amountType": "FIXED",
    "maxAmount": 100,
    "frequency": "MONTHLY",
    "expireAt": "2026-09-05T12:47:11.710Z",
    "paymentMode": "ENACH_ACCOUNT",
    "authInstrumentType": "DEBIT_CARD",
    "redirectUrl": "https://www.google.com",
    "cancelRedirectUrl": "https://www.google.com",
    "accountNumber": "XXXXXXX01250",
    "ifsc": "HDXXXXXXXXX",
    "accountType": "SAVINGS",
    "bankCustomerName": "Davneet"
  }',
  CURLOPT_HTTPHEADER =>  array(
    'Content-Type: application/json',
    'X-API-TOKEN: AOP_XXXXXXXXXXXX286XXXXX',
    'X-REGISTRATION-ID: AOP-XXX'
  ),
));
$response =  curl_exec($curl);
curl_close($curl);
echo $response;
                                

RESPONSE

200

401

-Result

Example

{   
    "orderId": "OMOXXXXXXXXXXXXXXXXXXXX",
    "state": "PENDING",
    "redirectUrl": "https://www.google.com",
    "merchantSubscriptionId": "AOPXXXSUBXXXXXXXX",
    "success": true,
    "code": "",
    "message": "",
}
                                
{
    "Status": false,
    "Message": "Invalid API token or RegistrationID.",
    "ErrorCode": "INVALID_API_TOKEN",
    "StatusCode": 401,
    "RequestId": "55160861-9ccd-482b-85f4-c9521fd4d1ed",
}