Update draft invoice
update_invoiceEdit an existing DRAFT invoice (borrador): items, prices, customer, dates, tax/retention rates or notes. Only DRAFT invoices can be edited, a finalized invoice is immutable, use rectify_invoice instead. Only the fields you pass are changed, EXCEPT items: passing items REPLACES the full line-item list (pass all lines you want to keep, not just the changed one). Returns the updated draft's id and new total.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | Replaces ALL line items when provided. | |
| notes | No | ||
| due_date | No | YYYY-MM-DD | |
| tax_rate | No | ||
| invoice_id | Yes | ||
| issue_date | No | YYYY-MM-DD | |
| referencia | No | Short human reference shown on the PDF and searchable in the invoice list. Pass an empty string to clear it. | |
| customer_id | No | ||
| numero_pedido | No | Purchase order / commitment number of a public customer (Facturae ReceiverTransactionReference). Can still be set on a FINALIZED invoice as long as it was not submitted to FACe. Empty string clears it. | |
| product_group | No | Product group from get_product_groups. Pass an empty string to clear it. | |
| retention_rate | No |