Line items in payables
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, the subtotal
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.
Add line items to a payable
To add line items to a payable, send a POST
request to the /payables/{payable_id}/line_items
endpoint:
The successful response contains information about the created line item:
List all line items of a payable
To list all line items of a specific payable, send a GET
request to the /payables/{payable_id}/line_items
endpoint:
You will get a list of all line items present in the informed payable:
Retrieve a line item
To retrieve information from a specific line item in a payable, send a GET
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 a PATCH
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 a PUT
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 a DELETE
request to the /payables/{payable_id}/line_items/{line_item_id}
endpoint: