Skip to main content

Line Items

A Line Item represents an estimated expenditure. In Agave, Line Items are always associated with a financial objects, including Accounts Receivable (AR) Payments, Bills, Change Events, Change Orders, Invoices, Purchase Orders, and Subcontracts. Each Line Item has own Agave-generated UUID.

Note, Line Items are different from Items. An Item is a thing that a company buys, sells, or re-sells (e.g. products, services). A Line Item can reference an Item, but not always. For example, AR Payments have Line Items, but they reference documents (e.g. Invoices), not Items.

Creating Line Items

The following is an example request that creates an Invoice with a Line Item. Note, most Source Systems (e.g. QuickBooks Online) require a Line Item when creating a financial object:

curl --request POST https://api.agaveapi.com/invoices \
--header 'API-Version: 2021-11-21' \
--header 'Client-Id: your_client_id' \
--header 'Client-Secret: your_client_secret' \
--header 'Account-Token: account_token' \
--header 'Content-Type: application/json' \
--data-raw '{
"customer_id": "c840285e-e65f-4342-943f-5950ef8072dc",
"line_items": [
{
"amount": 100,
"description": "New Line Item",
"item_id": "b840285e-e65f-4342-943f-5950ef8072dc",
"quantity": 2,
"type": "SalesItemLineDetail",
"unit_price": 50
}
]
}'

Updating Line Items

To update an existing Line Item, you need to include the Agave UUID from the create request. To add a new Line Item, you need to add another Line Item object without an Agave UUID. Here is an example using the update Invoice request:

curl --request PUT https://api.agaveapi.com/invoices/{id} \
--header 'API-Version: 2021-11-21' \
--header 'Client-Id: your_client_id' \
--header 'Client-Secret: your_client_secret' \
--header 'Account-Token: account_token' \
--header 'Content-Type: application/json' \

--data-raw '{
"line_items": [
{
"id": "a840285e-e65f-4342-943f-5950ef8072dc",
"amount": 100,
"description": "Update Existing Line Item",
"item_id": "b840285e-e65f-4342-943f-5950ef8072dc",
"quantity": 2,
"type": "SalesItemLineDetail",
"unit_price": 50
},
{
"amount": 50,
"description": "New Line Item",
"item_id": "b840285e-e65f-4342-943f-5950ef8072dc",
"quantity": 1,
"type": "SalesItemLineDetail",
"unit_price": 50
}
]
}'