const url = 'https://example.com/api/Subscriptions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel';const options = { method: 'POST', headers: { 'Idempotency-Key': 'example', Authorization: 'Bearer <token>', 'Content-Type': 'application/json' }, body: '{"id":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","merchantId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","reason":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/Subscriptions/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/cancel \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --header 'Idempotency-Key: example' \ --data '{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reason": "example" }'Cancels a subscription permanently. This cannot be undone. To re-enrol the member, create a new subscription. The matching subscription at the payment gateway is archived and any outstanding failed-payment retries are written off. Cancelling an already-cancelled subscription changes nothing and charges no cancellation fee.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The subscription’s unique identifier.
Header Parameters
Section titled “Header Parameters ”Required. A unique value (a UUID is ideal) per logical operation; reuse it when retrying that operation. A retry with the same key and body replays the original response instead of running twice. A 4xx frees the key, so the operation can be corrected and retried on it. A 5xx does not: the attempt may already have moved money, so retries with that key replay a problem+json saying the outcome is unknown, and a genuinely fresh attempt needs a new key. Missing → 400.
Request Body
Section titled “Request Body ”Optional cancellation reason.
object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reason": "example"}object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reason": "example"}object
Example generated
{ "id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "merchantId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "reason": "example"}Responses
Section titled “ Responses ”Subscription cancelled.
object
object
Example
{ "planFrequency": "OneOff", "status": "Trial", "recentCycles": [ { "status": "Pending" } ]}No subscription with the given ID exists.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}The early-cancellation fee was declined, or its outcome at the gateway isn’t known yet. The subscription is still active; the fee is on record and a retry won’t charge it twice.
object
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}