curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/nonSeamless/subscription \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>' \
--data '
{
"subscriptionId": "DemoSubscriptionq",
"customerName": "John Doe",
"customerPhone": "9999900000",
"customerEmail": "john@gmail.com",
"returnUrl": "www.google.com",
"authAmount": 10,
"expiresOn": "2024-12-02 09:20:12",
"planInfo": {
"type": "ON_DEMAND",
"planName": "abcede",
"maxAmount": 1000,
"maxCycles": 10,
"linkExpiry": 5
},
"notificationChannels": [
"EMAIL",
"SMS"
]
}
'{
"status": 200,
"message": "Subscription Created",
"data": {
"subReferenceId": 1234,
"authLink": "https://cfre.in/wjnwdj3"
}
}Subscription
Create a Subscription
Use this API to create a subscription by specifying the plan ID or plan Info and customer details.You can also specify the bank account information when you create the subscription to ensure that mandates are created via the specified bank account only. TPV is applicable only for eNACH and UPI AutoPay. The Auth Link received in the response will be redirected to a link hosted on cashfree.com. Once the authorization is complete, your customer will be redirected to returnUrl. Store the subReferenceId as this is the unique ID generated by Cashfree for the subscription and will be required for subsequent operations.
POST
/
api
/
v2
/
subscriptions
/
nonSeamless
/
subscription
curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/nonSeamless/subscription \
--header 'Content-Type: application/json' \
--header 'X-Client-Id: <x-client-id>' \
--header 'X-Client-Secret: <x-client-secret>' \
--data '
{
"subscriptionId": "DemoSubscriptionq",
"customerName": "John Doe",
"customerPhone": "9999900000",
"customerEmail": "john@gmail.com",
"returnUrl": "www.google.com",
"authAmount": 10,
"expiresOn": "2024-12-02 09:20:12",
"planInfo": {
"type": "ON_DEMAND",
"planName": "abcede",
"maxAmount": 1000,
"maxCycles": 10,
"linkExpiry": 5
},
"notificationChannels": [
"EMAIL",
"SMS"
]
}
'{
"status": 200,
"message": "Subscription Created",
"data": {
"subReferenceId": 1234,
"authLink": "https://cfre.in/wjnwdj3"
}
}Headers
Body
application/json
Was this page helpful?