Cancel subscription

Cancel the subscription immediately, or cancel the next charge to allow your customer to keep the membership until the next rebill date.

Cancellation modes

Centrobill supports two cancellation behaviours, matching the options available in the Merchant Portal dashboard:

Dashboard actionAPI behaviourWhat happens
CancelOmit cancelDate or set it to nullSubscription is cancelled immediately. No further rebills.
Cancel further automatic chargesPass keepActiveUntilNextRebill: truecancelDate is automatically set to 1 hour before the next scheduled rebill. The customer retains access until that date, then the subscription stops.

Immediate cancellation:

curl --request PUT \
  --url https://api.centrobill.com/subscription/{id}/cancel \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{}'

Immediate cancellation response:

{
  "consumer": {
    "id": "000887000",
    "email": "[email protected]",
    "firstName": "Jonny",
    "lastName": "Sonny",
    "country": "USA",
    "zip": "90042"
  },
  "metadata": {
    "chargeId": "00fa21a5-000f-0000-0000-0b5b8f6460fc"
  },
  "subscription": {
    "id": "000001978",
    "cycle": 0,
    "status": "canceled",
    "cancelDate": "2026-05-19 20:54:59",
    "timezone": "+02:00",
    "eventTime": "2026-05-19 20:54:59"
  }
}

Cancel at end of current period:

curl --request PUT \
  --url https://api.centrobill.com/subscription/{id}/cancel \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "keepActiveUntilNextRebill": true
  }'

Note: keepActiveUntilNextRebill overrides any cancelDate value passed in the same request.

Cancel at end of current period response:

{
  "consumer": {
    "id": "000892000",
    "email": "[email protected]",
    "firstName": "Jonny",
    "lastName": "Sonny",
    "country": "USA",
    "zip": "21061"
  },
  "metadata": {
    "invoice_id": 0004500
  },
  "subscription": {
    "id": "000501000",
    "cycle": 0,
    "status": "active",
    "cancelDate": "2026-06-15 20:10:09",
    "timezone": "+02:00",
    "eventTime": "2026-05-19 20:43:58"
  }
}

Cancel request

curl --request PUT \
  --url https://api.centrobill.com/subscription/{id}/cancel \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "cancelDate": "2025-03-01 00:00:00",
    "reason": "Request from customer",
    "sendEmail": true,
    "keepActiveUntilNextRebill": false
  }'

Request fields:

FieldRequiredDescription
cancelDateNoDate and time to cancel the subscription (YYYY-MM-DD HH:MM:SS). If omitted or set to null, the subscription is cancelled immediately
reasonNoReason for cancellation. Max 255 characters
sendEmailNoIf true, Centrobill sends a cancellation email to the consumer. Defaults to true
keepActiveUntilNextRebillNoIf true, sets cancelDate to 1 hour before the next scheduled rebill date, overriding any cancelDate value passed in the same request
subscription.idYesSubscription ID

A successful response returns the updated subscription object with status: canceled and the cancelDate set.

Note: If cancelDate is set to a future date, the subscription status remains active until cancelDate is reached.



Did this page help you?