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:
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:
When a contract is canceled mid-term, you can set a termination fee to be levied. Here's how:
charge with price set to the termination fee.charge_on_event parameter to contract_termination. ORsubscription_items[charge_on_event][i] parameter to contract_termination.Once the above steps are done, the termination fee will be charged automatically if you terminate the contract in the middle of its term.
{
"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
}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_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. 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.