InvoiceLineItems
Create, update, delete, and query QuickBooks Invoice Line Items.
Invoices may be inserted, queried, or updated via the Invoices or InvoiceLineItems tables. Invoices may be deleted by using the Invoices table.
All filterable columns support the following operators:
- =
- !=
- >=
- <=
- >
- <
- IN
- LIKE
- CONTAINS
The driver processes other filters client-side within the driver.
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 |
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' |
To delete existing Line Items, you'll need to set the LineId and InvoiceId:\
DELETE From InvoiceLineItems WHERE LineId='5656' AND InvoiceId='1' |
Name | Type | ReadOnly | References | Filterable | Sortable | Description |
LineId [KEY] | String | False | | false | false | The Id of the line item of the invoice. |
InvoiceId [KEY] | String | False | true | true | The Id of the invoice. | |
SyncToken | String | True | | false | false | Version number of the object. It is used to lock an object for use by one app at a time. As soon as an application modifies an object, its SyncToken is incremented. Attempts to modify an object specifying an older SyncToken fails. Only the latest version of the object is maintained by QuickBooks Online. |
MetaData_CreateTime | Datetime | True | | true | true | The time the record was created. |
MetaData_LastUpdatedTime | Datetime | True | | true | true | The time the record was last updated. |
CustomFieldAggregate | String | False | | false | false | Am XML aggregate of custom field information. |
DocNumber | String | False | | true | true | The reference number for the transaction. |
TxnDate | Date | False | | true | true | The date entered by the user when this transaction occurred. |
PrivateNote | String | False | | false | false | A private note for the transaction, which does not appear on the transaction records. |
TxnStatus | String | False | | false | false | The status of the transaction. The allowed values are Accepted, Closed, Pending, Rejected. |
LinkedTxnAggregate | String | False | | false | false | An XML aggregate of transactions linked to the estimate. |
Line_Id | String | False | | false | false | The Id of the line item. |
Line_LineNum | String | False | | false | false | The line number of the line item. |
Line_Description | String | False | | false | false | The description of the line item. |
Line_Amount | Decimal | False | | false | false | The amount of the line item. |
Line_DetailType | String | False | | false | false | The detail type of the line item. Different detail types indicate different types of line items. |
Line_SalesItemLineDetail_ItemRef | String | False | false | false | The Id of the item in the line item. | |
Line_SalesItemLineDetail_ItemRef_Name | String | True | false | false | The name of the item in the line item. | |
Line_SalesItemLineDetail_ClassRef | String | False | false | false | The Id of the class in the line item. | |
Line_SalesItemLineDetail_ClassRef_Name | String | True | false | false | The name of the class in the line item. | |
Line_SalesItemLineDetail_UnitPrice | Decimal | False |