Create a customer invoice
Create an invoice for a customer, as a draft by default.
MCP tool pennylane_write → create_customer_invoice
Creates an invoice with one or more lines and returns its invoice_id and amounts. Draft defaults to true and keeps the invoice editable; with draft set to false Pennylane finalizes it at once and it can no longer be edited. Amounts are strings, and the call fails when the totals do not add up or the VAT rate is not one Pennylane accepts. Without a ledger account on a line, Pennylane applies the company's default mapping. Set external_reference so a repeated run finds the invoice instead of creating it twice. A draft reaches nobody; a final invoice is a legal document. By default you confirm each call; you can switch that off for this tool.
Parameters
| Name | Type | Description |
|---|---|---|
| customer_id integer required | integer | Customer ID from list_customers or create_customer. |
| date date required | date | Invoice date. |
| deadline date required | date | Payment due date. |
| lines array required | array | Invoice lines. Each has label, quantity, unit, unit_price as a string and vat_rate in percent. |
| draft boolean | boolean | true keeps the invoice a draft, false finalizes it. Default: true. |
| external_reference string | string | Your own reference, e.g. 2026-10-atelier-lumen. Use it to avoid duplicates. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "pennylane_write",
"arguments": {
"operation": "create_customer_invoice",
"arguments": {
"customer_id": 4034,
"date": "2026-10-31",
"deadline": "2026-11-30",
"draft": true,
"external_reference": "2026-10-studio-marais",
"lines": [
{
"label": "Workshop day, October",
"quantity": 8,
"unit": "hour",
"unit_price": "120.00",
"vat_rate": 20
}
]
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"invoice_id": 118390,
"customer": {
"customer_id": 4021,
"name": "Atelier Lumen SARL"
},
"status": "draft",
"draft": true,
"date": "2026-10-31",
"deadline": "2026-11-30",
"external_reference": "2026-10-atelier-lumen",
"amount_before_tax": "1140.00",
"tax": "228.00",
"amount": "1368.00",
"currency": "EUR"
},
"isError": false
}