younifyd
Menu

Import Contract Term

Import contract term

POST/subscriptions/{subscription-id}/import_contract_term

Use it in a workflow

  1. Add a step and choose the Chargebee connector.
  2. Pick the Import Contract Term action (under Chargebee API).
  3. Fill in the fields below, then reference the result from later steps as {{importContractTerm.response.data}}.

Request

Path parameters

subscription-idstringrequired

Headers

chargebee-request-origin-devicestring

The device from which the customer has made the request

chargebee-request-origin-userstring (email)

The email address of your customer/user. Use this when the email address has only ASCII characters.

chargebee-request-origin-user-encodedstring (email)

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-request-origin-ipstring

The IP address of the customer where the request originated

chargebee-event-actionsstring

skip all actions to be done on the events

One ofall-disabled

chargebee-event-emailstring

skip only emails

One ofall-disabled

chargebee-event-webhookstring

skip only webhooks

One ofall-disabled

chargebee-business-entity-idstring

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.

Request body

Enter the body as JSON in the step's Body field.

contract_term_billing_cycle_on_renewalinteger (int32)

<p class="mb-2">The number of billing cycles the new contract term should run for when the contract term renews. This value is used when <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">renew</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">renew_once</code>.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Should not be sent when <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">cancel</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">evergreen</code>.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Default value</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Defaults to the value of <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">billing_cycle</code> or a custom value depending on the <a href="https://www.chargebee.com/docs/billing/2.0/subscriptions/contract-terms#configuring-contract-terms" target="_blank" rel="noopener noreferrer" class="text-blue-600 hover:text-blue-800 underline">site configuration</a>.</li> </ul></div>

contract_termobject

Parameters for contract_term

idstring

Unique identifier for the contract term in the site. **Default value** * If not provided, a unique identifier is automatically generated.

created_atinteger (unix-time)

<p class="mb-2">The date when the contract term was created.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code>.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">For active contract terms, cannot be a future date unless the subscription <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">future</code>.</li> <li class="text-base leading-relaxed">Must be less than or equal to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_start</code>.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Default value</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">For historical contract terms, defaults to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_start</code> if not provided.</li> </ul></div>

contract_startinteger (unix-time)

<p class="mb-2">The start date of the contract term.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Must be less than <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_end</code>.</li> <li class="text-base leading-relaxed">For active contract terms, cannot be a future date unless the subscription <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">future</code>.</li> <li class="text-base leading-relaxed">For historical contract terms, must be a past date.</li> <li class="text-base leading-relaxed">Cannot be less than <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">created_at</code>.</li> <li class="text-base leading-relaxed">Must not overlap with existing contract terms for the subscription.</li> </ul></div>

contract_endinteger (unix-time)

<p class="mb-2">The end date of the contract term.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is not <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> (for historical contract terms).</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Should not be sent when the contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> (it is calculated automatically).</li> <li class="text-base leading-relaxed">Must be greater than <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_start</code>.</li> <li class="text-base leading-relaxed">Must be a past date.</li> <li class="text-base leading-relaxed">Must not overlap with existing contract terms for the subscription.</li> </ul></div>

statusstring

<p class="mb-2">Current status of the contract term. Use <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> for currently running contract terms, or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">completed</code>, <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">cancelled</code>, or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">terminated</code> for historical contract terms.</p> * active - <p class="mb-2">An actively running contract term.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Prerequisite</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The subscription <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> must be <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">future</code>, <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">in_trial</code>, <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code>, or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">non-renewing</code>.</li> </ul></div> * completed - <p class="mb-2">The contract term has run its full duration.</p> * cancelled - <p class="mb-2">The contract term was ended because a change in the subscription caused a <a href="/docs/api/subscriptions/update-subscription-for-items#force_term_reset" class="text-blue-600 hover:text-blue-800 underline">subscription term reset</a>, or the subscription was canceled due to non-payment.</p> * terminated - <p class="mb-2">The contract term was terminated ahead of completion.</p>

One ofactivecompletedcancelledterminated

total_amount_raisedinteger (int64)

<p class="mb-2">The amount raised for the contract term up to the time of importing the subscription. This amount is added to the contract estimate to calculate the <a href="/docs/api/contract_terms#total_contract_value" class="text-blue-600 hover:text-blue-800 underline"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">total_contract_value</code></a> for active contract terms.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code>.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Should not be sent when the contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is not <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code>.</li> </ul></div>

Default 0

total_amount_raised_before_taxinteger (int64)

<p class="mb-2">The amount raised for the contract term up to the time of importing the subscription, excluding tax. This amount is added to the contract estimate to calculate the <a href="contract_terms#contract_term_total_contract_value_before_tax" class="text-blue-600 hover:text-blue-800 underline"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">total_contract_value_before_tax</code></a> for active contract terms.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> and <a href="https://www.chargebee.com/docs/contract-terms.html" target="_blank" rel="noopener noreferrer" class="text-blue-600 hover:text-blue-800 underline">pre-tax TCV</a> is enabled on the site.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Should not be sent when the contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is not <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code>.</li> </ul></div>

Default 0

total_contract_valueinteger (int64)

<p class="mb-2">The sum of the <a href="/docs/api/invoices#total" class="text-blue-600 hover:text-blue-800 underline">totals</a> of all invoices raised as part of the contract term. For active contract terms, this is a predicted value calculated as the sum of the contract estimate and <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">total_amount_raised</code>.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is not <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> (for historical contract terms).</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Should not be sent when the contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> (it is calculated automatically).</li> </ul></div>

Default 0

total_contract_value_before_taxinteger (int64)

<p class="mb-2">The total amount of revenue expected to be generated from the contract term, calculated as the sum of all invoices raised during the term, excluding taxes. For active contract terms, this is calculated as the sum of the contract estimate (before tax) and <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">total_amount_raised_before_tax</code>.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is not <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> and <a href="https://www.chargebee.com/docs/contract-terms.html" target="_blank" rel="noopener noreferrer" class="text-blue-600 hover:text-blue-800 underline">pre-tax TCV</a> is enabled on the site (for historical contract terms).</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Should not be sent when the contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> (it is calculated automatically).</li> </ul></div>

Default 0

billing_cycleinteger (int32)

<p class="mb-2">The number of billing cycles of the subscription that the contract term covers.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The contract term <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code>.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">For active contract terms, must be greater than the subscription&#x27;s <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">remaining_billing_cycles</code> when the subscription <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">status</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">non-renewing</code>.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Default value</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">For historical contract terms, defaults to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">1</code> if not provided.</li> </ul></div>

action_at_term_endstring

<p class="mb-2">Action to be taken when the contract term completes.</p> * evergreen - <p class="mb-2">The contract term completes and the subscription continues to renew without a new contract term.</p> * renew_once - <p class="mb-2">The contract term completes and a new contract term is started for the number of billing cycles specified in <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_term_billing_cycle_on_renewal</code>. The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> for the new contract term is set to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">cancel</code>, so the subscription is canceled when the new contract term completes.</p> * cancel - <p class="mb-2">The contract term completes and the subscription is canceled.</p> * renew - <p class="mb-2">The contract term completes and a new contract term is started for the number of billing cycles specified in <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_term_billing_cycle_on_renewal</code>. The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> for the new contract term is set to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">renew</code>.</p>

One ofrenewevergreencancelrenew_onceDefault "renew"

cancellation_cutoff_periodinteger (int32)

<p class="mb-2">The number of days before <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_end</code> during which the customer is barred from canceling the contract term. The customer can cancel the contract term via the <a href="https://www.chargebee.com/docs/self-serve-portal.html" target="_blank" rel="noopener noreferrer" class="text-blue-600 hover:text-blue-800 underline">Self-Serve Portal</a> only before this period. This allows you to have sufficient time for processing the contract term closure.</p> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Required if</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">renew</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">renew_once</code>.</li> </ul></div> <div class="alert alert-info"><p class="mb-2"><strong class="font-semibold">Constraints</strong></p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Must be less than the duration of the contract term (in days).</li> <li class="text-base leading-relaxed">Should not be sent when <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> is <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">cancel</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">evergreen</code>.</li> </ul></div>

