# Quotes

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


A quote is an estimate of the invoice with the charges likely to occur when customers buy an item. A quote can be converted to a regular invoice once the customer accepts it.

The line items of a quote are grouped by charge events and are available as a separate [resource](/docs/api/quote_line_groups). This resource can be retrieved using the [List quote line groups](/docs/api/quotes/list-quote-line-groups) endpoint. Note that the first quote line group is available within the quote resource itself and parsing the quote line groups object is not required.

## Sample Quote

```json
{
  "amount_due": 500,
  "amount_paid": 0,
  "billing_address": {
    "first_name": "John",
    "last_name": "Doe",
    "object": "billing_address",
    "validation_status": "not_validated"
  },
  "charge_on_acceptance": 500,
  "credits_applied": 0,
  "currency_code": "USD",
  "customer_id": "__test__KyVnHhSBWTO25CR",
  "date": 1517501504,
  "id": "10",
  "line_item_discounts": {},
  "line_item_taxes": {},
  "line_items": [
    {
      "amount": 500,
      "customer_id": "__test__KyVnHhSBWTO25CR",
      "date_from": 1517501504,
      "date_to": 1517501504,
      "description": "Service Charge",
      "discount_amount": 0,
      "entity_type": "adhoc",
      "id": "__test__KyVnHhSBWTO5pCa",
      "is_taxed": false,
      "item_level_discount_amount": 0,
      "object": "line_item",
      "pricing_model": "flat_fee",
      "quantity": 1,
      "tax_amount": 0,
      "unit_amount": 500
    },
    {..}
  ],
  "object": "quote",
  "operation_type": "onetime_invoice",
  "price_type": "tax_exclusive",
  "resource_version": 1517501504000,
  "status": "open",
  "sub_total": 500,
  "taxes": {},
  "total": 500,
  "total_payable": 500,
  "updated_at": 1517501504,
  "valid_till": 1517596199,
  "version": 1
}
```

## Quotes attributes

## Input Parameters

- `id` (required, string, max chars=50)
  The quote number. Acts as a identifier for quote and typically generated sequentially.

- `name` (optional, string, max chars=100)
  The quote name will be used as the pdf name of the quote.

- `po_number` (optional, string, max chars=100)
  Purchase Order Number

- `customer_id` (required, string, max chars=50)
  The identifier of the customer this quote belongs to.

- `subscription_id` (optional, string, max chars=50)
  The identifier of the subscription this quote belongs to.

- `invoice_id` (optional, string, max chars=50)
  The identifier of the invoice generated while converting this quote.

- `status` (required, enumerated string)
  Current status of this quote.
  Possible enum values:
    - `open`
      Open
    - `accepted`
      Accepted.
    - `declined`
      Declined.
    - `invoiced`
      Invoiced
    - `closed`
      Closed
    - `pending_approval`
      Pending Approval
    - `approval_rejected`
      Approval Rejected
    - `proposed`
      Proposed.
    - `voided`
      Voided.
    - `expired`
      Expired

- `operation_type` (required, enumerated string)
  Operation Type
  Possible enum values:
    - `create_subscription_for_customer`
      create\_subscription\_for\_customer
    - `change_subscription`
      change\_subscription
    - `onetime_invoice`
      onetime\_invoice
    - `renew_subscription`
      renew\_subscription

- `vat_number` (optional, string, max chars=20)
  VAT/ Tax registration number of the customer. [Learn more](https://www.chargebee.com/docs/tax.html#capture-tax-registration-number)

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

- `valid_till` (required, timestamp(UTC) in seconds)
  Quote will be valid till this date. After this date quote will be marked as closed.

- `date` (required, timestamp(UTC) in seconds)
  Creation date of the quote. Typically this is the date on which quote is generated.

- `total_payable` (optional, in cents, min=0)
  Total contract value. Applicable when multi billing cycle quote is enabled.

- `charge_on_acceptance` (optional, in cents, default=0, min=0)
  Charge on acceptance. Applicable when multi billing cycle quote is enabled.

- `sub_total` (required, in cents, min=0)
  Subtotal (in cents) of the first quote line group.

- `total` (optional, in cents, default=0, min=0)
  Total (in cents) of the first quote line group.

- `credits_applied` (optional, in cents, default=0, min=0)
  Credits applied (in cents) for the first quote line group.

- `amount_paid` (optional, in cents, default=0, min=0)
  Existing outstanding payments (in cents) if any, applied to the first quote line group.

- `amount_due` (optional, in cents, default=0, min=0)
  Amount due (in cents) for the first quote line group.

- `version` (optional, integer, default=1)
  Version of the quote.

- `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 this quote was last updated.

- `vat_number_prefix` (optional, string, max chars=10)
  An overridden value for the first two characters of the [full VAT number](https://en.wikipedia.org/wiki/VAT_identification_number). Only applicable specifically for customers with `[billing_address](/docs/api/customers/customer-object#billing_address)`
  
  `country` as `XI` (which is **United Kingdom - Northern Ireland** ).
  
  When you have enabled [EU VAT](https://www.chargebee.com/docs/eu-vat.html) in 2021 or have [manually enabled](https://www.chargebee.com/docs/brexit.html#what-needs-to-be-done-in-chargebee) the Brexit configuration, you have the option of setting `[billing_address](/docs/api/customers/customer-object#billing_address)`
  
  `country` as `XI`. That's the code for **United Kingdom - Northern Ireland**. The first two characters of the VAT number in such a case is `XI` by default. However, if the VAT number was registered in UK, the value should be `GB`. Set `vat_number_prefix` to `GB` for such cases.

- `tax_category` (optional, string)
  Specifies the customer's category for the Goods and Services Tax (GST). This field is returned only if you've configured GST for the India region.

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

- `notes` (optional)
  List of notes associated with this quotes.

- `contract_term_start` (optional, timestamp(UTC) in seconds)
  Specifies the contract term's start date.

- `contract_term_end` (optional, timestamp(UTC) in seconds)
  Specifies the contract term's end date. It indicates when the action set in `action_at_term_end` gets triggered.

- `contract_term_termination_fee` (optional, in cents, min=0)
  Specifies the charge to be applied for terminating the contract term.

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

- `deleted` (required, boolean)
  Indicates that this resource has been deleted when the value is `true` .

- `total_contract_value` (optional, in cents, min=0)
  The total contract value of the quote.

- `total_discount` (optional, in cents, min=0)
  The total discount value of the quote for the contract period.

- `has_entitlements` (optional, boolean)

- `discounts` (optional, list of discount)
  The list of all deductions applied to the quote.
  - `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)` .
  - `entity_id` (optional, string, max chars=100)
    When the deduction is due to a `coupon` , then this is the `id` of the coupon.
  - `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 applicable for this quote.
  - `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.

- `shipping_address` (optional, shipping_address)
  Shipping address for the quote.
  - `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.

- `billing_address` (optional, billing_address)
  Billing address for the quote.
  - `first_name` (optional, string, max chars=150)
    The first name of the billing contact.
  - `last_name` (optional, string, max chars=150)
    The last name of the billing 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)
    State or Province
  - `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.

