How to Implement KSeF: Step-by-Step Guide for Polish Businesses
Step-by-step guide to implementing KSeF e-invoicing in Poland. From registering with KSeF to issuing your first FA_VAT invoice: configuration, testing, and going live.
How to Implement KSeF: Step-by-Step Guide for Polish Businesses
KSeF is now mandatory. If you have not set it up yet, this guide walks you through the entire process — from first login to issuing your first compliant e-invoice.
What You Need Before You Start
Before touching any software, gather these:
- Your NIP (Numer Identyfikacji Podatkowej) — your 10-digit Polish tax identification number
- Access method for KSeF authentication — either a Trusted Profile (Profil Zaufany), qualified electronic signature (podpis kwalifikowany), or qualified electronic seal (pieczęć kwalifikowana). For most businesses:
- Sole traders → Trusted Profile is the easiest route
- Businesses (sp. z o.o. etc.) → Qualified electronic seal on the company name (not the individual) is the correct choice
- KSeF-ready accounting software — verified support for FA(2) schema and KSeF API (see our software comparison)
Step 1: Register Access on the KSeF Portal
Go to https://ksef.mf.gov.pl/ (the production portal — not the test environment yet).
Log in using your Profil Zaufany or qualified signature. If this is your first login, the system will identify you by your NIP (for companies) or PESEL/NIP (for sole traders acting as natural persons).
You do not need to "create an account" in KSeF — the system uses your existing NIP as your identity. Your first authenticated login is effectively your registration.
Once authenticated, verify that KSeF shows the correct entity name and NIP. If there is a mismatch, contact your tax office (Urząd Skarbowy) — it usually indicates a data inconsistency in the CEIDG or KRS register.
Step 2: Grant API Access to Your Software
If you are using accounting software rather than submitting invoices manually through the portal, you need to authorise the software to act on your behalf.
This is done through the KSeF portal under Zarządzanie → Uprawnienia do KSeF (Manage → KSeF Permissions):
- Generate or import the API token for your software
- Specify the roles: at minimum, Invoice Issuer (Wystawiający faktury) and Invoice Recipient (Odbiorca faktur) — the latter allows you to pull down purchase invoices that your suppliers have uploaded for you
- Copy the token into your accounting software's KSeF configuration screen
Most Polish accounting tools (Comarch, InsERT, enova365) have a specific "KSeF Integration" settings panel where you paste this token. Refer to your software's documentation for exact steps.
Step 3: Test in the Test Environment First
Do not skip this step. The KSeF test environment is available at: https://ksef-test.mf.gov.pl/
It is a completely separate system — test invoices do not affect your production tax records. However, it uses a separate test NIP, which you need to request via the Ministry of Finance portal or use the pre-provided test NIPs from the Ministerstwo Finansów documentation.
In your accounting software, enable test mode (środowisko testowe). The exact setting varies by software, but it is typically under:
- Comarch Optima: Konfiguracja → KSeF → Środowisko testowe
- InsERT nexo: Ustawienia → Integracje → KSeF → Tryb testowy
- enova365: Konfiguracja systemu → e-Faktury → KSeF → Środowisko
Once in test mode, issue the following test invoices before going live:
| Test Case | Why |
|---|---|
| Standard domestic sale (23% VAT) | Validates basic FA(2) generation and submission |
| Invoice with multiple VAT rates (23% + 8%) | Tests VAT breakdown handling |
| Invoice in EUR (foreign currency) | Tests currency and PLN equivalent fields |
| Corrective invoice (korekta) | Validates correction reference chain |
| Advance invoice (zaliczkowa) | Tests advance payment handling |
Check that each test invoice:
- Was accepted by KSeF (status: Przetworzono — processed)
- Has a KSeF reference number (Numer Referencyjny) in your software
- Can be retrieved from KSeF
If any test invoice is rejected, KSeF returns an error code and description. Common errors:
Błąd walidacji schematu— your FA(2) XML does not match the schema. Update your software or check the XML generation settings.Nieprawidłowy NIP nabywcy— the buyer's NIP is not recognised. In the test environment this is expected if using real NIPs — use the test buyer NIPs from the Ministry documentation.Podmiot nie posiada uprawnień— your token does not have the right permissions. Go back to Step 2.
Step 4: Configure Your Invoice Template
Before going live, ensure your invoice template includes all KSeF-mandatory data:
Seller data (must match KSeF records exactly):
- Full legal name (Pełna Nazwa) — as registered in KRS/CEIDG
- NIP — exactly as registered
- Full address including postal code
Buyer data:
- Full legal name
- NIP (mandatory for all VAT-registered buyers)
- Address
Invoice data:
- Sequential invoice number (your internal numbering is preserved — KSeF adds its own reference number on top)
- Date of issue (Data wystawienia)
- Date of supply/delivery (Data dokonania dostawy / zakończenia usługi)
- Payment due date and payment method
Line items:
- Description (Nazwa towaru / usługi)
- Unit of measure (Jednostka miary)
- Quantity
- Net unit price (Cena netto)
- VAT rate (as FA_VAT code: 23, 8, 5, 0, ZW, NP, OO)
- Net total for line
Totals:
- Net total per VAT rate
- VAT amount per rate
- Gross total
After KSeF processes the invoice, your software must add:
- KSeF Reference Number (Numer Referencyjny KSeF) — printed on the invoice PDF you send to your buyer
Step 5: Switch to Production and Issue Your First Live Invoice
Once all tests pass:
- Switch your software back from test mode to production mode
- Ensure your production API token is configured (not the test token)
- Issue your next real invoice as you normally would
- Before sending anything to the buyer, confirm in your software that the invoice has status Przetworzono in KSeF and that a KSeF reference number is shown
Send the invoice to your buyer including the KSeF reference number. Most businesses send a PDF version of the invoice with the KSeF number printed on it — this is best practice and helps buyers retrieve the invoice from KSeF if needed.
Step 6: Set Up the Incoming Invoice Process
KSeF is a two-way system. Your suppliers (once they are also mandated) will submit their invoices to KSeF on your NIP. You must retrieve these purchase invoices from KSeF.
In your accounting software, enable the KSeF purchase invoice pull. The software will periodically query KSeF for new invoices addressed to your NIP and import them directly into your accounts payable. This eliminates the need for suppliers to email you PDFs for domestic purchases.
Key point: you should not book a purchase invoice in your accounts payable that does not have a KSeF reference number, if the supplier was obligated to use KSeF. Doing so creates VAT deduction risk in an audit.
Step 7: Handle KSeF Downtime Correctly
If the KSeF API becomes unavailable (planned maintenance or unplanned outage):
- Your software should detect the unavailability and automatically switch to offline mode (tryb offline)
- In offline mode, invoices are issued locally with an offline temporary ID (not a KSeF reference number)
- The Ministry of Finance publishes planned KSeF downtime windows on the KSeF portal — you should have these in your calendar
- When KSeF recovers, your software must automatically upload all offline invoices within the legally required window (currently 1 business day)
If your software does not handle this automatically, you must monitor KSeF availability and manually upload offline invoices. Check your software's offline mode documentation.
Checklist: Am I KSeF-Ready?
- KSeF portal access verified with correct NIP
- Authentication method configured (Profil Zaufany or qualified seal)
- API token generated and configured in accounting software
- Test environment tests completed successfully (all 5 test types passed)
- Production mode switched on in software
- First live invoice issued and KSeF reference number confirmed
- Invoice template updated to include KSeF reference number
- Incoming invoice pull (KSeF Odbiornik) configured
- Offline mode tested or documented procedure known
- Staff trained on new process
KSeF portal: ksef.mf.gov.pl | Test environment: ksef-test.mf.gov.pl | Documentation: podatki.gov.pl/ksef