json
{
  "contract_term_billing_cycle_on_renewal": null,
  "contract_term": null
}

Response

Returns 200 with an object. Read it in later steps with {{importContractTerm.response.data.<field>}}.

contract_termobject

<div class="api-description"><p class="mb-2">Subscriptions can run indefinitely or they may run for a fixed number of billing cycles. Subscription can have &quot;contract terms&quot;, 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.</p><p class="mb-2">The <strong class="font-semibold">contract term</strong> resource described below defines the properties of this lock-in period. This includes the <a href="/docs/api/contract_terms/contract_term-object#remaining_billing_cycles">number of billing cycles</a>, the <a href="/docs/api/contract_terms/contract_term-object#total_contract_value">total contract value</a>, the <a href="/docs/api/contract_terms/contract_term-object#action_at_term_end">action to be taken</a> at the end of the contract term, and so on. To allow for exceptions, you also have the option of terminating an <a href="/docs/api/contract_terms/contract_term-object#status"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code></a> contract term and charging a <a href="/docs/api/contract_terms">termination fee</a>.</p><p class="mb-2">A contract term starts in the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> state and ends in the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">completed</code> state. If the contract was canceled due to non-payment or other reasons, it can end in the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">canceled</code> or <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">terminated</code> state. A given contract term is always associated with one, and only one subscription. A subscription, however, can be associated with only one <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> contract term. Over time, a subscription can be associated with several non-<code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> contract terms. The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> contract term for a subscription is available as an <a href="/docs/api/subscriptions/subscription-object#contract_term">object</a> within the subscription.</p><p class="mb-2">To enable and configure contract terms, follow these steps in the Chargebee UI:</p><ol class="list-decimal list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Click <strong class="font-semibold">Settings</strong> on the left navigation.</li> <li class="text-base leading-relaxed">Click <strong class="font-semibold">Configure Chargebee</strong>.</li> <li class="text-base leading-relaxed">Under <strong class="font-semibold">Billing</strong>, click <strong class="font-semibold">Contract Terms</strong>.</li> <li class="text-base leading-relaxed">Enable and configure the feature as needed.</li> </ol><p class="mb-2">Once contract terms have been configured, the following actions can be performed using the API:</p><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed"> <p class="mb-2"><strong class="font-semibold">Define a contract term</strong> for a subscription and <strong class="font-semibold">set renewal options</strong> for the contract term. The following endpoints support this:</p> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/subscriptions/create-subscription-for-items">Create a subscription</a> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/subscriptions/update-subscription-for-items">Update a subscription</a> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/subscriptions/reactivate-a-subscription">Reactivate a subscription</a> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/ramps/create-a-ramp">Create a subscription ramp</a> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/ramps/update-a-subscription-ramp">Update a subscription ramp</a> </li> <li class="text-base leading-relaxed"> <p class="mb-2"><strong class="font-semibold">Retrieving</strong> a historical record of all contract terms for a subscription can be done via the following endpoint:</p> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/subscriptions/list-contract-terms-for-a-subscription">List contract terms for a subscription</a> </li> <li class="text-base leading-relaxed"> <p class="mb-2"><strong class="font-semibold">Canceling a contract term</strong> can be done via the following endpoints:</p> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/subscriptions/update-subscription-for-items">Update a subscription</a> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/subscriptions/cancel-subscription-for-items">Cancel a subscription</a> </li> <li class="text-base leading-relaxed"> <a href="/docs/api/ramps/update-a-subscription-ramp">Update a subscription ramp</a> </li> </ul><h4>Including a termination fee</h4><p class="mb-2">When a contract is canceled mid-term, you can set a termination fee to be levied. Here&#x27;s how:</p><ol class="list-decimal list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed"><a href="/docs/api/item_prices/create-an-item-price">Create</a> an item price for an item of <a href="/docs/api/items/item-object#type">type</a> <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">charge</code> with <a href="/docs/api/item_prices/create-an-item-price#price">price</a> set to the termination fee.</li> <li class="text-base leading-relaxed">Do one of the following:</li> </ol><ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed"><a href="/docs/api/attached_items/create-an-attached-item">Attach the charge-item to a plan</a>, setting the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">charge_on_event</code> parameter to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_termination</code>. OR</li> <li class="text-base leading-relaxed"><a href="/docs/api/subscriptions/create-subscription-for-items">Include the charge-item price on a subscription</a>, setting the <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">subscription_items[charge_on_event][i]</code> parameter to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_termination</code>.</li> </ul><p class="mb-2">Once the above steps are done, the termination fee will be charged automatically if you <a href="/docs/api/subscriptions/cancel-subscription-for-items#contract_term_cancel_option">terminate the contract in the middle of its term</a>.</p></div>

