invoice_item_delete
Soft-deletes a line item — it leaves the invoice and its derived total immediately, but the row is retired for audit history, never removed. expected_updated_at is required: the line's updated_at from your read (invoice_item_read); without it the removal is refused and the refusal names the current value. Refuses when the parent invoice is 'paid' (ledger-locked: retire the payment first) or 'cancelled' (terminal: its lines stay as issued), and with CONFLICT when the line changed since that read (read it again). If retiring the line settles the remaining balance on a partially-paid invoice, the parent re-derives to 'paid' by itself. NEXT: invoice_read to see the updated total.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | Yes | The invoice_item id (invoice_item_list shows them). | |
| unit | No | ||
| position | No | ||
| quantity | No | ||
| tax_code | No | ||
| invoice_id | No | ||
| description | No | ||
| discount_bps | No | ||
| unit_price_cents | No | ||
| expected_updated_at | Yes | Required: the line's updated_at from your last read (invoice_item_read, invoice_item_list or the create answer). Left out, the call is refused and names the current value; a line changed since then returns CONFLICT with the current value and stays as it is. |