POST /subscriptions/{subscription-id}/reactivate
Note: This operation optionally supports 3DS verification flow. To achieve the same, create the Payment Intent and pass it as input parameter to this API.
This API is used to reactivate a cancelled subscription. You may also optionally specify a trial end date, to move the subscription to In Trial state. If trial end is not specified, the subscription will be activated and any applicable charges will be initiated.
Unless the billing cycle is specified, it will be set to plan's default billing cycle.
During an in-term reactivation^++^, unless the billing cycle is specified, the subscription's remaining billing cycles will be restored. If a trial end date is specified, then the plan's default billing cycle is used.
What is an "in-term reactivation"? An "in-term reactivation" happens when the billing term of the subscription is retained upon cancellation and reactivation is initiated within that term.
When is the 'billing term' retained for a cancelled subscription? When dunning (payment failure retry settings) is configured with the last retry configured as
- cancel subscription and mark invoice as 'Not Paid', or
- cancel subscription and mark the invoice as 'Voided' and the case if any of the current term invoices is partially or fully paid, the invoice is not voided but instead Chargebee marks the invoices as 'Not Paid'.
Note : In both cases, the billing term is retained and upon reactivation the subscription will be moved to active state (if the plan does not have a trial period) and no invoice will be generated. Ensure that you collect any unpaid invoices.
Example : A Subscription was billed from 1st to 31st of a month and it was cancelled on the 20th due to one of the above cases (billing term is not reset). If the reactivation happens on 25th then it is considered an in-term reactivation.
Servers
- {protocol}://{site}.{environment}:{port}/api/v2
- {protocol}://{site}-test.{environment}:{port}/api/v2
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:
|
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:
|
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:
|
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
payment_initiator |
String | No |
The type of initiator to be used for the payment request triggered by this operation. * customer - Pass this value to indicate that the request is initiated by the customer * merchant - Pass this value to indicate that the request is initiated by the merchant Valid values:
|
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:
|
payment_intent |
Object | No |
Parameters for payment_intent |
payment_intent.id |
String | No |
Identifier for PaymentIntent generated by Chargebee.js. Applicable only when you are using Chargebee.js for completing the 3DS flow. The PaymentIntent should be in 'authorized' state while passing it here. You need not pass other PaymentIntent parameters if this is passed. |
payment_intent.gateway_account_id |
String | No |
The gateway account used for performing the 3DS flow. |
payment_intent.payment_method_type |
String | No |
The list of payment method types (For example, card, ideal, sofort, bancontact, etc.) this Payment Intent is allowed to use. If payment method type is empty, Card is taken as the default type for all gateways except Razorpay. * card - card * netbanking_emandates - netbanking_emandates * payconiq_by_bancontact - Payconiq by Bancontact * dotpay - dotpay * faster_payments - Faster Payments * upi - upi * direct_debit - direct_debit * sepa_instant_transfer - Sepa Instant Transfer * bancontact - bancontact * google_pay - google_pay * apple_pay - apple_pay * online_banking_poland - Online Banking Poland * giropay - giropay * paypal_express_checkout - paypal_express_checkout * venmo - Venmo * klarna_pay_now - Klarna Pay Now * sofort - sofort * amazon_payments - Amazon Payments * ideal - ideal * pay_to - PayTo * boleto - boleto Valid values:
|
payment_intent.additional_information |
Object | No |
|
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 |
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. The value of this parameter must always be in the past (backdating). Do this when the subscription has already been reactivated and the billing has been delayed. The following prerequisites must be met for this parameter to be passed:
|
invoice_date |
Integer | No |
The document date displayed on the invoice PDF. The default value is the current date. 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
|
contract_term |
Object | No |
Parameters for contract_term |
contract_term.action_at_term_end |
String | No |
Action to be taken when the contract term completes.
Valid values:
|
contract_term.cancellation_cutoff_period |
Integer | No |
The number of days before 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 |
contract_term_billing_cycle_on_renewal |
Integer | No |
Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as |
billing_cycles |
Integer | No |
Number of cycles(plan interval) this subscription should be charged. After the billing cycles exhausted, the subscription will be cancelled. |
How to start integrating
- Add HTTP Task to your workflow definition.
- 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.
- Click Test request to test run your request to the API and see the API's response.