Introducing the Chargebee CLI

Subscription Cancellation

Introduction

When an active subscription moves to an inactive state and further renewals do not take place, it is canceled. You can cancel an active subscription at any time. There are five ways in which a subscription can be canceled:

Cancellation Reasons

Subscription cancellation can happen due to various reasons. If a subscription gets canceled for any of the following cases, the subscription_canceled event will notify you of the reason for the cancellation.

  • Not Paid
  • No Card
  • Fraud Review Failed
  • Non Compliant EU Customer
  • Tax Calculation Failed
  • Currency incompatible with Gateway
  • Non Compliant Customer

If the subscription gets canceled due to any other reason, the subscription_canceled event will not include the reason for cancellation.

Configure Subscription Cancellation

You can configure Chargebee's default subscription cancellation settings by navigating to Settings > Configure Chargebee > Billing LogIQ > Customers & Subscriptions > Subscription cancellation.

The following table explains the various options available for each setting.

SettingOptions Available
When a subscription has to be canceled

Cancel immediately: Cancels the subscription immediately.

Cancel at end of current term: Waits until the next renewal date and then cancels (changes the subscription status to non-renewing).

Cancel on a specific date: Waits till the scheduled date and then cancels. You can set the precise date and time of cancellation.

Cancel at end of subscription billing term: Cancels a subscription either at the end of the advance term, if it's billed for future renewals or at the end of its current billing cycle.

When a subscription is canceled mid-term, how do you want to handle credits for the unused period?

Don’t issue credits: The subscription is canceled without giving any credits for the unused period.

Issue prorated credits: The subscription is canceled and prorated credits are given for the unused period. (Not advised for shippable subscriptions as proration in Chargebee is time-based.)

Issue full credits: Issues full credits for the entire term.

When subscription is canceled, include the cancellation date in the billing period?

This setting is only available when Chargebee is running on day-based proration mode. When enabled, a subscription canceling on a particular date will end its term on the same date. When disabled, the subscription will end its term on the day before the cancellation date.

Note: If you switch from Day-based to Millisecond-based proration mode, this setting is no longer applicable and therefore will not appear in the Subscription Cancellation settings.

If there are existing refundable credits

Retain credits: No action is taken against the credits.

Initiate refund: Initiates the refund of the credits.

If there are existing unpaid invoices for the canceled subscription

Retain as unpaid: No action is taken against the invoice.

Attempt Collection: A charge is attempted on the available payment method if auto-collection is enabled. If the payment fails, the invoice is retained as payment due.

Write Off: The amount due is written off.

If there are existing unbilled charges for the canceled subscription

Invoice Charges: The unbilled charges will be invoiced and a charge is attempted on the available payment method if auto-collection is enabled. If the payment fails, the invoice is marked not paid.

Delete Charges: The unbilled charges will be deleted.

Apply refundable credits/excess payments, if any, to unpaid invoices.

This toggle allows you to apply to the unpaid invoices, any refundable credits/excess payments that are present for the customer record.

When a subscription is scheduled to be canceled after the current billing period, how do you want to bill the final period?

Invoice Full Period: The customer is invoiced for the entire final billing period. Once the subscription is canceled, any unused portion of the billing period (from the cancellation date to the end of the term) is calculated and credited back to the customer.

Invoice up to the Scheduled Cancellation Date: The billing term is adjusted to end on the cancellation date. The customer is invoiced only for the actual duration of service used during the final period, instead of the full billing cycle.

When invoicing up to the scheduled cancellation date, how should charges be raised?

Raise prorated charges: The customer is invoiced a prorated amount for the actual number of days in the shortened final term.

Raise full charges: The customer is invoiced the full plan amount for the shortened final term, even though the service period ends on the cancellation date. This is the default setting when proration is not selected.

Show Decommission Option During Cancellation

When enabled, the cancellation flow includes an option to decommission the subscription. Decommissioning is irreversible: it disables all operations on the subscription except deletion, and you cannot undo it from the Chargebee interface. This setting only controls whether the decommission option is visible during subscription cancellation. The subscription is decommissioned only when you select the option during cancellation. The option is not available after a subscription is already canceled.

This is a site-level setting which is enabled by default.

Chargebee also allows you to override the default settings or add a condition. You can perform these actions by clicking the vertical ellipsis available next to each setting.

  • Allow overriding via Chargebee interface: By enabling the "Allow overriding via Chargebee interface" for a setting, you can allow your users to override the default option.
  • Add condition to this rule: A different behavior can be set for subscription cancellations based on whether the cancellation is invoked via the web interface, API, by the customer through the Self-serve Portal, or due to scheduled cancellations.
  • To avoid credit card disputes (chargebacks), it is recommended to have a clear and precise cancellation/refund policy in place with your customers.

For Future Subscriptions

  • The subscription can be canceled only immediately. There is no option to set it to cancel at the end of term after the subscription gets activated.
  • If you want to cancel it at the end of the first term, you can use the Edit Subscription operation and set the number of billing cycles to 1.

From Scheduled Cancellation to Active

When the number of billing cycles increases for a subscription or when the subscription is changed to a plan that has a different term period, it will switch from non-renewing state to active state.

Example

If the number of billing cycles for a monthly subscription scheduled for cancellation (number of billing cycles set to 0) is set to any non-zero number, or if the plan is changed to a yearly one using the Edit Subscription operation, the subscription will become active. Customers can be offered a way to turn their subscriptions to "active" from "non-renewing" by extending their subscription.

Edit Scheduled Cancellation

The date/time of cancellation for a subscription that is scheduled to be canceled upon the next renewal can be changed via web interface using the Edit Scheduled Cancellation available in the subscription details page.

If the cancellation date is postponed, the subscription will still continue to be in the non-renewing state until the cancellation date/time. An option to raise prorated charges for the extended period is also made available while performing this action.

The following are the options for scheduled cancellation of a subscription:

  • Cancel immediately: This option is used to cancel the subscription with immediate effect.
  • Cancel at end of current term: This option is used to cancel a subscription at the end of the current billing cycle.
  • Cancel on a specific date: This option is used to cancel a subscription on a specified date.
  • Cancel at end of subscription billing term: This option is used to cancel a subscription either at the end of the advance term, if it's billed for future renewals, or at the end of its current billing cycle.

You can schedule subscription cancellation for any specific date up to 5 years (1,830 days) from the current date.

Reactivating Canceled Subscription

To re-start the billing for a canceled subscription, you need to ‘reactivate' your subscription. Learn more.

You cannot reactivate a decommissioned subscription.

Decommission a canceled subscription

In some cases, you might need to retain a canceled subscription for audit purposes but prevent any further action on it. To support this, Chargebee allows you to decommission a subscription when you cancel it.

You can decommission a subscription only during the cancellation flow, from the Chargebee interface or the Cancel a subscription for items API. You cannot decommission a subscription after it has already been canceled.

Decommissioning retires a subscription while preserving its data for reference and compliance. After a subscription is decommissioned, all operations on it are disabled except deleting the subscription. This action is irreversible. You cannot undo it from the Chargebee interface. If you need to reverse it, contact Chargebee Support.

A decommissioned subscription has the following restrictions:

  • You cannot reactivate it.
  • You cannot edit it.
  • You cannot add one-time charges or non-recurring addons to it.
  • You cannot perform other subscription operations on it, except deleting it.
  • It remains canceled and inactive, and available for audit and historical reference.

Show the decommission option during cancellation

The Show Decommission Option During Cancellation setting controls whether the cancellation flow includes Decommission this subscription. The setting is enabled by default.

To change the setting, go to Settings > Configure Chargebee > Billing LogIQ > Customers & Subscriptions > Subscription cancellation.

Turn the setting on to show Decommission this subscription in the cancellation flow. Turn it off if you do not want users to decommission subscriptions from the Chargebee interface. You can still decommission a subscription using the Cancel a subscription for items API.

