# Quoted subscriptions

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


When a `[quote](/docs/api/quotes)` is created, it generates the `quoted_subscription` resource. This captures most of the details of the subscription that would eventually be created once the quote is invoiced. This resource is returned along with the quote for most of the associated operations.

## Sample Quoted subscription

```json
{
  "plan_id": "basic",
  "plan_quantity": 1,
  "billing_period": 1,
  "billing_period_unit": "month",
  "object": "quoted_subscription",
  "addons": [
    {
      "id": "ssl",
      "quantity": 1,
      "unit_price": 495,
      "object": "addon"
    }
  ],
  "event_based_addons": [
    {
      "id": "day-pass",
      "quantity": 2,
      "unit_price": 200,
      "on_event": "subscription_creation",
      "charge_once": true,
      "object": "event_based_addon"
    }
  ],
  "coupons": [
    {
      "coupon_id": "plan_addons_coupon",
      "object": "coupon"
    }
  ]
}
```

## Quoted subscriptions attributes

## Input Parameters

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

- `billing_period` (optional, integer, min=1)

- `billing_period_unit` (optional, enumerated string)
  Possible enum values:
    - `day`
    - `week`
    - `month`
    - `year`

- `start_date` (optional, timestamp(UTC) in seconds)
  Applicable only when `operation_type` of the quote is `create_subscription_for_customer`. For subscriptions in the `future` `status` , this is the date/time when the subscription is set to start. The quote can be converted on a date/time after this date. This is called backdating the subscription creation. Backdating is performed when the subscription has already been provisioned but the conversion action has been delayed. Backdating is allowed only when the following prerequisites are met:
  
  -   Backdating is enabled for subscription creation operations.
  -   The current day of the month does not exceed the limit set in Chargebee for backdating such operations. This day is typically the day of the month by which the accounting for the previous month must be closed.
  -   The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription's plan is 2 months and today is 14th April, the `start_date` cannot be earlier than 14th February.

- `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)
  Possible enum values:
    - `on`
    - `off`

- `plan_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.

- `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/currencies) is enabled.

- `changes_scheduled_at` (optional, timestamp(UTC) in seconds)
  Applicable only when `operation_type` of the quote is `change_subscription`. When `change_option` is set to `specific_date` , then this is the date/time at which the subscription change is scheduled to occur. The quote can be converted on a date/time after this date. This is called backdating the subscription change and performed when the subscription change has already been provisioned but the conversion action has been delayed. Backdating is allowed only when the following prerequisites are met:
  
  -   Backdating must be enabled for subscription change operations.
      
  -   Only the following changes can be backdated:
      
  -   Changes in the recurring items or their prices.
      
  -   Addition of non-recurring items.
      
  -   Subscription `status` is `active`, `cancelled`, or `non_renewing`.
      
  -   The current day of the month does not exceed the limit set in Chargebee for backdating subscription change. This limit is the day of the month by which the accounting for the previous month must be closed.
      
  -   The date is on or after `current_term_start`.
      
  -   The date is on or after the last date/time any of the following changes were made:
      
  -   Changes in the recurring items or their prices.
      
  -   Addition of non-recurring items.
      
  -   The date is not more than duration X into the past where X is the billing period of the plan. For example, if the period of the subscription's plan is 2 months and today is 14th April, `changes_scheduled_at` cannot be earlier than 14th February.

- `change_option` (optional, enumerated string)
  Applicable only when `operation_type` of the quote is `change_subscription`. When the quote is converted, this attribute determines the date/time as of when the subscription change is to be carried out.
  Possible enum values:
    - `end_of_term`
      The change is scheduled to be carried out at the end of the billing cycle of the subscription.
    - `specific_date`
      The change is carried out as of `changes_scheduled_at` .
    - `immediately`
      The change is carried out immediately upon quote conversion.

- `free_period` (optional, integer, min=1)
  The period of time by which the first term of the subscription is extended free of charge. The value is expressed in the time unit specified by `free_period_unit`. For example, `3` with `free_period_unit` = `month` means 3 free months are added to the first term.
  
  **Constraints**
  
  -   Applicable only when `operation_type` is `create_subscription_for_customer`.
  -   Applicable only when Chargebee CPQ is enabled. To request access, [contact 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)

- `free_period_unit` (optional, enumerated string)
  The time unit for `free_period`.
  
  **Constraints**
  
  -   Applicable only when `operation_type` is `create_subscription_for_customer`.
  -   Applicable only when Chargebee CPQ is enabled. To request access, [contact 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)
  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)

- `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) .

