KSeF test environment and demo: test store invoices safely
In short: the KSeF test environment (KSeF testowy) is a free Ministry of Finance (MF) environment where you issue invoices with no legal effect. There are two environments for trials: the test one, where you log in with fictitious data for any NIP (Polish tax number), and the pre-production one (Demo), where you log in with real data but still issue invoices with fictitious content. Production certificates and permissions do not work there, so you generate separate ones for testing.
KSeF test, demo and production: the differences
The MF provides three public KSeF 2.0 environments. Each has its own Aplikacja Podatnika (the MF taxpayer app, the "test portal" people search for), its own API and its own QR code address.
| Test (TE) | Pre-production (Demo) | Production | |
|---|---|---|---|
| Aplikacja Podatnika | https://ap-test.ksef.mf.gov.pl | https://ap-demo.ksef.mf.gov.pl | https://ap.ksef.mf.gov.pl |
| API base URL | https://api-test.ksef.mf.gov.pl/v2 | https://api-demo.ksef.mf.gov.pl/v2 | https://api.ksef.mf.gov.pl/v2 |
| API documentation | https://api-test.ksef.mf.gov.pl/docs/v2 | https://api-demo.ksef.mf.gov.pl/docs/v2 | https://api.ksef.mf.gov.pl/docs/v2 |
| QR code address | https://qr-test.ksef.mf.gov.pl | https://qr-demo.ksef.mf.gov.pl | https://qr.ksef.mf.gov.pl |
| What it is for | testing an integration with the API, including release candidate versions | final check of an integration in a configuration matching production | invoices with full legal effect |
| Login | fictitious data, any NIP ("uwierzytelnienie testowe", test authentication), or a self-signed certificate in the API | real data (e.g. login.gov.pl, Profil Zaufany), matching official registers | real data |
| Data on invoices | fictitious only | fictitious only | real |
| Legal effect | none | none | invoice enters legal circulation |
| API request limits | by default 10 times higher than in production | same as production | production |
| Data deleted | periodically | periodically | no, 10-year archive |
Sources: the MF pages for the test and pre-production versions of Aplikacja Podatnika KSeF 2.0 and the KSeF 2.0 API documentation ("Środowiska" (environments), "Kody QR", "Limity żądań API" (API request limits)); the API base URLs are the server addresses in each environment's OpenAPI specification, checked on 30.10.2026. The MF describes the difference like this: in the test version "credential simulation is possible", that is logging in in the context of any NIP, while in Demo credentials work as in production (MF FAQ, category "Zagadnienia techniczne" (Technical issues), q. 7). Whenever the API returns a URL, its host matches the environment you called (KSeF 2.0 API documentation, "Środowiska").
On the test environments maintenance work may take place every day from 16:00 to 18:00, so do not plan tests for that time.
Demo vs test: which one for a store integration
Build and debug on test, then do the final run on Demo. Test (TE) lets you log in for any fictitious NIP and, in the API, with a self-signed certificate, so a developer can start in minutes without Profil Zaufany or permissions. The MF describes it as the environment for testing an integration with the API, including release candidate versions. Demo matches the production configuration and request limits and needs your real login and permissions, so it is where you check the path your store will use in production: your own NIP, a KSeF certificate generated by you, permissions for your accountant (KSeF 2.0 API documentation, "Środowiska").
- Test, if you want to see how KSeF works, practise issuing and corrections, or check an integration without any formalities. You do not need Profil Zaufany or permissions.
- Demo, if you want to go through the whole path as in production: logging in through login.gov.pl (e.g. with Profil Zaufany) in the context of your company's NIP, generating a certificate, granting permissions to your accountant. It is a good dress rehearsal before your first real invoice.
How to log in to the KSeF test portal
- Open https://ap-test.ksef.mf.gov.pl and choose "Uwierzytelnij się w Krajowym Systemie e-Faktur" (authenticate in KSeF).
- Choose "Zaloguj uwierzytelnieniem testowym" (log in with test authentication).
- On the "Wprowadź kontekst logowania" (enter the login context) screen, choose the identifier type, usually NIP, and enter a fictitious NIP: this is the company you act for.
- Say whether the certificate used for authorisation contains a NIP or PESEL, and in "Podpisz testowe żądanie autoryzacyjne" (sign the test authorisation request) enter the NIP, PESEL or six-character fingerprint identifier to sign with. For a first login, use the same NIP as the context.
- Click "Uwierzytelnij do aplikacji testowej" (authenticate to the test app). The app fetches the challenge, signs it with a test certificate and sends it back on the server side, then opens Aplikacja Podatnika in the chosen context.
Signing with a NIP other than the context, or with a PESEL or certificate fingerprint, works only after permissions have been granted to that identifier. The test portal also has a "Zaloguj certyfikatem kwalifikowanym" (log in with a qualified certificate) tile, but the MF advises against using seals and signatures with real data on TE. Profil Zaufany does not work in the test environment, only on Demo and in production (Instrukcja uwierzytelnienia w Aplikacji Podatnika KSeF 2.0, wersja testowa (authentication guide, test version), chapters 1 to 1.3).
Which NIP to enter? A fictitious one. Three rules:
- Do not use a real company's data, including your own. The MF reminds you not to use real data in the test environment (MF FAQ, category "Zagadnienia techniczne", q. 6).
- Be careful with random NIPs. If a random NIP belongs to an existing company, that company potentially has access to the data from such an invoice (the same q. 6). Put fictitious names, addresses and amounts on invoices.
- Remember the environment is shared. Because TE accepts self-signed certificates, many integrators can log in in the context of the same company, so the data is not isolated (KSeF 2.0 API documentation, "Środowiska").
In the Demo environment you log in with real data, so the NIP is yours, but invoice content should still be fictitious.
Test certificate and token
Production certificates and permissions do not work in the test environments, and the other way round. The MF writes that actions in the pre-production version do not affect production permissions and certificates, and production ones are not available in Demo. So:
- Log in to Aplikacja Podatnika in the chosen environment (test or Demo).
- Generate a KSeF certificate as in production: "Wnioskuj o certyfikat" (request a certificate), name, password, purpose "Uwierzytelnienie w systemie KSeF" (authentication in KSeF), download the file. The exact steps are in how to generate a KSeF certificate.
- Or generate a token in the "Generuj token" (generate token) menu.
- Upload the certificate or token to software set to the same environment.
The most common mistake: a Demo certificate uploaded to software that connects to production (or vice versa). The connection fails, because each environment has its own certificates.
For developers: on TE the API also accepts authentication with a self-signed certificate, so an integration can generate its own test certificate for a fictitious NIP without logging in to Aplikacja Podatnika first (KSeF 2.0 API documentation, "Środowiska"). This option is described only for TE; on Demo and in production you use a KSeF certificate or token generated in that environment. A foreign company preparing its own set-up will also find the login routes in KSeF for foreign companies.
What to test in a store
Go through the scenarios that really happen in your store. Checklist:
- Ordinary order with a NIP, paid by card: the invoice reaches KSeF, the KSeF number comes back, the PDF has a QR code with the number.
- Several VAT rates in one order, for example 23% and 8%, plus shipping.
- Discount and promo code: do the amounts on the invoice match the order to the grosz.
- Order in euro: amounts in the currency, VAT in zloty, exchange rate and rate date on the invoice.
- Partial return: a correction invoice referring to the KSeF number of the original invoice.
- Full return: correction to zero.
- Wrong NIP: how the store reacts before the invoice goes out, and what a correction to zero looks like.
- Duplicate invoice number: KSeF rejects a second file with the same number from the same seller.
- Order by a private person: the store does not issue a KSeF invoice where it should not.
- QR code: scan it with a phone and check it opens the invoice in the test environment (addresses qr-test.ksef.mf.gov.pl or qr-demo.ksef.mf.gov.pl).
- Permissions: on Demo, give your accountant permission to view invoices and check they can see them.
If an invoice is rejected, read the error code and fix the data. Typical causes are covered in KSeF rejected invoice, and the full preparation list in the KSeF online store checklist.
What a test won't show
A test environment gives you a lot, but not everything:
- Legal and tax effects. A test invoice is not an invoice. You cannot use it to check whether you chose the right VAT rate or exchange rate. That is still a job for your accountant.
- NIP validation. The checksum check of the seller's and buyer's NIP works only in production (KSeF 2.0 API documentation, "Weryfikacja faktury" (invoice verification)). An invoice with a wrong NIP may pass the test and be rejected in production.
- Performance. On TE request limits are by default ten times higher than in production. A large store should test sending on Demo, where the limits are the same as in production.
- A real buyer. The customer will not see a test invoice in their KSeF.
- Data permanence. Data in the test and Demo versions is deleted periodically, so do not treat it as an archive.
Moving to production
- In production (ap.ksef.mf.gov.pl) generate a new KSeF certificate or token. Remove the test files from your software.
- Switch your software or store app to the production environment.
- Remove test settings: the fictitious seller NIP, test numbering series.
- Issue the first real invoice and check in Aplikacja Podatnika that it is in KSeF with a number.
- Remember that from now on every invoice "enters legal circulation", as the MF warns. You fix mistakes with a correction from now on.
We test the KSeF Faktury for Shopify app on the MF KSeF 2.0 test environment. How a store connects to KSeF and where testing makes the most sense is covered in online store KSeF integration. A PrestaShop store can send invoices to KSeF TEST with our free KSeF module for PrestaShop (you open a service account yourself, no invite code needed).
Questions and answers
Is an invoice issued in the KSeF test environment valid?
No. Invoices in the test and pre-production versions have no legal effect (MF FAQ, category "Zagadnienia techniczne", q. 6 and 7).
Is the KSeF test environment paid?
No. The test and pre-production versions of Aplikacja Podatnika are free, just like the production one.
Can I log in to the KSeF test environment with Profil Zaufany?
No. In the test environment you log in with test authentication. Profil Zaufany works on Demo and in production.
I generated a certificate in Demo. Will it work in the real KSeF?
No. Certificates and permissions from Demo work only in Demo. In production you generate new ones.
What is the KSeF demo address?
The Demo version of Aplikacja Podatnika is at https://ap-demo.ksef.mf.gov.pl and the Demo API at https://api-demo.ksef.mf.gov.pl/v2. You log in there with real credentials, but invoices must contain fictitious data.
What is ap-test KSeF?
https://ap-test.ksef.mf.gov.pl is the test version of Aplikacja Podatnika KSeF 2.0, the KSeF test portal. You log in with "Zaloguj uwierzytelnieniem testowym" for any fictitious NIP and can issue and receive invoices, request certificates, generate tokens and manage permissions without legal effect.
KSeF test or demo: which should my store's developer use?
Test for building and debugging, because it needs no real login and accepts self-signed certificates in the API. Demo for the final check before going live, because its configuration and request limits match production.
Sources
- Aplikacja Podatnika KSeF 2.0: wersja testowa (test version), MF
- Aplikacja Podatnika KSeF 2.0: wersja przedprodukcyjna (Demo), MF
- Instrukcja uwierzytelnienia w Aplikacji Podatnika KSeF 2.0, wersja testowa, MF, November 2025, chapters 1 to 1.4
- Pytania i odpowiedzi KSeF 2.0 (KSeF 2.0 Q&A): category "Zagadnienia techniczne", q. 6 and 7
- KSeF 2.0 API documentation, MF: "Środowiska" (16.03.2026), "Limity żądań API", "Weryfikacja faktury", "Kody QR"; OpenAPI specifications at api-test, api-demo and api, checked 30.10.2026
- Podręcznik KSeF 2.0, part I (06.08.2026), step 7 "Testowanie KSeF 2.0"
- Aplikacja Podatnika KSeF 2.0, MF
Legal status as of 30 October 2026.
This article is general information and not tax advice.