Portfolio · Module

KSeF module and Autopay integration

Online payment, confirmation and an invoice in KSeF, Poland’s national e-invoicing system, with no manual work. A shared settlement module running in production in three applications.

In production in three applications: Translate in Context / XL8, Let’s Play a Gig / Koncertuj and Feel at Home / Zadomo.

Our own Localize.pl project, not client work.

The problem and who it is for

An application that takes online payments in Poland must issue a valid FA(3) invoice in KSeF, the national e-invoicing system, after every successful payment. It must not issue it twice, and it must not issue it when the payment did not go through.

Instead of writing this three times, we built one module for three applications.

How it works

  1. Payment through the Autopay gateway
  2. ITN notification with signature check
  3. Amount and buyer data checks
  4. FA(3) invoice sent to KSeF
  5. KSeF number and XML archived
How it works: a simplified diagram, not a screenshot.

What we built

One invoice per payment

The payment ID works as a key that prevents a second invoice, and the invoice number is claimed in a single, indivisible operation. A repeated gateway notification or a parallel background job will not issue another invoice.

The amount has to match

The module compares the amount from the gateway with the invoice lines. If they differ, no invoice is created.

Companies only with a verified tax ID

A company invoice cannot be built from hand-typed data: the code requires the result of a tax ID (NIP) check, so a version without it simply will not compile.

FA(3) validated against the schema

Business and consumer invoices and corrections, including cross-border rates (intra-EU supply, export, reverse charge), validated against the official XSD schema.

Payment status from the gateway server

The Autopay integration accepts ITN notifications with signature checks and handles refunds. Payment status comes from the gateway server, not from a browser redirect.

Technologies and their role

TechnologyRole
TypeScript, Node.jsKSeF module with no runtime dependencies
KSeF 2.0 (API v2), FA(3), XSDIssuing and validating invoices
AutopayPayments, ITN notifications and refunds
Automated testsBusiness and consumer invoices, corrections, retries

Status

The KSeF module and the Autopay integration run in production in all three applications. The KSeF module is a shared, versioned package with automated tests, while the Autopay integration has a separate implementation in each application. Examples on this page contain no real company or buyer data.

As of 28 September 2026.

← Full portfolio

Need payments and KSeF invoicing in your application?

Tell us about your process. We will check whether a similar approach makes sense for you.

Book a consultation→