v1
latestOpenAPI 3.0.32026-07-248079274.0 KBCancel a subscription
Cancels a subscription. By default (at_period_end is false) the subscription is cancelled immediately: the status transitions to 'cancelled' and any outstanding draft bills are voided. When at_period_end is true, the subscription remains in its current status and the cancel_at_period_end field on the subscription is set to true — the subscription is then cancelled automatically when the next bill becomes due, at which point that bill is voided and no payment is taken for it.
Path parameters
Unique identifier for the subscription.
Query parameters
When false (default), the subscription is cancelled immediately and outstanding draft bills are voided. When true, the subscription remains in its current status and is cancelled automatically when the next bill becomes due — that bill is voided and no payment is taken for it (the cancel_at_period_end field on the subscription is set to true).
Comma-separated list of fields to expand in the response. Fields marked as Expandable in the response schema can be expanded. Supported fields: product, price, discount.
Response
Subscription Cancelled
Example response
{
"id": "01HNY4G8G5ZMAXQB8T0Z1Y1ZMW",
"status": "active",
"customer": {
"customer_id": "c3e06b6f-bb52-4b2c-81a3-899860652240"
},
"payment_methods": [
{
"type": "card",
"payment_method_id": "266761e2-de8b-44df-b7e3-7ab42421bce8",
"is_primary": true
}
],
"product": {
"product_id": "01HNY4G8G06M4J4J9P11CR3BCG"
},
"price": {
"price_id": "01HNY4G8G2WJ6S7G8R9QAF3KZY"
},
"discount": {
"coupon_id": "01JCX5Y8K9M3N4P6Q7R8S9T0UV"
},
"start_date": "2025-11-01T09:00:00Z",
"trial_end": "2025-11-15T09:00:00Z",
"payment": {
"reference": "ORDER-12345"
},
"payment_failure_configuration": {
"recovery_strategy": "example_strategy",
"incomplete_bills_before_cancellation": 3
},
"webhook_url": "https://example.com/webhooks/billing",
"links": [
{
"rel": "self",
"href": "/v1/subscriptions/01HNY4G8G5ZMAXQB8T0Z1Y1ZMW",
"method": "GET"
}
]
}