Quotes
Query quotes for a Xero organization
Table Specific Information
The Quotes table allows you to SELECT, INSERT, and UPDATE Quote lines for a Xero organization. The Id column is generated by the driver; it combines the index of the line item with the unique, Xero-generated QuoteId.
SELECT
The Xero API allows extensive filtering and ordering. You can define WHERE and ORDER BY clauses in a query to filter and order the results using any non-line-item column.
Note: The Xero API does not support filtering on line items or journal lines.
INSERT
To insert a single row, set the required fields. A new table object is created as a single entry. To insert a new Quote, the ContactId and Date fields are required in addition to at least one line item. A Quote line item must at minimum contain a description (LineItem_Description).
- You can insert a new Quote with multiple line items using an XML aggregate.
The elements supported here are the same as the LineItem columns without the "LineItem_" prefix. Please refer to the
Xero documentation of the Quotes API for more details.
INSERT INTO Quotes (ContactId, Date, LineItemAggregate) VALUES ( '883628bc-7f22-4234-8a4c-81571816a8a1', '2023-11-21', '<LineItem> <Description>Example Description</Description> </LineItem>' )
- You can also create multiple Quotes in a single query by using a bulk insert.
To do this, you should not include a QuoteId in your query, then specify the values for the first line item of each Quote to add.
INSERT INTO Quotes (ContactId, Date, LineItem_Description) VALUES ('883628bc-7f22-4234-8a4c-81571816a8a1', '2023-11-21', 'Example Description'), ('883628bc-7f22-4234-8a4c-81571816a8a1', '2023-11-21', 'Example Description')
- You can also insert new line items on an existing object by specifying the Xero-generated value of the existing record. For example, to add 2 new line items to an existing Quote:
INSERT INTO Quotes (QuoteId, LineItem_Description) VALUES ('fbb38812-dcc4-4e07-9ebd-2c38e1409b18', 'newItem1'), ('fbb38812-dcc4-4e07-9ebd-2c38e1409b18', 'newItem2')
Note: Inserting into existing records will count as two operations against the Xero API. One is required to retrieve the existing record, and another to update the record with new data.
UPDATE
You can update any field that is not read-only.
Note: UPDATE operations will count as two operations against the Xero API. One is required to retrieve the existing record, and another to update the record with new data.
Columns
Name | Type | ReadOnly | Description |
Id [KEY] | String | False |
The line item index combined with the Id of the Quote. |
QuoteId | String | False |
The Id of the Quote. This field is assigned by Xero. |
ContactId | String | False |
The Id of the contact. |
ContactName | String | False |
The name of the contact. |
Date | Date | False |
The date the quote was issued. |
ExpiryDate | Date | False |
The date the quote expires. |
Status | String | False |
The status of the quote. |
LineItem_LineItemId | String | False |
The Xero generated identifier for a line item. |
LineItem_Description | String | False |
The description of the line item. |
LineItem_Quantity | Double | False |
The quantity of the associated item in the line item. |
LineItem_UnitAmount | Decimal | False |
The unit amount of the associated item in the line item. |
LineItem_ItemCode | String | False |
The code that identifies the associated item. |
LineItem_AccountCode | String | False |
The account code. This must be active for the organisation. |
LineItem_TaxType | String | False |
The tax type. This field is used to override AccountCode, the default tax code for the selected account. |
LineItem_TaxAmount | Decimal | False |
The automatically calculated percentage of tax, based on the tax rate, for the line amount. |
LineItem_LineAmount | Decimal | False |
The total of the quantity multiplied by the unit amount with any discounts applied. |
LineItem_DiscountRate | Double | False |
The discount percentage being applied to the line item. |
LineItem_TrackingCategory1_CategoryId | String | False |
The Id of a tracking category. The API allows two optional tracking categories to be defined. |
LineItem_TrackingCategory1_CategoryName | String | False |
The name of a tracking category. The API allows two optional tracking categories to be defined. |
LineItem_TrackingCategory1_OptionId | String | False |
The Id of a tracking category. The API allows two optional tracking categories to be defined. |
LineItem_TrackingCategory1_OptionName | String | False |
The option of a tracking category. The API allows two optional tracking categories to be defined. |
LineItem_TrackingCategory2_CategoryId | String | False |
The Id of a tracking category. The API allows two optional tracking categories to be defined. |
LineItem_TrackingCategory2_CategoryName | String | False |
The name of a tracking category. The API allows two optional tracking categories to be defined. |
LineItem_TrackingCategory2_OptionId | String | False |
The Id of a tracking category. The API allows two optional tracking categories to be defined. |
LineItem_TrackingCategory2_OptionName | String | False |
The option of a tracking category. The API allows two optional tracking categories to be defined. |
QuoteNumber | String | False |
The unique, alphanumeric code identifying the quote. |
LineAmountTypes | String | False |
This field specifies whether line amounts include tax. The valid values are Exclusive, Inclusive, and NoTax. |
Reference | String | False |
An additional reference number for ACCREC-type invoices. |
CurrencyCode | String | False |
The ISO 4217 currency code. |
CurrencyRate | Decimal | False |
The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. |
SubTotal | Decimal | False |
The subtotal for the invoice, which excludes taxes. |
TotalTax | Decimal | False |
The total tax for the invoice. |
Total | Decimal | False |
The total for the invoice, including tax -- the sum of SubTotal and TotalTax. |
TotalDiscount | Decimal | False |
Total of discounts applied on the invoice line items. |
BrandingThemeId | String | False |
The Id of the branding theme. |
Terms | String | False |
The terms of the quote. |
UpdatedDateUTC | Datetime | False |
The date when the invoice was last updated. |
TenantId | String | False |
The ID of the tenant to query instead of the connection tenant |
LineItemAggregate | String | False |
Used to define Quote LineItem rows using XML values. Should be provided on INSERT only. |