Subscriptions can run indefinitely or they may run for a fixed number of billing cycles. Subscription can have "contract terms", which define a lock-in period on the subscription for a certain number of billing cycles. This prevents the subscription from being canceled by the customer when it is within the contract term.
The contract term resource described below defines the properties of this lock-in period. This includes the number of billing cycles, the total contract value, the action to be taken at the end of the contract term, and so on. To allow for exceptions, you also have the option of terminating an active
contract term and charging a termination fee.
A contract term starts in the active
state and ends in the completed
state. If the contract was canceled due to non-payment or other reasons, it can end in the canceled
or terminated
state. A given contract term is always associated with one, and only one subscription. A subscription, however, can be associated with only one active
contract term. Over time, a subscription can be associated with several non-active
contract terms. The active
contract term for a subscription is available as an object within the subscription.
To enable and configure contract terms, follow these steps in the Chargebee UI:
- Click Settings on the left navigation.
- Click Configure Chargebee.
- Under Billing, click Contract Terms.
- Enable and configure the feature as needed.
Once contract terms have been configured, the following actions can be performed using the API:
- Define a contract term for a subscription and set renewal options for the contract term. The following endpoints support this:
- Retrieving a historical record of all contract terms for a subscription can be done via the following endpoint:
- Canceling a contract term can be done via the following endpoints:
Including a termination fee
When a contract is canceled mid-term, you can set a termination fee to be levied. Here's how:
- Create an item price for an item of type
charge
with price set to the termination fee.
- Do one of the following:
Once the above steps are done, the termination fee will be charged automatically if you terminate the contract in the middle of its term.
Sample contract term [ JSON ]
{
"action_at_term_end": "renew",
"billing_cycle": 12,
"cancellation_cutoff_period": 0,
"contract_end": 1548974761,
"contract_start": 1517438761,
"created_at": 1517438761,
"id": "__test__3Nl7o66Rt41dR98T",
"remaining_billing_cycles": 11,
"status": "active",
"total_contract_value": 10740
}
API Index URL GET
https://{site}.chargebee.com/api/v2/contract_terms
string, max chars=50 Id that uniquely identifies the contract term in the site.
enumerated string Current status of contract Possible values are
activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. Show all values[+]
timestamp(UTC) in seconds The start date of the contract term
timestamp(UTC) in seconds The end date of the contract term
integer, min=0 The number of billing cycles of the subscription that the contract term is for.
enumerated string, default=renew Action to be taken when the contract term completes. Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. Show all values[+]
in cents, default=0, min=0 The sum of the totals of all the invoices raised as part of the contract term. For active
contract terms, this is a predicted value. The value depends on the type of currency. If the subscription was imported with the contract term, then this value includes the value passed for total_amount_raised
. total_contract_value_before_tax
in cents, default=0, min=0 It refers to the total amount of revenue that is expected to be generated from a specific contract term, calculated as the sum of all invoices raised during the term, regardless of payment status. It is based on past performance and the specified currency in the contract. If the subscription was imported, the value for total_amount_raised_before_tax
is included in the calculation of the total contract value before tax. It's important to note that this value excludes any applicable taxes. cancellation_cutoff_period
optional, integer The number of days before contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to 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
timestamp(UTC) in seconds The date when the contract term was created.
string, max chars=50 The Id of the subscription that this contract term is for.
optional, integer, min=0 The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for active
contract terms.
This is a list of the event types we currently support. We will continue
to add more events moving forward. All events follow a uniform pattern -
<resource>_<event_name>. The resources that will be
present in the event content are provided beneath each event type's
description.
Note: If consolidated invoicing is enabled, the
attributes invoice.subscription_id and
credit_note.subscription_id should not be used
(as it will not be present if the invoice / credit note has lines from
multiple subscriptions). Instead to know the related subscriptions,
their line_items' subscription_id attribute should be referred.
string, max chars=50 Id that uniquely identifies the contract term in the site.
enumerated string Current status of contract Possible values are
activeAn actively running contract term.completedThe contract term has run its full duration.cancelledThe contract term was ended because: terminatedThe contract term was terminated ahead of completion. Show all values[+]
timestamp(UTC) in seconds The start date of the contract term
timestamp(UTC) in seconds The end date of the contract term
integer, min=0 The number of billing cycles of the subscription that the contract term is for.
enumerated string, default=renew Action to be taken when the contract term completes. Possible values are
renewContract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to renew
.evergreenContract term completes and the subscription renews.cancelContract term completes and subscription is canceled.renew_onceUsed when you want to renew the contract term just once. Does the following: Contract term completes and a new contract term is started for the number of billing cycles specified in contract_billing_cycle_on_renewal
.The action_at_term_end
for the new contract term is set to cancel
. Show all values[+]
in cents, default=0, min=0 The sum of the totals of all the invoices raised as part of the contract term. For active
contract terms, this is a predicted value. The value depends on the type of currency. If the subscription was imported with the contract term, then this value includes the value passed for total_amount_raised
.
in cents, default=0, min=0 It refers to the total amount of revenue that is expected to be generated from a specific contract term, calculated as the sum of all invoices raised during the term, regardless of payment status. It is based on past performance and the specified currency in the contract. If the subscription was imported, the value for total_amount_raised_before_tax
is included in the calculation of the total contract value before tax. It's important to note that this value excludes any applicable taxes.
optional, integer The number of days before contract_end
, during which the customer is barred from canceling the contract term. The customer is allowed to 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
timestamp(UTC) in seconds The date when the contract term was created.
string, max chars=50 The Id of the subscription that this contract term is for.
optional, integer, min=0 The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for active
contract terms.