KSeF Faktury
EN
Join the start list

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").

How to log in to the KSeF test portal

  1. Open https://ap-test.ksef.mf.gov.pl and choose "Uwierzytelnij się w Krajowym Systemie e-Faktur" (authenticate in KSeF).
  2. Choose "Zaloguj uwierzytelnieniem testowym" (log in with test authentication).
  3. 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.
  4. 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.
  5. 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:

  1. 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).
  2. 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.
  3. 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:

  1. Log in to Aplikacja Podatnika in the chosen environment (test or Demo).
  2. 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.
  3. Or generate a token in the "Generuj token" (generate token) menu.
  4. 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:

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:

Moving to production

  1. In production (ap.ksef.mf.gov.pl) generate a new KSeF certificate or token. Remove the test files from your software.
  2. Switch your software or store app to the production environment.
  3. Remove test settings: the fictitious seller NIP, test numbering series.
  4. Issue the first real invoice and check in Aplikacja Podatnika that it is in KSeF with a number.
  5. 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

This article is general information and not tax advice.

KSeF Faktury

Join the launch list

We will write once, on launch day in the Shopify App Store (December 2026), and help you set up.