Aller au contenu
Log in

Manage KSeF electronic invoicing

Ce contenu n’est pas encore disponible dans votre langue.

KSeF (Krajowy System e-Faktur, "National e-Invoice System") is the mandatory platform of the Polish Ministry of Finance for B2B electronic invoicing. VAT-registered companies established in Poland must issue their invoices in FA(3) format in KSeF. KSeF assigns each invoice an official identifier (Numer KSeF).

Timeline and exceptions — KSeF is mandatory since 1 February 2026 for companies with 2024 sales above PLN 200 million, and since 1 April 2026 for all others. Until 31 December 2026, invoices can still be issued outside KSeF while they total PLN 10,000 or less per month, and also from cash registers. From 1 January 2027, invoices issued outside KSeF are penalised, and transfers between companies must carry the KSeF number. Invoices to consumers are not mandatory in KSeF, but they can be sent to it.

B2Brouter handles the full cycle: signing with the tax certificate, transforming to FA(3), submitting, receiving the KSeF number, and generating the QR code and the official receipt (UPO).

Who is it for — Companies with a Polish NIP (Numer Identyfikacji Podatkowej). Non-Polish companies cannot activate KSeF nor select it as the transport on a Polish contact — the invoice would not be sent.

KSeF environments — The Ministry publishes three: Production, Demo (pre-production, without fiscal effects: do not send real data) and Test (open sandbox for integrations). B2Brouter's production instance talks to KSeF Production; the staging instance talks to KSeF Test or Demo depending on the environment you choose when you activate KSeF.


  • A B2Brouter account with country Poland and a correct NIP on the company profile.
  • A fiscal authentication certificate issued in the name of your Polish company (see below).
  • The password of the certificate, if it is a PKCS#12 file, or of the private key, if the key is encrypted.

Production — Access the official KSeF web portal of the Polish Ministry of Finance at ap.ksef.mf.gov.pl/web identifying yourself with your fiscal identity system (Profil Zaufany, qualified signature, or similar). Inside the portal, in the certificates/credentials section, generate an authentication certificate linked to your NIP and download it in one of the formats that B2Brouter accepts (see below). If you export it in PKCS#12 format, the file has a name similar to <NIP>_Uwierzytelnianie.pfx (Uwierzytelnianie = Authentication).

Test (testing and integrations) — The equivalent test web portal is ap-test.ksef.mf.gov.pl/web. You can generate a self-signed certificate with OpenSSL; the subject must include the NIP in the field serialNumber=TINPL-<NIP>. Before using it, register it manually on that same portal: without this step, KSeF Test will reject every signature from that certificate as unknown.

Accepted formats — B2Brouter accepts the certificate in two ways:

  • PKCS#12 (.p12 or .pfx): one file that already contains the private key, protected with a password.
  • Certificate and private key in separate files: the certificate (.crt or .pem) and its private key (.key or .pem). The password is necessary only if the private key is encrypted.

A .crt file alone is not sufficient: it contains only the public part, and KSeF also needs the private key to authenticate the signature. You do not have to convert the .crt and the .key to PKCS#12.

Encryption algorithm — 3DES or AES — If you upload a PKCS#12 file and get the error "This certificate uses an older encryption method that is not supported. Please re-export it using AES or 3DES encryption.", the file is encrypted with an old algorithm (RC2-40bit, typical of exports done from old Windows). KSeF and B2Brouter only accept 3DES or AES. Re-export with OpenSSL:

openssl pkcs12 -in original.p12 -out temp.pem -nodes -passin pass:<PASSWORD>
openssl pkcs12 -export -in temp.pem -out compatible.p12 -passout pass:<PASSWORD>
  1. ⚙ Account settings → Taxes → KSeF.
  2. Activate KSeF.
  3. Fill in the form:
    • Electronic certificate — upload the .p12, .pfx, .crt or .pem file.
    • Private key — shows when you upload a .crt or a .pem file. Upload the private key (.key or .pem) in it.
    • Certificate password — shows when you upload a .p12 or a .pfx file. If you upload an encrypted private key, Private key password shows.
    • The KSeF environment — in production there is no field: B2Brouter always connects to KSeF Production. In the staging environment you can select Test or Demo.
  4. Save.

When you save, B2Brouter connects to KSeF and authenticates with the certificate on behalf of the account NIP. If the validation succeeds, the certificate is stored and KSeF is active for your account.

Once KSeF is active, the tax report is generated on its own — You don't need to do anything else. Every issued invoice, whatever the customer's country, will automatically generate its tax report and will be submitted to KSeF as part of the same issuing flow. If you integrate via API, configure the tax_report_setting with auto_generate: true and auto_send: true so the flow is equivalent to the UI one.

