Check a KSeF QR code
Beta This tool is in beta. It is tested on sample files, and details may still change. Review the result before relying on it.
Read the KSeF QR code on a Polish invoice, check its link and compare it with the invoice XML, on your device, then confirm it on the KSeF page.
In short
Check a payment or receipt QR code from a photo, a screenshot, a PDF or its text, on your device. Each finding says what to correct, and the result says what the check cannot show. Free.
How to check a QR code
- Drop a photo, a screenshot or a PDF with the code, or paste the code's text.
- Klarbon reads the code on your device and checks it against the rules for its kind.
- Read each finding, and open the authority's own link where the code has one.
Check the KSeF QR code on a Polish invoice by dropping a photo, screenshot or PDF, or by pasting its link. Klarbon reads it on your device and checks the address, the seller's NIP, the date and the invoice hash against the Ministry of Finance's specification. Add the invoice's XML to check it is the file the code was made for, then open the code's link in KSeF.
What does the check cover?
KOD I is a link to KSeF with the seller's NIP, the issue date and the SHA-256 hash of the invoice file. KOD II, on invoices issued offline, links to the issuer's KSeF certificate with a signature (Ministry of Finance, in Polish). Klarbon checks:
- that the link goes to qr.ksef.mf.gov.pl, and not to a test or demo environment;
- the NIP, 10 digits with a correct check digit, and the date written DD-MM-YYYY;
- the hash: a SHA-256 in Base64URL, 43 characters;
- for KOD II, the context type, the certificate serial number and the form of the signature;
- the code itself: error correction level M.
Comparing the code with the invoice XML
Choose the invoice's XML file and Klarbon computes its SHA-256 on your device and compares it with the hash in KOD I. It also compares the seller's NIP and the issue date in the file with those in the code. A match shows that the file is the one the code was made for; it does not show that KSeF holds it.
What the check does not show
A code that passes is well formed. It does not show that KSeF holds the invoice, and the signature in KOD II can only be checked by KSeF against the issuer's certificate. Klarbon shows the code's link and does not open it for you.
What next?
- Open a KSeF invoice and read its XML as a document.
- What is KSeF FA(3)? and e-invoicing in Poland.
Frequently asked questions
What is the KSeF QR code?
An invoice issued through KSeF, Poland's national e-invoicing system, carries a QR code when it is given to a buyer outside KSeF, for example as a PDF. KOD I links to the invoice in KSeF; an invoice issued offline also carries KOD II, which links to the issuer's KSeF certificate.
How does the comparison with the XML work?
KOD I holds the SHA-256 hash of the invoice's XML file. Choose that file and Klarbon computes its hash on your device: when the two match, the file is exactly the one the code was made for. Even saving the file again in another program can change the hash.
Does Klarbon tell me whether KSeF has the invoice?
No. Only KSeF knows. The result shows the code's own link to KSeF, and opening it sends the code's details there. The signature in KOD II can only be checked by KSeF too.
Is the file uploaded?
No. The code and the XML file are read and checked in your browser. Nothing is sent to Klarbon.
Sources
- Polish Ministry of Finance, KSeF verification QR codes (in Polish) github.com
- Polish Ministry of Finance, KSeF (in Polish) ksef.podatki.gov.pl
Related
- Open any e-invoice. Check it. Convert it.
- Klarbon help centre
- Open a Polish KSeF invoice
- Understanding KSeF structured invoice
- E-invoicing in Poland
- Simple pricing for invoices and bank statements
- What happens to my files?
- E-invoice tools
- Check the KSeF numbers in your payment titles
- Am I affected by e-invoicing?