# Subscriptions

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


Subscription represents the recurring items a customer has subscribed to. The recurring items can be - plan, addons. It may also contain the discount items like coupons.

Subscriptions are invoiced at the start of every term based on the recurring items and charged immediately against the customer's credit card if 'auto\_collection' is turned 'on', otherwise the resulting invoice will be created as 'Payment Due'.

**Note:** The maximum number of subscriptions for any given [customer](/docs/api/customers) (`[active](/docs/api/subscriptions/subscription-object#status)` or not) is 900.

Tax provider fields

**Avalara**: Merchants using **Avalara Sales Tax** can optionally associate each item price with a locationCode (from their Avalara company locations), so tax can be resolved correctly at the line item level.

Field ID

Field Value

APIs

`locationCode`

Merchant to configure it on Avalara Platform under company locations

APIs having [Item Prices](/docs/api/item_prices/item-price-object) attributes.

**Anrok**: Canadian customers can have multiple tax registration numbers. We currently support only sharing one tax registration number with Anrok. So we added a new field which can have comma separated multiple tax reg numbers for Anrok. Values configured in the field is passed as it is to Anrok for accurate tax calculation

Field ID

Field Value

APIs

`additionalTaxRegistrationNumber`

Canadian tax registration numbers in comma separated fashion.

APIs involving customer attributes. Also includes APIs where we are creating new customers. Eg: estimate, subscription, hosted pages.

**Vertex**: Chargebee shares field IDs and corresponding values with merchants, who then configure them on the Vertex Platform for seamless integration

**Note:** Field Id like `customerCode` , `customerClass` , and`taxExempted` belong to the customer object.

Field Id like `productCode` , `productClass` , `productTaxCode` , and `productClass` belong to the product object.

Field ID

Field Value

APIs

`productCode`

Merchant to configure it on Vertex Platform

APIs having [Plan](/docs/api/v2/pcv-1/plans/plan-object)(PC1), [Addons](/docs/api/v2/pcv-1/addons/addon-object)(PC1) and [Item Prices](/docs/api/item_prices/item-price-object)(PC2) attributes.

`productClass`

`customerCode`

APIs involving [customer](/docs/api/customers/customer-object) attributes. Also includes APIs where we are creating new customers. For example: [estimate](/docs/api/estimates/estimate-for-creating-a-customer-and-subscription), [subscription](/docs/api/subscriptions), [hosted pages](/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges).

`customerClass`

**Taxamo:** Chargebee shares field IDs and corresponding values with merchants, who then configure them on the Taxamo Platform for seamless integration

Field Id

Field Value

APIs

`productTaxCode`

Merchant to configure it on Taxamo Platform

APIs having [Plan](/docs/api/v2/pcv-1/plans/plan-object)(PC1), [Addons](/docs/api/v2/pcv-1/addons/addon-object)(PC1) and Item Prices (PC2) attributes.

`productClass`

`taxExempted`

APIs involving [customer](/docs/api/customers/customer-object) attributes. Also includes APIs where we are creating new customers. For example: [estimate](/docs/api/estimates/estimate-for-creating-a-customer-and-subscription), [subscription](/docs/api/subscriptions), [hosted pages](/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges).

**cbtaxes**: With CBTaxes, you can activate India IGST for customers located in Special Economic Zones (SEZ), implement zero-rated tax for SEZ customers, enable India IGST for customers outside of India, and set up zero-rated tax for customers outside of India.

Field ID

Field Value

APIs

`indiaSez`

`SEZ_IGST_TAX`

APIs involving [customer](/docs/api/customers/customer-object) attributes. Also includes APIs where we are creating new customers. For example: [estimate](/docs/api/estimates/estimate-for-creating-a-customer-and-subscription), [subscription](/docs/api/subscriptions), [hosted pages](/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges).

`SEZ_ZERO_RATED_TAX`

`indiaExport`

`EXPORT_IGST_TAX`

`EXPORT_ZERO_RATED_TAX`

**All**: For tax inclusive tax calculation, For tax exclusive tax calculation. This is currently used for price type overriding at customer level

Field ID

Field Value

APIs

`priceType`

`TAX_INCLUSIVE`

APIs involving [customer](/docs/api/customers/customer-object) attributes. Also includes APIs where we are creating new customers. For example: [estimate](/docs/api/estimates/estimate-for-creating-a-customer-and-subscription), [subscription](/docs/api/subscriptions), [hosted pages](/docs/api/hosted_pages/checkout-charge-items-and-one-time-charges).

`TAX_EXCLUSIVE`

`SITE_DEFAULT`

Removes price type override, and allows site level configuration to be used for tax calculation.

**Note:** Make sure you choose the correct **Field ID** and **Available APIs** combination from the table above. All Product Catalog APIs include [Plans](/docs/api/v2/pcv-1/plans) , [Addons](/docs/api/v2/pcv-1/addons) , [Coupons](/docs/api/v2/pcv-1/coupons) , [Coupon Sets](/docs/api/v2/pcv-1/coupon_sets) , [Coupon Codes](/docs/api/v2/pcv-1/coupon_codes) .

## Sample Subscription

```json
{
  "activated_at": 1517505643,
  "auto_collection": "off",
  "billing_period": 1,
  "billing_period_unit": "month",
  "created_at": 1517505643,
  "currency_code": "USD",
  "current_term_end": 1519924843,
  "current_term_start": 1517505643,
  "customer_id": "__test__KyVnHhSBWkkwI2Tn",
  "deleted": false,
  "due_invoices_count": 1,
  "due_since": 1517505643,
  "has_scheduled_changes": false,
  "id": "__test__KyVnHhSBWkkwI2Tn",
  "mrr": 0,
  "next_billing_at": 1519924843,
  "object": "subscription",
  "plan_amount": 895,
  "plan_free_quantity": 0,
  "plan_id": "no_trial",
  "plan_quantity": 1,
  "plan_unit_price": 895,
  "resource_version": 1517505643000,
  "started_at": 1517505643,
  "status": "active",
  "total_dues": 895,
  "updated_at": 1517505643
}
```

## Subscriptions attributes

## Input Parameters

- `id` (required, string, max chars=50)
  A unique and immutable identifier for the subscription. If not provided, it is autogenerated.

- `currency_code` (required, string, max chars=3)
  The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html) ) of the subscription

- `plan_id` (required, string, max chars=100)
  Identifier of the plan for this subscription

- `plan_quantity` (required, integer, default=1, min=1)
  Represents the plan quantity for this subscription.

- `plan_unit_price` (optional, in cents, min=0)
  Amount that will override the Plan's default price. The unit depends on the [type of currency](/docs/api/getting-started) .

- `setup_fee` (optional, in cents, min=0)
  Amount that will override the default setup fee. The unit depends on the [type of currency](/docs/api/getting-started) .

- `billing_period` (optional, integer, min=1)
  Defines billing frequency. Example: to bill customer every 3 months, provide "3" here.

- `billing_period_unit` (optional, enumerated string)
  Defines billing frequency in association with the billing period.
  Possible enum values:
    - `day`
      Charge based on day(s)
    - `week`
      Charge based on week(s)
    - `month`
      Charge based on month(s)
    - `year`
      Charge based on year(s)

- `start_date` (optional, timestamp(UTC) in seconds)
  Applicable only for 'future' subscriptions. The scheduled start time of the subscription.

- `trial_end` (optional, timestamp(UTC) in seconds)
  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.

- `remaining_billing_cycles` (optional, integer, min=0)
  -   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](/docs/api/contract_terms): this value is the number of billing cycles remaining in the contract term after the current billing cycle.

- `po_number` (optional, string, max chars=100)
  Purchase order number for this subscription.

- `auto_collection` (optional, enumerated string)
  Defines whether payments need to be collected automatically for this subscription. Overrides customer's auto-collection property.
  Possible enum values:
    - `on`
      Whenever an invoice is created for this subscription, an automatic charge will be attempted on the payment method available.
    - `off`
      Automatic collection of charges will not be made for this subscription. Use this for offline payments.

- `plan_quantity_in_decimal` (optional, string, max chars=33)
  The decimal representation of the quantity of the plan purchased. Returned for quantity-based plans when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.

- `plan_unit_price_in_decimal` (optional, string, max chars=39)
  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](/docs/api/v2/pcv-1/currencies) is enabled.

- `customer_id` (required, string, max chars=50)
  Identifier of the customer with whom this subscription is associated.

