Idempotency Supported
Imports an active or historical contract term for a subscription.
Use this operation to import contract terms when migrating subscriptions from another billing system, or to add historical contract term data for existing subscriptions. You can import both active contract terms (currently running) and historical contract terms (completed, canceled, or terminated).
Prerequisites & Constraints
- The Contract Terms feature must be enabled on the site.
- The Multi-Frequency Billing feature must not be enabled for the site.
- The subscription must have a fixed billing cycle (the
remaining_billing_cyclesmust be set). - The contract term period must not overlap with any existing contract terms for the subscription.
Impacts
Contract term
- A new
contract_termresource is created and associated with the subscription. - For active contract terms:
- the
total_contract_valueis calculated as the sum of the contract estimate and thetotal_amount_raisedparameter. - The
contract_enddate is calculated based on thecontract_startdate and thebilling_cycleparameter.
Implementation Notes
- Check the subscription's
remaining_billing_cyclesattribute. If it is not set, the subscription is set to forever renewal. Update the subscription to a fixed billing cycle before importing a contract term. - Check for existing contract terms for the subscription. Ensure that the the
contract_startandcontract_enddates don't overlap with any existing contract term for the subscription.
Sample Request
Sample Result[JSON]
URL Format
POST https://[site].chargebee.com/api/v2/subscriptions/{subscription-id}/import_contract_term
Input Parameters
The number of billing cycles the new contract term should run for when the contract term renews. This value is used when action_at_term_end is renew or renew_once.
Constraints
- Should not be sent when
action_at_term_endiscancelorevergreen.
Default value
- Defaults to the value of
billing_cycleor a custom value depending on the site configuration.
Returns
Contract term object
Resource object representing contract_term