ChargebeeAPI
Using AI coding agents like Claude Code or Cursor? Try the official Chargebee Agent Skills to speed up your development.Try now

Reactivate a subscription

Idempotency Supported
Try in API Explorer

Reactivates a canceled subscription.

Use this operation to restore a canceled subscription to an active or in-trial state.

Extend non-renewing subscriptions

To extend the billing cycles of a non_renewing subscription, use the Remove scheduled cancellation API.

Prerequisites & Constraints

  • The subscription status must be cancelled.

Impacts

Subscription

Invoice

If an invoice gets generated during this operation, customer balances such as promotional credits, excess payments, and refundable credits are automatically applied subject to limits set at the site level which can be overridden for subscriptions via subscription.billing_override.

Use Cases

Create payment source using payment_intent

Use the payment_intent parameter to create a payment source for the customer. If reactivation generates an invoice and auto_collection is on, Chargebee immediately attempts payment collection using the new payment source.

Note

  1. Create a payment_intent resource by calling the Create a payment intent API.
  2. Pass the payment_intent object to your frontend and use Chargebee.js to capture the payment source details from the customer. You can use Payment Components to capture the payment source details.
  3. Listen to the payment_intent_updated event. Once the payment_intent.status is authorized, pass the payment_intent.id using the payment_intent[id] parameter in this API call.

Sample Request

URL Format

POST https://[site].chargebee.com/api/v2/subscriptions/{subscription-id}/reactivate

Input Parameters

trial_end
optional, timestamp(UTC) in seconds

Providing this parameter indicates that the subscription reactivates with an in_trial status and the trial period ends at the date provided.

Constraints

  • Must not be earlier than reactivate_from if reactivate_from is provided.
  • When trial_end is backdated, the subscription immediately goes into active or non_renewing status.
billing_cycles
optional, integer, min=0

The number of billing cycles (including the current cycle) this subscription should remain active for. After the billing cycles are exhausted, the subscription is canceled automatically.

Default value

Impact

reactivate_from
optional, timestamp(UTC) in seconds

The date-time at which the subscription was reactivated. When not provided, the subscription is reactivated immediately on calling this API.

Prerequisites

  • The backdating feature has been enabled for subscription reactivation operations.
  • The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is the day of the month by which the accounting for the previous month must be closed.

Constraints

  • Must be in the past.
  • Must not be more than the billing period of the plan into the past. For example, if the period of the plan in the subscription is 2 months and today is 14th April, reactivate_from cannot be earlier than 14th February.
  • Must not be after trial_end if trial_end is provided.
invoice_immediately
optional, boolean

If there are charges raised immediately for the subscription, this parameter specifies whether those charges are to be invoiced immediately or added to unbilled charges. The default value is as per the site settings .

Note: invoice_immediately only affects charges that are raised at the time of execution of this API call. Any charges scheduled to be raised in the future are not affected by this parameter.

.

billing_alignment_mode
optional, enumerated string

Applicable when calendar billing is enabled and a new active term gets started during this operation. Unless specified the configured default value will be used.

Possible Enum Values
immediate

Subscription period will be aligned with the configured billing date immediately, with credits or charges raised accordingly.

delayed

Subscription period will be aligned with the configured billing date at the next renewal.

terms_to_charge
optional, integer, min=1

The number of subscription billing cycles to invoice in advance. If a new term is started for the subscription due to this API call, then terms_to_charge is inclusive of this new term. See description for the force_term_reset parameter to learn more about when a subscription term is reset.

invoice_date
optional, timestamp(UTC) in seconds

The document date displayed on the invoice PDF. Provide this value to backdate the invoice. Backdating an invoice is done for reasons such as booking revenue for a previous date or when the subscription is effective as of a past date. Moreover, if create_pending_invoices is true, and if the site is configured to set invoice dates to the date of closing, then upon invoice closure, this date is changed to the invoice closing date. taxes and line_item_taxes are computed based on the tax configuration as of invoice_date.

Default value

  • Current date.

Constraints

  • Must be in the past.
  • Must not be more than one calendar month into the past. For example, if today is 13th January, then you cannot pass a value that is earlier than 13th December.
  • Must not be earlier than reactivate_from or trial_end.
  • invoice_immediately must be true.
contract_term_billing_cycle_on_renewal
optional, integer, min=1, max=100

The number of billing cycles the new contract term should run for, on contract renewal. This value is used when action_at_term_end is renew.

Constraints

  • Should not be sent when contract_term.action_at_term_end is cancel or evergreen.

Default value

  • Defaults to the value of billing_cycle or a custom value depending on the site configuration.
payment_initiator
optional, enumerated string

The initiator of this payment request. Sending this information can improve the success rate of the payment at the gateway.

Possible Enum Values
customer

The payment was initiated by your customer.

merchant

The payment was initiated by you (the merchant).

contract_term
Parameters for contract_term
pass parameters as contract_term[<param name>]
statement_descriptor
Parameters for statement_descriptor
pass parameters as statement_descriptor[<param name>]
payment_intent
Parameters for payment_intent
pass parameters as payment_intent[<param name>]

Returns

subscriptionSubscription object
Resource object representing subscription
customerCustomer object
Resource object representing customer
cardCard object
Resource object representing card
invoiceInvoice object
Resource object representing invoice
Resource object representing unbilled_charge