Issue invoice
Issue a domestic invoice for a contractor with one or more lines.
MCP tool ifirma_write → issue_invoice
write Confirm
Issues the invoice with the next number in the series, the same as "Wystaw". Lines need name, quantity, unit, unit price and VAT rate; a line that is not exempt may also need a PKWiU code. The invoice is not sent to KSeF or to the buyer until you call send_invoice_to_ksef or send_invoice_email. By default you confirm each call; you can switch that off for this tool.
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. |
| sale_date string | string | YYYY-MM-DD. Default: issue date. |
| due_date string | string | YYYY-MM-DD. |
| payment_method string | string | transfer, cash or card. |
| notes string | string | Remarks printed on the invoice, up to 1000 characters. |
tools/call
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "ifirma_write",
"arguments": {
"operation": "issue_invoice",
"arguments": {
"contractor_id": "c_4817",
"calculate_from": "net",
"issue_date": "2026-10-14",
"sale_date": "2026-10-14",
"due_date": "2026-10-28",
"payment_method": "transfer",
"lines": [
{
"name": "Website retainer",
"quantity": 2,
"unit": "month",
"unit_price": 500,
"vat_rate": 23
}
]
}
}
}
} Example response
{
"content": [
{
"type": "text",
"text": "{ ... same JSON as structuredContent ... }"
}
],
"structuredContent": {
"id": 7020118,
"number": "41/2026",
"draft": false,
"buyer": "Blue Fern Studio",
"net": 1000,
"vat": 230,
"gross": 1230,
"currency": "PLN",
"issue_date": "2026-10-14",
"due_date": "2026-10-28",
"ksef_status": null
},
"isError": false
}