KSeF integration for stores, panels and ERP through API 2.0

VulCode, a software house from Cracow, Poland, integrates stores, panels, billing systems and ERP that create invoices automatically with KSeF, Poland's national e-invoicing system, through the KSeF 2.0 API. The integration sends and receives invoices, stores the KSeF number with the order, works in offline modes with QR codes and is tested on the Ministry of Finance test environments. The KSeF integration costs from PLN 999 (about EUR 220) and usually takes 2-3 days, and the free quote comes back within an hour.

KSeF

Who KSeF applies to, and from when

KSeF already applies to every business: to receiving invoices since 1 February 2026 and to issuing them since 1 April 2026.

1 February 2026

Receiving invoices

Every business

from 1 February 2026

1 February 2026

Issuing invoices

Sales above 200 million PLN incl. VAT in 2024

from 1 February 2026

1 April 2026

Issuing invoices

Everyone else

from 1 April 2026

1 April 2026 - 1 January 2027

Issuing invoices

Up to 10,000 PLN incl. VAT a month on invoices outside KSeF

outside KSeF until the end of 2026

1 January 2026 - 1 January 2027

Penalties for errors

Every business

deferred to 1 January 2027

1 January 2026

Consumer invoices

Sales to private individuals

in KSeF on a voluntary basis

Your own integration or a ready tool

Not every business needs code. What matters is where invoices are created.

A ready tool is enough

  • You issue a few invoices a month, by hand.
  • Invoices come from an invoicing program that already talks to KSeF.
  • You do not need invoice statuses in your own panel or store.

The Ministry's free tools or a program with a ready integration. Code would be money spent for nothing.

You need your own integration

  • The invoice is created automatically in a store, client panel, billing system or ERP.
  • You want the KSeF number, UPO and rejection reason on every order.
  • Purchase invoices should land in your system or with your accountant on their own.

An integration with the KSeF 2.0 API in your code, with a queue, offline modes and QR codes on the invoice view.

API and integrations service

How a system talks to KSeF

One invoice in an interactive session, from the challenge to the UPO. This is what it looks like in API 2.0.

Your systemKSeF moduleKSeF API
Your system → KSeF module
Invoice to send

The order becomes an XML file in the FA(3) schema

KSeF module → KSeF API
POST /auth/challenge

The challenge is valid for 10 minutes

KSeF module → KSeF API
POST /auth/ksef-token

The KSeF token and timestamp encrypted with the MF public key

KSeF API → KSeF module
accessToken and refreshToken

After a status check and a one-off POST /auth/token/redeem

KSeF module → KSeF API
POST /sessions/online

A session with an AES-256 key wrapped in the MF key, valid for 12 hours

KSeF module → KSeF API
Encrypted invoice

POST /sessions/online/{ref}/invoices

KSeF API → KSeF module
KSeF number or rejection

A rejection comes back with an error code and description

KSeF module → Your system
Status on the order

KSeF number stored with the invoice, a link for the QR code

KSeF module → KSeF API
Close the session, get the UPO

The collective UPO is generated asynchronously

Batch session
For many invoices we send a ZIP package split into parts of up to 100 MB before encryption, instead of hundreds of single calls.
A certificate instead of a token
Signing in with a XAdES signature or a KSeF certificate works too. The Ministry recommends a KSeF certificate in production, as its check does not wait on external OCSP.

When KSeF or the internet is down

An invoice sent later than the day it was issued is an offline invoice. The module works out the deadline for each one.

Legal basis: articles 106nda, 106nh and 106nf of the VAT Act, per the MF integrator guide. An offline invoice gets the offlineMode flag and two QR codes.

  1. 01 Offline24
  2. 02 KSeF unavailable
  3. 03 KSeF failure
  4. 04 Total failure

01 Offline24

When The issuer chooses it, with no announcement or proof of a lost connection.

Deadline to send to KSeF By the next working day after the issue date.

02 KSeF unavailable

When Unavailability announced in the Ministry's BIP and in the interface software.

Deadline to send to KSeF By the next working day after it ends.

03 KSeF failure

When A failure announced in the Ministry's BIP and in the interface software.

Deadline to send to KSeF Within 7 working days of its end; a further announcement restarts the count.

04 Total failure

When An announcement on radio, TV, press or the internet.

Deadline to send to KSeF No duty to send them later. These invoices carry no QR codes.

What is on the invoice your customer sees

A customer without KSeF access gets a PDF or a printout. The view has to let them check the invoice in the system.

VAT invoice, PDF view

Schema
FA(3)
Issue date (field P_1)
2026-10-06
Seller
Seller tax number
Sending mode
online
Lines, rates and amountsfrom the same record as the XML file
1. KSeF numberassigned by the system once the file is accepted
2. CODE I (QR code)verification link: tax number, date, SHA-256 hash of the file
3. Label under the codethe KSeF number or the word OFFLINE
4. CODE II (offline only)a link signed with the issuer's KSeF certificate key

The issuer's application generates the codes locally, per ISO/IEC 18004:2024.

We design the view together with your invoice template.

A queue instead of waiting on KSeF

A sale never waits on KSeF. The invoice goes into a queue, sending runs in the background and retries with a growing pause.

  1. 01at once
  2. 02after a minute
  3. 03after a few minutes
  4. 04after 15 minutes
  5. 05hourly

Stop and alert with the reason

