Get in touch
  • OpenCart
  • Payments
  • v1.0.0

KSeF E-Invoicing for OpenCart — FA(3) e-invoices to Poland’s KSeF straight from orders

Structured FA(3) e-invoices for Poland's KSeF from OpenCart 4, 3 and 2.3 orders: sent directly to the KSeF API 2.0 with your own token, no SaaS subscription. KSeF number, UPO and QR code on the order, NIP field at checkout, queue with retries, TEST/DEMO/PROD. Pro adds correction invoices, EU and non-EU buyers, B2C, currencies at the NBP rate and a customer e-mail with the QR code. Lifetime licence.

Download Free
Pro · lifetime licence The more sites, the less each one costs
Compatibility
OpenCart 4.0.2 – 4.1.x, 3.0.x and 2.3.0.2 (tested on 4.1.0.3, 4.0.2.3, 3.0.5.0, 2.3.0.2) · default checkout and One Page Checkout (CatCode) · KSeF API 2.0, FA(3)
Version
v1.0.0 (OpenCart 4)
v1.0.0 (OpenCart 3.x)
v1.0.0 (OpenCart 2.3)
Licence
one site, lifetime
Trial
7 days, no card, one per site
Updated
September 2026
Or all 144 Pro modules with All Access — 4 990 ₴ / year

What Free has,
and what Pro adds

The free version works with no time limit. Pro adds the rest of the features in the table.

