create_invoice
Issue a Poland structured e-invoice (faktura ustrukturyzowana, schema FA(3)) through KSeF 2.0 — Krajowy System e-Faktur, the national government e-invoice API. Bring your own credentials via headers: x-ksef-token (a KSeF authorization token you self-mint in the Ministry of Finance taxpayer portal at ksef.podatki.gov.pl) and x-ksef-nip (your 10-digit seller NIP). Runs against the MoF TEST environment by default (no fiscal effect); set header x-ksef-mode: production to submit real invoices to KSeF (or demo for the demo environment). The server opens an encrypted online session, submits the FA(3) invoice, closes the session, and returns the assigned KSeF number. Amounts are in PLN; each line item carries a NET unit price and a Polish VAT rate (23, 8, 5, or 0) — the server computes per-rate net/VAT and the invoice gross total.
Parameters9
| seller_name | string | required | Seller legal name (your company). The seller NIP comes from the x-ksef-nip header. |
| buyer_nip | string | required | Buyer 10-digit Polish NIP (B2B). Validated with the official NIP checksum. |
| buyer_name | string | required | Buyer legal name (nazwa). |
| buyer_address | string | optional | Optional buyer address line (defaults to "Polska"). |
| seller_address | string | optional | Optional seller address line (defaults to "Polska"). |
| invoice_number | string | required | Your invoice number (numer faktury), e.g. FV/2026/07/001. |
| issue_date | string | optional | Issue date (data wystawienia) YYYY-MM-DD. Defaults to today (UTC). |
| currency | string | optional | ISO currency code. Default PLN. |
| items | array | required | Line items. Each: name, quantity, net_price (PLN, per unit, NET/excl. VAT), vat_rate (23, 8, 5, or 0). |
Raw schema
{
"type": "object",
"properties": {
"seller_name": {
"type": "string",
"description": "Seller legal name (your company). The seller NIP comes from the x-ksef-nip header."
},
"buyer_nip": {
"type": "string",
"description": "Buyer 10-digit Polish NIP (B2B). Validated with the official NIP checksum."
},
"buyer_name": {
"type": "string",
"description": "Buyer legal name (nazwa)."
},
"buyer_address": {
"type": "string",
"description": "Optional buyer address line (defaults to \"Polska\")."
},
"seller_address": {
"type": "string",
"description": "Optional seller address line (defaults to \"Polska\")."
},
"invoice_number": {
"type": "string",
"description": "Your invoice number (numer faktury), e.g. FV/2026/07/001."
},
"issue_date": {
"type": "string",
"description": "Issue date (data wystawienia) YYYY-MM-DD. Defaults to today (UTC)."
},
"currency": {
"type": "string",
"description": "ISO currency code. Default PLN."
},
"items": {
"type": "array",
"minItems": 1,
"description": "Line items. Each: name, quantity, net_price (PLN, per unit, NET/excl. VAT), vat_rate (23, 8, 5, or 0).",
"items": {
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Item name (P_7), max 256 chars."
},
"quantity": {
"type": "number",
"description": "Quantity (P_8B). Default 1."
},
"net_price": {
"type": "number",
"description": "NET unit price in PLN (P_9A), excludes VAT."
},
"vat_rate": {
"type": "number",
"enum": [
23,
8,
5,
0
],
"description": "Polish VAT rate percent: 23 standard, 8 reduced, 5 reduced, 0 zero-rated."
}
},
"required": [
"name",
"net_price",
"vat_rate"
]
}
}
},
"required": [
"seller_name",
"buyer_nip",
"buyer_name",
"invoice_number",
"items"
]
}