compliant mode, you cannot edit an invoice’s line items after issuing it. In non_compliant mode, you can edit issued invoices, including their line items. See Invoice compliance for details.
Update invoice line items
To add, replace, or remove line items while updating other invoice fields, callPATCH /receivables/{receivable_id}. The response for every invoice line item includes a stable id; use that ID when replacing or removing an existing item.
The line_items object can contain add, replace, and remove operations in the same request. Each item in add and replace[].data uses the complete line item shape accepted by the replace line items endpoint. A replace operation keeps the existing line item’s ID.
replace and remove. The final invoice must contain at least one line item. Tesouro recalculates the totals from the resulting list and records the header and line-item changes in one history entry.
Replace all invoice line items
To replace the entire list in a separate request, send aPUT request to the /receivables/{receivable_id}/line-items endpoint. In the request body, use the data field to specify the invoice’s new line items. This endpoint is unchanged.