Create invoice
Create a draft invoice for a customer with its lines.
MCP tool bokio_write → create_invoice
write
Creates an invoice as a draft with status draft and no invoice number, and returns net, VAT and total so you can check them. Bokio has no discount per line: add a line with a negative unit price instead. A draft reaches no one and can be deleted in Bokio, so create_invoice runs without asking first; publishing is a separate tool.
Parameters
| Name | Type | Description |
|---|---|---|
| customer_id string required | string | Customer ID from list_customers or create_customer. |
| currency string | string | Currency code such as SEK. Default: SEK. |
| invoice_date string required | string | YYYY-MM-DD. |
| due_date string required | string | YYYY-MM-DD. |
| lines array required | array | Objects with description, quantity, unit_price and tax_rate (percent). |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "bokio_write",
"arguments": {
"operation": "create_invoice",
"arguments": {
"customer_id": "c7a1e5d2-3b94-4f60-9a1d-5e2f0b8c6d11",
"currency": "SEK",
"invoice_date": "2026-10-14",
"due_date": "2026-11-13",
"lines": [
{
"description": "Website audit",
"quantity": 8,
"unit_price": 1200,
"tax_rate": 25
},
{
"description": "Hosting setup",
"quantity": 1,
"unit_price": 900,
"tax_rate": 25
}
]
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"invoice_id": "f2d84b1a-6c30-4e97-8a5b-1d9c7e3a40b2",
"status": "draft",
"invoice_number": null,
"customer": "Nordlys Design AB",
"currency": "SEK",
"invoice_date": "2026-10-14",
"due_date": "2026-11-13",
"total_amount": 13125,
"total_tax": 2625
},
"isError": false
}