update_voucher
Modify an existing bookkeeping voucher using its current version to prevent overwriting concurrent edits; replace line items, totals, dates, or contact details.
Instructions
Change a bookkeeping voucher that is already recorded.
Writes real accounting data. Read it with get_voucher first: it
shows what is there and carries the version this needs. Two API
calls. Passing items replaces every line rather than adding one.
An unchecked voucher takes new data and stays unchecked until
finalize books it, which needs its number, date, contact and lines.
If the voucher changed since that read, nothing is written. One that is already paid or booked may be refused whatever the version.
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": {
"voucher_id": "<voucher_id>",
"version": "<version>"
},
"name": "update_voucher"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | No | Replaces every line on the voucher. The totals are recomputed to match unless you state them. | |
| remark | No | New note. | |
| confirm | No | Required only for finalize. Ignored otherwise. | |
| version | Yes | The `version` from the record as you last read it. If the record has changed since, the update is refused instead of overwriting that change. | |
| due_date | No | New due date, as YYYY-MM-DD. | |
| finalize | No | Book an unchecked voucher, such as one upload_file made, by moving it to open. Only when the user asked for that. Needs confirm. | |
| contact_id | No | Move it to a different contact, by id. | |
| voucher_id | Yes | The voucher's Lexware id, as returned by search_vouchers. Not the voucher number a human reads off the document. | |
| voucher_date | No | New document date, as YYYY-MM-DD. | |
| voucher_number | No | New document number. | |
| total_tax_amount | No | New total tax. | |
| total_gross_amount | No | New total including tax. | |
| use_collective_contact | No | True moves it to the collective contact instead of a named one. Not together with contact_id. To leave the collective contact, pass contact_id instead. |