idstringrequired

Id that uniquely identifies the contract term in the site.

statusstringrequired

Current status of contract \* active - An actively running contract term. \* cancelled - The contract term was ended because: - a change in the subscription caused a [subscription term reset](/docs/api/v2/pcv-1/subscriptions/update-a-subscription#force_term_reset). * the subscription was cancelled due to non-payment. \* terminated - The contract term was terminated ahead of completion. \* completed - The contract term has run its full duration.

One ofactivecompletedcancelledterminated

contract_startinteger (unix-time)required

The start date of the contract term

contract_endinteger (unix-time)required

The end date of the contract term

billing_cycleinteger (int32)required

The number of billing cycles of the subscription that the contract term is for.

action_at_term_endstringrequired

<p class="mb-2">Action to be taken when the contract term completes.</p> * renew - <ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">Contract term completes and a new contract term is started for the number of billing cycles specified in <a href="/docs/api/v2/pcv-1/subscriptions/create-subscription-for-customer#contract_term_billing_cycle_on_renewal"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_billing_cycle_on_renewal</code></a>.</li> <li class="text-base leading-relaxed">The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> for the new contract term is set to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">renew</code>.</li> </ul> * evergreen - <p class="mb-2">Contract term completes and the subscription renews.</p> * renew_once - <p class="mb-2">Used 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 <a href="/docs/api/v2/pcv-1/subscriptions/create-subscription-for-customer#contract_term_billing_cycle_on_renewal"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_billing_cycle_on_renewal</code></a>.</p> <ul class="list-disc list-outside ml-6 my-4 space-y-2"> <li class="text-base leading-relaxed">The <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">action_at_term_end</code> for the new contract term is set to <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">cancel</code>.</li> </ul> * cancel - <p class="mb-2">Contract term completes and subscription is canceled.</p>

One ofrenewevergreencancelrenew_onceDefault "renew"

total_contract_valueinteger (int64)required

<p class="mb-2">The sum of the <a href="/docs/api/invoices/invoice-object#total">totals</a> of all the invoices raised as part of the contract term. For <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> contract terms, this is a predicted value. The value depends on the <a href="/docs/api/contract_terms">type of currency</a>. If the subscription was <a href="/docs/api/contract_terms">imported</a> with the contract term, then this value includes the value passed for <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">total_amount_raised</code> .</p>

Default 0

total_contract_value_before_taxinteger (int64)required

<p class="mb-2">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 <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">total_amount_raised_before_tax</code> is included in the calculation of the total contract value before tax. It&#x27;s important to note that this value excludes any applicable taxes.</p>

Default 0

cancellation_cutoff_periodinteger (int32)

<p class="mb-2">The number of days before <a href="/docs/api/contract_terms/contract_term-object#contract_end"><code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">contract_end</code></a> , 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.</p>

created_atinteger (unix-time)required

The date when the contract term was created.

subscription_idstringrequired

The [Id](/docs/api/subscriptions/subscription-object#id) of the subscription that this contract term is for.

remaining_billing_cyclesinteger (int32)

<p class="mb-2">The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned for <code class="bg-gray-100 text-gray-800 font-medium border border-gray-300 rounded px-1.5 py-0.5 mx-1 text-sm font-mono whitespace-nowrap">active</code> contract terms.</p>

json
{
  "contract_term": null
}

Need more? See the Chargebee guide for connection setup and behaviour shared by every action.

Import Contract Term — Chargebee — Documentation