KSeF

KSeF TEST environment: how to test invoices before production

What the KSeF TEST (sandbox) environment is, how it differs from production and how to test your FA(3) invoices safely.

Published 3 min readBy Tomek

Overview

The KSeF TEST environment (api-test.ksef.mf.gov.pl) is the Ministry of Finance's sandbox where you can send FA(3) invoices without touching production data. It uses the same FA(3) schema and the same status flow, so it is the safe place to validate your XML, your authentication and your status handling before going live. Notaly's sandbox maps to KSeF TEST and includes three free test invoices.

What TEST is for

KSeF (Krajowy System e-Faktur) is Poland's national e-invoicing platform run by the Ministry of Finance (Ministerstwo Finansów). The TEST environment mirrors the production API: you authenticate, open a session, send an encrypted FA(3) invoice and read back a status with a KSeF number or a rejection code. Because the schema is identical, an invoice that passes in TEST is much more likely to pass in production — which is exactly why you should not skip this step.

TEST vs production

The environments are separate. They have different endpoints and different credentials, and a test invoice has no production or tax effect. The FA(3) schema is the same, so the value of TEST is not in "practice data" but in catching schema errors, authentication mistakes and status-handling bugs before they cost you a real customer invoice.

How to test with Notaly

Sign up for the sandbox — no KSeF token needed: the sandbox submits to KSeF TEST with Notaly's own test credentials, so use the sandbox seller NIP 2745013933 in your payload. Then send a test invoice through POST /invoices. Notaly generates the FA(3) XML, validates it against the official XSD before sending (an invalid invoice gets a 422 and is not sent), authenticates to KSeF TEST and reports the final status by webhook or through GET /invoices/{id}, with the UPO when KSeF issues it. You get three free test invoices, enough to confirm your payloads and your webhook handling end to end.

What to check before going live

Confirm the seller and buyer identifiers, the line items, and that you can handle both accepted and rejected statuses. Then validate your own KSeF token with the "Validate on KSeF DEMO first" option in Connect KSeF: DEMO checks your NIP and token without legal effect. After that, upgrade to a paid plan and use "Switch to KSeF PRODUCTION" in Connect KSeF with a production token for the same NIP; from then on, Notaly sends your invoices to KSeF production. The free TEST sandbox belongs to the sandbox plan only; on a paid plan every invoice goes through your own KSeF connection, so a production invoice is a real tax document.

Disclaimer

Notaly is not a tax, accounting or legal advisor. This article is general information, not tax advice, and may be outdated. You are responsible for your own VAT compliance; confirm with a qualified accountant where required.

Sources

Source: www.podatki.gov.pl

Frequently asked questions

Are TEST invoices visible to the tax office?

No. TEST invoices are processed only in the sandbox, against the same FA(3) schema but without production effect.

Do I use the same token in TEST and production?

No. Each environment has its own credentials. Notaly's sandbox needs no KSeF token — it submits to KSeF TEST with Notaly's test credentials. Before production you can validate your own token on KSeF DEMO, and you connect your production token after you upgrade.

Can I send unlimited test invoices?

Notaly's sandbox plan includes three free test invoices on KSeF TEST, so you can validate the flow end to end before upgrading.

Issue your first KSeF test invoice today

Create a sandbox account: API key in seconds, 3 free test invoices on KSeF TEST, no credit card.