KSeF Poland: Complete Guide to Poland's National e-Invoicing System

Poland's KSeF (Krajowy System e-Faktur — National e-Invoice System) is one of the most technically demanding e-invoicing mandates in Europe. Unlike Peppol-based systems where you send a structured invoice between two business endpoints, KSeF is a clearance model: every B2B invoice must pass through a government API, receive a unique KSeF number, and only then become a legally valid document. If you are a business with a Polish VAT registration — domestic or foreign — this affects you.


What Is KSeF?

KSeF is Poland's centralised national invoice system, operated by the Polish Ministry of Finance (Ministerstwo Finansów). Under the clearance model, an invoice does not legally exist until KSeF acknowledges it. The flow is:

  1. Supplier generates an invoice in the FA(3) XML format
  2. Supplier submits it to the KSeF API
  3. KSeF validates the structure, checks both parties' NIP (Polish tax identification number), and processes the document
  4. KSeF returns a unique KSeF number (a string of characters that permanently identifies the invoice in the government system)
  5. The invoice is now legally valid — the buyer can retrieve it directly from KSeF using their own credentials

There is no traditional "send an invoice by email" flow. The buyer does not receive an email with a PDF attachment. The KSeF system is the delivery mechanism.


Who Must Comply?

KSeF is mandatory for:

KSeF is not currently required for:

If your business has a Polish VAT registration — even as a foreign company — KSeF applies to the B2B invoices you issue with that Polish VAT number.


Timeline

Phase Date Who
Voluntary phase January 2022 Any taxpayer could opt in to KSeF voluntarily
Mandatory — large taxpayers February 2024 Large taxpayers (VAT turnover above threshold)
Mandatory — all taxpayers February 2026 All VAT-registered Polish taxpayers

As of February 2026, KSeF is mandatory for all VAT-registered businesses in Poland. There is no further deferral.


How KSeF Works — Technical Detail

Authentication

KSeF uses a session-based authentication model. Before submitting invoices, your system must initiate a KSeF session using either a qualified electronic signature (QES), a trusted profile (Profil Zaufany), or an authorisation token issued by the company's KSeF administrator. Sessions expire and must be renewed. The session token is included in every subsequent API call.

The FA(3) Format

KSeF does not use UBL 2.1 or any Peppol-aligned format. Poland has its own national XML schema called FA (Faktura), currently at version FA(3). Key characteristics:

Submission and Status Polling

KSeF invoice submission is asynchronous:

  1. Submit the FA(3) XML to the KSeF API — you receive a reference number (referenceNumber)
  2. Poll the KSeF status endpoint using the referenceNumber
  3. Once KSeF has processed the invoice, the status changes and you receive the KSeF number
  4. The KSeF number must be stored and associated with the invoice — it is required for payment matching and VAT return reporting

The asynchronous model means you cannot issue an invoice and immediately hand it to the buyer. There is a processing delay — typically seconds under normal load, but potentially longer during high-traffic periods.


The KSeF Number

The KSeF number is the government-assigned identifier that makes an invoice legally valid. It is a long alphanumeric string (around 36 characters). Its importance:

Your system must persist the KSeF number returned from the API. Losing it means reconstructing it from KSeF's search endpoint — possible but time-consuming.


What Happens for Foreign Suppliers?

If you are a foreign business selling to a Polish company but you are not VAT-registered in Poland:

If you are a foreign business that is VAT-registered in Poland (for example, because you hold inventory in a Polish warehouse, or you are providing services under the Polish VAT registration), then KSeF applies to the B2B invoices you issue under that Polish VAT number — you are a Polish taxpayer for those transactions.


Common Mistakes

Wrong element ordering in FA(3) XML. This is the most frequent rejection reason. The FA(3) schema is strict about the sequence of elements within parent elements. An invoice that looks correct visually may fail KSeF validation because two sibling elements appear in the wrong order. The fix is to always generate FA(3) XML from a schema-validated template, not by string concatenation.

Missing or incorrect P18 tax row. The P18 element (tax breakdown by rate) is mandatory and must be present even for zero-rated transactions. Missing it causes rejection. For multiple tax rates on a single invoice, each rate must have its own P18 row.

Not polling for the KSeF number. Some integrations submit the invoice and do not implement the polling step — they assume the submission succeeded. The KSeF number is only available after the processing step completes. Without polling, you have an invoice reference but not a legally valid invoice.

Session expiry not handled. KSeF sessions expire. If your system does not detect session expiry and re-authenticate before retrying, submissions will fail silently until the session is refreshed.


Related Reading

Live KSeF integration — KSeF number in every API response

Clearvo's e-invoicing API handles FA(3) generation, KSeF session management, status polling, and returns the KSeF number directly. 25 free invoices per month, no sales call needed.

Get started free →