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
  }
}
In the sandbox environment, authorisation-related responses for eNACH, card, and UPI differ from those in production.

You must generate the URL in production by concatenating it with the payload data in JSON format. The following are example responses for all Seamless Auth modes in the production environment.

Authorizations

x-client-id
string
header
required

Client app ID. You can find your app id in the merchant dashboard.

x-client-secret
string
header
required

Client secret key. You can find your secret in the merchant dashboard.

Headers

x-api-version
string
default:2025-01-01
required

API version to be used. Format is in YYYY-MM-DD.

x-request-id
string

Request id for the API call. Can be used to resolve tech issues. Communicate this in your tech related queries to Cashfree.

x-idempotency-key
string

An idempotency key is a unique identifier you include with your API call. If the request fails or times out, you can safely retry it using the same key to avoid duplicate actions.

Body

application/json

Request body to create a subscription payment.

The request to be passed for the create subscription payment API.

Response

200
application/json

response of created payment.

The response returned is Create Subscription Auth or Charge APIs.