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 action | API behaviour | What happens |
|---|---|---|
| Cancel | Omit cancelDate or set it to null | Subscription is cancelled immediately. No further rebills. |
| Cancel further automatic charges | Pass keepActiveUntilNextRebill: true | cancelDate 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:
keepActiveUntilNextRebilloverrides anycancelDatevalue 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:
| Field | Required | Description |
|---|---|---|
cancelDate | No | Date and time to cancel the subscription (YYYY-MM-DD HH:MM:SS). If omitted or set to null, the subscription is cancelled immediately |
reason | No | Reason for cancellation. Max 255 characters |
sendEmail | No | If true, Centrobill sends a cancellation email to the consumer. Defaults to true |
keepActiveUntilNextRebill | No | If true, sets cancelDate to 1 hour before the next scheduled rebill date, overriding any cancelDate value passed in the same request |
subscription.id | Yes | Subscription ID |
A successful response returns the updated subscription object with status: canceled and the cancelDate set.
Note: If
cancelDateis set to a future date, the subscription status remains active untilcancelDateis reached.
Updated 20 days ago
Did this page help you?
