Poland — KSeF Sandbox Onboarding
Operational guide for getting test credentials at the KSeF (Krajowy System e-Faktur) sandbox.
| Property | Value |
|---|---|
| Authority | Ministry of Finance (Ministerstwo Finansów) |
| Sandbox base URL | https://ksef-test.mf.gov.pl/api/ |
| Cost | Free for token mode; ~€100-300/yr if you need qualified e-signature |
| Time to provision | 1-3 days for token; 2-4 weeks for qualified e-sig |
| Identity required | Polish NIP (10-digit tax number) |
Steps
- Register at the KSeF test portal with your NIP.
- Choose authentication mode:
- Token mode (easiest): generate from the portal; no e-sig needed. Use this for sandbox/CI.
- Qualified electronic signature or trusted profile (Profil Zaufany): needed for production prod-grade integrations.
- Generate a session token via
POST /api/online/Session/InitToken. Adapter atrust/adapters/poland/src/auth.rshandles the token-exchange flow. - Validate with a small invoice submission via
POST /Invoice/Send.
GitHub secrets to set
PL_KSEF_NIP
PL_KSEF_TOKEN
Gotchas
- Sandbox runs FA(2) today. FA(3) becomes mandatory 2026-10-01. During the overlap window (mid-2026 to 2026-09-30), sandbox-nightly should test both schemas. The adapter has a feature flag for this.
- Token has a session lifetime. Adapter's
runtime.rsalready handles refresh. - Mandatory rollout has slipped multiple times. Verify the current sandbox state matches the production rollout date — KSeF's calendar has been a moving target.
- Dual-numbering: issuer's
P_2is what goes on the printed invoice; KSeF assignsnumerKSeFpost-acceptance. Sandbox tests should verify both fields are correctly persisted (already infiscal_id+fiscal_id_upstreamper fi-9ss).
Non-resident path
Polish NIP is required for KSeF taxpayer registration. There is no foreign-software-vendor shortcut here — the auth model assumes a NIP-bearing entity.
- Foreign legal entities can apply for a NIP via the
NIP-2form, but it's a longer process — 4-6 weeks typical. - Standard route is a Polish accountant or fiscal representative who handles NIP issuance + token generation on the platform's behalf. Budget ~€100-300/month.
- Cheapest dev path: partner with a Polish accountant for NIP + KSeF token issuance. ~2-4 weeks.
- Production. For serving Polish merchants, the merchants themselves register on KSeF; the platform doesn't need a Polish entity. The platform-as-intermediary model keeps us out of NIP-bearing scope. For VAT-bearing transactions on the platform's own books, a Polish branch or VAT representative is needed.
Related
- Research doc: poland.md
- Adapter crate:
rust/adapters/poland/ - Sandbox tests:
rust/adapters/poland/tests/sandbox.rs