PurchaseLineItems
Captures the line-level details of purchase transactions, including vendor items, quantities, unit costs, and expense accounts for accurate expense and cost tracking.
Table Specific Information
Note: A Purchase object represents an expense, such as a purchase made from a vendor.
Purchases may be inserted, queried, or updated via the Purchases or PurchaseLineItems tables. Purchases may be deleted by using the Purchases 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 a Purchase, specify the AccountRef, PaymentType, and at least one Line Item. The following shows an example of inserting multiple Purchases, each with a single line. To insert a Purchase with multiple lines, see the example on the Purchases table.
INSERT INTO PurchaseLineItems#TEMP (AccountRef, PaymentType, Line_Amount, Line_DetailType, Line_AccountBasedExpenseLineDetail_AccountRef) VALUES ('41', 'Cash', 0.01, 'ItemBasedExpenseLineDetail', '8')
INSERT INTO PurchaseLineItems#TEMP (AccountRef, PaymentType, Line_Amount, Line_DetailType, Line_AccountBasedExpenseLineDetail_AccountRef) VALUES ('41', 'Cash', 0.02, 'ItemBasedExpenseLineDetail', '8')
INSERT INTO PurchaseLineItems (AccountRef, PaymentType, Line_Amount, Line_DetailType, Line_AccountBasedExpenseLineDetail_AccountRef) SELECT AccountRef, PaymentType, Line_Amount, Line_DetailType, Line_AccountBasedExpenseLineDetail_AccountRef FROM PurchaseLineItems#TEMP
Columns
| Name | Type | ReadOnly | References | Filterable | Sortable | Description |
| LineId [KEY] | String | True | False | False |
Specifies the unique identifier (Id) of the line item of the purchase transaction. | |
| PurchaseId [KEY] | String | False |
Purchases.Id | True | True |
Specifies the unique Id of the purchase transaction to which this line item belongs. |
| SyncToken | String | True | False | False |
Specifies the version number of the object that 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 fail. Only the latest version of the object is maintained by QuickBooks Online. | |
| MetaData_CreateTime | Datetime | True | True | True |
Specifies the date and time when the record was created. | |
| MetaData_LastUpdatedTime | Datetime | True | True | True |
Specifies the date and time when the record was last updated. | |
| DocNumber | String | False | True | True |
Specifies the reference number for the transaction. | |
| TxnDate | Date | False | True | True |
Specifies the date when this transaction occurred. | |
| PrivateNote | String | False | False | False |
Specifies a private note about the transaction that does not appear on the transaction records by default. This field maps to the Memo field on the Check and CreditCard form. | |
| Line_Id | String | False | False | False |
Specifies the unique Id of the line item. | |
| Line_Description | String | False | False | False |
Specifies the description of the line item that appears in the printed record. | |
| Line_Amount | Decimal | False | False | False |
Specifies the total amount of the charges or discounts for the given line. This field includes the charges and allowances but excludes the tax amount. | |
| Line_DetailType | String | False | False | False |
Specifies the type of line in the transaction. | |
| Line_ItemBasedExpenseLineDetail_ItemRef | String | False |
Items.Id | False | False |
Specifies the unique Id of the item in the line item. When a line item lacks an ItemRef it is treated as documentation and the Line_Amount field is ignored. |
| Line_ItemBasedExpenseLineDetail_ItemRef_Name | String | True |
Items.Name | False | False |
Specifies the name of the item. When a line item lacks an ItemRef it is treated as documentation and the Line_Amount field is ignored. |
| Line_ItemBasedExpenseLineDetail_ClassRef | String | False |
Class.Id | False | False |
Specifies the unique Id of the class for the line item. |
| Line_ItemBasedExpenseLineDetail_ClassRef_Name | String | True |
Class.Name | False | False |
Specifies the name of the class for the line item. |
| Line_ItemBasedExpenseLineDetail_UnitPrice | Decimal | False | False | False |
Specifies the unit price of the item as referenced by ItemRef. | |
| Line_ItemBasedExpenseLineDetail_Qty | Double | False | False | False |
Specifies the number of items for the line. | |
| Line_ItemBasedExpenseLineDetail_MarkupInfo_Value | Double | False | False | False |
Specifies the markup value applied to the line item. | |
| Line_ItemBasedExpenseLineDetail_MarkupInfo_Percent | Double | False | False | False |
Specifies the markup amount expressed as a percent of charges already entered in the current transaction. For example, to enter a rate of 10%, use 10.0, not 0.01. | |
| Line_ItemBasedExpenseLineDetail_MarkupInfo_PriceLevelRef | String | False | False | False |
Specifies the unique Id of the price level for the markup. | |
| Line_ItemBasedExpenseLineDetail_MarkupInfo_PriceLevelRef_Name | String | True | False | False |
Specifies the name of the price level for the markup. | |
| Line_ItemBasedExpenseLineDetail_TaxCodeRef | String | False |
TaxCodes.Id | False | False |
Specifies the sales tax code for this item. |
| Line_ItemBasedExpenseLineDetail_CustomerRef | String | False |
Customers.Id | False | False |
Specifies the unique Id of the customer that is associated with the expense. |
| Line_ItemBasedExpenseLineDetail_CustomerRef_Name | String | True |
Customers.DisplayName | False | False |
Specifies the name of the customer that is associated with the expense. |
| Line_ItemBasedExpenseLineDetail_BillableStatus | String | False | False | False |
Specifies the billable status of the expense line item. The allowed values are Billable, NotBillable, HasBeenBilled. | |
| Line_AccountBasedExpenseLineDetail_ClassRef | String | False |
Class.Id | False | False |
Specifies the unique Id of the class entity of the expense. |
| Line_AccountBasedExpenseLineDetail_ClassRef_Name | String | True |
Class.Name | False | False |
Specifies the name of the class entity of the expense. |
| Line_AccountBasedExpenseLineDetail_CustomerRef | String | False |
Customers.Id | False | False |
Specifies the unique Id of the customer that is associated with the expense. |
| Line_AccountBasedExpenseLineDetail_CustomerRef_Name | String | True |
Customers.DisplayName | False | False |
Specifies the name of the customer that is associated with the expense. |
| Line_AccountBasedExpenseLineDetail_AccountRef | String | False |
Accounts.Id | False | False |
Specifies the unique Id of the expense account that is associated with the expense. |
| Line_AccountBasedExpenseLineDetail_AccountRef_Name | String | True |
Accounts.Name | False | False |
Specifies the name of the expense account that is associated with the expense. Checks should reference a bank account and CreditCard should reference a credit card account. |
| Line_AccountBasedExpenseLineDetail_BillableStatus | String | False | False | False |
Specifies the billable status of the expense line item. The allowed values are Billable, NotBillable, HasBeenBilled. | |
| Line_AccountBasedExpenseLineDetail_MarkupInfo_Value | Double | False | False | False |
Specifies the markup value applied to the line item. | |
| Line_AccountBasedExpenseLineDetail_MarkupInfo_Percent | Double | False | False | False |
Specifies the markup amount expressed as a percent of charges already entered in the current transaction. To enter a rate of 10% use 10.0, not 0.01. | |
| Line_AccountBasedExpenseLineDetail_MarkupInfo_PriceLevelRef | String | False | False | False |
Specifies the unique Id of the price level for the markup. | |
| Line_AccountBasedExpenseLineDetail_MarkupInfo_PriceLevelRef_Name | String | True | False | False |
Specifies the name of the price level for the markup. | |
| Line_AccountBasedExpenseLineDetail_TaxCodeRef | String | False |
TaxCodes.Id | False | False |
Specifies the tax code for the account-based expense line detail. |
| AccountRef | String | False |
Accounts.Id | False | False |
Specifies the unique Id of the account that is associated with the transaction. |
| AccountRef_Name | String | True |
Accounts.Name | False | False |
Specifies the name of the account that is associated with the transaction. Checks should reference a bank account and CreditCard should reference a credit card account. |
| PaymentType | String | False | True | True |
Specifies the expense type for the line item. The allowed values are Cash, Check, CreditCard. | |
| EntityRef | String | False | False | False |
Specifies the unique Id of the party with whom an expense is associated. | |
| EntityRef_Name | String | True | False | False |
Specifies the name of the party with whom an expense is associated. | |
| Credit | Boolean | False | False | False |
Specifies whether the transaction is a credit. This field is valid only for the CreditCard payment type. | |
| TotalAmt | Decimal | True | True | True |
Specifies the total amount due as determined by the sum of the line items. This includes all charges, allowances, taxes, discounts, and other applicable amounts. | |
| PrintStatus | String | False | False | False |
Specifies the print status of the payment. This field is applicable only for checks and is ignored for credit card charges or refunds. | |
| DepartmentRef | String | False |
Departments.Id | False | False |
Specifies the unique Id of the department that is used to store the location of the transaction. |
| DepartmentRef_Name | String | True |
Departments.Name | False | False |
Specifies the name of the department that is used to store the location of the transaction. |
| TxnTaxDetail_TxnTaxCodeRef | String | False |
TaxCodes.Id | False | False |
Specifies the transaction tax code that is applied to the entire purchase. |
| TxnTaxDetail_TotalTax | String | False | False | False |
Specifies the total tax calculated for the transaction, excluding any tax lines manually inserted into the transaction line list. | |
| TxnTaxDetail_TaxLineAggregate | String | False | False | False |
Specifies an XML aggregate of all tax line items that are applied to the transaction. | |
| CurrencyRef | String | False | False | False |
Specifies the unique Id of the currency that is used in the transaction. | |
| CurrencyRef_Name | String | True | False | False |
Specifies the name of the currency that is used in the transaction. | |
| ExchangeRate | Double | 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, exchange rates are always recorded as the number of home currency units it takes to equal one foreign currency unit. This field is available 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. |