Movatterモバイル変換


[0]ホーム

URL:


ChargebeeAPI
Join the Chargebee Developers Discord — Connect, ask questions, and build faster.Join

Contract terms

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.

Thecontract term resource described below defines the properties of this lock-in period. This includes thenumber of billing cycles, thetotal contract value, theaction to be taken at the end of the contract term, and so on. To allow for exceptions, you also have the option of terminating anactive contract term and charging atermination fee.

A contract term starts in theactive state and ends in thecompleted state. If the contract was canceled due to non-payment or other reasons, it can end in thecanceled orterminated state. A given contract term is always associated with one, and only one subscription. A subscription, however, can be associated with only oneactive contract term. Over time, a subscription can be associated with several non-active contract terms. Theactive contract term for a subscription is available as anobject within the subscription.

To enable and configure contract terms, follow these steps in the Chargebee UI:

  1. ClickSettings on the left navigation.
  2. ClickConfigure Chargebee.
  3. UnderBilling, clickContract Terms.
  4. Enable and configure the feature as needed.

Once contract terms have been configured, the following actions can be performed using the API:

Including a termination fee

When a contract is canceled mid-term, you can set a termination fee to be levied. Here's how:

  1. Create an item price for an item oftypecharge withprice set to the termination fee.
  2. Do one of the following:

Once the above steps are done, the termination fee will be charged automatically if youterminate the contract in the middle of its term.

Sample Contract termJSON

API Index URL

https://[site].chargebee.com/api/v2/contract_terms

Contract terms attributes

id
required, string, max chars=50

Id that uniquely identifies the contract term in the site.

status
required, enumerated string

Current status of contract

Possible Enum Values
active

An actively running contract term.

completed

The contract term has run its full duration.

cancelled

The contract term was ended because: - a change in the subscription caused asubscription term reset.

  • the subscription was cancelled due to non-payment.
terminated

The contract term was terminated ahead of completion.

contract_start
required, timestamp(UTC) in seconds

The start date of the contract term

contract_end
required, timestamp(UTC) in seconds

The end date of the contract term

billing_cycle
required, integer, min=0

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

action_at_term_end
required, enumerated string, default=renew

Action to be taken when the contract term completes.

Possible Enum Values
renew
  • Contract term completes and a new contract term is started for the number of billing cycles specified incontract_billing_cycle_on_renewal.
  • Theaction_at_term_end for the new contract term is set torenew.
evergreen

Contract term completes and the subscription renews.

cancel

Contract term completes and subscription is canceled.

renew_once

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 incontract_billing_cycle_on_renewal.

  • Theaction_at_term_end for the new contract term is set tocancel.
total_contract_value
required, in cents, default=0, min=0

The sum of thetotalsof all the invoices raised as part of the contract term. Foractivecontract terms, this is a predicted value. The value depends on thetype of currency.If the subscription wasimportedwith the contract term, then this value includes the value passed fortotal_amount_raised.

total_contract_value_before_tax
required, 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 fortotal_amount_raised_before_taxis 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 beforecontract_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.

created_at
required, timestamp(UTC) in seconds

The date when the contract term was created.

subscription_id
required, string, max chars=50

TheIdof the subscription that this contract term is for.

remaining_billing_cycles
optional, integer, min=0

The number of subscription billing cycles remaining after the current one for the contract term. This attribute is only returned foractivecontract terms.


[8]ページ先頭

©2009-2026 Movatter.jp