KSeF

The KSeF invoice PDF and QR code: KOD I vs KOD II

What KOD I and KOD II mean on a KSeF invoice, who generates each QR code, and the PDF Notaly produces.

Published 3 min readBy Tomek

Overview

When an invoice is accepted, KSeF returns the UPO (official proof of receipt) and the KSeF number; the readable PDF is a visualisation Notaly generates from the FA(3) data, carrying the official KOD I QR. KOD I and KOD II are two different codes, not two states of one: KOD I is the verification link built by the issuer from the SHA-256 of the XML, and KOD II is the issuer's verification QR, signed with a KSeF certificate of type Offline, added only on an offline invoice.

KSeF (Krajowy System e-Faktur) is Poland's national e-invoicing platform run by the Ministry of Finance (Ministerstwo Finansów). KSeF does not return a PDF: on acceptance it returns the UPO plus the KSeF number. The structured FA(3) XML is the legal invoice, and the PDF is a human-readable rendering you show a customer or an auditor. Notaly generates this PDF for the invoices it submits and stamps the KOD I verification QR on it.

KOD I is not a code KSeF returns after acceptance — the issuer builds it, in both the online and the offline flow, from the SHA-256 hash of the exact invoice XML. The link follows the pattern https://{host}/invoice/{seller NIP}/{issue date}/{hash}, and it does not carry the KSeF number in the URL. When the invoice has been accepted, the text under the QR shows the KSeF number so anyone can verify the document in the KSeF portal; when it has not, the same QR shows "OFFLINE" in place of the number.

KOD II: the offline QR

KOD II is the issuer's verification QR signed with a KSeF certificate of type Offline and labelled CERTYFIKAT; it verifies the issuer via a /certificate/ link. Under KSeF 2.0's offline procedure, an invoice issued while the platform is unreachable carries both QR codes — KOD I (showing "OFFLINE") and KOD II — not KOD II instead of KOD I, and nothing is later replaced. The conditions for offline issuance are defined by the Ministry of Finance, so confirm the current procedure on podatki.gov.pl/KSeF before relying on it.

Where the PDF appears in Notaly

Notaly generates the PDF for an accepted invoice and returns its absolute URL in the invoice.accepted webhook. Store that URL against your invoice record and surface it to your customer, so they always have a verifiable, printable copy with the KOD I QR code.

FAQ

Which QR code is on an accepted invoice? KOD I — the issuer's verification link, with the KSeF number shown under it once accepted.

When is KOD II used? On an offline invoice, alongside KOD I, as the issuer's QR signed with a KSeF certificate of type Offline.

Disclaimer

Notaly is not a tax, accounting or legal advisor. This article is general information, not tax advice, and may be outdated. You are responsible for your own VAT compliance; confirm with a qualified accountant where required.

Sources

Source: www.podatki.gov.pl

Frequently asked questions

Which QR code is on an accepted invoice?

KOD I. It is the verification link generated by the issuer from the SHA-256 of the invoice XML, and the text under it shows the KSeF number once accepted.

When is KOD II used?

KOD II is the issuer's verification QR signed with a KSeF certificate of type Offline and labelled CERTYFIKAT. It appears on an offline invoice together with KOD I, not instead of it.

Does Notaly return the PDF?

Yes. On invoice.accepted, the webhook payload includes the absolute URL of the generated PDF with the KOD I QR.

Issue your first KSeF test invoice today

Create a sandbox account: API key in seconds, 3 free test invoices on KSeF TEST, no credit card.