This setting only controls visibility of the option. A subscription is decommissioned only when you select Decommission this subscription during cancellation, or when you pass decommissioned as true in the cancel API request. The option is not available after a subscription is already canceled.

Decommission a subscription from the Chargebee interface

You can decommission a subscription only when the required setting is enabled, and when you cancel the subscription from the subscription details page. The decommission option is not available after the subscription is already canceled.

This action is irreversible. After the subscription is decommissioned, you cannot undo it from the Chargebee interface.

  1. Open the subscription details page.
  2. Click Cancel Subscription.
  3. Select when to cancel the subscription.
  4. Select Decommission this subscription.
  1. Complete the cancellation.

If you schedule the cancellation for a later date, decommissioning takes effect when the subscription is canceled, not when you schedule it.

Filter decommissioned subscriptions

You can filter decommissioned subscriptions on the Subscriptions page and through the API.

To filter from the Chargebee interface:

  1. Click Subscriptions.
  2. Click Filter list.
  3. Select the Decommissioned filter and set it to True.
  4. Click Apply Filter.

You can also filter decommissioned subscriptions using the List subscriptions API and the Export subscriptions API.

Use cases for decommissioning a subscription

Common scenarios for decommissioning a subscription can include:

  • Recreate a subscription under a different customer
    When a subscription needs to be continued under a different customer, cancel and decommission the original subscription, then create a new one under the target customer. Decommissioning prevents reactivation and retains the original subscription for audit purposes.

    • Example 1
      Company A has an active subscription. Company B acquires Company A, and Company A is no longer active. Company B takes over the subscription.

      To support this transition:

      • Cancel and decommission the subscription under Company A to retain it as a historical record.
      • Create a new subscription under Company B.

      The decommissioned subscription serves as an audit record of the transfer.

    • Example 2
      A customer can operate multiple businesses, each with its own subscription and billing account. These are often created as separate customers in Chargebee.

      For example, a business operates three businesses:

      • Pet store (billing account ending 1111)
      • Provision store (billing account ending 2222)
      • Toy store (billing account ending 3333)

      Each business has its own subscription.

      If another customer acquires one of these businesses (for example, the Pet store) and wants to continue the subscription.

      To support this transition:

      • Cancel and decommission the subscription associated with the Pet store to retain historical invoices and transactions.
      • Create a new subscription under the acquiring customer.

      This approach ensures that:

      • Historical data remains with the original customer for audit purposes.
      • The new customer starts with a clean subscription.
      • Sensitive financial data is not shared across customers.
  • Data migration
    During migrations, you might cancel and decommission legacy subscriptions and create new ones. Decommissioning keeps the older subscriptions available for audit purposes.

  • Operational changes
    When a subscription needs to be replaced due to system-level changes (for example, a change in currency), you cannot modify the existing subscription. Instead, cancel and decommission the current subscription, then create a new one with the updated configuration. The decommissioned subscription remains available for audit and tracking.

    • Example
      If there is a user who has a USD subscription and has moved to a new location, the user now wants to pay in EUR. To avoid making any credits in USD after the user moves to EUR, you cancel and decommission the USD subscription and create a new subscription in EUR. The decommissioned USD subscription is preserved as a historical record.

Decommissioning and cancellation

Decommissioning happens as part of cancellation, not as a separate action after the subscription is already canceled. Use the following guidelines:

ScenarioAction
Customer chooses to stop the subscriptionCancel the subscription
Subscription might be resumed laterCancel the subscription
Subscription is replaced (transferred or migrated)Cancel and decommission
Subscription is required only for the auditCancel and decommission

FAQ

1) Why can't I set the time when I change the cancellation date?

Your Chargebee site must be in day-based proration mode. In this mode, it is implied that the cancellation happens at the end of the day.

2) How is the refund calculated when a day-based proration subscription gets canceled on the created day?

In day-based proration, whether the subscription is used for one hour or one day, the usage duration is considered as one day. When the credit note gets generated, it will deduct one day usage amount.

Articles & FAQs