curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/seamless/subscription \
--header 'Content-Type: application/json' \
--data '
{
"subscriptionId": "DemoSubscription",
"planId": "TestPlan_ReArch_002",
"customerName": "John",
"customerPhone": "99999XXXXX",
"customerEmail": "john@gmail.com",
"returnUrl": "www.google.com",
"authAmount": 1,
"expiresOn": "2024-12-02 09:20:12",
"firstChargeDate": "2024-12-02",
"payerAccountDetails": {
"accountNumber": "007200000000",
"accountHolderName": "John",
"bankId": "ICIC",
"accountType": "SAVINGS",
"ifsc": "ICIC0000072"
},
"notificationChannels": [
"EMAIL",
"SMS"
]
}
'{
"status": 200,
"message": "Subscription Created",
"data": {
"subReferenceId": 107350,
"subscriptionId": "DemoSubscription",
"customerPhone": "9999988888",
"customerEmail": "demo.email@gmail.com",
"planId": "TestPlan_ReArch_002",
"status": "INITIALIZED",
"currentCycle": 0,
"authAmount": 1,
"returnUrl": "www.google.com",
"startDate": {
"E_MANDATE": "2024-12-02",
"UPI": "2024-12-02"
},
"endDate": "2024-12-02 09:20:12",
"tpvEnabled": false,
"paymentOptions": [
{
"type": "E_MANDATE",
"accountTypes": [
"SAVINGS",
"CURRENT"
],
"frequentBankDetails": [
{
"bankId": "SBIN",
"bankName": "STATE BANK OF INDIA",
"accountAuthModes": [
"DEBIT_CARD",
"NET_BANKING"
]
}
]
}
]
}
}{
"status": "ERROR",
"subCode": "400",
"message": "Invalid subscription expiresOn"
}{
"status": "ERROR",
"message": "Server encountered an unexpected condition."
}Create Seamless Subscription with Plan ID
Use this API to create a subscription by providing a custom payment experience to your customers by specifying the plan ID and the 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.
curl --request POST \
--url https://sandbox.cashfree.com/api/v2/subscriptions/seamless/subscription \
--header 'Content-Type: application/json' \
--data '
{
"subscriptionId": "DemoSubscription",
"planId": "TestPlan_ReArch_002",
"customerName": "John",
"customerPhone": "99999XXXXX",
"customerEmail": "john@gmail.com",
"returnUrl": "www.google.com",
"authAmount": 1,
"expiresOn": "2024-12-02 09:20:12",
"firstChargeDate": "2024-12-02",
"payerAccountDetails": {
"accountNumber": "007200000000",
"accountHolderName": "John",
"bankId": "ICIC",
"accountType": "SAVINGS",
"ifsc": "ICIC0000072"
},
"notificationChannels": [
"EMAIL",
"SMS"
]
}
'{
"status": 200,
"message": "Subscription Created",
"data": {
"subReferenceId": 107350,
"subscriptionId": "DemoSubscription",
"customerPhone": "9999988888",
"customerEmail": "demo.email@gmail.com",
"planId": "TestPlan_ReArch_002",
"status": "INITIALIZED",
"currentCycle": 0,
"authAmount": 1,
"returnUrl": "www.google.com",
"startDate": {
"E_MANDATE": "2024-12-02",
"UPI": "2024-12-02"
},
"endDate": "2024-12-02 09:20:12",
"tpvEnabled": false,
"paymentOptions": [
{
"type": "E_MANDATE",
"accountTypes": [
"SAVINGS",
"CURRENT"
],
"frequentBankDetails": [
{
"bankId": "SBIN",
"bankName": "STATE BANK OF INDIA",
"accountAuthModes": [
"DEBIT_CARD",
"NET_BANKING"
]
}
]
}
]
}
}{
"status": "ERROR",
"subCode": "400",
"message": "Invalid subscription expiresOn"
}{
"status": "ERROR",
"message": "Server encountered an unexpected condition."
}Headers
"{{X-Client-Id}}"
"{{X-Client-Secret}}"
Body
Unique identifier for the subscription.
"DemoSubscription"
Unique identifier for the subscription plan.
"TestPlan_ReArch_002"
Name of the customer subscribing.
"John"
Customer's phone number.
"99999XXXXX"
Customer's email address.
"john@gmail.com"
URL to redirect the user after successful subscription.
"www.google.com"
Authorization amount for the subscription.
1
Expiration date for the subscription.
"2024-12-02 09:20:12"
First charge date for the subscription.
"2024-12-02"
Show child attributes
Show child attributes
Notification channels for subscription.
["EMAIL", "SMS"]
Whether Third Party Verification (TPV) is enabled.
true
Show child attributes
Show child attributes
Was this page helpful?