Cancel subscriptions
Learn how to cancel existing subscriptions.
This guide describes how to use the Subscription API or the Dashboard to manage customer subscriptions.
If you want to keep a subscription active but temporarily stop collecting payment, you can pause payment collection. Pausing payment collection doesn’t affect the subscription status, which we recommend using as the trigger for starting or stopping service to your customer.
Subscriptions cancel automatically after up to eight unsuccessful attempts to bill the customer. You can configure the number of attempts in your subscription lifecycle settings. Learn more about revenue recovery settings, such as Smart Retries and configurable customer emails.
Cancel subscriptions
You can cancel customer subscriptions manually with the API or in the Dashboard. By default, cancellation takes effect immediately and invoices are no longer generated for cancelled subscriptions. After it’s cancelled, you can no longer update the subscription or its metadata.
Common mistake
If you set a custom cancellation date, you can’t provide a refund. A credit proration is always generated. To prevent a credit proration from generating, make sure the custom cancellation date is within the current billing period and proration_
is set to none
.
Prorate for usage-based billing
If a subscription is part of the way through a paid billing period, you can prorate the cancellation by passing the prorate parameter.
When you prorate a cancellation, you can optionally invoice for:
- Outstanding prorations
- Metered usage
If you don’t prorate the subscription, all metered usage gets discarded and the customer won’t receive credit for any potential prorations.
Create a final invoice immediately using the invoice_now parameter. If you owe the customer a credit after cancellation, you can add the credit to their credit balance to apply to future invoices. To refund your customer, issue refunds and then adjust their account balance back to zero.
Cancel at the end of the current billing cycle
To cancel a subscription at the end of the current billing period, set cancel_
to true
:
This allows the subscription to complete the duration of time the customer has already paid for. You can reactivate subscriptions scheduled for cancellation by updating cancel_
to false
. You can reactivate the subscription at any time up to the end of the period.
Cancel after scheduled changes or future billing cycles
To schedule a subscription to end after a specified number of billing cycles, create a subscription schedule. Set the schedule length by specifying one or more phases and intervals, and set its end_behavior attribute to cancel
.
With an end behaviour of cancel
, subscription schedules automatically manage the subscription’s cancel_at attribute. When the schedule is in its last phase, the subscription’s cancel date is set to the phase’s end date, otherwise, the cancel date isn’t set on the subscription.
As a result, adding a new phase to a schedule that’s currently in its last phase removes the cancel date. If the subscription is in its last billing period when extending or removing the cancel date, this might update the period end and billing cycle anchor. See how to set a custom cancel date for more details.
Configure automatic cancellation after a dispute
Limited support
This feature is only supported for disputed credit and debit card payments opened in the full amount.
When a customer disputes a charge for a subscription, the subscription continues to cycle, which can create more disputed charges. You can change this behaviour in the Dashboard to cancel subscriptions instead. Changes to the subscription take effect after approximately one hour.
Under Manage disputed payments, select one of the following:
cancel the subscription immediately without prorating – The subscription cancels immediately without any prorating. You can’t restart a cancelled subscription. You must create a new subscription for the customer if you want to continue billing them.
cancel the subscription at the end of the period – The subscription cancels at the end of the current billing period and cancel_at_period_end is set to
true
. This allows you time to work through the dispute process before the cancellation occurs.
For subscriptions managed with schedules, the subscription is first released from the schedule and then cancelled. This means the rest of the scheduled changes won’t take effect.
Handle invoice items when cancelling subscriptions
Your customer might still be billed for pending invoice items on a subscription in the following cases:
- The subscription cancellation includes a final invoice
- Your customer has another active subscription
To prevent billing your customer for pending invoice items, you must manually delete the invoice items.
Similarly, any usage reported during the billing period bills at the end of the period. To avoid a final usage charge, use the clear_usage parameter to update the subscription and remove the metered price.
If you set the subscription to cancel at period end, any pending prorations are left in place and still collected at the end of the period. If you cancel the subscription before the end of the period, invoice items remain and won’t be processed unless you specifically generate an invoice that includes them.
When you cancel a subscription, all open
and draft
invoices for that subscription have their auto_
property set to false
. This pauses automatic collection for these invoices and prevents automatic reminder emails from sending. You can still manually attempt to collect payment and send emails.
Identify cancellation events
Stripe sends the following events for cancelled subscriptions.
Event | Description |
---|---|
customer. | Sent when you cancel a customer’s subscription immediately. If the event’s request property isn’t null , that indicates the cancellation is a result of your request rather than based on your subscription settings. |
customer. | Sent when you cancel a customer’s subscription at the end of the billing period. This triggers when you set cancel_ to true and the event reflects a change in the cancel_ value for the subscription. |
Stop a pending cancellation
You can stop a scheduled cancellation through the Update Subscription API or the Dashboard. You can’t reactivate a cancelled subscription.
Set a custom cancel date
Use the cancel_at parameter to cancel a subscription at a future timestamp.
When you schedule a cancel date that occurs before the billing period ends, the subscription’s current_period_end updates to match the cancel_
date. This creates prorations for the change in the current period, unless your update disables prorations.
If you schedule a cancel date that occurs more than one period away, the subscription’s cycle remains unaffected until the subscription renews into the period that contains the cancel_
date. Then, the current_
for the renewal shortens to match the cancel_
date.
For example, your customer subscribes to a 120 USD per year licensed subscription that renews on 1 January 2024. They set the subscription to cancel on 1 July 2024. The final invoice subtotal on 1 January calculates as 60 USD and the current_
is 1 July.
Changing, adding, or removing a scheduled cancel date within the current period updates the current_
and creates prorations. In the above example, on 15 February you update the cancel date to 1 October. The current period end becomes 1 October, and Stripe creates prorations for 30 USD for the additional quarter. To invoice the prorated items immediately instead of in a final invoice on 1 October, pass a proration_behavior of always_
in the update, or separately create a one-off invoice.
The subscription’s billing cycle anchor property might change if it tracked the previous cancel date. During the first period, Stripe preserves any anchor you originally set on the subscription. When the first period has finished, or if you didn’t provide a custom anchor when creating the subscription, the anchor resets to the current period start.
Adding a cancel date or moving an existing one closer to the current time shortens the billing cycle anchor to match the new cancel date. In the above example, on 15 February you update the cancel date to 1 April. The period end and billing anchor become 1 April, and Stripe creates prorations for -30 USD to credit your customer for unused time for 1 April to 1 July.