# Estimates

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


During the process of signing up customers to subscriptions, use the Estimates API to evaluate the details of the purchase before actually signing them up. The details returned by the API include the invoice amounts, next billing date and unbilled charges.

For example, consider that you are creating a new subscription or update an existing one. Use the Estimates API before that to deduce the details such as the amount the customer would be charged, the state the subscription would be in after creation or updation, and so on.

If you have configured the [Avalara integration](https://www.chargebee.com/docs/2.0/avalara.html), Chargebee retrieves the tax amount from Avalara for the invoice. This counts against your Avalara API limits.

## Estimates attributes

## Input Parameters

- `created_at` (required, timestamp(UTC) in seconds)
  The time at which this estimate got generated

- `subscription_estimate` (optional, subscription_estimate)
  Represents the subscription details when the 'estimate' operations are invoked.

- `subscription_estimates` (optional, list of subscription_estimate)
  Is a list of estimated subscriptions i.e., an array of _subscription\_estimate_ objects. It is generated when 'Create an estimate for purchase' operation is invoked
  - `id` (optional, string, max chars=50)
    The identifier of the subscription
  - `currency_code` (required, string, max chars=3)
    The currency code (ISO 4217 format) of the subscription.
  - `status` (optional, enumerated string)
    The status 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 subscription has been transferred to another business entity within the organization.
  - `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`
        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. This is the default value when `trial_end_action` is **not** defined for the plan.
      - `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. This is the default value when `trial_end_action` is defined for the plan.
      - `activate_subscription`
        The subscription activates and charges are raised for non-metered items.
      - `cancel_subscription`
        The subscription cancels.
  - `next_billing_at` (optional, timestamp(UTC) in seconds)
    Date on which the next billing happens. This will be null for non-renewing and cancelled subscriptions.
  - `pause_date` (optional, timestamp(UTC) in seconds)
    The date on which subscription will be paused. Applicable only to paused or scheduled pause subscriptions
  - `resume_date` (optional, timestamp(UTC) in seconds)
    The date on which subscription will be resumed. Applicable only to paused or scheduled pause subscriptions
  - `shipping_address` (optional, shipping_address)
    Represents the shipping address when the 'estimate' operations are invoked.
    - `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 and India. 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` ).
    - `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.
  - `contract_term` (optional, contract_term)
    Represents the contract terms when the 'estimate' operations are invoked.
    - `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/estimates). If the subscription was [imported](/docs/api/estimates/estimate-for-creating-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.

- `invoice_estimate` (optional, invoice_estimate)
  Represents the preview of the invoice generated immediately when the 'estimate' operations are invoked.

- `invoice_estimates` (optional, list of invoice_estimate)
  Is a list of estimated invoices i.e., an array of _invoice\_estimate_ objects. It is generated when 'Create an estimate for unbilled charges' operation is invoked
  - `recurring` (required, boolean, default=true)
    Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates.
  - `price_type` (required, enumerated string, default=tax_exclusive)
    The price type of this invoice.
    Possible enum values:
      - `tax_exclusive`
        All amounts in the document are exclusive of tax.
      - `tax_inclusive`
        All amounts in the document are inclusive of tax.
  - `currency_code` (required, string, max chars=3)
    The currency code (ISO 4217 format) of the invoice.
  - `sub_total` (required, in cents, min=0)
    Invoice sub-total in cents.
  - `total` (optional, in cents, default=0, min=0)
    Invoice total in cents.
  - `credits_applied` (optional, in cents, default=0, min=0)
    credits applied to this invoice in cents.
  - `amount_paid` (optional, in cents, default=0, min=0)
    Existing outstanding payments if any, applied to this invoice in cents.
  - `amount_due` (optional, in cents, default=0, min=0)
    Invoice amount due in cents
  - `round_off_amount` (optional, in cents, min=0)
    Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the `round_off_amount`. If there is no `round-off amount` , it will display `0` .
  - `customer_id` (optional, string, max chars=100)
    A unique identifier for the customer this invoice belongs to
  - `discounts` (optional, list of discount)
    The list of discounts applied to this estimate
    - `amount` (required, in cents, min=0)
      The amount deducted. The format of this value depends on the [kind of currency](/docs/api/currencies) .
    - `description` (optional, string, max chars=250)
      Description for this deduction.
    - `line_item_id` (optional, string, max chars=40)
      The unique id of the line item that this deduction is for. Is required when `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon` .
    - `entity_type` (required, enumerated string)
      The type of deduction and the amount to which it is applied.
      Possible enum values:
        - `item_level_coupon`
          The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id` .
        - `document_level_coupon`
          The deduction is due to a coupon applied to the invoice `sub_total`. The coupon id is passed as `entity_id` .
        - `promotional_credits`
          The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice.
        - `prorated_credits`
          The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by `[adjustment_credit_notes](/docs/api/invoices/invoice-object#adjustment_credit_notes)` .
        - `item_level_discount`
          The deduction is due to a [discount](/docs/api/discounts) applied to a line item of the invoice. The discount `id` is available as the `entity_id`.
        - `document_level_discount`
          The deduction is due to a [discount](/docs/api/discounts) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
    - `discount_type` (optional, enumerated string)
      The type of discount that is applied to the line item. Relevant only when `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon` , `document_level_discount` , or `document_level_coupon`
      Possible enum values:
        - `fixed_amount`
          when amount is applied as discount
        - `percentage`
          when percentage is applied as discount
    - `entity_id` (optional, string, max chars=100)
      When the deduction is due to a `coupon` or a `[discount](/docs/api/discounts)` , then this is the `id` of the coupon or discount.
    - `coupon_set_code` (optional, string, max chars=50)
      The [coupon code](/docs/api/coupon_codes/coupon_code-object#code) , if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons/coupon-object#id) is available in `entity_id` .
  - `taxes` (optional, list of tax)
    The list of taxes applied to this estimate
    - `name` (required, string, max chars=100)
      The name of the tax applied. E.g. GST.
    - `amount` (required, in cents, min=0)
      The tax amount.
    - `description` (optional, string, max chars=250)
      Description of the tax item.

- `payment_schedule_estimates` (optional, list of payment_schedule_estimate)
  `payment_schedule_estimate` is used to hold the details related to payment schedules for an invoice. It will contain a list of `payment_schedules` resources.

- `next_invoice_estimate` (optional, invoice_estimate)
  Represents the preview of the invoice generated at term end when the 'estimate' operations are invoked.
  - `recurring` (required, boolean, default=true)
    Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates.
  - `price_type` (required, enumerated string, default=tax_exclusive)
    The price type of this invoice.
    Possible enum values:
      - `tax_exclusive`
        All amounts in the document are exclusive of tax.
      - `tax_inclusive`
        All amounts in the document are inclusive of tax.
  - `currency_code` (required, string, max chars=3)
    The currency code (ISO 4217 format) of the invoice.
  - `sub_total` (required, in cents, min=0)
    Invoice sub-total in cents.
  - `total` (optional, in cents, default=0, min=0)
    Invoice total in cents.
  - `credits_applied` (optional, in cents, default=0, min=0)
    credits applied to this invoice in cents.
  - `amount_paid` (optional, in cents, default=0, min=0)
    Existing outstanding payments if any, applied to this invoice in cents.
  - `amount_due` (optional, in cents, default=0, min=0)
    Invoice amount due in cents
  - `round_off_amount` (optional, in cents, min=0)
    Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the `round_off_amount`. If there is no `round-off amount` , it will display `0` .
  - `customer_id` (optional, string, max chars=100)
    A unique identifier for the customer this invoice belongs to
  - `discounts` (optional, list of discount)
    The list of discounts applied to this estimate
    - `amount` (required, in cents, min=0)
      The amount deducted. The format of this value depends on the [kind of currency](/docs/api/currencies) .
    - `description` (optional, string, max chars=250)
      Description for this deduction.
    - `line_item_id` (optional, string, max chars=40)
      The unique id of the line item that this deduction is for. Is required when `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon` .
    - `entity_type` (required, enumerated string)
      The type of deduction and the amount to which it is applied.
      Possible enum values:
        - `item_level_coupon`
          The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id` .
        - `document_level_coupon`
          The deduction is due to a coupon applied to the invoice `sub_total`. The coupon id is passed as `entity_id` .
        - `promotional_credits`
          The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice.
        - `prorated_credits`
          The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by `[adjustment_credit_notes](/docs/api/invoices/invoice-object#adjustment_credit_notes)` .
        - `item_level_discount`
          The deduction is due to a [discount](/docs/api/discounts) applied to a line item of the invoice. The discount `id` is available as the `entity_id`.
        - `document_level_discount`
          The deduction is due to a [discount](/docs/api/discounts) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
    - `discount_type` (optional, enumerated string)
      The type of discount that is applied to the line item. Relevant only when `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon` , `document_level_discount` , or `document_level_coupon`
      Possible enum values:
        - `fixed_amount`
          when amount is applied as discount
        - `percentage`
          when percentage is applied as discount
    - `entity_id` (optional, string, max chars=100)
      When the deduction is due to a `coupon` or a `[discount](/docs/api/discounts)` , then this is the `id` of the coupon or discount.
    - `coupon_set_code` (optional, string, max chars=50)
      The [coupon code](/docs/api/coupon_codes/coupon_code-object#code) , if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons/coupon-object#id) is available in `entity_id` .
  - `taxes` (optional, list of tax)
    The list of taxes applied to this estimate
    - `name` (required, string, max chars=100)
      The name of the tax applied. E.g. GST.
    - `amount` (required, in cents, min=0)
      The tax amount.
    - `description` (optional, string, max chars=250)
      Description of the tax item.

- `credit_note_estimates` (optional, list of credit_note_estimate)
  Represents the preview of the credit-notes generated during 'estimate' operation. Currently applicable only for the 'Update Subscription Estimate' operation.

- `unbilled_charge_estimates` (optional, list of unbilled_charge)
  Represents the preview of the unbilled charges generated during 'estimate' operation. Currently not applicable for the 'Subscription renewal estimate' operation.

## Subscription estimate attributes

## Input Parameters

- `id` (optional, string, max chars=50)
  The identifier of the subscription

- `currency_code` (required, string, max chars=3)
  The currency code (ISO 4217 format) of the subscription.

- `status` (optional, enumerated string)
  The status 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 subscription has been transferred to another business entity within the organization.

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

- `next_billing_at` (optional, timestamp(UTC) in seconds)
  Date on which the next billing happens. This will be null for non-renewing and cancelled subscriptions.

- `pause_date` (optional, timestamp(UTC) in seconds)
  The date on which subscription will be paused. Applicable only to paused or scheduled pause subscriptions

- `resume_date` (optional, timestamp(UTC) in seconds)
  The date on which subscription will be resumed. Applicable only to paused or scheduled pause subscriptions

- `shipping_address` (optional, shipping_address)
  Represents the shipping address when the 'estimate' operations are invoked.
  - `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 and India. 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` ).
  - `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.

- `contract_term` (optional, contract_term)
  Represents the contract terms when the 'estimate' operations are invoked.
  - `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/estimates). If the subscription was [imported](/docs/api/estimates/estimate-for-creating-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.

## Invoice estimate attributes

## Input Parameters

- `recurring` (required, boolean, default=true)
  Whether or not the estimate for the invoice is recurring. Will be 'true' or 'false' for subscription related estimates.

- `price_type` (required, enumerated string, default=tax_exclusive)
  The price type of this invoice.
  Possible enum values:
    - `tax_exclusive`
      All amounts in the document are exclusive of tax.
    - `tax_inclusive`
      All amounts in the document are inclusive of tax.

- `currency_code` (required, string, max chars=3)
  The currency code (ISO 4217 format) of the invoice.

- `sub_total` (required, in cents, min=0)
  Invoice sub-total in cents.

- `total` (optional, in cents, default=0, min=0)
  Invoice total in cents.

- `credits_applied` (optional, in cents, default=0, min=0)
  credits applied to this invoice in cents.

- `amount_paid` (optional, in cents, default=0, min=0)
  Existing outstanding payments if any, applied to this invoice in cents.

- `amount_due` (optional, in cents, default=0, min=0)
  Invoice amount due in cents

- `round_off_amount` (optional, in cents, min=0)
  Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the `round_off_amount`. If there is no `round-off amount` , it will display `0` .

- `customer_id` (optional, string, max chars=100)
  A unique identifier for the customer this invoice belongs to

- `discounts` (optional, list of discount)
  The list of discounts applied to this estimate
  - `amount` (required, in cents, min=0)
    The amount deducted. The format of this value depends on the [kind of currency](/docs/api/currencies) .
  - `description` (optional, string, max chars=250)
    Description for this deduction.
  - `line_item_id` (optional, string, max chars=40)
    The unique id of the line item that this deduction is for. Is required when `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon` .
  - `entity_type` (required, enumerated string)
    The type of deduction and the amount to which it is applied.
    Possible enum values:
      - `item_level_coupon`
        The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id` .
      - `document_level_coupon`
        The deduction is due to a coupon applied to the invoice `sub_total`. The coupon id is passed as `entity_id` .
      - `promotional_credits`
        The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice.
      - `prorated_credits`
        The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by `[adjustment_credit_notes](/docs/api/invoices/invoice-object#adjustment_credit_notes)` .
      - `item_level_discount`
        The deduction is due to a [discount](/docs/api/discounts) applied to a line item of the invoice. The discount `id` is available as the `entity_id`.
      - `document_level_discount`
        The deduction is due to a [discount](/docs/api/discounts) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
  - `discount_type` (optional, enumerated string)
    The type of discount that is applied to the line item. Relevant only when `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon` , `document_level_discount` , or `document_level_coupon`
    Possible enum values:
      - `fixed_amount`
        when amount is applied as discount
      - `percentage`
        when percentage is applied as discount
  - `entity_id` (optional, string, max chars=100)
    When the deduction is due to a `coupon` or a `[discount](/docs/api/discounts)` , then this is the `id` of the coupon or discount.
  - `coupon_set_code` (optional, string, max chars=50)
    The [coupon code](/docs/api/coupon_codes/coupon_code-object#code) , if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons/coupon-object#id) is available in `entity_id` .

- `taxes` (optional, list of tax)
  The list of taxes applied to this estimate
  - `name` (required, string, max chars=100)
    The name of the tax applied. E.g. GST.
  - `amount` (required, in cents, min=0)
    The tax amount.
  - `description` (optional, string, max chars=250)
    Description of the tax item.

## Payment schedule estimate attributes

## Input Parameters

- `id` (required, string, max chars=40)
  An auto-generated unique identifier for the payment schedule.

- `scheme_id` (required, string, max chars=40)
  The identifier of the `payment_schedule_scheme` , used to create the payment schedules.

- `entity_type` (required, enumerated string)
  Specifies the modeled entity that the payment schedule is based on.
  Possible enum values:
    - `invoice`
      Represents an invoice.

- `entity_id` (optional, string, max chars=50)
  The identifier of the modeled entity that this payment schedule is based on.

- `amount` (required, in cents, min=0)
  An amount that this payment schedule is able to collect.

- `currency_code` (optional, string, max chars=3)
  The currency code (ISO 4217 format) of the transaction amount.

- `schedule_entries` (optional, list of schedule_entry)
  List of schedule entries
  - `id` (required, string, max chars=40)
    An auto-generated unique identifier for the payment schedule.
  - `date` (required, timestamp(UTC) in seconds)
    The date when this payment schedule is scheduled.
  - `amount` (required, in cents, min=0)
    The total maximum amount that this payment schedule is allowed to collect.
  - `status` (required, enumerated string)
    Defines the status of each payment schedule.
    Possible enum values:
      - `posted`
        Indicates that the payment is posted.
      - `payment_due`
        Indicates that the payment is due.
      - `paid`
        Indicates that the payment has been made.

## Credit note estimate attributes

## Input Parameters

- `reference_invoice_id` (required, string, max chars=50)
  The reference invoice id

- `type` (required, enumerated string)
  Credit note types. [Learn more](/docs/api/credit_notes/credit-note-object) about credit note types.
  Possible enum values:
    - `adjustment`
      Adjustment Credit Note
    - `refundable`
      Refundable Credit Note
    - `store`
      Store Credit Note

- `price_type` (required, enumerated string, default=tax_exclusive)
  The price type of this credit note.
  Possible enum values:
    - `tax_exclusive`
      All amounts in the document are exclusive of tax.
    - `tax_inclusive`
      All amounts in the document are inclusive of tax.

- `currency_code` (required, string, max chars=3)
  The currency code (ISO 4217 format) of the credit note.

- `sub_total` (required, in cents, min=0)
  Invoice sub-total in cents.

- `total` (required, in cents, min=0)
  Credit note total in cents.

- `amount_allocated` (required, in cents, min=0)
  Allocated credits in cents.

- `amount_available` (required, in cents, min=0)
  Remaining credits in cents

- `round_off_amount` (optional, in cents, min=0)
  Indicates the rounded-off amount. For example, if your invoice amount is $99.99, and the amount is rounded off to $100.00, in this case, $100.00 is your invoice amount, $0.01 is the `round_off_amount`. If there is no `round-off amount` , it will display `0` .

- `customer_id` (optional, string, max chars=100)
  A unique identifier for the customer this credit note belongs to

- `discounts` (optional, list of discount)
  The list of discounts applied to this estimate
  - `amount` (required, in cents, min=0)
    The amount deducted. The format of this value depends on the [kind of currency](/docs/api/currencies) .
  - `description` (optional, string, max chars=250)
    Description for this deduction.
  - `line_item_id` (optional, string, max chars=40)
    The unique id of the line item that this deduction is for. Is required when `discounts[entity_type]` is `item_level_coupon` or `document_level_coupon` .
  - `entity_type` (required, enumerated string)
    The type of deduction and the amount to which it is applied.
    Possible enum values:
      - `item_level_coupon`
        The deduction is due to a coupon applied to line item. The coupon `id` is passed as `entity_id` .
      - `document_level_coupon`
        The deduction is due to a coupon applied to the invoice `sub_total`. The coupon id is passed as `entity_id` .
      - `promotional_credits`
        The deduction is due to a [promotional credit](/docs/api/promotional_credits) applied to the invoice.
      - `prorated_credits`
        The deduction is due to a legacy adjustment credit applied to the invoice. The `entity_id` is `null` in this case. The legacy credits feature is superseded by `[adjustment_credit_notes](/docs/api/invoices/invoice-object#adjustment_credit_notes)` .
      - `item_level_discount`
        The deduction is due to a [discount](/docs/api/discounts) applied to a line item of the invoice. The discount `id` is available as the `entity_id`.
      - `document_level_discount`
        The deduction is due to a [discount](/docs/api/discounts) applied to the invoice `sub_total`. The discount `id` is available as the `entity_id`.
  - `discount_type` (optional, enumerated string)
    The type of discount that is applied to the line item. Relevant only when `discounts[entity_type]` is one of `item_level_discount` , `item_level_coupon` , `document_level_discount` , or `document_level_coupon`
    Possible enum values:
      - `fixed_amount`
        when amount is applied as discount
      - `percentage`
        when percentage is applied as discount
  - `entity_id` (optional, string, max chars=100)
    When the deduction is due to a `coupon` or a `[discount](/docs/api/discounts)` , then this is the `id` of the coupon or discount.
  - `coupon_set_code` (optional, string, max chars=50)
    The [coupon code](/docs/api/coupon_codes/coupon_code-object#code) , if applicable, used to provide the discount. The [coupon.id](/docs/api/coupons/coupon-object#id) is available in `entity_id` .

- `taxes` (optional, list of tax)
  The list of taxes applied to this estimate
  - `name` (required, string, max chars=100)
    The name of the tax applied. E.g. GST.
  - `amount` (required, in cents, min=0)
    The tax amount.
  - `description` (optional, string, max chars=250)
    Description of the tax item.

## Unbilled charge estimate attributes

## Input Parameters

- `id` (optional, string, max chars=40)
  Uniquely identifies an unbilled charge.

- `customer_id` (optional, string, max chars=50)
  A unique identifier for the customer being charged.

- `subscription_id` (optional, string, max chars=50)
  A unique identifier for the subscription this charge belongs to.

- `date_from` (optional, timestamp(UTC) in seconds)
  Start date of this charge.

- `date_to` (optional, timestamp(UTC) in seconds)
  End date of this charge.

- `unit_amount` (optional, in cents, min=0)
  Unit amount of the charge item.

- `pricing_model` (optional, enumerated string)
  The pricing scheme for this line item.
  Possible enum values:
    - `flat_fee`
      A fixed price that is not quantity-based.
    - `per_unit`
      A fixed price per unit quantity.
    - `tiered`
      There are quantity tiers for which per unit prices are set. Quantities are purchased from successive tiers.
    - `volume`
      The per unit price is based on the tier that the total quantity falls in.
    - `stairstep`
      A quantity-based pricing scheme. The item is charged a fixed price based on the tier that the total quantity falls in.

- `quantity` (optional, integer, min=0)
  Quantity of the item which is represented by this charge.

- `amount` (optional, in cents, min=0)
  Total amount of this charge. Typically equals to unit amount x quantity.

- `currency_code` (required, string, max chars=3)
  The currency code (ISO 4217 format) for the charge.

- `discount_amount` (optional, in cents, min=0)
  Total discounts for this charge.

- `description` (optional, string, max chars=250)
  Detailed description about this charge.

- `entity_type` (required, enumerated string)
  Specifies the modelled entity this line item is based on.
  Possible enum values:
    - `adhoc`
      Indicates that this lineitem is not modelled. i.e created adhoc. So the 'entity\_id' attribute will be null in this case
    - `plan_item_price`
      Indicates that this line item is based on plan Item Price
    - `addon_item_price`
      Indicates that this line item is based on addon Item Price
    - `charge_item_price`
      Indicates that this line item is based on charge Item Price

- `entity_id` (optional, string, max chars=100)
  The identifier of the modelled entity this charge is based on. Will be null for 'adhoc' entity type.

- `is_voided` (required, boolean, default=false)
  Will be true if the charge has been voided. Usually the unbilled charge will be voided and revised to different charges(s) during proration.

- `voided_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating the date and time this charge got voided.

- `unit_amount_in_decimal` (optional, string, max chars=39)
  The decimal representation of the amount for the charge, in major units of the currency. Typically equals to `unit_amount_in_decimal` x `quantity_in_decimal`. Returned when [multi-decimal pricing](/docs/api/currencies) is enabled.

- `quantity_in_decimal` (optional, string, max chars=33)
  The decimal representation of the quantity of this entity. Returned when the entity is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.

- `amount_in_decimal` (optional, string, max chars=39)
  The decimal representation of the unit amount for the entity. The value is in major units of the currency. Returned when the entity is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.

- `created_at` (optional, timestamp(UTC) in seconds)
  Timestamp indicating when the unbilled charge was created.

- `updated_at` (required, timestamp(UTC) in seconds)
  Timestamp indicating when the unbilled charge was last updated

- `is_advance_charge` (optional, boolean, default=false)
  The value of this parameter will be true if it is a recurring unbilled charge for a future term.

- `business_entity_id` (optional, string, max chars=50)
  The unique ID of the [business entity](/docs/api/getting-started) of this subscription. This is always the same as the [business entity](/docs/api/subscriptions/subscription-object#customer_id) of the customer.

- `deleted` (required, boolean)
  Indicates that this resource has been deleted.

- `tiers` (optional, list of line_item_tier)
  The list of tiers applicable for this line item
  - `line_item_id` (optional, string, max chars=40)
    Uniquely identifies a line\_item
  - `starting_unit` (required, integer, min=0)
    The lower limit of a range of units for the tier
  - `ending_unit` (optional, integer)
    The upper limit of a range of units for the tier
  - `quantity_used` (required, integer, min=0)
    The number of units purchased in a range.
  - `unit_amount` (required, in cents, min=0)
    The price of the tier if the charge model is a `stairtstep` pricing , or the price of each unit in the tier if the charge model is `tiered` /`volume` pricing.
  - `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 `line_items.pricing_model` is `tiered` , `volume` or `stairstep` and [multi-decimal pricing](/docs/api/currencies) 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 `line_items.pricing_model` is `tiered` , `volume` or stairstep and [multi-decimal pricing](/docs/api/currencies) is enabled.
  - `quantity_used_in_decimal` (optional, string, max chars=33)
    The decimal representation of the quantity purchased from this tier. Returned when the `line_item` is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.
  - `unit_amount_in_decimal` (optional, string, max chars=40)
    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 `line_item`. The value is in major units of the currency. Returned when the `line_item` is quantity-based and [multi-decimal pricing](/docs/api/currencies) is enabled.
  - `pricing_type` (optional, enumerated string)
    Pricing type for the tier.
    Possible enum values:
      - `per_unit`
        Indicates that the tier pricing is based on individual units. Customers are charged a fixed price per unit. For example, if the price per unit is $2 and the customer consumes 150 units, they will be charged $300 (150 × $2).
      - `flat_fee`
        Indicates that the tier pricing is a flat fee, applied to the entire tier regardless of the number of units consumed. For the **stairstep** pricing model, `pricing_type` will be set to `flat_fee` by default. For example, if the flat fee for a tier is $100, the customer pays $100 whether they consume 1 unit or the maximum number of units within that tier.
      - `package`
        Indicates that the tier pricing is based on a package of units. Customers are charged for each block or package of units. For example, if the package size is 100 units and the cost per block is $20 consuming 400 units will result in a charge of $80 (4 × $20).
  - `package_size` (optional, integer, min=1)
    Package size for the tier when pricing type is `package`. Specify the number of units that make up one package. For example, if 1000 API hits are grouped into a single package, set the package size to 1000.

