Skip to main content
ARVELEHT

Documentation · PL · KSeF FA(2)

How Arveleht handles Polish KSeF.

KSeF (Krajowy System e-Faktur — National e-Invoicing System) is Poland’s central clearance platform. Arveleht emits the FA(2) XML the system expects; the SOAP-channel integration that submits it automatically is the last missing link.

Status: beta. Arveleht produces FA(2) XML that validates against the Ministry of Finance schema. Submission to ksef.mf.gov.pl is manual today; automated submission lands when the first PL customer asks.

01 · What’s mandated

KSeF was piloted voluntarily from January 2022. After several delays the current timetable (Ministry of Finance communication 2024) is:

  • 1 February 2026 — mandatory for large taxpayers (previous-year turnover over PLN 200M).
  • 1 April 2026 — mandatory for everyone else carrying out taxable activity in Poland, including foreign sellers with a Polish VAT registration.
  • Scope. B2B and B2G invoices clear through KSeF. B2C is voluntary. Invoices not cleared through KSeF when required are non-deductible for the buyer.
  • Schema. FA(2) — variant 2 of the Faktura schema, namespace http://crd.gov.pl/wzor/2023/06/29/12648/.

02 · What Arveleht produces

The FA(2) builder lives at lib/ksef/fa2.ts. Given the same form fields, it emits the XML the Ministry’s schema-compliance tool accepts:

  • Naglówek. KodFormularza = FA, WariantFormularza = 2, plus the Ministry’s required metadata block.
  • Podmiot1 / Podmiot2. Seller + buyer with NIP validation (10-digit numeric, hyphens stripped, rejects malformed on render).
  • Fa block. P_1 (issue date), P_2 (invoice number), P_6 (sale date), P_13_1 / P_14_1 / P_15 (net / VAT rate / gross), plus a FaWiersz line element per item.
  • Localisation. The UI swaps line-unit labels to Polish abbreviations (godz. / szt. / usł. / poz.) and flips currency to PLN; the emitter keeps the underlying unit values stable so the submit pipeline doesn’t branch.
  • Diacritics. Polish diacritics (ą / ć / ę / ł / ń / ó / ś / ź / ż) preserved through emit + parse.

03 · What you do with the output

Today, manual upload:

  1. Download the FA(2) XML from /invoices/new.
  2. Log in to ksef.mf.gov.pl using your e-dowód (qualified signature) or trust profile.
  3. Upload the XML in the “Wysyłka” section.
  4. KSeF returns a numer referencyjny (reference number) + KSeF number. Keep both; they are the legal proof of clearance.

04 · What this doesn’t do yet

Automated KSeF submission requires a XAdES-signed authentication session against /api/online/Session/InitSigned, handling of challenge tokens, and integration with either your qualified signature or a KSeF-registered proxy. This is a multi-week build. We will pick it up when the first PL customer commits to a pilot.

Inbound KSeF (receiving supplier invoices) is also not wired; the existing FA(2) renderer is sending-side only.