create_voucher
Records a bookkeeping voucher in Lexware Office with line items, tax details, and posting categories, booking it immediately to the account.
Instructions
Record a bookkeeping voucher in the account.
Writes real accounting data, and the API cannot take it back:
there is no way to delete a voucher here. Correcting one is a job for
the web app. Confirm the organization with get_profile first. One
API call, never retried.
Every line needs a posting category id, from get_master_data
with kind 'posting-categories'. Totals are added up from the lines
unless stated. It is booked immediately and no status can be asked
for. To record a receipt for review instead, use upload_file, which
files it as an unchecked purchase invoice.
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_type": "<voucher_type>",
"voucher_date": "<voucher_date>",
"tax_type": "<tax_type>",
"items": "<items>",
"voucher_number": "<voucher_number>"
},
"name": "create_voucher"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| items | Yes | The lines this voucher books. Every line names the posting category it belongs to. At least one is required. | |
| remark | No | A note kept with the voucher. | |
| due_date | No | When payment is due, as YYYY-MM-DD. | |
| tax_type | Yes | 'gross' means the line amounts include tax, 'net' means they do not, 'vatfree' means there is none. The API checks the lines against this and refuses a mismatch. | |
| contact_id | No | The customer or vendor this belongs to, by id from search_contacts. Leave unset to book against the collective contact instead of a named one. | |
| voucher_date | Yes | The date on the document, as YYYY-MM-DD. | |
| voucher_type | Yes | What is being booked: a sales invoice or credit note is money owed to the account, a purchase invoice or credit note is money the account owes. | |
| shipping_date | No | Delivery or service date, as YYYY-MM-DD. | |
| voucher_number | Yes | The number on the document being recorded, for example the supplier's invoice number. Required by the API for every voucher type. | |
| total_tax_amount | No | The total tax. Also added up from the lines if unset. | |
| total_gross_amount | No | The total including tax. Leave unset to have it added up from the lines, which is what the API expects it to equal. |