POST /subscriptions/{subscription-id}/reactivate

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.

The subscription's current billing term is demarcated by the current_term_start and current_term_end attributes. These attributes are retained even if the subscription is canceled. An "in-term reactivation" happens when the subscription is reactivated on or before current_term_end.

Prerequisites & Constraints

Impacts

Subscription

  • For subscriptions canceled due to payment failure, in-term reactivation is governed by the Chargebee Billing configuration for reactivation.

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

  • This works for both Strong Customer Authentication (SCA) (i.e. 3D-Secure) and non-SCA flows.
  • The payment source replaces the existing primary payment source for the customer.
  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.

Servers

Path parameters

Name Type Required Description
subscription-id String Yes

Request headers

Name Type Required Description
chargebee-request-origin-device String No

The device from which the customer has made the request

Content-Type String Yes The media type of the request body.

Default value: "application/x-www-form-urlencoded"

chargebee-event-webhook String No

skip only webhooks

Valid values:

  • "all-disabled"
chargebee-business-entity-id String No

If the site has multiple business entities, you can use this custom HTTP header to specify the business entity for which Chargebee should perform the operation.

chargebee-event-actions String No

skip all actions to be done on the events

Valid values:

  • "all-disabled"
chargebee-request-origin-user String No

The email address of your customer/user. Use this when the email address has only ASCII characters.

chargebee-request-origin-ip String No

The IP address of the customer where the request originated

chargebee-request-origin-user-encoded String No

The Base64-encoded email address of your customer/user. Use this if the email address has UTF-8 characters. When this header is provided, the header chargebee-request-origin-user is ignored.

chargebee-event-email String No

skip only emails

Valid values:

  • "all-disabled"

Request body fields

Name Type Required Description
payment_initiator String No

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

The payment was initiated by your customer. * merchant -

The payment was initiated by you (the merchant).

Valid values:

  • "merchant"
  • "customer"
invoice_immediately Boolean No

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 String No

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. * delayed -

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

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

Valid values:

  • "immediate"
  • "delayed"
payment_intent Object No

Parameters for payment_intent

payment_intent.id String No

Identifier for the payment_intent resource. If you provide this parameter, you do not need to pass other payment_intent parameters.

Prerequisites

  • The value of payment_intent.status must be authorized.
payment_intent.gateway_account_id String No

The gateway account used for performing the 3DS flow.

payment_intent.payment_method_type String No

The payment method type.

Default value

  • card
* card -

card

* netbanking_emandates -

netbanking_emandates

* payconiq_by_bancontact -

Payconiq by Bancontact

* dotpay -

dotpay

* faster_payments -

Faster Payments

* upi -

upi

* kbc_payment_button -

KBC Payment Button

* electronic_payment_standard -

Electronic Payment Standard

* direct_debit -

direct_debit

* sepa_instant_transfer -

Sepa Instant Transfer

* bancontact -

bancontact

* pay_by_bank -

Pay By Bank

* google_pay -

google_pay

* apple_pay -

apple_pay

* online_banking_poland -

Online Banking Poland

* trustly -

Trustly

* stablecoin -

Stablecoin

* giropay -

giropay

* paypal_express_checkout -

paypal_express_checkout

* pix -

Pix

* venmo -

Venmo

* klarna_pay_now -

Klarna Pay Now

* sofort -

sofort

* amazon_payments -

Amazon Payments

* ideal -

ideal

* pay_to -

PayTo

* boleto -

boleto

Valid values:

  • "pay_by_bank"
  • "upi"
  • "online_banking_poland"
  • "cash_app_pay"
  • "direct_debit"
  • "boleto"
  • "netbanking_emandates"
  • "giropay"
  • "electronic_payment_standard"
  • "venmo"
  • "payconiq_by_bancontact"
  • "card"
  • "klarna_pay_now"
  • "pix"
  • "faster_payments"
  • "sepa_instant_transfer"
  • "alipay"
  • "naver_pay"
  • "revolut_pay"
  • "bancontact"
  • "amazon_payments"
  • "trustly"
  • "sofort"
  • "stablecoin"
  • "kakao_pay"
  • "paypal_express_checkout"
  • "apple_pay"
  • "pay_to"
  • "kbc_payment_button"
  • "dotpay"
  • "google_pay"
  • "ideal"
  • "wechat_pay"
payment_intent.additional_information Object No
  • checkout_com: While adding a new payment method using permanent token or passing raw card details to Checkout.com, document ID and country_of_residence are required to support payments through dLocal.

    • payer: User related information.
      • country_of_residence: This is required since the billing country associated with the user's payment method may not be the same as their country of residence. Hence the user's country of residence needs to be specified. The country code should be a two-character ISO code.
      • document: Document ID is the user's identification number based on their country.
  • bluesnap: While passing raw card details to BlueSnap, if fraud_session_id is added, additional validation is performed to avoid fraudulent transactions.

    • fraud: Fraud identification related information.
      • fraud_session_id: Your BlueSnap fraud session ID required to perform anti-fraud validation.
  • braintree: While passing raw card details to Braintree, your fraud_merchant_id and the user's device_session_id can be added to perform additional validation and avoid fraudulent transactions.

    • fraud: Fraud identification related information.
      • device_session_id: Session ID associated with the user's device.
      • fraud_merchant_id: Your merchant ID for fraud detection.
  • chargebee_payments: While passing raw card details to Chargebee Payments, if fraud_session_id is added, additional validation is performed to avoid fraudulent transactions.

    • fraud: Fraud identification related information.
      • fraud_session_id: Your Chargebee Payments fraud session ID required to perform anti-fraud validation.
  • bank_of_america: While passing raw card details to Bank of America, your user's device_session_id can be added to perform additional validation and avoid fraudulent transactions.

    • fraud: Fraud identification related information.
      • device_session_id: Session ID associated with the user's device.
  • ecentric: This parameter is used to verify and process payment method details in Ecentric. If the merchant_id parameter is included, Chargebee will vault it / perform a lookup and verification against this merchant_id, overriding the one configured in Chargebee. If tokens and processing occur in the same Merchant GUID, you can just skip this part.

    • merchant_id: Merchant GUID where the card is vaulted or need to be vaulted.
  • ebanx: While passing raw card details to EBANX, the user's document is required for some countries and device_session_id can be added to perform additional validation and avoid fraudulent transactions.

    • payer: User related information.
      • document: Document is the user's identification number based on their country.
    • fraud: Fraud identification related information.
      • device_session_id: Session ID associated with the user's device
payment_intent.gw_token String No

Identifier for 3DS transaction/verification object at the gateway. Can be passed only after successfully completing the 3DS flow. Refer 3DS implementation in Chargebee to find out the gateway-specific gw_token format. Applicable when you are using gateway APIs directly for completing the 3DS flow.

payment_intent.reference_id String No

Identifier for Braintree permanent token. Applicable when you are using Braintree APIs for completing the 3DS flow.

terms_to_charge Integer No

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.

reactivate_from Integer No

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_date Integer No

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 Object No

Parameters for creating a contract term for the subscription. **Prerequisites** * [Contract Terms](https://www.chargebee.com/docs/contract-terms.html) feature must be enabled for the site.

contract_term.action_at_term_end String No

Action to be taken when the contract term completes.

Constraints

  • billing_cycles must be provided when this parameter is sent.
* evergreen -

The contract term completes and the subscription continues to renew without a new contract term.

* renew -

The contract term completes and a new contract term is started for the number of billing cycles specified in contract_term_billing_cycle_on_renewal. The action_at_term_end for the new contract term is set to renew.

* cancel -

Contract term completes and subscription is canceled.

Valid values:

  • "evergreen"
  • "cancel"
  • "renew"
contract_term.cancellation_cutoff_period Integer No

The number of days before contract_end during which the customer is barred from canceling the contract term. The customer can cancel the contract term via the Self-Serve Portal only before this period. This allows you to have sufficient time for processing the contract term closure.

Required if

  • The action_at_term_end is renew.

Constraints

  • Must be less than the duration of the contract term (in days).
  • Should not be sent when action_at_term_end is cancel or evergreen.

Default value: 0

statement_descriptor Object No

Parameters for statement_descriptor

statement_descriptor.descriptor String No

Payment transaction descriptor text to help your customer easily recognize the transaction. When this value is passed this will override the transaction descriptor text configured in the Chargebee site for all the subscription renewal transactions.

trial_end Integer No

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.
contract_term_billing_cycle_on_renewal Integer No

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.
billing_cycles Integer No

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

  • If not specified, the billing cycles configured for the plan are used.

Impact

  • The remaining_billing_cycles attribute of the subscription is updated to one less than the value of this parameter.

How to start integrating

  1. Add HTTP Task to your workflow definition.
  2. Search for the API you want to integrate with and click on the name.
    • This loads the API reference documentation and prepares the Http request settings.
  3. Click Test request to test run your request to the API and see the API's response.