POST
/
api
/
v2
/
subscription
/
{subReferenceId}
/
charge
/
{chargeId}
/
cancel
curl --request POST \
  --url https://sandbox.cashfree.com/api/v2/subscription/{subReferenceId}/charge/{chargeId}/cancel \
  --header 'X-Client-Id: <x-client-id>' \
  --header 'X-Client-Secret: <x-client-secret>'
{
  "status": "OK",
  "message": "Subscription charge cancelled",
  "payment": {
    "paymentId": 2276563,
    "referenceId": 214308920,
    "subReferenceId": 5513463,
    "cfOrderId": 236286405,
    "currency": "INR",
    "amount": 250,
    "cycle": 5,
    "status": "CANCELLED",
    "remarks": null,
    "scheduledOn": "2021-09-13",
    "addedOn": "2021-09-09 11:05:19",
    "retryAttempts": 0,
    "failureReason": null
  }
}

Headers

X-Client-Id
string
required

Client ID provided by Cashfree.

Example:

"asdf1234"

X-Client-Secret
string
required

Client Secret provided by Cashfree.

Example:

"qwer9876"

Path Parameters

subReferenceId
integer
required

The reference ID of the subscription.

Example:

123456

chargeId
integer
required

The ID of the charge to be cancelled.

Example:

9876543

Response

200
application/json

Successful cancellation of the subscription charge.

The response is of type any.