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"
    }
  }
}'

Authorizations

x-client-id
string
headerrequired

Client app ID. You can find your app id in the Merchant Dashboard.

x-client-secret
string
headerrequired

Client secret key. You can find your secret in the Merchant Dashboard.

Headers

x-api-version
string
default: 2023-08-01required

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

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

subscription_id
string
required

A unique ID passed by merchant for identifying the subscription.

payment_id
string
required

A unique ID passed by merchant for identifying the subscription payment.

payment_type
string
required

Payment type. Can be AUTH or CHARGE.

subscription_session_id
string

Session ID for the subscription. Required only for Auth.

payment_amount
number

The charge amount of the payment. Required in case of charge.

payment_schedule_date
string

The date on which the payment is scheduled to be processed. Required for UPI and CARD payment modes.

payment_remarks
string

Payment remarks.

payment_method
object

Payment method. Can be one of ["upi", "enach", "pnach", "card"]

Response

200 - application/json

The response returned is Create Subscription Auth or Charge APIs.

cf_payment_id
string

Cashfree subscription payment reference number

failure_details
object
payment_amount
number

The charge amount of the payment.

payment_id
string

A unique ID passed by merchant for identifying the transaction.

payment_initiated_date
string

The date on which the payment was initiated.

payment_status
string

Status of the payment.

payment_type
string

Payment type. Can be AUTH or CHARGE.

subscription_id
string

A unique ID passed by merchant for identifying the subscription.

data
object

Contains a payload for auth app links in case of AUTH. For charge, the payload is empty.

payment_method
string

Payment method used for the authorization.