Save invoice draft
Save an invoice as a draft without a number, to review and issue in the app.
MCP tool ifirma_write → save_invoice_draft
write
Does what "Zapisz szkic" does: saves the invoice without a number, and it shows in the invoice list. A draft reaches no one and can be edited or deleted in the app, so save_invoice_draft runs without asking first. It takes the same parameters as issue_invoice.
Parameters
| Name | Type | Description |
|---|---|---|
| contractor_id string required | string | Contractor ID from list_contractors or create_contractor. |
| lines array required | array | Lines: {name, quantity, unit, unit_price, vat_rate}. vat_rate is 23, 8, 5, 0 or exempt. |
| calculate_from string | string | net or gross: which price you give. Default: net. |
| issue_date string | string | YYYY-MM-DD. Default: today. |
| due_date string | string | YYYY-MM-DD. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ifirma_write",
"arguments": {
"operation": "save_invoice_draft",
"arguments": {
"contractor_id": "contractor_8c41d2",
"lines": "lines"
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"id": 7020119,
"number": null,
"draft": true,
"buyer": "Blue Fern Studio",
"gross": 1230,
"currency": "PLN"
},
"isError": false
}