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 generate a test token, open a session, send an encrypted FA(3) invoice and read back a status with a UPO 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 never skip this step.

TEST vs production

The two 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, authenticates to KSeF TEST and returns the status and UPO by webhook. You get three free test invoices, which is enough to confirm your payloads, your NIP data 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 read both accepted (with UPO) and rejected statuses from the webhook. Once the TEST flow works, upgrade to a paid plan and connect your own production KSeF token in Connect KSeF (NIP + token); once production is enabled, Notaly routes your invoices to KSeF production — and the sandbox stays available for staging.

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. You connect your own production token only when 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.