Feature Free Pro
FA(3) invoice (schema 1-0E) from the order: seller, buyer with NIP, products with options, SKU and EAN, shipping, fees, VAT by rate, payment ✔ ✔
Issued automatically when the order gets the chosen statuses (default: the shop's "complete" statuses); "Issue KSeF invoice" button on the order page ✔ ✔
Coupons and discounts are spread over the VAT rates of the products; VAT from OpenCart taxes, a rate included in prices or a VAT-exempt seller (zw) ✔ ✔
Direct sending to the KSeF API 2.0 with your KSeF token: online session, AES-256 encryption, no third-party services ✔ ✔
KSeF number, official UPO and verification QR code (KOD I) on the order; XML and UPO download ✔ ✔
NIP field at checkout (a native OpenCart custom field, created with one button) with checksum validation — default checkout and One Page Checkout ✔ ✔
Queue with automatic retries: when KSeF is down, invoices wait and go out later ✔ ✔
Duplicate protection: the same file never makes a second invoice, a foreign KSeF number is never attached to the order ✔ ✔
Rejection reasons in KSeF's words, "Regenerate and send" after a fix, "Discard" ✔ ✔
TEST, DEMO and PRODUCTION environments with separate number counters ✔ ✔
Your own number format: {YYYY}/{MM}/{DD}/{N}, reset monthly, yearly or never ✔ ✔
Invoice register with search and filter, KSeF panel on the order page, the invoice NIP can be corrected from the admin ✔ ✔
KSeF token encrypted, the key in a file outside the database; sending right after the status change, by the OpenCart 4 scheduler or a cron address ✔ ✔
Builds for OpenCart 4.x, 3.x and 2.3; module languages: English, polski ✔ ✔
Correction invoices (KOR): full on a refund status, partial by lines and / or amount, with the KSeF number of the original — ✔
Buyers from other EU countries (EU VAT, 0% WDT) and outside the EU (export, 0% EX) — ✔
Consumer invoices (B2C) to KSeF if you choose — ✔
EUR, USD and other currencies at the NBP rate with VAT in PLN in the XML — ✔
Customer e-mail "Your invoice is in KSeF" with the QR code, a block in the customer account and a printable invoice — ✔
Invoices for past orders (by ID or period), CSV register for the accountant, e-mails about rejected invoices — ✔

What it looks like

NIP field with a checksum error at the OpenCart checkout
OpenCart 4 checkout (One Page Checkout): the “NIP (for a VAT invoice)” field with a wrong checksum — “NIP (for a VAT invoice) is not a valid input!”. An empty field does not stop the order.
NIP error at the OpenCart checkout
OpenCart checkout with the NIP field: a number with a wrong checksum is refused, with the error right under the field.
Printable VAT invoice with the KSeF number and verification QR code on a phone
Pro: printable invoice on a phone — seller, buyer with NIP, lines with shipping, totals by rate, the NBP rate for EUR and a QR code to verify the invoice in KSeF.

The trial starts when you ask

A fresh install is the free version, nothing switches on by itself. The “Try Pro for 7 days” button → e-mail → the key right in the window and by e-mail.

One key — one site

Moving the store? Unbind the licence on the old domain and activate it on the new one yourself. If our server is unreachable, Pro keeps working for 14 more days. For studios — keys for 5 or 25 sites, or unlimited.

Technical requirements

  • OpenCart 4.0.2 – 4.1.x (tested on 4.1.0.3 and 4.0.2.3), 3.0.x (tested on 3.0.5.0) or 2.3.0.2 (tested on PHP 7.0)
  • PHP as required by your OpenCart version, with OpenSSL; no third-party libraries. MySQL / MariaDB, mysqli and pdo drivers.
  • A KSeF token for the seller’s NIP from the KSeF taxpayer application of the environment you work in (TEST, DEMO or PRODUCTION). When moving from TEST to PRODUCTION the token has to be replaced.
  • OpenCart taxes with Polish rates (23%, 8%, 5% …) in the tax classes of products and shipping, or the “rate included in prices” mode, or zw. Rates outside the Polish list and fixed taxes (type F, eco tax) produce no invoice — the module explains why.
  • Currency — PLN for Free; other currencies at the NBP rate with Pro.
  • Checkout: default and One Page Checkout (CatCode). Third-party checkouts with their own field templates have not been tested.
  • For fast statuses — PHP-FPM or the cron address from the “Tools” tab every 5 minutes. Without them statuses and UPO update hourly (OpenCart 4) or when the admin is opened.
  • Module languages: English and Polish.

Version history

v1.0.0 Current September 2026

For OpenCart 4.x, 3.x and 2.3: FA(3) 1-0E, KSeF API 2.0 with a KSeF token, queue with retries, UPO, KOD I QR code, duplicate protection, validated NIP field on the default checkout and One…

Frequently bought with KSeF E-Invoicing for OpenCart

4 modules in one order — 40% cheaper than separately

“Store starter” bundle KSeF E-Invoicing Nova Poshta Premium LiqPay Telegram notifications and Viber/SMS for customers Need more — all 144 modules in All Access for 4 990 ₴.
3 590 ₴ lifetime instead of 5 960 UAH bought separately
Buy the bundle →

Full module description

KSeF E-Invoicing for OpenCart is a module for shops in Poland that invoice businesses. From 2026 Polish VAT payers send B2B invoices through the National e-Invoice System (Krajowy System e-Faktur, KSeF). The module turns an OpenCart order into a structured invoice in the official FA(3) format and sends it straight to the KSeF API 2.0 — no accounting SaaS in between and no monthly subscription. The KSeF number, the official receipt (UPO) and the verification QR code are stored on the order. Builds for OpenCart 4.x, 3.x and 2.3.

What you need. A KSeF token for your company’s NIP, generated in the KSeF taxpayer application (Aplikacja Podatnika KSeF) of the chosen environment (“Tokeny” section, invoice write and read permissions). Honestly about testing: the module has been tested on the official KSeF TEST environment of the Ministry of Finance on OpenCart 4.1, 4.0.2, 3.0.5 and 2.3 — invoices were accepted with real KSeF numbers and UPO, and every XML is valid against the official FA(3) XSD. We have not run it on DEMO or PRODUCTION yet: same API there, but it needs a real company. Try it on your own NIP with the 7-day Pro trial — if KSeF answers differently than on TEST, we fix it promptly.

The shop remains responsible for the invoice content: the module builds FA(3) from the OpenCart order data (products, order total lines, taxes, addresses, NIP). Tax decisions — how a coupon is spread over rates, when 0% WDT or EX applies, when an order counts as paid, the correction type — follow OpenCart’s logic and the Ministry of Finance documentation; show the settings to your accountant before switching to PRODUCTION.

What the customer sees

The module adds a native OpenCart custom field “NIP (for a VAT invoice)” — the “Create the NIP field” button in the settings creates it. The default checkout, registration, account pages and One Page Checkout (CatCode) show it. It is optional: without a NIP the order goes through as usual and no KSeF invoice is created. When a NIP is entered, the module checks its checksum — a wrong number stops the checkout with an error next to the field. “5265877635”, “526-587-76-35” and “PL5265877635” are all accepted, as are VAT numbers of other EU countries (invoicing such buyers needs Pro).

On a phone it works the same way: the error shows under the field, the rest of the checkout is unchanged. A customer who already has an account in OpenCart 4 sees the NIP field in their account, not at checkout — that is how OpenCart shows account fields. For such orders you can enter the NIP on the order page in the admin (see below).

With Pro the customer gets the e-mail “Your invoice is in KSeF” with the KSeF number and QR code, an invoice block on the order page of their account and a printable invoice behind a keyed link. The printable invoice is an information copy; the legally binding invoice is the XML in KSeF.

What the admin gets

  • Extensions → Modules → KSeF E-Invoicing: tabs “Invoices”, “Settings”, “Tools” and “Licence”.
  • The KSeF token is stored encrypted, with the encryption key in the file storage/cc_ksef.key.php, not in the database; the form only shows “saved”. You can also set the token with the CC_KSEF_API_TOKEN constant in config.php.
  • “Check the connection to KSeF” runs a full authentication and tells you which NIP and environment work, or shows the KSeF error in words (e.g. 450 for a wrong token).
  • Environment — TEST, DEMO or PRODUCTION; while TEST or DEMO is on, a notice at the top reminds you that invoices have no legal effect.
  • Statuses that issue the invoice, the seller (Podmiot1) with KRS / REGON / BDO, number format, VAT source, unit of measure, shipping line prefix, order total lines that are payments (gift vouchers, store credit), payment term and IBAN for bank transfer orders.
  • Invoice register: number, order, buyer with NIP, total, status, KSeF number or rejection text; status filter, search and pagination.
  • “Send queued invoices now” sends the queue at once, including invoices waiting for a retry.
  • Order history notes: “created and queued”, “accepted, KSeF number …” or the rejection reason.

The KSeF panel on the order page: the buyer’s NIP with its validation mark, a field to enter or correct the NIP just for the invoice (the customer’s own field is not changed), status, KSeF number, KOD I QR code and a link to the details. An order without an invoice gets an “Issue KSeF invoice” button, and when there is no invoice for a reason (e.g. a consumer order), the panel says why.

The invoice page: date, status, KSeF number, session, SHA-256 of the file, “Download XML”, “Download UPO”, the printable invoice, the QR code and the full FA(3) XML that KSeF saw. A rejected invoice shows the KSeF text in Polish and the “Regenerate and send” (after fixing the data) and “Discard” buttons. With Pro the same page has the correction invoice form: returned quantities per line and / or a price reduction spread over the VAT rates; the module will not correct more than is left.

Number already used by another program. If you also issue invoices on the same NIP in another program or another shop with the same number pattern, KSeF refuses the second invoice with that number (code 440). The module compares the file with the UPO of the original: its own file (e.g. when the KSeF response was lost) is taken over with its KSeF number, a foreign one never. Such an invoice becomes “Rejected by KSeF” with an explanation and the other document’s KSeF number; change the number format (e.g. a SKLEP/ prefix) and click “Regenerate and send” — the invoice gets a new number. While the original cannot be compared yet, the invoice stays in processing for up to 24 hours and is checked every 2 minutes.

How it works — step by step

  1. Setup. KSeF token → “Check the connection to KSeF” → seller data → “Create the NIP field” → switch on “Issue KSeF invoices”. Start on the TEST environment.
  2. Checkout. A business buyer enters the NIP. A wrong NIP will not pass; without a NIP it is a regular order without an invoice.
  3. Order status. The order gets a chosen status (default: the shop’s “complete” statuses) — the module builds an FA(3) invoice with the next number and queues it. Lines come from the order products and order total lines: shipping, fees, coupons (spread over the rates).
  4. Sending. On a PHP-FPM server the invoice goes out right after the admin page responds; on top of that the queue is checked by the OpenCart 4 scheduler (hourly), by the keyed cron address from the “Tools” tab (every 5 minutes recommended) and when the admin is opened.
  5. KSeF status. Accepted — the KSeF number and QR code on the order; the UPO appears in KSeF shortly after the number and is fetched on the next pass. Rejected — the reason in the register, on the invoice page and in the order history.
  6. Failures. KSeF down, 429 or 503 — the invoice waits and retries by itself; the same XML byte for byte, so there is never a second invoice.
  7. Returns (Pro). The order gets a correction status (Refunded / Reversed by default) — a full KOR correction invoice with the original’s KSeF number; partial corrections by hand on the invoice page.
  8. Customer (Pro). The e-mail “Your invoice is in KSeF” with the KSeF number and KOD I QR code, a block in the account and a printable invoice.

Under the hood

  • FA(3), schema 1-0E — element order strictly per the Ministry of Finance XSD; every invoice from the test runs on OpenCart 4, 3 and 2.3 (B2B with several rates, coupons, EUR, EU, B2C, KOR) is valid against the official schema.
  • KSeF API 2.0 without third-party libraries: token authentication (RSA-OAEP SHA-256), online session, AES-256-CBC, status polling, UPO. Access and refresh tokens are cached; a 401 triggers re-authentication.
  • Totals as in the order. Coupons and discounts are spread over the rates in proportion to the products’ net amounts, shipping and fee tax comes from the order’s tax lines, and the rounding remainder goes into the largest line — the invoice P_15 equals the order total, in PLN and in a second currency.
  • Payment: cash on delivery → form 1, bank transfer → form 6 with the IBAN from the settings; “paid” by the chosen statuses, otherwise a payment term.
  • The XML never changes after it is created. A retry sends the same file, so a lost KSeF response gives a 440 with the original number, not a second invoice. A 440 duplicate is taken over only for the module’s own file (SkrotDokumentu from the original’s UPO or the SHA-256 of the file from KSeF).
  • Numbering with a lock (MySQL GET_LOCK): two orders in the same second never get the same number.
  • NBP rate (Pro) — table A of the last business day before the date of sale; the XML has KursWaluty and VAT in PLN (P_14_xW). A printable invoice in EUR shows the rate, VAT in PLN is in the XML.
  • Own tables (cc_ksef_invoice, cc_ksef_order, cc_ksef_kv) and OpenCart events — no core file edits: install.xml in the 3.x and 2.3 builds contains no modification.
  • KSeF offline modes (offline24, emergency, KOD II) are not implemented: while KSeF is down, invoices wait in the queue.
  • Uninstalling. OpenCart itself erases the module settings, so after a reinstall the token and seller data are entered again; the invoice register, counters and licence stay. The “Delete data on uninstall” switch removes the register too.

Installation

  1. OpenCart 4: Extensions → Installer → upload cc_ksef.ocmod.zip (do not rename the archive) and click “Install”. OpenCart 3: Extensions → Installer → cc_ksef-oc3.ocmod.zip. OpenCart 2.3: copy the contents of the upload/ folder from cc_ksef-oc2.ocmod.zip to the shop root (FTP or the hosting file manager) — the 2.3 installer needs FTP access, uploading by hand is simpler.
  2. Extensions → Extensions → Modules → KSeF E-Invoicing → “Install”, then “Edit”.
  3. TEST environment, a token from the KSeF taxpayer application of the same environment, “Check the connection to KSeF”.
  4. Seller data, number format (your own prefix if another invoicing program is in use) and VAT source; “Create the NIP field”; switch on “Issue KSeF invoices”.
  5. Place a test order with a NIP and set it to “Complete” — within a minute the order page shows the KSeF number.
  6. Moving to PRODUCTION — switch the environment and paste the PRODUCTION token.
  7. For Pro: the “Licence” tab — the key from the e-mail after payment, or the 7-day trial.

Questions
about the module

Didn't find the answer? Message us on Telegram and we'll reply within a business day.

@catcode_support Setup, compatibility, activation
What do I need to start?

A KSeF token for your company's NIP. You generate it in the KSeF taxpayer application (Aplikacja Podatnika KSeF, "Tokeny" section) with the invoice write and read permissions and paste it into Extensions → Modules → KSeF E-Invoicing → Settings. No separate contract or SaaS account is needed.

What has the module been tested on?

On the official KSeF TEST environment of the Ministry of Finance, on OpenCart 4.1.0.3, 4.0.2.3, 3.0.5.0 and 2.3.0.2: B2B, B2C, EU in EUR, corrections, a rejection with its reason, UPO, duplicates — with real KSeF numbers. It has not been run on DEMO or PRODUCTION yet: same API there, but it needs a real company.

I'm moving from TEST to PRODUCTION. What do I change?

The token. A KSeF token only works in the environment it was generated in, so after switching paste a token from the PRODUCTION taxpayer application. Each environment keeps its own number counters.

I also issue invoices in another program on the same NIP.

Give the shop its own number format, e.g. SKLEP/{YYYY}/{MM}/{N}. If the other program already used the same number, KSeF refuses the invoice; the module marks it as rejected with an explanation and never attaches the other document's KSeF number to the order. After changing the format use "Regenerate and send".

Is the licence really lifetime?

Yes. For OpenCart the licence is a one-time payment with no yearly fees. The Pro features stay in your shop for good.

What if KSeF is down?

Invoices stay in the queue and are sent automatically as soon as KSeF answers. Nothing is lost, nothing is sent twice.

Not quite what you are looking for?

We build custom modules for WordPress, WooCommerce, OpenCart and Shopify. Tell us about the task and we'll prepare an estimate.

Order a custom module