If the certificate belongs to a person and not to the company — That person must have permissions in KSeF to issue invoices on behalf of your NIP. Permissions are granted in the KSeF portal. If the company cannot log in to the portal with a qualified electronic seal, the first permission is granted with the ZAW-FA notification, filed with the tax office (naczelnik urzędu skarbowego). Without permissions, KSeF rejects the authentication.


Before issuing an invoice to a customer, the customer must exist in contacts.

  1. Contacts → New contact.
  2. Select the customer's country.
  3. Enter the tax identifier — it depends on the customer's country (see table below).
  4. Validate identifier and continue — for Polish customers, B2Brouter connects to the Ministry registry to verify the NIP and autocomplete the legal name.
  5. Fill in the address (street, postal code, city).
  6. Configure the delivery method and choose KSeF as transport. If KSeF does not appear, switch the network type to the one that shows KSeF in the list (in some accounts it is an open network that bundles several transports).
  7. Save.

Three identification structures depending on the customer's country

Section titled “Three identification structures depending on the customer's country”

KSeF requires informing the customer using one of three mutually exclusive structures. If you mix formats (NIP with prefix, prefix without country, etc.) in the same account, you will get intermittent errors — some invoices pass and others are rejected.

Customer typeIdentifier to enterHow KSeF renders it in XML
PolishNIP (exactly 10 digits, without the PL prefix)Podmiot2/DaneIdentyfikacyjne/NIP
Other EU countryVAT number without country prefix (e.g. 123456789 for DE123456789)KodUE (code) + NrVatUE (number, max. 12 characters)
Outside the EUCountry's tax identifierKodKraju + NrID

Do not mix formats — For the same customer, always send the same type of identifier. If you send them as Polish on one invoice (PL + NIP) and as EU on the next (DE + VAT), KSeF will apply different validation rules and the result will be inconsistent.

Greece: fiscal code EL, not GR — On the EU fiscal field (in KSeF, KodUE), Greece is identified with EL. For the address, GR is used. If the form lets you pick GR in the fiscal field, change it to EL; otherwise KSeF will reject the invoice with the error KodUE: 'GR' is not an element of the set {...}.


  1. Invoices → Create invoice.
  2. Choose the contact and Continue.
  3. Fill in:
    • Invoice number — unique sequential.
    • Invoice date and VAT date (Data sprzedaży).
    • Currency — PLN for domestic invoices. For foreign currencies, fill in the exchange rate to PLN on the invoice date: it will be sent to KSeF's KursWalutyZ field.
    • Notes — free text that will appear as the invoice footer (Stopka) in the official PDF. Useful for legal clauses, contractual conditions, or any information that does not fit in another field.

B2Brouter assigns the type according to the workflow, but you can change it on the KSeF section of the invoice, in the Operation type field:

  • VAT — Ordinary invoice. (default)
  • KOR — Corrective invoice. See § 5 · Corrective invoices.
  • ZAL — Advance invoice (prepayment, Art. 106f sec. 4).
  • ROZ — Final settlement invoice (Art. 106f sec. 3) — completes a previous ZAL.
  • UPR — Simplified invoice (Art. 106e sec. 5 item 3) — total amount up to PLN 450 or EUR 100.
  • KOR_ZAL / KOR_ROZ — Corrective advance and settlement invoices.

For each line, choose the VAT rate:

RateCodeUse
23 % / 22 % / 8 % / 7 % / 5 % / 4 % / 3 %23, 22, 8, 7, 5, 4, 3Domestic rates
0 % domestic0 KRDomestic zero-rate (neither export nor intra-community)
0 % WDT0 WDTIntra-community supply (Wewnątrzwspólnotowa Dostawa Towarów)
0 % Export0 EXExport outside the EU
ExemptzwExempt operation (use of a VAT Act exemption)
Domestic reverse chargeooOdwrotne obciążenie — PL reverse charge
Not subjectnp ISupplies and services outside Poland, except those in the next row
Not subject, EU servicesnp IIB2B services to a taxable person in another EU Member State (Art. 28b, Art. 100 sec. 1 item 4)

Exempt lines (zw) — legal basis in the Comment — For lines with exempt VAT, state the legal basis (e.g. "art. 43 ust. 1 pkt 37 ustawy VAT") in the line's Comment field. The PDF will show two paragraphs: a generic legal annotation (automatic) and the comment you wrote.

For an export outside the EU in foreign currency:

  • VAT rate: 0 EX.
  • Customer country: the non-EU country.
  • Exchange rate: the rate of the day prior to the VAT date, per the ECB or NBP tables.

