Create invoice draft
create_invoice_draftCreates an invoice draft or an open proforma for a customer of a company, optionally with item lines. An invoice draft gets no number and nothing is issued or sent; a proforma is numbered at once. The seller data and the default bank account of the company are copied to the document. Item lines that can't be added are listed in item_errors with their index; the document is kept with the other lines.
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": {
"company_id": "<company_id>",
"customer_id": "<customer_id>"
},
"name": "create_invoice_draft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| vat | No | The default VAT rate of the document in percent, e.g. 22; new items get it. null: no rate. | |
| date | No | The date of the document, YYYY-MM-DD; today in the time zone of the company when not given. | |
| items | No | The item lines of the document, in this order. | |
| notes | No | The notes printed on the document; null clears them. | |
| due_date | No | The due date, YYYY-MM-DD, not before the date; null clears it. | |
| language | No | The language of the printed document; the language of the user when not given. | |
| proforma | No | true: an open proforma (numbered at once) instead of an invoice draft. | |
| vat_note | No | The VAT note printed on the document; null clears it. | |
| company_id | Yes | The id of the company, from list_companies. | |
| customer_id | Yes | The id of the customer of the company, from list_customers; its data is copied to the document. | |
| supply_date | No | The date of supply of the goods or services, YYYY-MM-DD; null clears it. | |
| valid_until | No | Proformas only: the last day the proforma is valid, YYYY-MM-DD; from the validity days of the company when not given. | |
| vat_category | No | The default VAT category of the document. | |
| payment_terms | No | The payment terms printed on the document; those of the customer when not given. | |
| buyer_reference | No | The buyer reference required by the customer on e-invoices (one line); that of the customer when not given. | |
| order_reference | No | The order (purchase order) reference of the customer (one line); null clears it. | |
| vat_exemption_reason | No | The VAT exemption reason for an exempt category; null clears it. |