- `coupons` (optional, list of coupon)
  List of coupons for this subscription
  - `coupon_id` (required, string, max chars=100)
    Used to uniquely identify the coupon

- `discounts` (optional, list of discount)
  List of discounts for this quoted subscription.
  - `id` (required, string, max chars=50)
    An immutable unique id for the discount. It is always auto-generated.
  - `invoice_name` (optional, string, max chars=100)
    The name of the discount as it should appear on customer-facing pages and documents such as [invoices](/docs/api/invoices) and [hosted pages](/docs/api/hosted_pages). This is auto-generated based on the `type` , `amount` , and `currency_code` of the discount. For example, it can be `10% off` or `10$ off` .
  - `type` (required, enumerated string, default=percentage)
    The type of discount. Possible value are:
    Possible enum values:
      - `fixed_amount`
        The specified amount will be given as discount.
      - `percentage`
        The specified percentage will be given as discount.
      - `offer_quantity`
        A specified number of units of the item price are offered for free. The number of free units is specified in `quantity`. The `offer_quantity` option is valid only when `apply_on` is set to `each_specified_item` and the `[pricing_model](/docs/api/item_prices/item_price-object#pricing_model)` of the item price is `per_unit` .
  - `percentage` (optional, double, min=0.01, max=100)
    The percentage of the original amount that should be deducted from it.
  - `amount` (optional, in cents, min=0)
    The value of the discount. [The format of this value](/docs/api/currencies) depends on the kind of currency.
  - `quantity` (optional, integer, min=1)
    Specifies the number of free units provided for the item, without affecting the total quantity sold. This parameter is applicable only when `discount.type` is `offer_quantity`.
  - `currency_code` (optional, string, max chars=3)
    The currency code ([ISO 4217 format](https://www.chargebee.com/docs/supported-currencies.html) ) of the discount. This is only applicable when `discount.type` is `fixed_amount` .
  - `duration_type` (required, enumerated string, default=forever)
    Specifies the time duration for which this discount is attached to the subscription.
    Possible enum values:
      - `one_time`
        The discount stays attached to the subscription till it is applied on an invoice **once**. It is removed after that from the subscription.
      - `forever`
        The discount is attached to the subscription and applied on the invoices till it is [explicitly removed](/docs/api/subscriptions/update-subscription-for-items#discounts_operation_type) .
      - `limited_period`
        The discount is attached to the subscription and applied on the invoices for a limited duration. This duration starts from the point it is applied to an invoice for the first time and expires after a period specified by `period` and `period_unit` .
  - `period` (optional, integer, min=1)
    The duration of time for which the discount is attached to the subscription, in `period_units`. Applicable only when `duration_type` is `limited_period`.
  - `period_unit` (optional, enumerated string)
    The unit of time for `period`. Applicable only when `duration_type` is `limited_period`.
    Possible enum values:
      - `day`
        A period of 24 hours.
      - `week`
        A period of 7 days.
      - `month`
        A period of 1 calendar month.
      - `year`
        A period of 1 calendar year.
  - `included_in_mrr` (required, boolean)
    The discount is included in MRR calculations for your site. This attribute is only applicable when `duration_type` is `one_time` and when the [feature is enabled](https://www.chargebee.com/docs/reporting.html#dashboards_flexible-mrr-calculation) in Chargebee. Also, If the [site-level setting](https://www.chargebee.com/docs/reporting.html#chart_flexible-mrr-calculation) is to exclude one-time discounts from MRR calculations, this value is always returned `false`.
  - `apply_on` (required, enumerated string)
    The amount on the invoice to which the discount is applied.
    Possible enum values:
      - `invoice_amount`
        The discount is applied to the invoice `sub_total` .
      - `specific_item_price`
        The discount is applied to the `invoice.line_item.amount` that corresponds to the item price specified by `item_price_id` .
  - `item_price_id` (optional, string, max chars=100)
    The [id of the item price](/docs/api/subscriptions/subscription-object#subscription_items_item_price_id) in the subscription to which the discount is to be applied. Relevant only when `apply_on` = `specific_item_price`.
  - `created_at` (required, timestamp(UTC) in seconds)
    Timestamp indicating when this discount is created.
  - `apply_till` (optional, timestamp(UTC) in seconds)
    Specifies till when the limited period discount is applicable. This attribute will be sent in the response only for `limited_period` duration type discount.
  - `applied_count` (optional, integer)
    Specifies the number of times the discount has been applied.
  - `coupon_id` (required, string, max chars=100)
    Used to uniquely identify the coupon in your website/application and to integrate with Chargebee.
    
    **Note:**
    
    When the coupon ID contains a special character; for example: `#`, the API returns an error. Make sure that you [encode](https://www.urlencoder.org/) the coupon ID in the path parameter before making an API call.
  - `index` (required, integer, min=0)
    The index number of the subscription to which the item price is added. Provide a unique number between `0` and `4` (inclusive) for each subscription that is to be created.

- `subscription_items` (optional, list of subscription_item)
  Details of individual [item prices](/docs/api/item_prices) that are part of this subscription
  - `item_price_id` (required, string, max chars=100)
    The unique identifier of the item price.
  - `item_type` (required, enumerated string)
    The type of item. There must be one and only one item of type `plan` in this list.
    Possible enum values:
      - `plan`
        Plan
      - `addon`
        Addon
      - `charge`
        Charge
  - `quantity` (optional, integer, min=1)
    The quantity of the item purchased
  - `quantity_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity of the item purchased. Can be provided for quantity-based item prices and only when [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `unit_price` (optional, in cents, min=0)
    The price/per unit price of the item. When not provided, [the value set](/docs/api/item_prices/item-price-object) for the item price is used. This is only applicable when the `pricing_model` of the item price is `flat_fee` or `per_unit`. Also, it is only allowed when [price overriding](https://www.chargebee.com/docs/price-override.html) is enabled for the site. The value depends on the type of currency. If `changes_scheduled_at` is in the past and a `unit_price` is not passed, then the item price's current unit price is considered even if the item price did not exist on the date as of when the change is scheduled.
  - `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/getting-started) is enabled.
  - `amount` (optional, in cents, min=0)
    The total amount for the item as determined from `unit_price` , `free_quantity` , `quantity` and `item_tiers` as applicable. The value depends on the [type of currency](/docs/api/quoted_subscriptions) .
  - `current_term_start` (optional, timestamp(UTC) in seconds)
    The beginning of the item's current billing period.
    
    **Note** Applicable only when multi-frequency billing is enabled.
    
    **Private Beta** Multi-frequency billing is in private beta. Please reach out to the 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) to enable this feature.
  - `current_term_end` (optional, timestamp(UTC) in seconds)
    The end of the item's current billing period. Chargebee renews the item immediately following this date.
    
    **Note** Applicable only when multi-frequency billing is enabled.
    
    **Private Beta** Multi-frequency billing is in private beta. Please reach out to the 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) to enable this feature.
  - `next_billing_at` (optional, timestamp(UTC) in seconds)
    The date or time at when the next billing for the item is scheduled to occur. This typically occurs immediately after `current_term_end`.
    
    **Note** Applicable only when multi-frequency billing is enabled.
    
    **Private Beta** Multi-frequency billing is in private beta. Please reach out to the 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) to enable this feature.
  - `amount_in_decimal` (optional, string, max chars=39)
    The decimal representation of the total amount for the item, in major units of the currency. Always returned when [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `billing_period` (optional, integer, min=1)
    The interval between consecutive billing cycles for the subscription item. The interval is measured in the units defined by `billing_period_unit` .
  - `billing_period_unit` (optional, enumerated string)
    The unit of measurement used to define the `billing_period` for the subscription item.
    Possible enum values:
      - `day`
        A period of 24 hours.
      - `week`
        A period of 7 days.
      - `month`
        A period of 1 calendar month.
      - `year`
        A period of 1 calendar year.
  - `free_quantity` (optional, integer, min=0)
    The `free_quantity` of the plan-item as [specified](/docs/api/item_prices) for the item price.
  - `free_quantity_in_decimal` (optional, string, max chars=33)
    The `free_quantity_in_decimal` as set for the item price. Returned for quantity-based item prices when [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `trial_end` (optional, timestamp(UTC) in seconds)
    The date/time when the trial period of the item ends. Applies to plan-items and--when [enabled](https://www.chargebee.com/docs/2.0/addons-trial.html) --addon-items as well.
  - `billing_cycles` (optional, integer, min=0)
    For the plan-item price: the value determines the number of billing cycles the subscription runs before canceling automatically. If not provided, then [the value set](/docs/api/item_prices/item-price-object) for the plan-item price is used.
    
    For addon-item prices: If [addon billing cycles](https://www.chargebee.com/docs/2.0/addons-billingcycle.html) are enabled then this is the number of subscription billing cycles for which the addon is included. If not provided, then [the value set under attached addons](/docs/api/attached_items/attached-item-object) is used. Further, if that value is not provided, then [the value set for the addon-item price](/docs/api/item_prices/item-price-object) is used.
  - `service_period_days` (optional, integer, min=1, max=730)
    The service period of the item in days from the day of charge.
  - `charge_on_event` (optional, enumerated string)
    When `charge_on_option` option is set to `on_event` , this parameter specifies the event at which the charge-item is applied to the subscription. This parameter only applies to charge-items.
    Possible enum values:
      - `subscription_creation`
        the time of creation of the subscription.
      - `subscription_trial_start`
        the time when the trial period of the subscription begins.
      - `plan_activation`
        same as subscription activation, but also includes the case when the plan-item of the subscription is changed.
      - `subscription_activation`
        the moment a subscription enters an `active` or `non-renewing` state. Also includes reactivations of canceled subscriptions.
      - `contract_termination`
        when a contract term is [terminated](/docs/api/subscriptions/cancel-subscription-for-items#contract_term_cancel_option) .
  - `charge_once` (optional, boolean)
    Indicates if the charge-item is to be charged only once or each time the `charge_on_event` occurs. This parameter only applies to charge-items.
  - `charge_on_option` (optional, enumerated string)
    Indicates when the charge-item is to be charged. This parameter only applies to charge-items.
    Possible enum values:
      - `immediately`
        The item is charged immediately on being added to the subscription.
      - `on_event`
        The item is charged at the occurrence of the event specified as `charge_on_event` .
  - `proration_type` (optional, enumerated string)
    Possible enum values:
      - `full_term`
      - `partial_term`
      - `none`
  - `usage_accumulation_reset_frequency` (optional, enumerated string)
    Possible enum values:
      - `never`
      - `subscription_billing_frequency`
  - `description` (optional, string, max chars=500)
    **Limited availability**
    
    Subscription-level item descriptions are available only on sites where this feature is enabled. Please reach out to the 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) to enable this feature.
    
    The description stored for this item on this quoted subscription. It is used on the customer-facing invoice instead of the description configured for the item price, and is returned as `entity_description` on the invoice [line item](/docs/api/invoices/invoice-object#invoice_line_items).
    
    This attribute is returned only when a description has been stored for the item. When it is absent, the description configured for the item price applies. Whether a description is shown on the invoice at all continues to be controlled by the item price's [show\_description\_in\_invoices](/docs/api/item_prices#show_description_in_invoices) setting.

- `item_tiers` (optional, list of item_tier)
  List of item tier.
  - `item_price_id` (required, string, max chars=100)
    The id of the item price to which this tier belongs.
  - `starting_unit` (required, integer, min=1)
    The lowest value in the quantity tier.
  - `ending_unit` (optional, integer)
    The highest value in the quantity tier.
  - `price` (required, in cents, default=0, min=0)
    The per-unit price for the tier when the `pricing_model` is `tiered` or `volume`. The total cost for the item price when the `pricing_model` is `stairstep`. The value is in the minor unit of the currency.
  - `starting_unit_in_decimal` (optional, string, max chars=33)
    The decimal representation of the lowest value of quantity in this tier. This is zero for the lowest tier. For all other tiers, it is the same as `ending_unit_in_decimal` of the next lower tier. Returned only when the pricing\_model is `tiered` , `volume` or `stairstep` and [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `ending_unit_in_decimal` (optional, string, max chars=33)
    The decimal representation of the highest value of quantity in this tier. This attribute is not applicable for the highest tier. For all other tiers, it must be equal to the `starting_unit_in_decimal` of the next higher tier. Returned only when the pricing\_model is `tiered` , `volume` or `stairstep` and [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `price_in_decimal` (optional, string, max chars=39)
    The decimal representation of the per-unit price for the tier when the `pricing_model` is `tiered` or `volume`. When the `pricing_model` is `stairstep` , it is the decimal representation of the total price for the item. The value is in major units of the currency. Returned when the plan is quantity-based and [multi-decimal pricing](/docs/api/getting-started) is enabled.
  - `pricing_type` (optional, enumerated string)
    Possible enum values:
      - `per_unit`
      - `flat_fee`
      - `package`
  - `package_size` (optional, integer, min=1)
  - `index` (required, integer, min=0)
    The index number of the subscription to which the item price is added. Provide a unique number between `0` and `4` (inclusive) for each subscription that is to be created.

- `quoted_contract_term` (optional, quoted_contract_term)
  The details of the contract term to be created when this quote is invoiced.
  - `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/quoted_subscriptions). If the subscription was [imported](/docs/api/quoted_subscriptions) with the contract term, then this value includes the value passed for `total_amount_raised` .
  - `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.