Do not use zw (exempt) for exports — An export is 0 EX (export zero-rate, P_13_6_3). If you use zw, the operation is reported as exempt (P_13_7) and not as an export.

  1. Save and preview — review amounts and the customer NIP.
  2. Issue and send — B2Brouter signs the document with your certificate, deposits it to KSeF, and it remains pending registration.

On the invoice detail page you will see the current status, the Numer KSeF once registered, and the UPO receipt.

Sending → Registered → (QR + Numer KSeF + UPO)
↘ Error
  • Sending — B2Brouter has signed and submitted the document. Effective registration by KSeF can take a few minutes, especially at peak hours or month-end.
  • Registered ✅ — KSeF has validated and assigned the Numer KSeF (NrKSeF). The QR code on the printed invoice now shows this number, and the official registration receipt becomes available (see below).
  • Error ❌ — KSeF has rejected the document. The reason appears on the invoice page (code + description in Polish).

The QR appears right away, but that does not mean KSeF has accepted the invoice — B2Brouter generates the QR code locally from the cryptographic hash, the NIP and the date: it is visible immediately, even if the invoice will end up in error. The only reliable indicator of acceptance is the Registered status. If the status is Error, the invoice is not registered in KSeF, regardless of the QR or link generated. While the invoice is Sending, the QR carries the OFFLINE label. Do not deliver the invoice to the customer until it is Registered: an invoice delivered before it is registered is an offline invoice, and the law requires a second QR code with an Offline certificate, which B2Brouter does not generate.

What it is. The UPO (Urzędowe Poświadczenie Odbioru, "Official Confirmation of Receipt") is the receipt that KSeF issues when it accepts and registers the invoice. It works as an administrative acknowledgement: it is the legal proof, with fiscal value, that you have fulfilled the obligation of registering the invoice in KSeF at a specific moment.

Technically, it is an XML document digitally signed by the Polish Ministry of Finance. It contains the Numer KSeF (NrKSeF) assigned to the invoice, the exact timestamp of registration, and the Ministry signature. It is not a visual PDF — it is a machine-readable legal proof.

Where it comes from. KSeF generates it the moment it validates and accepts the invoice. It is not generated by B2Brouter or by you.

How to confirm the registration from B2Brouter. When the invoice moves to Registered, open the associated KSeF tax report (linked from the invoice page). On the Activity tab, you will see the successful submission event with the assigned Numer KSeF — confirmation that KSeF has received, validated and registered the document.

How to obtain the UPO XML file for your accounting archive. The original file is available through two channels:

  • From the official KSeF portal — ap.ksef.mf.gov.pl/web (or ap-test.ksef.mf.gov.pl/web for the test environment). By logging in with your fiscal identity system, you can browse and download the UPOs of your account directly from the Ministry — they are the official original.
  • Via the B2Brouter API — if you integrate with the API, the UPO is available as an attachment of the tax report. See the KSeF Developer Guide.

Keep the UPOs with the invoice — They have legal value before a tax inspection. Download them from KSeF or via API and archive them together with the original invoice.

  1. Open the invoice and read the error code and description.
  2. Correct the problematic data (contact, NIP, amounts…).
  3. Resend the invoice. B2Brouter retries the registration with KSeF using the corrected data.

Exception — invoice number already seen by KSeF — If the rejection comes from the fact that the invoice number has already been used in a previous submission, you cannot resubmit the same document: delete it, correct the data, and create a new invoice with a different number.


A corrective invoice (faktura korygująca) modifies a previous KSeF invoice. The document links the original (DaneFaKorygowanej) and restates the affected lines with an indication of the previous and new state.

  1. Open the original invoice already registered in KSeF.
  2. Create corrective invoice — B2Brouter automatically fills in the KSeF number, the invoice number, and the date of the original.
  3. Indicate the Effect type (TypKorekty):
    • 1 — Effect on the date of the original invoice. Use: corrections of errors that existed when issued (wrong amount, wrong VAT rate).
    • 2 — Effect on the date of the corrective invoice. Use: subsequent events (returns, post-sale discounts).
    • 3 — Effect on a different date — state it explicitly.
  4. Update the lines to the new state (quantities, prices, VAT rates).
  5. If you want to add a textual correction reason (e.g. "Korekta ilości — dostawa niepełna") or any associated legal text, write it in the invoice's Notes field: it is sent to the document's official footer (Stopka/Informacje/StopkaFaktury) and is visible on the KSeF PDF.
  6. Issue and send.

"Before / after" state — The corrective invoice you issue from the form carries the lines with the new values directly; this is the typical case and is enough for most corrections. If you need the formal before/after representation (original cancelled lines plus new lines on the same document, with a Stan przed marker per line), this option is only available via API: see the Developer Guide.

