# Estimates

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


Estimates, as the name implies, can be used to find out the estimate for performing an operation as against performing the operation itself. i.e Say you want to create a new subscription or update an existing one, using the estimate API one can deduce the details like how much money the customer needs to be charged for this operation, when it should be collected, the state the subscription would be in etc. **Note:**

-   Invoking these APIs do not perform the actual operation but just generates an estimate.
-   Prorated Credits and [Promotional Credits](https://www.chargebee.com/docs/account-credits.html) are not taken into account while generating the estimate.

## Estimates attributes

## Input Parameters

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

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

- `subscription_id` (optional, string, max chars=100)
  Applicable only for subscription related estimates. The identifier of the subscription this estimate belongs to.

- `subscription_status` (optional, enumerated string)
  Applicable only for subscription related estimates. The post-operation 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.
    - `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.

- `term_ends_at` (optional, timestamp(UTC) in seconds)
  Applicable only for subscription related estimates. End of the current billing term

- `collect_now` (required, boolean)
  'true' means the estimate amount needs to be collected immediately, whereas 'false' means the estimate amount needs to be collected at the term-end

- `price_type` (required, enumerated string, default=tax_exclusive)
  The price type of the 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.

- `amount` (required, in cents, default=0, min=0)
  Total estimate amount in cents. The 'collect\_now' field indicates when this amount needs to be collected.

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

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

- `sub_total` (required, in cents, min=0)
  The sub-total amount

- `line_items` (optional, list of line_item)
  The list of items in this estimate
  - `date_from` (required, timestamp(UTC) in seconds)
    Start date of this line item.
  - `date_to` (required, timestamp(UTC) in seconds)
    End date of this line item.
  - `unit_amount` (required, in cents)
    Unit amount of the line item.
  - `quantity` (optional, integer, default=1)
    [Quantity of the recurring item](/docs/api/v2/pcv-1/invoices/invoice-object#line_items_quantity) which is represented by this line item.
  - `amount` (optional, in cents)
    Total amount of this line item. Typically equals to unit amount x quantity
  - `is_taxed` (required, boolean, default=false)
    Specifies whether this line item is taxed or not
  - `tax` (optional, in cents, default=0, min=0)
    The tax amount charged for this item
  - `tax_rate` (optional, double, min=0, max=100)
    Rate of tax used to calculate tax for this lineitem
  - `reference_line_item_id` (optional, string, max chars=40)
    Invoice Reference Line Item ID
  - `description` (required, string, max chars=250)
    Detailed description about this line item.
  - `type` (required, enumerated string)
    Type of this lineitem. This along with 'entity\_type' and 'entity\_id' attributes consitutes the meta information of this lineitem.
    Possible enum values:
      - `charge`
        Represents the 'charge' lineitems in invoice. The 'entity\_type' attribute further identifies the modelled entity (plan / addon etc) this charge is based on
      - `prorated_charge`
        Represents the 'charge' lineitems that are pro-rated. The 'entity\_type' attribute further identifies the modelled entity (plan / addon etc) this 'prorated charge' is based on
      - `setup_charge`
        Represents the 'setup charge' lineitem in invoice - which is a one-time charge included only in the first invoice of the subscription
  - `entity_type` (required, enumerated string)
    Specifies the modelled entity this line item is based on.
    Possible enum values:
      - `plan`
        Indicates that this lineitem is based on 'Plan' entity. The 'entity\_id' attribute specifies the [plan](/docs/api/v1/plans/plan-object) id
      - `addon`
        Indicates that this lineitem is based on 'Addon' entity. The 'entity\_id' attribute specifies the [addon](/docs/api/v1/addons/addon-object) id
      - `adhoc`
        Indicates that this lineitem is not modelled. i.e created adhoc. So the 'entity\_id' attribute will be null in this case
  - `entity_id` (optional, string, max chars=100)
    The identifier of the modelled entity this line item is based on. Will be null for 'adhoc' entity type

- `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.
  - `type` (required, enumerated string)
    Type of this Discount lineitem
    Possible enum values:
      - `coupon`
        Represents the coupon discount items in invoice. Further the 'entity\_id' attribute specifies the [coupon](/docs/api/coupons/coupon-object) id this discount is based on
      - `credit_adjustment`
        Represents the Prorated Credits items in invoice. The 'entity\_id' attribute will be null in this case
      - `account_credits`
        Represents the Promotional Credits item in invoice. The 'entity\_id' attribute will be null in this case
  - `entity_id` (optional, string, max chars=100)
    When the deduction is due to a `coupon` , then this is the `id` of the coupon.

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

