Menu
List Contract Terms For A Subscription
List contract terms for a subscription
/subscriptions/{subscription-id}/contract_termsUse it in a workflow
- Add a step and choose the Chargebee connector.
- Pick the List Contract Terms For A Subscription action (under Chargebee API).
- Fill in the fields below, then reference the result from later steps as
{{listContractTermsForASubscription.response.data}}.
Request
Path parameters
subscription-idstringrequiredQuery parameters
limitinteger (int32)The number of resources to be returned.
Default 10
offsetstring<p class="mb-2">Determines your position in the list for pagination. To ensure that the next page is retrieved correctly, always set <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">offset</code> 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">next_offset</code> obtained in the previous iteration of the API call.</p>
sort_byobjectoptional, string filter Sorts based on the specified attribute. **Supported attributes :** created_at **Supported sort-orders :** asc, desc **Example →** *sort_by\[asc\] = "created_at"* This will sort the result based on the 'created_at' attribute in ascending (earliest first) order.
ascstringOne ofcreated_at
descstringOne ofcreated_at
Headers
chargebee-request-origin-devicestringThe 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-ipstringThe IP address of the customer where the request originated
chargebee-business-entity-idstringIf 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.
Response
Returns 200 with an object. Read it in later steps with {{listContractTermsForASubscription.response.data.<field>}}.
listarray<object>contract_termobjectrequired12 fields<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 "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.</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'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>
next_offsetstring<p class="mb-2">This attribute is returned only if more resources are present. To fetch the next set of resources use this value for the input parameter <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">offset</code>.</p>
{
"list": null,
"next_offset": null
}
Need more? See the Chargebee guide for connection setup and behaviour shared by every action.