To correct a ZAL (advance), use a KOR_ZAL; to correct a ROZ (settlement), use a KOR_ROZ. The procedure is identical to a normal KOR.


When you receive a prepayment before the delivery:

  1. Create an invoice of type ZAL.
  2. State the amount received and the collection date in the Zapłacono (Paid) field.
  3. Issue and send.

When you perform the delivery after one or more advances:

  1. Create an invoice of type ROZ.
  2. Link the advance(s) previously registered in KSeF.
  3. B2Brouter calculates the difference between the total value and the advances and generates the final amount.

A simplified invoice can only be used if the total amount is not above PLN 450 or EUR 100 (Art. 106e sec. 5 item 3). It cannot be used for intra-Community supplies or distance sales.

  1. Create an invoice of type UPR.
  2. The customer NIP is mandatory: the law does not allow a simplified invoice without the buyer's tax number. A sale to an individual with no NIP is not a UPR.
  3. Issue and send.

Once KSeF is active on the account, your NIP is registered as a recipient and Polish suppliers can send invoices directly to you.

  • Expenses → you will find all received KSeF invoices here.
  • Open an invoice to see its detail.

Where to find the Numer KSeF of a received invoice — The official KSeF number (NrKSeF) does not appear on the PDF preview, but in the Activity section of the received invoice (format XXXXXXXXXX-YYYYMMDD-XXXXXXXXXXXX-XX). The QR code is only visible on the PDF if the supplier included it on their image.

An invoice the supplier claims to have sent but does not appear in Expenses — First verify that the PDF sent by the supplier carries a KSeF QR code. Without a QR, the invoice was not sent via KSeF — the supplier may not have completed the registration. If there is a QR, scan it and copy its URL: with that URL we can check whether the document actually exists in KSeF.

  • New — received in B2Brouter, pending your review.
  • Read — you have opened it at least once.
  • Approved / Refused — the status you have assigned (no message is sent to the supplier; KSeF does not have an acceptance/rejection channel equivalent to Peppol's).

  • "This certificate uses an older encryption method that is not supported. Please re-export it using AES or 3DES encryption." — the PKCS#12 is encrypted with an old algorithm (RC2-40bit), typical of exports from old Windows. Re-export with 3DES or AES (see § 1).
  • "The private key (file .key) is missing." — you uploaded a .crt or a .pem file without its private key. Upload the key in the Private key field too.
  • "This file is the private key. Upload the certificate (.crt file) here." — you uploaded the key in the certificate field. Upload the certificate in the Electronic certificate field and the key in the Private key field.
  • "The private key does not correspond to the certificate" — the key belongs to a different certificate. Upload the key that you generated with this certificate.
  • Changing the certificate (for example, when it expires) — use Change certificate and upload the new certificate as in the activation: the PKCS#12 with its password, or the certificate with its private key. If a part is missing, the form shows an error on the missing field, and the current certificate stays in use.
  • 450 - Nip nabywcy: '…' jest nieprawidłowy — customer NIP invalid. Check 10 digits + check digit. For EU contacts, use the EU VAT number without prefix (see § 2).
  • KodUE: 'GR' is not an element of the set — Greece on the EU fiscal field must be EL, not GR. Edit the contact and fix it.
  • "Contact Email can't be blank" — the contact's transport is email but there is no address. Add an email or change the transport.
  • Status Error but QR and URL were generated — normal. The QR is computed locally and does not depend on KSeF's acceptance. The Error status is authoritative: the invoice is not registered.
  • An invoice the supplier claims to have sent but does not appear in Expenses — check that the supplier's PDF carries a KSeF QR code. Without QR, it was not actually registered.
  • Non-Polish account trying to use KSeF as transport — KSeF is only available for accounts with a Polish NIP. Use Peppol or email on that contact.
  • VAT summary shows "23% lub 22%" — official Ministry template label, combining the historical (22 %) and current (23 %) rates in a single field. It is not an error.
  • "Nazwa banku" (bank name) field empty — KSeF does not require the bank name and B2Brouter does not auto-populate it. If you need it, add it to the Notes field.

This manual describes the UI. If you integrate with B2Brouter via API, the official reference is the KSeF Developer Guide — it covers the Tax Report Settings, Tax Reports, Invoices and Contacts endpoints, the full JSON-to-FA(3) mapping, the status tracking webhooks, and the UPO download.

Authentication via static API key (header X-B2B-API-Key) + API version (X-B2B-API-Version). KSeF-specific functionalities require version 2025-10-13 or later.

Dernière mise à jour :