A limit is not an outage
Over a limit, KSeF says how long to wait. The module waits exactly that long, because every further breach extends the block.
The legal deadline over the retries
We set the retry schedule to end before the offline invoice deadline, with time left for a person to react.
No duplicates
A document has one state in the queue. A retry after a dropped connection checks the status in KSeF first instead of sending again.
Purchase invoices less often
The Ministry recommends incremental downloads no more often than every 15 minutes, or daily at low volume. That is how we set the schedule.

What we connect KSeF with

KSeF is one end. The other is the system where the invoice is created, or where it has to arrive.

KSeF modulequeue, statuses, UPO, QR codes

If you run a hosting business, the Flaem panel has full billing with KSeF, a queue and corrections built in.

How a KSeF integration project runs, in 9 stages

How a KSeF integration rollout goes, step by step.

9 stages, from "Choosing the route" to "Production and care".

  1. Stage 01Choosing the route We check whether an invoicing program with a ready KSeF connection is enough or whether you need your own integration. Output: a program or an integration
  2. Stage 02Data map We check where the invoice is created and which FA(3) fields your data lacks. Output: a list of gaps and decisions
  3. Stage 03Permissions You grant permission to issue invoices. The system signs in with a KSeF token or certificate on behalf of the seller's tax number, and we keep the keys outside the code. Output: access to KSeF
  4. Stage 04Sending queue We build a queue that sends invoices in the background, retries without duplicates and stores the KSeF number and UPO with the order. Output: the KSeF number with the order
  5. Stage 05Purchase invoices We set up incremental download of supplier invoices into your system, at the intervals the Ministry recommends. Output: purchase invoices in your system
  6. Stage 06Test environment Sign-in, sending, receiving and rejections on random tax numbers, no real data. Output: a working module on TEST
  7. Stage 07Fallback modes We simulate a lost connection: an offline invoice, two QR codes, sending on time. Output: offline scenarios tested
  8. Stage 08Pre-production On the DEMO environment, which mirrors production, with your own token. Output: sign-off before going live
  9. Stage 09Production and care A configuration switch and following the changes the Ministry announces in its API changelog. Output: invoices with a KSeF number

Common questions about KSeF

Answers about deadlines, offline modes, purchase invoices and corrections.

How much does the KSeF integration cost?
The KSeF integration costs from PLN 999 (about EUR 220). The figure grows with the number of systems, data directions and exceptions to handle. A typical integration takes 2-3 days, and the free quote comes back within an hour. We quote it under our API and integrations service.
How long does it take?
Usually 2-3 days. The exact dated schedule comes with the free quote, and if anything is going to move, you know in advance.
When do I need my own KSeF integration?
When invoices are created automatically in your store, panel, billing system or ERP. Then the integration sends them to KSeF on its own, and you see the KSeF number and any rejection reason on every order. For a few invoices issued by hand a program with a ready connection is enough, and we say so at once.
Does the customer wait for KSeF at checkout?
No. The invoice goes into a queue and sending happens in the background. A KSeF outage does not stop sales.
What if KSeF is down?
The rules provide offline modes with their own deadlines. The module flags the invoice, adds two QR codes and sends it on time.
Will you also receive my suppliers' invoices?
Yes. The integration downloads purchase invoices incrementally into your system, at the intervals the Ministry recommends.
How do I fix an invoice already in KSeF?
With a correction invoice. An accepted invoice cannot be changed, and a correction can only be sent once the original has its number.
How does the system sign in to KSeF?
With a token or a certificate from KSeF, always on behalf of the seller's tax number. Keys stay outside the code, in the server settings.
Do I already have to issue invoices in KSeF?
Yes. Since 1 February 2026 every business receives invoices in KSeF, and since 1 April 2026 every business issues them there (businesses with sales above 200 million PLN incl. VAT in 2024 since 1 February). Until the end of 2026, invoices totalling up to 10,000 PLN incl. VAT a month may still stay outside KSeF.
Do invoices for private individuals go to KSeF too?
They may, but need not: invoices for consumers go to KSeF on a voluntary basis. We set it in the integration the way you prefer.
Why the KSeF number in a transfer?
From 1 January 2027 an active VAT payer gives the KSeF number in a transfer paying another active VAT payer's invoice. That is why the integration stores the number with every invoice, purchase ones included, so it is at hand when you pay.
Who is responsible for connecting an online store to KSeF?
The duty to issue an invoice in KSeF lies with the seller, the company that runs the store. The technical connection is done by whoever built the store or by an integrator: VulCode connects stores to KSeF through the KSeF 2.0 API or through an invoicing program that already talks to KSeF. On your side you grant the permission to issue invoices and decide which system the invoices come from.
How do I connect a store to KSeF step by step?
First we list where invoices are created: in the store, in the ERP or by hand, and choose the route: an invoicing program with KSeF or your own integration. You grant the permissions, and we map invoices to FA(3), build the sending queue with the KSeF number and UPO stored with the order, downloading of purchase invoices and offline modes with QR codes. We test it all on the TEST and DEMO environments and switch on monitoring after launch.
Will the KSeF integration code be mine?
Yes. Once the work is accepted and paid in full, the economic copyright in the code passes to you. You have access to the repository from the first day, and after acceptance you get it with run instructions. Open source libraries keep their own licences.

Sources

Dates, modes and technical details come from the Ministry of Finance website and documentation.

Describe your project.

A free quote comes back within an hour during working hours.