InvoiceLineItems
Captures line-level details of customer invoices, including products or services sold, quantities, prices, discounts, and taxes, forming the granular data behind each invoice.
Table Specific Information
Invoices may be inserted, queried, or updated via the Invoices or InvoiceLineItems tables. Invoices may be deleted by using the Invoices table.
Select
All filterable columns support the following operators:
- =
- !=
- >=
- <=
- >
- <
- IN
- LIKE
- CONTAINS
The driver processes other filters client-side within the driver.
Insert
To add an Invoice, specify a Customer and at least one Line Item. For example, the following will insert a new Invoice with two Line Items:
INSERT INTO InvoiceLineItems#TEMP (CustomerRef, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount) VALUES ('4', 'SalesItemLineDetail', '2', 0.01)
INSERT INTO InvoiceLineItems#TEMP (CustomerRef, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount) VALUES ('4', 'SalesItemLineDetail', '3', 0.02)
INSERT INTO InvoiceLineItems (CustomerRef, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount) SELECT CustomerRef, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount FROM InvoiceLineItems#TEMP
To add lines to an existing Invoice, You'll need to specify the InvoiceId in the WHERE clause for the INSERT command. For example:
INSERT INTO InvoiceLineItems#TEMP (InvoiceId, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount) VALUES ('1234', 'SalesItemLineDetail', '2', 0.01)
INSERT INTO InvoiceLineItems#TEMP (InvoiceId, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount) VALUES ('1234', 'SalesItemLineDetail', '3', 0.02)
INSERT INTO InvoiceLineItems (InvoiceId, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount) SELECT InvoiceId, Line_DetailType, Line_SalesItemLineDetail_ItemRef, Line_Amount FROM InvoiceLineItems#TEMP
Update
To update an existing Line Item, you'll need to specify the LineId. You can only update Line Items which have a Detail Type of SalesItemLineDetail.
UPDATE InvoiceLineItems SET Line_SalesItemLineDetail_Qty = 20 WHERE LineId = '5656'
Delete
To delete existing Line Items, you'll need to set the LineId and InvoiceId:
DELETE FROM InvoiceLineItems WHERE LineId = '5656' AND InvoiceId = '1'
Columns
| Name | Type | ReadOnly | References | Filterable | Sortable | Description |
| LineId [KEY] | String | True | False | False |
Specifies the unique identifier (Id) of the invoice line item. This value distinguishes each line item on the invoice for reference or updates. | |
| InvoiceId [KEY] | String | False |
Invoices.Id | True | True |
Specifies the unique Id of the invoice that the line item belongs to. This links each line item back to its parent invoice. |
| SyncToken | String | True | False | False |
Specifies the version number that is used to lock the invoice line item for use by one application at a time. When an application modifies an object, its sync token is incremented. Attempts to modify an object with an older sync token fail, ensuring that only the latest version is maintained by QuickBooks Online. | |
| MetaData_CreateTime | Datetime | True | True | True |
Specifies the date and time when the invoice line-item record was created. | |
| MetaData_LastUpdatedTime | Datetime | True | True | True |
Specifies the date and time when the invoice line-item record was last updated. | |
| CustomFieldAggregate | String | False | False | False |
Specifies an XML aggregate of custom field information for the invoice line item. This field groups all user-defined or application-defined custom fields that are associated with the line item into a single XML payload so that you can retrieve, parse, and process the custom data programmatically. | |
| DocNumber | String | False | True | True |
Specifies the reference number for the transaction that is associated with this line item. | |
| TxnDate | Date | False | True | True |
Specifies the date entered by the user when the transaction occurred. This parameter defines when the invoice line item was recorded. | |
| PrivateNote | String | False | False | False |
Specifies a private note for the transaction. This note does not appear on the transaction records and is intended for internal use. | |
| LinkedTxnAggregate | String | False | False | False |
Specifies an XML aggregate of transactions linked to the invoice. This field allows you to see related transactions that are associated with the invoice line item. | |
| Line_Id | String | False | False | False |
Specifies the unique Id of the line item within the invoice. | |
| Line_LineNum | String | False | False | False |
Specifies the line number of the line item within the invoice. This number indicates the position of the line item. | |
| Line_Description | String | False | False | False |
Specifies the description of the line item. This text appears on the invoice and in printed or emailed forms. | |
| Line_Amount | Decimal | False | False | False |
Specifies the amount of the line item. This amount includes the charges or allowances but excludes applicable taxes unless otherwise stated. | |
| Line_DetailType | String | False | False | False |
Specifies the detail type of the line item. Different detail types indicate different kinds of line items, such as products, services, or discounts. | |
| Line_SalesItemLineDetail_ItemRef | String | False |
Items.Id | False | False |
Specifies the unique Id of the item used in the line item. This Id links the line item to a product or service record. |
| Line_SalesItemLineDetail_ItemRef_Name | String | True |
Items.Name | False | False |
Specifies the name of the item that is used in the line item. This name identifies the product or service for the customer. |
| Line_SalesItemLineDetail_ClassRef | String | False |
Class.Id | False | False |
Specifies the unique Id of the class that is used in the line item. This Id links the line item to a class category in QuickBooks Online. |
| Line_SalesItemLineDetail_ClassRef_Name | String | True |
Class.FullyQualifiedName | False | False |
Specifies the name of the class that is used in the line item. This name helps classify and group transactions for reporting. |
| Line_SalesItemLineDetail_UnitPrice | Decimal | False | False | False |
Specifies the unit price of the item that is used in the line item. This value is the price per single unit of product or service. | |
| Line_SalesItemLineDetail_Qty | Double | False | False | False |
Specifies the number of items for the line item. This quantity multiplies with the unit price to compute the total amount. | |
| Line_SalesItemLineDetail_TaxCodeRef | String | False |
TaxCodes.Id | False | False |
Specifies the tax code for the item that is used in the line item. This code determines how taxes are applied. |
| Line_SalesItemLineDetail_DiscountAmt | Decimal | False | False | False |
Specifies the discount amount that is applied to an individual line item. If both the discount amount and the discount rate are supplied, the discount rate takes precedence and the discount amount is recalculated by QuickBooks Online based on the discount rate. | |
| Line_SalesItemLineDetail_ServiceDate | Date | False | False | False |
Specifies the service date for the item in the line item. This date indicates when the product or service was provided. | |
| Line_GroupLineDetail_GroupItemRef | String | True | False | False |
Specifies the unique Id of the group item object. This Id links the line item to a group of products or services. | |
| Line_GroupLineDetail_GroupItemRef_Name | String | True | False | False |
Specifies the name of the group item object. This name identifies the group of products or services on the invoice. | |
| Line_GroupLineDetail_Quantity | Integer | True | False | False |
Specifies the quantity of the group item in the line item. | |
| Line_DiscountLineDetail_ClassRef | String | False |
Class.Id | False | False |
Specifies the unique Id of the class that is used in the discount line item. This Id links the discount to a class category. |
| Line_DiscountLineDetail_ClassRef_Name | String | True |
Class.FullyQualifiedName | False | False |
Specifies the name of the class that is used in the discount line item. |
| Line_DiscountLineDetail_TaxCodeRef | String | False |
TaxCodes.Id | False | False |
Specifies the tax code for the item that is used in the discount line item. This code determines how taxes are applied. |
| Line_DiscountLineDetail_TaxCodeRef_Name | String | True |
TaxCodes.Name | False | False |
Specifies the name of the tax sales code that is used in the discount line item. |
| Line_DiscountLineDetail_PercentBased | Boolean | False | False | False |
Indicates whether the discount in the line item is percentage-based. It is true if the discount is a percentage and null or false if the discount is based on a fixed amount. | |
| Line_DiscountLineDetail_DiscountAccountRef | String | False | False | False |
Specifies the discount code for the item that is used in the discount line item. | |
| Line_DiscountLineDetail_DiscountAccountRef_Name | String | True | False | False |
Specifies the name of the discount account that is used in the discount line item. | |
| Line_DiscountLineDetail_DiscountPercent | Decimal | False | False | False |
Specifies the percentage by which the amount due is reduced, from 0% to 100%. To enter a discount of 8.5%, use 8.5, not 0.085. | |
| TxnTaxDetail_TxnTaxCodeRef | String | False |
TaxCodes.Id | False | False |
Specifies the tax code for the transaction that is associated with the invoice line item. |
| TxnTaxDetail_TotalTax | String | False | False | False |
Specifies the total tax that is calculated for the transaction, excluding any tax lines that are manually inserted into the transaction line list. | |
| TxnTaxDetail_TaxLineAggregate | String | False | False | False |
Specifies an XML aggregate of tax line items that are associated with the invoice line item. This field allows you to retrieve all tax lines as one structured payload. | |
| CustomerRef | String | False |
Customers.Id | True | False |
Specifies the unique Id of the customer linked to the invoice. This value links the invoice to the customer record for reporting and tracking. |
| CustomerRef_Name | String | True |
Customers.DisplayName | False | False |
Specifies the name of the customer linked to the invoice. This name identifies the customer in user-facing reports and forms. |
| CustomerMemo | String | False | False | False |
Specifies a message to the customer that appears on the invoice and in the printed or emailed version. Use this field to communicate special notes or instructions. | |
| BillAddr_Id | String | False | False | False |
Specifies the unique Id of the billing address entity, mainly used for modifying the address. This field is assigned by the data service. | |
| BillAddr_Line1 | String | False | False | False |
Specifies the first line of the billing address. | |
| BillAddr_Line2 | String | False | False | False |
Specifies the second line of the billing address. | |
| BillAddr_Line3 | String | False | False | False |
Specifies the third line of the billing address. | |
| BillAddr_Line4 | String | False | False | False |
Specifies the fourth line of the billing address. | |
| BillAddr_Line5 | String | False | False | False |
Specifies the fifth line of the billing address. | |
| BillAddr_City | String | False | False | False |
Specifies the city name of the billing address. | |
| BillAddr_Country | String | False | False | False |
Specifies the country name of the billing address. | |
| BillAddr_CountrySubDivisionCode | String | False | False | False |
Specifies the region within a country in the billing address. For example, this value is the state name for the USA or the province name for Canada. | |
| BillAddr_PostalCode | String | False | False | False |
Specifies the postal code of the billing address. For example, this value is the ZIP code for the USA and the postal code for Canada. | |
| BillAddr_Lat | String | False | False | False |
Specifies the latitude coordinate of the geocoded billing address. | |
| BillAddr_Long | String | False | False | False |
Specifies the longitude coordinate of the geocoded billing address. | |
| ShipAddr_Id | String | False | False | False |
Specifies the unique Id of the shipping address entity, mainly used for modifying the address. This field is assigned by the data service. | |
| ShipAddr_Line1 | String | False | False | False |
Specifies the first line of the shipping address. | |
| ShipAddr_Line2 | String | False | False | False |
Specifies the second line of the shipping address. | |
| ShipAddr_Line3 | String | False | False | False |
Specifies the third line of the shipping address. | |
| ShipAddr_Line4 | String | False | False | False |
Specifies the fourth line of the shipping address. | |
| ShipAddr_Line5 | String | False | False | False |
Specifies the fifth line of the shipping address. | |
| ShipAddr_City | String | False | False | False |
Specifies the city name of the shipping address. | |
| ShipAddr_Country | String | False | False | False |
Specifies the country name of the shipping address. | |
| ShipAddr_CountrySubDivisionCode | String | False | False | False |
Specifies the region within a country in the shipping address. For example, this value is the state name for the USA or the province name for Canada. | |
| ShipAddr_PostalCode | String | False | False | False |
Specifies the postal code of the shipping address. For example, this value is the zip code for the USA and Canada. | |
| ShipAddr_Lat | String | False | False | False |
Specifies the latitude coordinate of the geocoded shipping address. | |
| ShipAddr_Long | String | False | False | False |
Specifies the longitude coordinate of the geocoded shipping address. | |
| ClassRef | String | False |
Class.Id | True | False |
Specifies the unique Id of the class that is associated with the transaction. This Id links the invoice to a class category in QuickBooks Online. |
| ClassRef_Name | String | True |
Class.FullyQualifiedName | False | False |
Specifies the name of the class that is associated with the transaction. |
| SalesTermRef | String | False |
Terms.Id | False | False |
Specifies the unique Id of the sales terms that are associated with the transaction. This Id links the invoice to the agreed payment terms. |
| SalesTermRef_Name | String | True |
Terms.Name | False | False |
Specifies the name of the sales terms that are associated with the transaction. |
| DueDate | Date | False | True | False |
Specifies the date when the invoice is due for payment, not including any early payment discount incentives or late payment penalties. If this date is not supplied, the current server date is used. | |
| ShipMethodRef | String | False | False | False |
Specifies the unique Id of the shipping method that is associated with the transaction. | |
| ShipMethodRef_Name | String | True | False | False |
Specifies the name of the shipping method that is associated with the transaction. | |
| ShipDate | Date | False | False | False |
Specifies the date for delivery of goods or services that are associated with the invoice. | |
| TrackingNum | String | False | False | False |
Specifies the tracking number from the shipping provider for the delivery of goods that are associated with the transaction. | |
| TotalAmt | Decimal | True | True | True |
Specifies the total amount of the transaction. This amount includes the total of all charges, allowances, and taxes. | |
| PrintStatus | String | False | False | False |
Specifies the print status of the invoice, indicating whether it has been printed. The allowed values are NotSet, NeedToPrint, PrintComplete. The default value is NotSet. | |
| EmailStatus | String | False | False | False |
Specifies the email status of the invoice, indicating whether it has been sent or is pending delivery. The allowed values are NotSet, NeedToSend, EmailSent. The default value is NotSet. | |
| BillEmail_Address | String | False | False | False |
Specifies the email address where the invoice is sent. If the value of the EmailStatus attribute is NeedToSend, this field becomes a required input. | |
| Balance | Decimal | True | True | True |
Specifies the remaining balance on the invoice after applying payments or credits. | |
| DepartmentRef | String | False |
Departments.Id | False | False |
Specifies the unique Id of the department where the transaction is stored as defined using location tracking in QuickBooks Online. |
| DepartmentRef_Name | String | True |
Departments.Name | False | False |
Specifies the name of the department where the transaction is stored as defined using location tracking in QuickBooks Online. |
| AllowOnlineCreditCardPayment | Boolean | False | False | False |
Indicates whether online credit-card payments are allowed for this invoice. This information corresponds to the Cards online-payment check box in the QuickBooks Online interface. | |
| ApplyTaxAfterDiscount | Boolean | False | False | False |
Specifies whether discounts are applied before tax is calculated. | |
| CurrencyRef | String | False | False | False |
Specifies the unique Id of the currency used in the transaction. | |
| CurrencyRef_Name | String | True | False | False |
Specifies the name of the currency used in the transaction. | |
| ExchangeRate | Decimal | False | False | False |
Specifies the currency exchange rate. This field is valid only if the company file is set up to use the multicurrency feature. In QuickBooks Online, exchange rates are always recorded as the number of home currency units it takes to equal one foreign currency unit. This field is available only for the UK, AU, and CA editions. | |
| GlobalTaxCalculation | String | False | False | False |
Specifies the method in which tax is applied. This field is valid in the UK, AU, and CA editions. The allowed values are TaxExcluded, TaxInclusive, NotApplicable. | |
| HomeTotalAmt | Decimal | True | False | False |
Specifies the total amount of the transaction in the home currency. This includes the total of all the charges, allowances, and taxes. This field is valid in the UK, AU, and CA editions. |