A Chargebee subscription connects a customer record to products/services. It describes what the customer has signed up for and how often they're charged for it. The essential components of a subscription are:
- A plan-item price.
- Any addon- and charge-item prices applied to the subscription.
- Any coupons applied.
- Any discounts applied.
The charges in a subscription are billed via invoices.
Sample SubscriptionJSON
Subscriptions attributes
The unique identifier of the subscription
resource. You have the option to specify this value when creating a customer. If not specified, Chargebee automatically generates a unique identifier.
Note
In the event that the subscription resource is transferred along with its associated customer resource to a different business entity, Chargebee assigns a new random value as the id for the subscription. The original identifier is preserved for the transferred copy of the subscription resource. (See also: Mechanics of business entity transfer.)
Applicable only for 'future' subscriptions. The scheduled start time of the subscription.
End of the trial period for the subscription. Presence of this value for 'future' subscription implies the subscription will go into 'in_trial' state when it starts.
- When the subscription is not on a contract term: this value is the number of billing cycles remaining after the current cycle, at the end of which, the subscription cancels.
- When the subscription is on a contract term: this value is the number of billing cycles remaining in the contract term after the current billing cycle.
The decimal representation of the quantity of the addon. Returned for quantity-based plans when multi-decimal pricing is enabled.
The decimal representation of the price or per-unit price of the plan. The value is in major units of the currency. Always returned when multi-decimal pricing is enabled.
Identifier of the customer with whom this subscription is associated.
Current state of the subscription
The subscription is scheduled to start at a future date.
The subscription is in trial.
The subscription is active and will be charged for automatically based on the items in it.
The subscription will be canceled at the end of the current term.
The subscription is paused. The subscription will not renew while in this state.
The subscription has been canceled and is no longer in service.
The transferred
status will be reflected on the source business entity's subscription attribute once the customer transfer
activity is completed successfully.
Start of the trial period for the subscription. Presence of this value for future
subscription implies the subscription will go into in_trial
state when it starts.
Applicable only when End-of-trial Action has been enabled for the site. Whenever the subscription has a trial period, this attribute (parameter) is returned (required) and specifies the operation to be carried out for the subscription once the trial ends.
This is the default value. The action configured for the site at the time when the trial ends, takes effect.
The action configured for the site at the time when the trial ends, takes effect.
The subscription activates and charges are raised for non-metered items.
The subscription cancels.
Start of the current billing period of the subscription.
End of the current billing period of the subscription. Subscription is renewed immediately after this.
The date/time at which the next billing for the subscription happens. This is usually right after current_term_end
unless multiple subscription terms were invoiced in advance using the terms_to_charge
parameter.
Time at which the subscription was started. Is null
for future
subscriptions as it is yet to be started.
Time at which the subscription status
last changed to
active.
For example, this value is updated when an in_trial
or
cancelled
subscription activates.
Number of billing cycles the new contract term should run for, on contract renewal. The default value is the same as billing_cycles
or a custom value depending on the site configuration
.
If true
, ignores the hierarchy relationship
and uses customer as payment and invoice owner.
When a pause has been scheduled, it is the date/time of scheduled pause. When the subscription is in the paused
state, it is the date/time when the subscription was paused.
For a paused subscription, it is the date/time when the subscription is scheduled to resume. If the pause is for an indefinite period, this value is not returned.
Time at which subscription was cancelled or is set to be cancelled.
The reason for canceling the subscription. Set by Chargebee automatically.
Not Paid
No Card
Fraud Review Failed
Non Compliant EU Customer
Tax Calculation Failed
Currency incompatible with Gateway
Non Compliant Customer
The IP address of the user. Used primarly in Refersion integration. Refersion uses this field to track/log affiliate subscription.
Version number of this resource. The resource_version
is updated with a new timestamp in milliseconds for every change made to the resource. This attribute will be present only if the resource has been updated after 2016-09-28.
The subscription has an advance invoicing schedule .
Indicates whether there are subscription changes scheduled for the next renewal.
Note
This attribute does not consider changes scheduled through upcoming ramps on the subscription. If changes on the subscription are scheduled only via ramps and not through the Update Subscription API, the value of this attribute remains false.
Payment source attached to this subscription. If present, customer's payment sources won't be used to collect any payment for this subscripiton.
The free_quantity_in_decimal as set for the plan. Returned for quantity-based plans when multi-decimal pricing is enabled.
The decimal representation of the total amount for the item, in major units of the currency. Always returned when multi-decimal pricing is enabled.
This is the date/time at which the most recent cancellation schedule for the subscription was created in Chargebee. Applicable only for cancelled
subscriptions or subscriptions that are scheduled for cancellation.
The subscription channel this object originated from and is maintained in.
The object was created (and is maintained) for the web channel directly in Chargebee via API or UI.
The object data is synchronized with data from in-app subscription(s) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.
The object data is synchronized with data from in-app subscription(s) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
The Net D value explicitly set for this subscription. Net D is the number of days within which any invoice raised for the subscription must be paid. When an invoice is raised, and this value is unavailable, the net_term_days defined at the customer level is considered.
Note: Present only when the subscription has been transferred between business entities.
Represents the id of the active version of the subscription resource.
Tip
If the id and active_id of a subscription resource are the same, this indicates that you are working with the active version of that subscription resource.
Total number of invoices that are due for payment against the subscription.
Note:
Not supported if consolidated invoicing
is enabled, or when the subscription is for the customer who is in hierarchy
, and the parent of this customer owns and pays for the invoices of the subscription. It is also worth noting that the consolidated invoice amount is not included in the calculation of due_invoices_count
.
Time since this subscription has unpaid invoices. Note: Not supported if consolidated invoicing is enabled, or when the subscription is for the customer who is in hierarchy , and the parent of this customer owns and pays for the invoices of the subscription.
Total invoice due amount for this subscription. The value depends on the type of currency
.
Note:
Not supported if consolidated invoicing
is enabled, or when the subscription is for the customer who is in hierarchy
, and the parent of this customer owns and pays for the invoices of the subscription. It is also worth noting that the consolidated invoice amount is not included in the calculation of total_dues
.
Monthly recurring revenue for the subscription. Updated asynchronously, this value catches up with changes to the subscription in less than a minute. The value depends on the type of currency . Note: This may not return accurate values since updated asynchronously.
Exchange rate used for base currency conversion.This value is updated to the rate configured on your site each time any change is made to the subscription.
The currency code (ISO 4217 format ) of the site's base currency.
A customer-facing note added to all invoices associated with this subscription. This note is one among all the notes displayed on the invoice PDF.
A collection of key-value pairs that provides extra information about the subscription.
Note: There's a character limit of 65,535.
Indicates that the subscription has been deleted when the value is true.
You can retrieve a deleted subscription using the list operation
.
If a subscription change has been scheduled, this is the date/time when the change is set to take effect. Note: As a limitation, this attribute is not returned when the change is scheduled to happen at the end of the current term.
Reason code for canceling the subscription. Must be one from a list of reason codes set in the Chargebee app in Settings > Configure Chargebee > Reason Codes > Subscriptions > Subscription Cancellation. Must be passed if set as mandatory in the app. The codes are case-sensitive
The period of time by which the first term of the subscription is to be extended free-of-charge. The value must be in multiples of free_period_unit."
Defines additional free period in association with the billing period.
Charge based on day(s)
Charge based on week(s)
Charge based on month(s)
Charge based on year(s)
Indicates whether the invoices for this subscription are generated with a pending status. This attribute is set to true automatically when the subscription has item prices that belong to metered items.
You can also set this to true explicitly using the create/update subscription operations. This is useful in the following scenarios:
- When tracking usages and calculating usage-based charges on your end. You can then add them to the subscription as a one-time charge at the end of the billing term.
- When you need to inspect all charges before closing invoices for this subscription. Applicable only when Metered Billing is enabled for the site
Set to false
to override for this subscription, the site-level setting
for auto-closing invoices. Only applicable when auto-closing invoices has been enabled for the site. This attribute has a higher precedence than the same attribute at the customer level
.
The unique ID of the business entity of this subscription. This is always the same as the business entity of the customer.
Indicates whether the subscription should be decommissioned when it is canceled. If set to true all subscription operations will be disabled except deletion.
Note: Decommission operation is irreversible. Once set to true it cannot be updated to false and thus subscription will remain decommissioned permanently.
Details of individual item prices that are part of this subscription.
The pricing details of subscription_items
which have pricing_model
as
tiered
, volume
or stairstep
.
List of event based charge items that have already been charged.
Specify limits on how credits and excesspayments are applied to individual invoices for the subscription.
Prerequisite
- Credit flexibility must be enabled for the site.
Constraints
- These limits do not apply to consolidated invoices.
List of discounts currently attached to the subscription.
Note
- Discounts of
duration_typeone_timeare removed from the list after a single application to the subscription. - Discounts of
duration_typelimited_periodare removed from the list once the specifiedperiodexpires since their attachment to the subscription.