KSeF QR Codes — KOD I, KOD II and Offline Mode
An online invoice has one QR code — KOD I, with the KSeF number. An offline or offline24 invoice has two: KOD I "OFFLINE" and KOD II "CERTIFICATE", which confirms the issuer's identity and requires a type 2 KSeF certificate. Your issuing tool computes the codes locally to the ISO/IEC 18004:2024 standard — the KSeF API does not return them.
A common question after the first invoice goes through: "where's the QR code?" The answer surprises people — KSeF does not return a ready-made QR code. Your issuing tool generates it locally, to the ISO/IEC 18004:2024 standard, from the invoice data and the KSeF number. The KSeF API does not return it.
Online invoice: one code (KOD I)
When you issue an invoice directly in KSeF (online mode), the visualisation (the PDF you hand to the buyer) carries one QR code — KOD I, with the KSeF number underneath. Scan KOD I and it points back to the invoice in the system, letting anyone verify its authenticity and the document's data.
How does online mode differ from offline mode?
In online mode the invoice gets its KSeF number immediately and carries one code — KOD I. In offline mode (and offline24) the document reaches the buyer before the number is assigned, so it carries two codes — KOD I "OFFLINE" and KOD II "CERTIFICATE", which attests to the issuer's identity and requires a type 2 KSeF certificate.
When an invoice is created outside the system (offline or offline24 mode), the visualisation carries two QR codes:
- KOD I labelled "OFFLINE" — used to verify access and the invoice data.
- KOD II labelled "CERTIFICATE" — confirms the issuer's identity. Generating it requires a type 2 KSeF certificate.
That's the core difference from an online invoice: offline mode adds a second code, because the document reaches the buyer before the system assigns it a KSeF number, so the issuer's identity has to be attested with a certificate.
Offline24 mode
Offline24 mode comes from art. 106nda of the VAT Act and applies from 1 February 2026. It lets you issue an invoice outside KSeF and send it to the system by the next business day at the latest, so the invoice receives a KSeF number. Until it's sent, the document circulates with two QR codes (KOD I "OFFLINE" + KOD II "CERTIFICATE"), which let the buyer verify it even before the number is assigned.
Where the codes come from — you compute them yourself
This is the key implementation detail: KSeF assigns the KSeF number and the UPO (the official confirmation that the invoice was received), but you generate the QR codes yourself from the invoice data and the KSeF number. That means:
- Your tool has to be able to compute the QR code (and KOD II in offline mode), not just fetch it from the API.
- The code is tied to a specific document — you can't "borrow" one from another invoice.
In KSeF Kit the QR codes are computed automatically and placed on the invoice visualisation — you never need to know the formula or work them out by hand.
When QR codes matter most
QR codes matter most for invoices handed off outside the system, where the recipient has no access to KSeF:
- Foreign buyers — the QR code is their way to verify it. See the export invoice guide.
- Consumers and buyers with no NIP — they get a PDF, not a view into the system.
Common misconceptions
- "The QR code comes from the KSeF API" — no; you compute it locally.
- "An invoice always has one code" — no; offline and offline24 have two (KOD I + KOD II).
- "The QR code replaces the KSeF number" — no; it complements it, as a way to verify.
Don't compute the codes by hand
Generating KOD I and KOD II is a frequent source of implementation bugs. KSeF Kit computes the QR codes for you and places them on the visualisation of every invoice you file. See what the UPO is and how to issue a structured invoice.