Update draft Xero invoice
xero_update_draft_invoiceUpdate a draft invoice using an expected revision to prevent stale writes. Patch individual line items while preserving omitted fields and existing discounts.
Instructions
Update only a DRAFT invoice using expectedRevision from xero_get_invoice. Prefer lineItemPatches for narrow edits: omitted fields and other lines are preserved. lineItems intentionally replaces the complete line set; existing IDs preserve omitted discounts. Returns actual before/after changes and totals. Rejects stale revisions before writing; external edits during the request cannot be locked.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"invoiceId": "<invoiceId>",
"expectedRevision": "<expectedRevision>"
},
"name": "xero_update_draft_invoice"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dueDate | No | Replacement due date as YYYY-MM-DD | |
| invoiceId | Yes | Xero InvoiceID | |
| lineItems | No | ||
| reference | No | ||
| invoiceDate | No | Replacement invoice date as YYYY-MM-DD | |
| lineItemPatches | No | ||
| expectedRevision | Yes | Revision returned by xero_get_invoice; stale reads are rejected |