Cancel a Subscription

Cancellation prevents future scheduled charges and clears the subscription’s next billing date. It does not refund charges that have already completed.

Both cancellation endpoints below are public and perform the same operation.

Dedicated Cancel Endpoint

POST https://backendapi.sayswitchgroup.com/api/v1/subscription/{id_or_code}/cancel
curl --request POST \
  --url https://backendapi.sayswitchgroup.com/api/v1/subscription/SUB_7q2m9x4k1v8b5n3p6r0s/cancel \
  --header "Authorization: Bearer YOUR_SECRET_KEY" \
  --header "Accept: application/json"

Update Endpoint

PUT https://backendapi.sayswitchgroup.com/api/v1/subscription/{id_or_code}
curl --request PUT \
  --url https://backendapi.sayswitchgroup.com/api/v1/subscription/SUB_7q2m9x4k1v8b5n3p6r0s \
  --header "Authorization: Bearer YOUR_SECRET_KEY" \
  --header "Accept: application/json" \
  --header "Content-Type: application/json" \
  --data '{
    "action": "cancel"
  }'

{id_or_code} accepts either the numeric ID or subscription_code. cancel is the only supported update action in v1.

Response

{
  "status": true,
  "message": "Subscription cancelled.",
  "data": {
    "subscription_code": "SUB_7q2m9x4k1v8b5n3p6r0s",
    "status": "cancelled",
    "next_charge_at": null,
    "cancelled_at": "2026-10-15T09:45:00.000000Z",
    "authorization_url": null
  }
}

Cancellation is idempotent. Cancelling an already-cancelled subscription returns a successful response with its existing cancelled state and does not send another cancellation event.

Subscriptions that are already completed or expired are also returned unchanged with a successful response. Their status is not changed to cancelled.

Invalid Update Action

HTTP 422:

{
  "status": false,
  "message": "Only cancellation is supported in this version.",
  "errors": {
    "action": [
      "The selected action is invalid."
    ]
  }
}

Subscription Not Found

HTTP 404:

{
  "status": false,
  "message": "Subscription not found."
}