invoice_item_update
Edits a line item's description, quantity, unit, price or discount, or re-parents it to another invoice. expected_updated_at is required: the line's updated_at from your read; without it nothing is written and the refusal names the current value; a line changed since then answers CONFLICT. Bounds: unit_price_cents is integer CENTS, 0 or more; quantity 0.001 to 1,000,000 (3 decimals); discount_bps 0 to 10000; quantity × unit_price_cents at most 10,000,000,000. unit "" clears the unit. Refuses when the current or target invoice is paid or cancelled. tax_code is the line's code under the document's tax_scheme, refused on a document without a scheme. 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 | How many, up to 3 decimals (1.5 hours → 1.5). A new line defaults to 1. | |
| tax_code | No | ||
| invoice_id | No | ||
| description | No | ||
| discount_bps | No | Optional line discount in basis points: 10% → 1000, none → 0. A discount is never a lower or negative price. | |
| 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. |