A Chargebee subscription connects a customer record to products/services. It describes what the customer has signed up for and how often they're charged for it. The essential components of a subscription are:
The charges in a subscription are billed via invoices.
Chargebee offers two billing frequency options for subscriptions:
Plan-based billing (default): Subscriptions are billed based on the billing period defined for the item price of the item_type plan. Learn more.
Multi-frequency billing: Subscriptions are billed according to the billing period of each recurring item price within the subscription. Learn more.
Important
Limitations of Multi-frequency billing.
Private Beta
Multi-frequency billing is in private beta. Please reach out to the Chargebee support to enable this feature.
The selection of the billing frequency preference is configured at the site level.
When creating or updating a subscription, one of the item prices specified under subscription_items must be a plan-item price. The remaining must be compatible addon- or charge-item prices. An item price is compatible with a plan-item price if their currencies are the same. Additionally, an addon-item price is compatible with a plan-item price only if their billing frequencies meet the following conditions:
period_unit for plan-item price | Compatible period_unit for addon-item price | Compatible period for addon-item price |
|---|---|---|
day | day | The Example If the |
week | week or day | The Example
If the
|
month | month | The Example If the |
year | year or month | The Example If the
|
Anrok: Canadian customers can have multiple tax registration numbers. We currently support only sharing one tax registration number with Anrok. So we added a new field which can have comma separated multiple tax reg numbers for Anrok. Values configured in the field is passed as it is to Anrok for accurate tax calculation
| Field ID | Field Value | APIs |
|---|---|---|
additionalTaxRegistrationNumber | Canadian tax registration numbers in comma separated fashion. | APIs involving customer attributes. Also includes APIs where we are creating new customers. Eg: estimate, subscription, hosted pages. |
Vertex: Chargebee shares field IDs and corresponding values with merchants, who then configure them on the Vertex Platform for seamless integration
Note:
Field Id like customerCode
, customerClass
, andtaxExempted
belong to the customer object.
Field Id like productCode
, productClass
, productTaxCode
, and productClass
belong to the product object.
| Field ID | Field Value | APIs |
|---|---|---|
productCode | Merchant to configure it on Vertex Platform | APIs having Plan(PC1), Addons(PC1) and Item Prices(PC2) attributes. |
productClass | ||
customerCode | APIs involving customer attributes. Also includes APIs where we are creating new customers. For example: estimate, subscription, hosted pages. | |
customerClass |
Taxamo: Chargebee shares field IDs and corresponding values with merchants, who then configure them on the Taxamo Platform for seamless integration
| Field Id | Field Value | APIs |
|---|---|---|
productTaxCode | Merchant to configure it on Taxamo Platform | APIs having Plan(PC1), Addons(PC1) and Item Prices(PC2) attributes. |
productClass | ||
taxExempted | APIs involving customer attributes. Also includes APIs where we are creating new customers. For example: estimate, subscription, hosted pages. |
cbtaxes: With CBTaxes, you can activate India IGST for customers located in Special Economic Zones (SEZ), implement zero-rated tax for SEZ customers, enable India IGST for customers outside of India, and set up zero-rated tax for customers outside of India.
| Field ID | Field Value | APIs |
|---|---|---|
indiaSez | SEZ_IGST_TAX | APIs involving customer attributes. Also includes APIs where we are creating new customers. For example: estimate, subscription, hosted pages. |
SEZ_ZERO_RATED_TAX | ||
indiaExport | EXPORT_IGST_TAX | |
EXPORT_ZERO_RATED_TAX |
All: For tax inclusive tax calculation, For tax exclusive tax calculation. This is currently used for price type overriding at customer level
| Field ID | Field Value | APIs |
|---|---|---|
priceType | TAX_INCLUSIVE | APIs involving customer attributes. Also includes APIs where we are creating new customers. For example: estimate, subscription, hosted pages. |
TAX_EXCLUSIVE | ||
SITE_DEFAULT or blank | Removes price type override, and allows site level configuration to be used for tax calculation. |
{
"activated_at": 1612890916,
"billing_period": 1,
"billing_period_unit": "month",
"created_at": 1612890916,
"currency_code": "USD",
"current_term_end": 1615310116,
"current_term_start": 1612890916,
"customer_id": "__test__8asukSOXdulGOV",
"deleted": false,
"due_invoices_count": 1,
"due_since": 1612890916,
"has_scheduled_changes": false,
"id": "__test__8asukSOXduqmOY",
"mrr": 0,
"next_billing_at": 1615310116,
"object": "subscription",
"remaining_billing_cycles": 1,
"resource_version": 1612890917000,
"started_at": 1612890916,
"status": "active",
"subscription_items": [
{
"amount": 1000,
"billing_cycles": 1,
"free_quantity": 0,
"item_price_id": "basic-USD",
"item_type": "plan",
"object": "subscription_item",
"quantity": 1,
"unit_price": 1000
},
{
"amount": 100,
"item_price_id": "day-pass-USD",
"item_type": "addon",
"object": "subscription_item",
"quantity": 1,
"unit_price": 100
}
],
"total_dues": 1100,
"updated_at": 1612890917
}subscription resource. You have the option to specify this value when creating a customer. If not specified, Chargebee automatically generates a unique identifier. In the event that the subscription resource is transferred along with its associated customer resource to a different business entity, Chargebee assigns a new random value as the id for the subscription. The original identifier is preserved for the transferred copy of the subscription resource. (See also: Mechanics of business entity transfer.)
billing_cycles or a custom value depending on the site configuration. true, ignores the hierarchy relationship and uses customer as payment and invoice owner. Indicates whether there are subscription changes scheduled for the next renewal.
This attribute does not consider changes scheduled through upcoming ramps on the subscription. If changes on the subscription are scheduled only via ramps and not through the Update Subscription API, the value of this attribute remains false.
Note: Present only when the subscription has been transferred between business entities.
Represents the id of the active version of the subscription resource.
If the id and active_id of a subscription resource are the same, this indicates that you are working with the active version of that subscription resource.
due_invoices_count. total_dues. true. You can retrieve a deleted subscription using the list operation. Indicates whether the invoices for this subscription are generated with a pending status. This attribute is set to true automatically when the subscription has item prices that belong to metered items.
You can also set this to true explicitly using the create/update subscription operations. This is useful in the following scenarios:
Applicable only when Metered Billing is enabled for the site
false to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. subscription_items which have pricing_model as
tiered, volume or stairstep.Note
duration_type one_time are removed from the list after a single application to the subscription.duration_type limited_period are removed from the list once the specified period expires since their attachment to the subscription.Note:
This endpoint optionally supports 3DS. To use it create
a payment_intent
and provide it via this endpoint.
Creates a new subscription for an existing customer in Chargebee. Any available credits and excess payments for the customer are automatically applied on the invoice.
The unique ID of the business entity this subscription should be linked to. Applicable only when multiple business entities have been created for the site. This must be the same as the business entity of the {customer_id} for the operation to be successful.
An alternative way of passing this parameter is by means of a custom HTTP header.
Specifies the number of billing cycles for the subscription. The behavior of the subscription after the billing cycles have completed depends on whether the subscription is on a contract term or not.
billing_cycles is not provided, then the billing cycles set for the plan-item price is used. Moreover, once the billing_cycles have completed, the subscription cancels.billing_cycles is mandatory. Moreover, once the billing_cycles have completed, the behavior of the subscription is determined by the contract_term[action_at_term_end] parameter.net_term_days defined at the customer level is considered.start_date cannot be earlier than 14th February.true, ignores the hierarchy relationship and uses customer as payment and invoice owner. create_pending_invoices is set to 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. When passing this parameter, the following prerequisites must be met:
invoice_date must be in the past.start_date.invoice_immediately is true.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_cycles or a custom value depending on the site configuration. Indicates whether the invoices for this subscription are generated with a pending status. This attribute is set to true automatically when the subscription has item prices that belong to metered items.
You can also set this to true explicitly using the create/update subscription operations. This is useful in the following scenarios:
Applicable only when Metered Billing is enabled for the site
.false to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. If you want to bill the usages from the previous billing cycle, set this parameter to true. This is useful if the subscription has moved from another system into Chargebee and you haven't closed the previous cycle's invoice yet. This creates a pending invoice immediately on subscription creation, to which you can add usages for the previous cycle.
If any non-metered items are present for the current term, they're also added to this pending invoice. As with all pending invoices, this invoice is also closed automatically or via an API call. This parameter can be passed only when the create_pending_invoices is true
Returns a list of subscriptions meeting all the conditions specified in the filter parameters below.
status last changed to
active. For example, this value is updated when an in_trial or
cancelled subscription activates. current_term_end unless multiple subscription terms were invoiced in advance using the terms_to_charge parameter. updated_at. This attribute will be present only if the resource has been updated after 2016-09-28. It is advisable when using this filter, to pass the sort_by input parameter as updated_at for a faster response. false to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. Possible values are : true, false true, ignores the hierarchy relationship and uses customer as payment and invoice owner. Possible values are : true, false Retrieves a list of contract term resources for the subscription specified in the path.
Warning This API will return an error when multi-frequency billing is enabled.
Retrieves a list of discount
resources currently attached
to a specific subscription. The list is sorted in descending order based on the created_at
timestamp.
Note
This endpoint does not return coupon or coupon_code resources.
Retrieves a subscription.
Caution
This API cannot be used for subscriptions that have ramps.
Retrieves a subscription with the scheduled changes applied.
Note: Only the following attributes are changed
Caution
This API cannot be used for subscriptions that have ramps.
Removes the subscription changes scheduled on next renewal. Advance charges, if any, will be refunded as credits and a new invoice will be generated on renewal.
Note: Cannot be called when the subscription is on a contract term. (That is, when the contract_term.status attribute is active.)
If the subscription is in Non Renewing or In Trial state and is also scheduled to cancel at the end of current term, then this API can be used to remove the scheduled cancellation. When a scheduled cancellation is removed, the subscription will revert to Active or In Trial state, whichever is the state before cancellation was scheduled.
While removing the scheduled cancellation, you may specify the number of billing cycles. If the billing cycle is not specified, the default billing cycle from the plan will be applied on the subscription.
billing_cycles or a custom value depending on the site configuration. Caution
If there are scheduled ramps for the subscription, this operation can move the ramps to the draft status when it conflicts with any upcoming ramps.
Removes coupons associated with the subscription. If the param coupon_ids
is not specified, all the coupons linked to the subscription are be removed.
Note:
payment_intent and provide it via this endpoint.Caution
If the subscription currently includes ramps, it's important to note that any ramps scheduled may move to the draft status due to changes in plan billing frequency, line item, or term end. Carefully review your ramp configurations and the details of the subscription update to prevent any unintended disruptions to the subscription.
Updates the specified subscription by setting the parameters passed. Any parameters not provided are left unmodified. If an invoice is generated for this operation, any available credits and excess payments for the customer are automatically applied.
0 or a positive integer: Net D is set explicitly for the subscription to the value provided. The value must be one of those defined in the site configuration.-1: The attribute is reset and therefore not returned by the API. In this case, when an invoice is raised - whether now or later - the net_term_days defined at the customer level is considered.create_pending_invoices is set to true, and if the site is configured to set invoice dates to 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. When passing this parameter, the following prerequisites must be met:
invoice_date must be in the past.invoice_date is not 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.changes_scheduled_at, reactivate_from, or trial_end.invoice_immediately is true.The time at which the trial has ended or will end for the subscription. Set it to 0 to have no trial period.
Note
status is future, in_trial, or cancelled.changes_scheduled_at or start_date.cancelled or in_trial status. Do this to keep a record of when the trial ended in case it ended at some point in the past. When trial_end is backdated, the subscription immediately goes into active or non_renewing status.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. status is cancelled and it is being reactivated via this operation, this is the date/time at which the subscription should be reactivated.changed_scheduled_at. reactivate_from can be backdated (set to a value in the past). Use backdating when the subscription has been reactivated already but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
changes_scheduled_at cannot be earlier than 14th February.changes_scheduled_at is in the past, then the currently available coupons can be used even if they were not available as of the date for when the change is scheduled. true: Prorated credits or charges are created as applicable for this change.false: The subscription is changed without creating any credits or charges.For further changes within the same billing term, when prorate is set to true, credits are not created when all the conditions below hold true:
An immediate previous change was made
prorate set to false andThis parameter is unavailable when the Subscription Ramps feature is enabled; use Create a ramp API instead.
true will have the subscription reset its term to the current date (provided end_of_term is false). status of the subscription is cancelled, this parameter determines whether the subscription is reactivated upon making this API request. Unless passed explicitly as false, this parameter is implied as true when you provide the subscription_items and coupons parameters. gateway_id in this API call will not override the gateway associated with the token.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.
true, ignores the hierarchy relationship and uses customer as payment and invoice owner. This parameter cannot be set to a future date when the Subscription Ramps feature is enabled; use Create a ramp API instead.
change_option is set to specific_date, then set the date/time at which the subscription change is to happen or has happened. Note: It is recommended not to pass this parameter along with reactivate_from. changes_scheduled_at can be set to a value in the past. This is called backdating the subscription change and is performed when the subscription change has already been provisioned but its billing has been delayed. Backdating is allowed only when the following prerequisites are met:
status is active, cancelled, or non_renewing.current_term_start.changes_scheduled_at cannot be earlier than 14th February.changes_scheduled_at parameter does not apply to auto_collection, shipping_address, and po_number; these parameters take effect immediately when scheduling a subscription update. billing_cycles or a custom value depending on the site configuration. Indicates whether the invoices for this subscription are generated with a pending status. This attribute is set to true automatically when the subscription has item prices that belong to metered items.
You can also set this to true explicitly using the create/update subscription operations. This is useful in the following scenarios:
Applicable only when Metered Billing is enabled for the site
.false to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. Use this endpoint to adjust when a subscription's current term or trial ends without altering the plan or billing frequency. It is helpful when you need to align renewals to a specific calendar date or extend a trial. Future renewals will follow the new date, keeping the subscription cadence intact.
Subscriptions must be in one of the following status values: in_trial, active, non_renewing.
Subscription
Based on the subscription's status, the following updates are made:
in_trial, the trial_end is set to the new date.active, the current_term_end is set to the new date.non_renewing, the upcoming cancellation date is set to the new date.Invoices and Credit Notes
The API can generate unbilled charges, invoice, or credit notes. You can control the behaviour using prorate and invoice_immediately parameters.
To preview invoices, credits, and dates, use the Change term end estimate endpoint.
Advance Charges
If there are advance charges, then credit notes are issued for the unused portion of the service period.
Scheduled Pause
If the subscription is scheduled to pause at the end of the current term, the pause date is updated to match the new term end date.
Ramps
If subscription ramps are present, this operation moves them to the draft state. Update and reschedule the ramps as needed to keep them in sync.
The request fails with invalid_state if the subscription is not in one of the trial, active, or non_renewing states. Validate the status before invoking this API.
next_billing_at. 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.
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
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.
Reactivation of a subscription in non_renewing state has been deprecated. To remove a scheduled cancellation of a non_renewing Subscription, use Remove Scheduled Cancellation API. However, if you use reactivate API to remove scheduled cancellation for a non_renewing Subscription, then the status will be set to active and the billing cycle will be set to forever. If any value is passed for trial_end or billing cycle, an error will be thrown. If an invoice gets generated during this operation, available Credits and Excess Payments will be automatically applied. Additional Error Scenarios: If there is a need to create an immediate charge and the collection fails, an error will be thrown.
in_trial status and the trial period ends at the date provided. The value must not be earlier than reactivate_from. Note: This parameter can be backdated (set to a value in the past) only when reactivate_from has been backdated. Do this to keep a record of when the trial ended in case it ended at some point in the past. When trial_end is backdated, the subscription immediately goes into active or non_renewing status. reactivate_from cannot be earlier than 14th February.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.
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. 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. When passing this parameter, the following prerequisites must be met:
invoice_date must be in the past.invoice_date is not 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.reactivate_from or trial_end.invoice_immediately is true.billing_cycles or a custom value depending on the site configuration. Adds a one time charge to the subscription which will be added to the invoice generated at the end of the current term. If there are any applicable coupons in the subscription, an appropriate discount will be applied.
To collect a charge immediately, use this API.
If any subscription changes happen before the end of the current term, these charges will be collected along with it.
Creates an advance invoice or an advance invoicing schedule. When an advance invoice is generated, and auto_collection is on for the subscription, the payment_source associated with the subscription is charged. Any changes scheduled for the subscription are taken into account automatically while generating an advance invoice. Advance invoices are not generated for a subscription when it is in the paused status. Advance invoices are generated only for non-metered items in a subscription.
non_renewing and cancelled subscriptions.ramps, this API will return error for the following scenarios
schedule_type is specific_dates or fixed_intervalsschedule_type = immediate: the number of future billing cycles to be invoiced in advance. The invoicing is done for the remaining_billing_cycles of the subscription if that is less than terms_to_charge.schedule_type = fixed_intervals: The number of future billing cycles in one interval. The schedule is created such that the total number of billing cycles in the schedule does not exceed the remaining_billing_cycles of the subscription.unbilled_charges. Applicable only when schedule_type is immediate. Caution
This API cannot be used for subscriptions that have ramps.- This API will return an error when multi-frequency billing is enabled.
Modifies the advance invoicing schedule for a subscription.
Caution
ramps.Retrieves the advance_invoice_schedule for a subscription. Note that this endpoint is only applicable for schedule_type = specific_dates or fixed_intervals.
Caution
ramps.Deletes an advance invoicing schedule. When schedule_type = specific_dates, you also have the option of deleting a part of the schedule.
Use this API to regenerate the current-term invoice for a subscription. The new invoice will contain non-metered charges from the current term and metered charges from the previous term. If a customer was billed incorrectly, because of a wrong plan, price, or tax configuration, you can first void or delete the erroneous invoice, update the subscription or usage records, and then run this operation to issue the corrected invoice.
Before regenerating an invoice, ensure the following conditions are met:
status must be active or non_renewing.metered subscribed items for the current term.metered items for the previous term.Current-Term Invoice
Chargebee does not modify the voided or deleted invoice for the current term. Instead, it creates a new invoice.
The new invoice includes:
The new invoice does not include:
If every charge for the current-term has a value of zero, and your site is configured to hide zero-value line items, the invoice is not generated.
If you delete the original invoice, the associated usage data is also deleted. To ensure accurate billing for metered items, add or bulk import usage records before regenerating the invoice.
Payment Collection
If auto-collection is on, Chargebee attempts to collect payment for the regenerated invoice. If the payment collection fails, the invoice regeneration also fails.
Note: Chargebee applies any customer balances, such as unapplied payment from the voided invoice, before attempting to collect the remaining amount.
Order
Any orders associated with the invoice are regenerated automatically when the invoice is regenerated.
Before calling this API, perform the following checks:
status is active or non_renewing.date_from and date_to parameters, ensure that their values fall within the range defined by subscription.current_term_start and subscription.current_term_end.false to leave the current term charge for the subscription as unbilled. Once you have done this for all suitable subscriptions of the customer, call Create an invoice for unbilled charges to invoice them. Import previous and active contract terms .
For contract terms in active
state, import is allowed only if the associated subscription is active
, in_trial
, future
or non-renewing
.
Warning This API will return an error when multi-frequency billing is enabled.
billing_cycles or a custom value depending on the site configuration. Imports one or more unbilled charges into an existing subscription. Use this operation to add usage-based or other unbilled charges recorded in external systems to the subscription.
If you are trying to use this operation on your live site, ensure you have requested Support to enable it, otherwise the API will return an "API not enabled" error.
Invoicing
Accounting Integrations
Imported unbilled charges will not sync with your accounting integration until they are invoiced.
Imports a subscription into Chargebee.
duration_type of one_time. Ensure that the IDs included in this parameter do not match any IDs provided in the coupon_ids parameter. net_term_days defined at the customer level is considered.The time at which the subscription was activated. A subscription is "activated" when its status changes from any other, to either active or non_renewing.
The following conditions must be satisfied when passing this parameter:
status is active, non_renewing, or paused, activated_at must be on or after trial_end or started_at. Additionally, activated_at must be on or before current_term_start.
status is in_trial, activated_at must precede trial_start
This parameter should not be provided when passing status as future or cancelled.
billing_cycles or a custom value depending on the site configuration. true if you want an invoice to be created for the subscription.active or non_renewing status.current_term_start to current_term_end.Indicates whether the invoices for this subscription are generated with a pending status. This attribute is set to true automatically when the subscription has item prices that belong to metered items.
You can also set this to true explicitly using the create/update subscription operations. This is useful in the following scenarios:
Applicable only when Metered Billing is enabled for the site
.false to override for this subscription, the site-level setting for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level. Assigns the payment source and sets auto collection state for the subscription.
When you don't pass any input param for this API, payment source and auto collection for the subscription will be the same as the customer's default settings.
Deletes the subscription resource.
Note: Deleting a subscription will not remove the associated usage events . The usage events will be retained even if the subscription is deleted.
This operation is irreversible - all data related to the subscription, such as invoices, transactions, and reports, will be deleted. Note: This operation schedules the subscription resource for deletion. It will be deleted in a few minutes.
Use this API to pause an active or non-renewing subscription. When a subscription is paused, it does not renew, and Chargebee does not generate renewal invoices for it. This allows you to temporarily suspend a customer's service without canceling the subscription.
active or non_renewing state can be paused.Subscription
If the pause_option parameter is set to immediately, the subscription's status changes to paused. The next_billing_at, pause_date, and resume_date values are updated based on the input parameters.
Unbilled Charges
If the subscription has unbilled charges and is paused immediately, you can choose to leave the charges unbilled or invoice them. If invoiced, Chargebee attempts payment collection based on the customer's auto-collection settings. If payment fails or auto-collection is not enabled, the invoice is marked as unpaid.
Use the unbilled_charges_handling parameter to set your preference.
Dunning
If the subscription has unpaid invoices in dunning and is paused immediately, you can choose to either stop or continue the dunning process.
Use the invoice_dunning_handling parameter to set your preference.
Scheduled Ramps
Any future subscription ramps (such as price or quantity changes) effective on or after the pause date are automatically deleted.
Advanced Invoices
If the subscription has an advance invoice, Chargebee creates an adjustment credit note if the invoice is unpaid or in a payment-due state. If the invoice is already paid, a refundable credit note is created.
Before calling this API, perform the following checks:
status is active or non_renewing. If it isn't, the API returns an invalid_state_for_pause error.has_scheduled_changes attribute. If true, either remove the scheduled changes before calling the API or avoid the operation. Otherwise, the API returns an operation_failed error.contract_term attribute is not present, or if it is present, that contract_term.status is not active. Otherwise, the API returns an invalid_request error.non_renewing state and you want to set the pause date to a future date, the pause date must be earlier than the cancellation date. If you specify a resume date, it must also be earlier than the cancellation date.Date on which the subscription will be paused. Applicable when specific_date option is chosen in the pause_option field.
For non-renewing subscriptions, pause_date should be before the cancellation date.
Applicable when unbilled charges are present for the subscription and pause_option is set as immediately. Note: On the invoice raised, an automatic charge is attempted on the payment method available, if customer's auto-collection property is set to on.
Handles dunning for invoices already in the dunning cycle when a subscription is paused. Applicable when pause_option is set as immediately.
If invoice is in the dunning cycle, invoice_dunning_handing allows you to stop or continue dunning.
pause_option is billing_cycles. Cancels the specified subscription.
cancelled or transferred.contract_term_cancel_option instead of cancel_option.Subscription
cancel_option.contract_term_cancel_option.status changes to cancelled when canceled.cancel_option is specified as end_of_term, or if contract_term_cancel_option is specified as end_of_subscription_billing_term, the subscription status changes to non_renewing and the subscription billing_cycles becomes 0.Contract Terms
contract_term_cancel_option.Ramps
If ramps are scheduled for the subscription, this operation deletes any ramps that are set to become effective on or after the subscription's cancellation date-time.
Before calling this API, perform the following checks:
status is not cancelled or transferred.contract_term_cancel_option instead of cancel_option.Cancel a subscription with a contract term
If the subscription has a contract term, you can use the following parameters with this API:
contract_term_cancel_optioncancel_atcredit_option_for_current_term_chargesunbilled_charges_optionaccount_receivables_handlingrefundable_credits_handling(Deprecated) Use cancel_option instead.
Applicable only when the subscription does not have contract terms.
Set this to true if you want to cancel the subscription at the end of the current subscription billing cycle. The subscription status changes to non_renewing.
Specifies the date and time when the subscription should be canceled. Do not use this parameter when end_of_term is set to true.
Applicable only when contract_term_cancel_option is specific_date. Specifies the date and time to cancel the subscription and contract term.
You can set a past date to backdate the cancellation. Backdating is allowed only if the following conditions are met:
current_term_start.cancel_at cannot be earlier than February 14.Specifies how to handle credits for current term charges when canceling immediately (i.e., cancel_option is immediately). If not specified, the site-level setting is used.
Specifies how to handle credits for current term charges when contract_term_cancel_option is terminate_immediately. If not specified, the site-level setting is used.
Specifies how to handle unbilled charges when canceling immediately (i.e., cancel_option is immediately). If not specified, the site-level setting is used.
Specifies how to handle unbilled charges when contract_term_cancel_option is terminate_immediately. If not specified, the site-level setting is used.
Specifies how to handle past due invoices when canceling immediately (i.e., cancel_option is immediately). If not specified, the site-level setting is used.
Specifies how to handle past due invoices when contract_term_cancel_option is terminate_immediately. If not specified, the site-level setting is used.
Specifies how to handle refundable credits when canceling immediately (i.e., cancel_option is immediately). If not specified, the site-level setting is used.
Specifies how to handle refundable credits when contract_term_cancel_option is terminate_immediately. If not specified, the site-level setting is used.
create_pending_invoices is true, and if the site is configured to set invoice dates to 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. When passing this parameter, the following prerequisites must be met:
invoice_date must be in the past.invoice_date is not 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.cancel_at.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 resume a paused subscription. On resumption the subscription will be activated and any applicable charges will be initiated.
You could schedule the resumption by passing specific_date parameter in resume_option. If scheduled, the subscription will be resumed on the specific_date and moved to Active state.
For in-term resumption, unless there are scheduled changes, unbilled charges will not be charged.
What is an "in-term resumption"? An "in-term resumption" is when the pause and resumption happens within the billing term of the subscription.
Example : A subscription was billed from 1st to 31st of a month. It was paused on the 20th and resumed before 31st. This is an in-term resumption.
Specifying unpaid_invoices allows you to close invoices of the subscription which have amounts due. The invoices are chosen for payment collection after applying the available credits and excess payments.
If you specify schedule_payment_collection, Chargebee will try to collect payments for overdue invoices, provided that auto_collection is enabled for the subscription. The available payment method is charged. Upon successful payment, the payment_succeeded event is triggered. If the payment collection fails, no further attempts will be made to collect payment on the invoices.
Note: If the invoices of the subscription are consolidated, and any of the subscriptions in the consolidated invoice are cancelled, these invoices will not be selected for collection.
Warning
This API will return an error when multi-frequency billing is enabled.
If the subscription is in Active or Non Renewing state and is also scheduled to pause at the end_of_term/specific_date, this API can be used to remove the scheduled pause.
Warning This API will return an error when multi-frequency billing is enabled.
If the subscription is in Paused state and is scheduled to resume on a specific_date, this API can be used to remove the scheduled resumption. When the scheduled resumption is removed, the subscription will remain Paused.
Warning This API will return an error when multi-frequency billing is enabled.
Moves a subscription from one customer to another asynchronously. All related resources such as unbilled_charge, invoice, credit_note, and transaction are also moved to the new customer.
After moving, Chargebee adds a comment to the original customer resource to document the move, including the to_customer_id and the ids of all the resources transferred to the destination customer.
Warning
auto_collection is on, it might fail after this operation. Refer to the warning in copy_payment_source for details.customer resource that is within an account hierarchy relationship.payment_due, pending, or posted associated with the subscription.credit_note resources with the statuses adjusted or refund_due should be associated with the subscription.If the above prerequisites are met, the API call returns a 200 OK response containing the subscription resource as is. However, the actual move operation can take up to five minutes to complete.
To know whether the operation was successful, we recommend that you watch for the subscription_changed event and see if subscription.customer_id has changed.
Note
: Resources linked to the original customer such as unbilled_charge
, invoice
, credit_note
, and transaction
but not
linked to the subscription being moved, are not
moved to the destination customer by this operation.
Specifies the unique ID of the customer resource to which the subscription will be moved.
customer.business_entity_id of the destination customer must match the subscription.business_entity_id. When true:
If the subscription has an associated payment_source:
payment_source resource is created.payment_source also deletes the other copies and the details stored at the payment gateway. When false:
No new payment source is created for the subscription. Moreover, if a payment_source is already linked to the subscription, it gets removed, meaning the subscription.payment_source_id is cleared.
copy_payment_source is false and if subscription.auto_collection is enabled, auto-collection will fail, in turn preventing subscription renewal. To prevent auto-collection failure, link a payment source to the subscription after this operation.