Overview
Line item refers to any service or product added to a payable, along with their descriptions, quantities, rates, and prices. Every payable contains descriptions of all items purchased. By default, thesubtotal and total fields of line items are automatically calculated based on the unit_price, quantity, and tax fields, therefore, are read-only and appear only in the response schema.
When an item is processed via OCR, the line items quantity and unit price may be extracted in a way that leads to rounding discrepancies. In this case, the API may adjust its quantity and unit price to prevent rounding issues and ensure accurate calculations while keeping the total price unchanged, ensuring they align with the invoice. When it happens, the line item field
ocr_set_quantity_to_one is set to true.Example of an adjustment:Before: Quantity: 2000, Price: $10, Unit Price: $0.005 (rounded to $0.01 due to minor units)
After: Quantity: 1, Price: $10, Unit Price: $10Add line items to a payable
To add line items to a payable, send aPOST request to the /payables/{payable_id}/line-items endpoint:
List all line items of a payable
To list all line items of a specific payable, send aGET request to the /payables/{payable_id}/line-items endpoint:
Retrieve a line item
To retrieve information from a specific line item in a payable, send aGET request to the /payables/{payable_id}/line-items/{line_item_id} endpoint:
Update a specific line item
To update some information about a specific line item in a payable, send aPATCH request to the /payables/{payable_id}/line-items/{line_item_id} endpoint:
Replace all line items
You can also replace all line items of a specific payable at once by sending aPUT request to the /payables/{payable_id}/line-items endpoint:
This action removes all existing line items of a payable and recreates them with the new data. As
a result, all line items get new
id values.Remove a line item
To remove the line item from the payable, send aDELETE request to the /payables/{payable_id}/line-items/{line_item_id} endpoint: