curl --request POST \
--url https://sandbox.cashfree.com/pg/subscriptions/pay \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"subscription_id": "test-subscription-id",
"payment_id": "test-payment-id",
"payment_amount": 10,
"payment_schedule_date": "2024-04-18T16:40:00",
"payment_remarks": "2nd EMI payment",
"payment_type": "CHARGE",
"payment_method": {
"upi": {
"upi_id": "john@upi",
"channel": "collect"
}
}
}
'{
"payment_id": "test-paymey",
"subscription_id": "Demo_Subscription",
"payment_amount": 1,
"cf_payment_id": "12345",
"payment_method": "upi",
"payment_status": "SUCCESS",
"payment_type": "AUTH",
"action": "custom",
"channel": "link",
"data": {
"url": "https://api.cashfree.com/pg/view/gateway/tuOssT3fNV8soG97VSeHca034555-8a65-4aaf-9e67-c9893471af23",
"payload": null,
"content_type": null,
"method": null
}
}{
"message": "bad URL, please check API documentation",
"code": "request_failed",
"type": "invalid_request_error"
}{
"message": "authentication Failed",
"code": "request_failed",
"type": "authentication_error"
}{
"message": "something is not found",
"code": "somethind_not_found",
"type": "invalid_request_error"
}{
"message": "something is not found",
"code": "request_invalid",
"type": "idempotency_error"
}{
"message": "Too many requests from IP. Check headers",
"code": "request_failed",
"type": "rate_limit_error"
}{
"message": "internal Server Error",
"code": "internal_error",
"type": "api_error"
}Payment
Raise a charge or create an auth.
Use this API to create an auth or to raise a charge.
POST
/
subscriptions
/
pay
curl --request POST \
--url https://sandbox.cashfree.com/pg/subscriptions/pay \
--header 'Content-Type: application/json' \
--header 'x-api-version: <x-api-version>' \
--header 'x-client-id: <api-key>' \
--header 'x-client-secret: <api-key>' \
--data '
{
"subscription_id": "test-subscription-id",
"payment_id": "test-payment-id",
"payment_amount": 10,
"payment_schedule_date": "2024-04-18T16:40:00",
"payment_remarks": "2nd EMI payment",
"payment_type": "CHARGE",
"payment_method": {
"upi": {
"upi_id": "john@upi",
"channel": "collect"
}
}
}
'{
"payment_id": "test-paymey",
"subscription_id": "Demo_Subscription",
"payment_amount": 1,
"cf_payment_id": "12345",
"payment_method": "upi",
"payment_status": "SUCCESS",
"payment_type": "AUTH",
"action": "custom",
"channel": "link",
"data": {
"url": "https://api.cashfree.com/pg/view/gateway/tuOssT3fNV8soG97VSeHca034555-8a65-4aaf-9e67-c9893471af23",
"payload": null,
"content_type": null,
"method": null
}
}{
"message": "bad URL, please check API documentation",
"code": "request_failed",
"type": "invalid_request_error"
}{
"message": "authentication Failed",
"code": "request_failed",
"type": "authentication_error"
}{
"message": "something is not found",
"code": "somethind_not_found",
"type": "invalid_request_error"
}{
"message": "something is not found",
"code": "request_invalid",
"type": "idempotency_error"
}{
"message": "Too many requests from IP. Check headers",
"code": "request_failed",
"type": "rate_limit_error"
}{
"message": "internal Server Error",
"code": "internal_error",
"type": "api_error"
}Authorizations
XClientID & XClientSecretXClientID & XPartnerAPIKeyXClientID & XClientSignatureHeaderXPartnerMerchantID & XPartnerAPIKey
Client app ID. You can find your app id in the Merchant Dashboard.
Client secret key. You can find your secret key in the Merchant Dashboard.
Headers
Body
application/json
Request body to create a subscription payment.
The request to be passed for the create subscription payment API.
Response
response of created payment.
The response returned is Create Subscription Auth or Charge APIs.
Was this page helpful?