- `plan_amount` (optional, in cents, min=0)
  The total amount for the plan.

- `plan_free_quantity` (optional, integer, min=0)
  The units of the item that will be free with this Plan.

- `status` (required, enumerated string)
  Current state of the subscription
  Possible enum values:
    - `future`
      The subscription is scheduled to start at a future date.
    - `in_trial`
      The subscription is in trial.
    - `active`
      The subscription is active and will be charged for automatically based on the items in it.
    - `non_renewing`
      The subscription will be canceled at the end of the current term.
    - `paused`
      The subscription is [paused](https://www.chargebee.com/docs/2.0/pause-subscription.html). The subscription will not renew while in this state.
    - `cancelled`
      The subscription has been canceled and is no longer in service.
    - `transferred`
      The `transferred` status will be reflected on the source business entity's subscription attribute once the [customer transfer](https://www.chargebee.com/docs/2.0/mbe-getting-started-with-customer-transfer.html) activity is completed successfully. This status is only valid for [product catalog 2.0](https://www.chargebee.com/docs/2.0/product-catalog.html) as the Multiple Business Entity features can only be enabled for product catalog 2.0.

- `trial_start` (optional, timestamp(UTC) in seconds)
  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.

- `trial_end_action` (optional, enumerated string)
  Applicable only when [End-of-trial Action](https://www.chargebee.com/docs/1.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) 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.
  Possible enum values:
    - `site_default`
      This is the default value. The action [configured for the site](https://www.chargebee.com/docs/1.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect.
    - `plan_default`
      The action [configured for the site](https://www.chargebee.com/docs/1.0/trial_periods_hidden.html#how-to-define-the-end-of-trial-actions-for-subscriptions) at the time when the trial ends, takes effect.
    - `activate_subscription`
      The subscription activates and charges are raised for non-metered items.
    - `cancel_subscription`
      The subscription cancels.

- `current_term_start` (optional, timestamp(UTC) in seconds)
  Start of the current billing period of the subscription.

- `current_term_end` (optional, timestamp(UTC) in seconds)
  End of the current billing period of the subscription. Subscription is renewed immediately after this

- `next_billing_at` (optional, timestamp(UTC) in seconds)
  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.

- `created_at` (optional, timestamp(UTC) in seconds)
  The time at which the subscription was created.

- `started_at` (optional, timestamp(UTC) in seconds)
  Time at which the subscription was started. Is `null` for `future` subscriptions as it is yet to be started.

- `activated_at` (optional, timestamp(UTC) in seconds)
  Time at which the subscription `status` last changed to `active`. For example, this value is updated when an `in_trial` or `cancelled` subscription activates.

- `gift_id` (optional, string, max chars=150)
  References the gift if it is a gifted subscription.

- `contract_term_billing_cycle_on_renewal` (optional, integer, min=1, max=100)
  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](https://www.chargebee.com/docs/contract-terms.html#configuring-contract-terms) .

- `override_relationship` (optional, boolean)
  If `true` , ignores the [hierarchy relationship](/docs/api/customers/customer-object#relationship) and uses customer as payment and invoice owner.

- `pause_date` (optional, timestamp(UTC) in seconds)
  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.

- `resume_date` (optional, timestamp(UTC) in seconds)
  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.

- `cancelled_at` (optional, timestamp(UTC) in seconds)
  Time at which subscription was cancelled or is set to be cancelled.

- `cancel_reason` (optional, enumerated string)
  The reason for canceling the subscription. Set by Chargebee automatically.
  Possible enum values:
    - `not_paid`
      Not Paid
    - `no_card`
      No Card
    - `fraud_review_failed`
      Fraud Review Failed
    - `non_compliant_eu_customer`
      Non Compliant EU Customer
    - `tax_calculation_failed`
      Tax Calculation Failed
    - `currency_incompatible_with_gateway`
      Currency incompatible with Gateway
    - `non_compliant_customer`
      Non Compliant Customer

- `affiliate_token` (optional, string, max chars=250)
  A unique tracking token

- `created_from_ip` (optional, string, max chars=50)
  The IP address of the user. Used primarly in Refersion integration. Refersion uses this field to track/log affiliate subscription.

- `resource_version` (optional, long)
  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.

- `updated_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when the item was last updated.

- `has_scheduled_advance_invoices` (required, boolean, default=false)
  The subscription has an [advance invoicing schedule](/docs/api/advance_invoice_schedules) .

- `has_scheduled_changes` (required, boolean, default=false)
  If `true` , there are subscription changes scheduled on next renewal.

- `payment_source_id` (optional, string, max chars=40)
  Payment source attached to this subscription. If present, customer's payment sources won't be used to collect any payment for this subscripiton.

- `plan_free_quantity_in_decimal` (optional, string, max chars=33)
  The free\_quantity\_in\_decimal as set for the plan. Returned for quantity-based plans when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.

- `plan_amount_in_decimal` (optional, string, max chars=39)
  The decimal representation of the total amount for the plan, in major units of the currency. Always returned when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.

- `cancel_schedule_created_at` (optional, timestamp(UTC) in seconds)
  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.

- `offline_payment_method` (optional, enumerated string)
  The preferred offline payment method for the subscription.
  Possible enum values:
    - `no_preference`
      No Preference
    - `cash`
      Cash
    - `check`
      Check
    - `bank_transfer`
      Bank Transfer
    - `ach_credit`
      ACH Credit
    - `sepa_credit`
      SEPA Credit
    - `boleto`
      Boleto
    - `us_automated_bank_transfer`
      US Automated Bank Transfer
    - `eu_automated_bank_transfer`
      EU Automated Bank Transfer
    - `uk_automated_bank_transfer`
      UK Automated Bank Transfer
    - `jp_automated_bank_transfer`
      JP Automated Bank Transfer
    - `mx_automated_bank_transfer`
      MX Automated Bank Transfer
    - `custom`
      Custom

- `channel` (optional, enumerated string)
  The subscription channel this object originated from and is maintained in.
  Possible enum values:
    - `web`
      The object was created (and is maintained) for the web channel directly in Chargebee via API or UI.
    - `app_store`
      The object data is synchronized with data from [in-app subscription(s)](/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed.
    - `play_store`
      The object data is synchronized with data from [in-app subscription(s)](/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed.
      
      In-App Subscriptions is currently in early access. Contact [eap@chargebee.com](mailto:eap@chargebee.com) for more information.

- `active_id` (optional, string, max chars=50)
  This attribute is only valid for [product catalog 2.0](https://www.chargebee.com/docs/2.0/product-catalog.html) as the Multiple Business Entity features can only be enabled for product catalog 2.0.

- `due_invoices_count` (optional, integer)
  Total number of invoices that are due for payment against the subscription. **Note:** Not supported if [consolidated invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html) is enabled, or when the subscription is for the customer who is in [hierarchy](/docs/api/hierarchies) , 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` .

- `due_since` (optional, timestamp(UTC) in seconds)
  Time since this subscription has unpaid invoices. **Note:** Not supported if [consolidated invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html) is enabled, or when the subscription is for the customer who is in [hierarchy](/docs/api/hierarchies) , and the parent of this customer owns and pays for the invoices of the subscription.

- `total_dues` (optional, in cents, min=0)
  Total invoice due amount for this subscription. The value depends on the [type of currency](/docs/api/v2/pcv-1/subscriptions) . **Note:** Not supported if [consolidated invoicing](https://www.chargebee.com/docs/consolidated-invoicing.html) is enabled, or when the subscription is for the customer who is in [hierarchy](/docs/api/hierarchies) , 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` .

- `mrr` (optional, in cents, min=1)
  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](/docs/api/currencies) . **Note:** This may not return accurate values since updated asynchronously.

- `exchange_rate` (optional, bigdecimal, min=1E-9, max=999999999.999999999)
  Exchange rate used for base currency conversion.This value is updated to the [rate configured](https://www.chargebee.com/docs/multi-currency-pricing.html#configuring-multicurrency) on your site each time any change is made to the subscription.

- `base_currency_code` (optional, string, max chars=3)
  The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html) ) of the site's base currency.

- `invoice_notes` (optional, string, max chars=2000)
  A customer-facing note added to all invoices associated with this subscription. This note is one among [all the notes](/docs/api/invoices/invoice-object#notes) displayed on the invoice PDF.

- `meta_data` (optional, jsonobject)
  A collection of key-value pairs that provides extra information about the subscription.
  
  **Note:** There's a character limit of 65,535.
  
  [Learn more](/docs/api/v2/pcv-1/advanced-features) .

- `deleted` (required, boolean)
  Indicates that the subscription has been deleted when the value is `true`. You can retrieve a deleted subscription using the [list operation](/docs/api/subscriptions/list-subscriptions) .

- `changes_scheduled_at` (optional, timestamp(UTC) in seconds)
  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.

- `cancel_reason_code` (optional, string, max chars=100)
  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

- `free_period` (optional, integer)
  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."

- `free_period_unit` (optional, enumerated string)
  Defines additional free period in association with the billing period.
  Possible enum values:
    - `day`
      Charge based on day(s)
    - `week`
      Charge based on week(s)
    - `month`
      Charge based on month(s)
    - `year`
      Charge based on year(s)

- `create_pending_invoices` (optional, boolean)
  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](/docs/api/subscriptions/create-subscription-for-items#create_pending_invoices)/[update](/docs/api/subscriptions/update-subscription-for-items#create_pending_invoices) 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](https://www.chargebee.com/docs/charges.html) 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](https://www.chargebee.com/docs/metered_billing.html) is enabled for the site

- `auto_close_invoices` (optional, boolean)
  Set to `false` to override for this subscription, the [site-level setting](https://www.chargebee.com/docs/billing/2.0/usage-based-billing/metered_billing#configuring-metered-billing) 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](/docs/api/customers/customer-object#auto_close_invoices) .

- `business_entity_id` (optional, string, max chars=50)
  The ID of the business entity created for the site. For Product Catalog 1.0, all the site data is tied to this business entity.
  
  **Note**
  
  [Multiple Business Entities](/docs/api/getting-started) is a feature available only on Product Catalog 2.0.

- `decommissioned` (required, boolean, default=false)
  Specifies whether a cancelled subscription is decommissioned or not

- `addons` (optional, list of addon)
  List of addons for this subscription with quantity(if applicable)
  - `id` (required, string, max chars=100)
    Identifier of the addon. Multiple addons can be passed.
  - `quantity` (optional, integer, default=1, min=1)
    Quantity of the addon. Applicable for addons with `pricing_model` other than `flat_fee` .
  - `unit_price` (optional, in cents, min=0)
    The price or per-unit-price of the addon. The value depends on the [type of currency](/docs/api/v2/pcv-1/currencies).
    
    **Note:**
    
    For recurring addons, this is the final price or per-unit price for each billing period of the subscription, regardless of the [addon period](/docs/api/v2/pcv-1/addons/addon-object#period). For example, consider the following details:
    
    -   The `unit_price` provided is $10
    -   The addon billing period is 1 month.
    -   The plan billing period is 3 months.
    -   The addon is only billed for $10 on each subscription renewal.
  - `amount` (optional, in cents, min=0)
    The total amount for the addon. The format of the value [depends upon the currency](/docs/api/currencies) .
  - `trial_end` (optional, timestamp(UTC) in seconds)
    The time at which the trial ends for the addon. This value can only be set for subscriptions that start with an `active` or `non-renewing` status. Once set, the value can't be changed. (Addon trial periods must be enabled by [Chargebee Support](https://www.chargebee.com/docs/billing/2.0/kb/getting-started/how-to-contact-chargebees-support-team?utm_source=docs_api&utm_medium=content&utm_campaign=support) )
  - `remaining_billing_cycles` (optional, integer, min=0)
    The number of billing cycles this addon will be attached to subscription.
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the addon. Returned for quantity-based plans when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `unit_price_in_decimal` (optional, string, max chars=39)
    The decimal representation of the price or per-unit price of the addon. The value is in major units of the currency. Always returned when multi-decimal pricing is enabled.
    
    **Note:**
    
    For recurring addons, this is the final price or per-unit price for each billing period of the subscription, regardless of the addon period. For example, consider the following details:
    
    -   The `unit_price_in_decimal` provided is $10.75
    -   The addon billing period is 1 month.
    -   The plan billing period is 3 months.
    -   The addon is only billed for $10.75 on each subscription renewal.
  - `amount_in_decimal` (optional, string, max chars=39)
    The decimal representation of the total amount for the addon, in major units of the currency. Always returned when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `proration_type` (optional, enumerated string)
    Specifies how to manage charges or credits for the addon during a subscription update.
    
    You can't modify this parameter's value within the current term. Moreover, it is removed from the subscription attributes when the next term starts.
    
    **See also:** `addons[proration_type]` parameter for [Update a subscription API](/docs/api/v2/pcv-1/subscriptions/update-a-subscription) .
    Possible enum values:
      - `full_term`
        Charge the full price of the addon or give the full credit. Don't apply any proration.
      - `partial_term`
        Prorate the charges or credits from the time of the change till the end of the current term.
      - `none`
        Don't apply any charges or credits for the addon.

- `event_based_addons` (optional, list of event_based_addon)
  List of non-recurring addons that will be charged on the occurrence of specified event.
  - `id` (required, string, max chars=100)
    A unique 'id' used to identify the addon.
  - `quantity` (required, integer, min=1)
    Quantity of the addon. Applicable for addons with `pricing_model` other than `flat_fee` .
  - `unit_price` (required, in cents, min=0)
    Amount that will override the Addon's default price. The unit depends on the [type of currency](/docs/api/getting-started) .
  - `on_event` (required, enumerated string)
    Event on which this addon will be charged.
    Possible enum values:
      - `subscription_creation`
        Addon will be charged on subscription creation.
      - `subscription_trial_start`
        Addon will be charged when the trial period starts.
      - `plan_activation`
        Addon will be charged on plan activation.
      - `subscription_activation`
        Addon will be charged on subscription activation.
      - `contract_termination`
        Addon will be charged on contract termination.
  - `charge_once` (required, boolean, default=true)
    If enabled, the addon will be charged only at the first occurrence of the event. Applicable only for non-recurring add-ons.
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the addon. Returned for quantity-based addons when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.
  - `unit_price_in_decimal` (optional, string, max chars=39)
    The decimal representation of the price or per-unit price of the addon. The value is in major units of the currency. Always returned when [multi-decimal pricing](/docs/api/v2/pcv-1/currencies) is enabled.

- `charged_event_based_addons` (optional, list of charged_event_based_addon)
  List of event\_based\_addons that have already been charged.
  - `id` (required, string, max chars=100)
    Addon id.
  - `last_charged_at` (required, timestamp(UTC) in seconds)
    Timestamp indicating when this add-on was last charged for this subscription.

- `coupons` (optional, list of coupon)
  List of coupons for this subscription
  - `coupon_id` (required, string, max chars=100)
    Used to uniquely identify the coupon
  - `apply_till` (optional, timestamp(UTC) in seconds)
    The date till when the coupon can be applied. Applicable for `limited_period` [coupons](/docs/api/coupons) only.
  - `applied_count` (required, integer, default=0)
    Number of times this coupon has been applied for this subscription
  - `coupon_code` (optional, string, max chars=50)
    The coupon code used to redeem the coupon. Will be present only when associated code for a coupon is used.

- `shipping_address` (optional, shipping_address)
  Shipping address for the subscription.
  - `first_name` (optional, string, max chars=150)
    The first name of the contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the contact.
  - `email` (optional, string, max chars=70)
    The email address.
  - `company` (optional, string, max chars=250)
    The company name.
  - `phone` (optional, string, max chars=50)
    The phone number.
  - `line1` (optional, string, max chars=150)
    Address line 1
  - `line2` (optional, string, max chars=150)
    Address line 2
  - `line3` (optional, string, max chars=150)
    Address line 3
  - `city` (optional, string, max chars=50)
    The name of the city.
  - `state_code` (optional, string, max chars=50)
    The [ISO 3166-2 state/province code](https://www.iso.org/obp/ui/#search) without the country prefix. Currently supported for USA, Canada, India and UAE. For instance, for Arizona (USA), set `state_code` as `AZ` (not `US-AZ` ). For Tamil Nadu (India), set as `TN` (not `IN-TN` ). For British Columbia (Canada), set as `BC` (not `CA-BC` ). For Dubai (UAE), set as `DU` (not `AE-DU` ).
  - `state` (optional, string, max chars=50)
    The state/province name.
  - `country` (optional, string, max chars=50)
    The billing address country of the customer. Must be one of [ISO 3166 alpha-2 country code](https://www.iso.org/iso-3166-country-codes.html) .
    
    **Note**: If you enter an invalid country code, the system will return an error.
    
    **Brexit**
    
    If you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or later, or have [manually enable](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, then `XI` (the code for **United Kingdom - Northern Ireland**) is available as an option.
  - `zip` (optional, string, max chars=20)
    Zip or postal code. The number of characters is validated according to the rules [specified here](https://chromium-i18n.appspot.com/ssl-address) .
  - `validation_status` (optional, enumerated string, default=not_validated)
    The address verification status.
    Possible enum values:
      - `not_validated`
        Address is not yet validated.
      - `valid`
        Address was validated successfully.
      - `partially_valid`
        The address is valid for taxability but has not been validated for shipping.
      - `invalid`
        Address is invalid.

- `referral_info` (optional, referral_info)
  Referral details if exists for the subscription
  - `referral_code` (optional, string, max chars=50)
    Referral code if available for the subscription
  - `coupon_code` (optional, string, max chars=50)
    Referral coupon code if available for the subscription
  - `referrer_id` (optional, string, max chars=19)
    Referrer id if available for the subscription
  - `external_reference_id` (optional, string, max chars=50)
    External reference id in referral system for the subscription
  - `reward_status` (optional, enumerated string, default=pending)
    Reward status for the referral subscription
    Possible enum values:
      - `pending`
        Pending
      - `paid`
        Paid
      - `invalid`
        Invalid
  - `referral_system` (optional, enumerated string)
    Source referral system for the referral subscription
    Possible enum values:
      - `referral_candy`
        Referral Candy
      - `referral_saasquatch`
        Referral Saasquatch
      - `friendbuy`
        Friendbuy
  - `account_id` (required, string, max chars=50)
    Referral account id
  - `campaign_id` (required, string, max chars=50)
    Referral campaign id
  - `external_campaign_id` (optional, string, max chars=100)
    Referral external campaign id
  - `friend_offer_type` (optional, enumerated string)
    Friend offer type for the referral camapign
    Possible enum values:
      - `none`
        None
      - `coupon`
        Coupon
      - `coupon_code`
        Coupon Code
  - `referrer_reward_type` (optional, enumerated string)
    Referrer reward type for the referral campaign
    Possible enum values:
      - `none`
        None
      - `referral_direct_reward`
        Referral Direct Reward
      - `custom_promotional_credit`
        Custom Promotional Credit
      - `custom_revenue_percent_based`
        Custom Revenue Percent Based
  - `notify_referral_system` (optional, enumerated string)
    Whether or not to notify the referral purchases to the referral system
    Possible enum values:
      - `none`
        None
      - `first_paid_conversion`
        First Paid Conversion
      - `all_invoices`
        All Invoices
  - `destination_url` (optional, string, max chars=250)
    Destination url for the referral campaign
  - `post_purchase_widget_enabled` (required, boolean, default=true)
    Whether post purchase widget is enabled for this campaign

- `contract_term` (optional, contract_term)
  Contract terms for this subscription
  - `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 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.
  - `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 in [`contract_billing_cycle_on_renewal`](/docs/api/v2/pcv-1/subscriptions/create-subscription-for-customer#contract_term_billing_cycle_on_renewal).
        -   The `action_at_term_end` for the new contract term is set to `renew`.
      - `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 in [`contract_billing_cycle_on_renewal`](/docs/api/v2/pcv-1/subscriptions/create-subscription-for-customer#contract_term_billing_cycle_on_renewal).
        
        -   The `action_at_term_end` for the new contract term is set to `cancel`.
  - `total_contract_value` (required, in cents, default=0, min=0)
    The sum of the [totals](/docs/api/invoices/invoice-object#total) of all the invoices raised as part of the contract term. For `active` contract terms, this is a predicted value. The value depends on the [type of currency](/docs/api/currencies). If the subscription was [imported](/docs/api/v2/pcv-1/subscriptions/import-a-subscription) with the contract term, then this value includes the value passed for `total_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 for `total_amount_raised_before_tax` is 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 before [`contract_end`](/docs/api/contract_terms/contract_term-object#contract_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)
    The [Id](/docs/api/subscriptions/subscription-object#id) of 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 for `active` contract terms.

