Connect WooCommerce to KSeF: step-by-step setup
In short: connecting WooCommerce to KSeF (the Polish National e-Invoicing System) takes six steps: KSeF access with permission to issue invoices, a plugin connected to the KSeF test environment, a NIP field at checkout, numbering, VAT rates including shipping, and the moment the invoice is issued. Then you test a refund, and only after that go to production. The guide fits most KSeF plugins, and we give WooCommerce setting names as they appear in its English documentation.
Which plugin to choose is covered in KSeF for WooCommerce, and seven plugins with prices and refund handling are side by side in KSeF e-invoicing plugins for WooCommerce compared. Here we assume the choice is made.
Step 1. Prepare access to KSeF
The plugin logs in to KSeF on behalf of your company with a KSeF token or certificate, which you create in the taxpayer app, Aplikacja Podatnika KSeF, in the context of your company's NIP (Polish tax identification number).
- Choose how to connect. A token takes a minute to generate and can be limited to selected permissions. A certificate works for up to 2 years and has a secure status after 2026, but carries all the permissions of the person who generated it. Comparison: KSeF token or certificate.
- Token: tick only issuing invoices, and viewing invoices only if the plugin vendor explains why it needs it. Guide: KSeF token.
- Certificate: choose the purpose "Uwierzytelnienie w systemie KSeF" (authentication in KSeF), save the
.keyfile and the password. Guide: how to generate a KSeF certificate. - Do not give the app permission management. The minimum for the plugin is described in KSeF permissions for a store app.
Before testing, generate a separate token or certificate on the test environment. Production credentials do not work there.
Step 2. Install the plugin and connect it to KSeF TEST
- Make a backup, install the plugin and check its requirements: PHP version, WooCommerce version and HPOS compatibility (the newer way WooCommerce stores orders).
- In the plugin settings, choose the test environment and paste the test token or upload the test certificate.
- Enter the seller details: NIP, name and address matching the official register.
- Use the connection test button if the plugin has one. An error at this stage is most often credentials from a different environment.
Step 3. Add and check the NIP field at checkout
KSeF makes the invoice available to a business by the NIP on the invoice, so the NIP must reach the order before payment.
- Check which checkout you use. New stores have the block checkout, older ones often the classic one. Fields in the block checkout are added through the Additional Checkout Fields API, available since WooCommerce 8.9 (WooCommerce documentation).
- If you already have a NIP field from another plugin, for example a checkout field editor, point the KSeF plugin to it in its settings instead of adding a second one.
- Turn on checksum validation, so that a typo blocks the order instead of ending in a correction to zero.
- Place an order from a phone and check that the NIP was saved in the order.
More about the NIP field: NIP field in checkout.
Step 4. Set up invoice numbering
The invoice number is assigned by the plugin or the invoicing software. Check that:
- the series does not overlap with invoices from other tools, for example the software you use for Allegro invoices. KSeF rejects a second invoice with the same number from the same seller (code 440),
- corrections have their own series,
- re-sending after a network error does not create a new number.
Step 5. Map VAT rates and shipping
WooCommerce does not know VAT rates as such, only tax classes: Standard, Reduced rate and Zero rate, plus any you add yourself (WooCommerce, setting up taxes). The KSeF plugin needs to know which class is 23%, 8%, 5% and 0%.
- In WooCommerce > Settings > Tax, set the rates for Poland in each class.
- In the plugin settings, assign the classes to the VAT rates on the invoice.
- Check the "Prices entered with tax" option. It decides whether WooCommerce stores gross or net prices, and therefore how amounts are calculated on the invoice.
- Shipping must have tax. The "Shipping tax class based on cart items" option takes the class from the products, but with a cart containing different classes, WooCommerce uses the Standard class for shipping if it is in the cart. On the invoice, the shipping cost follows the rate of the goods, and with several rates it is split between them. Rules: shipping cost on the invoice (in Polish).
- Compare invoice and order totals to the grosz. Differences usually come from rounding: VAT rounding on the invoice (in Polish).
Step 6. Decide when the invoice is created
In WooCommerce the status "Processing" means the payment has arrived, and "On hold" is waiting for payment confirmation, for example with a traditional bank transfer (WooCommerce, order statuses). Set in the plugin which statuses count as paid, and decide separately about cash on delivery. In KSeF the issue date is the day the invoice is sent to the system, so the date on the invoice and the sending day must match: when to issue an invoice in a store (in Polish).
If the plugin sends invoices in the background, it usually does so through WP-Cron, which runs only when someone visits the site (WordPress, Cron). In a small store it is worth setting up a system cron with your hosting provider.
What happens on a refund
You record a refund in WooCommerce with the "Refund" button, entering the quantities of returned items and, if needed, shipping. The "Refunded" status appears only when the whole order is refunded, and changing the status to "Refunded" by itself does not return any money (WooCommerce, refunds). For KSeF what counts is a correction invoice (faktura korygująca) with the KSeF number of the original invoice (art. 106j(2) point 2a and (4) of the VAT Act).
Test three cases: a refund of one item with shipping, a full refund, and a refund of an amount only, without items. Many plugins reject the last one or leave it for a manual correction. Correction rules: correction invoice for returned goods.
When KSeF does not respond
The plugin keeps the invoice in a queue until KSeF accepts it, or issues it offline and sends it later. In that case it tracks the deadline: the next working day in offline24 mode, or 7 working days from the end of an announced outage, and a PDF handed over before the number is assigned needs two QR codes. Ask the vendor which model it uses. Details: KSeF outage.
Testing on KSeF TEST and going to production
On the test environment, go through an order with a NIP, an order without a NIP, a wrong NIP, two VAT rates with shipping, a discount code, a partial refund and a full refund. Scenarios and differences between environments: KSeF test environment. Then generate a token or certificate on production, switch the plugin, remove the test settings and check the first real invoice in Aplikacja Podatnika KSeF.
Checklist before launch
General store preparation is described in the KSeF online store checklist. Here only what concerns the plugin:
- Token with permission to issue invoices, or a certificate for "Uwierzytelnienie w systemie KSeF", without permission management
- The NIP field works in the checkout you use, with checksum validation, also on a phone
- The number series does not overlap with other tools, corrections have their own
- Tax classes assigned to 23%, 8%, 5% and 0%, shipping taxed
- You know which statuses mean payment and what happens with cash on delivery
- Partial and full refunds produce a correction in KSeF
- You know what the plugin does when KSeF does not respond
- Only one tool sends this store's invoices to KSeF
- Your accountant has permission to view invoices (KSeF permissions for an accountant)
How it works in KSeF Faktury for WooCommerce
Our plugin is free: it passes paid orders with a NIP to our server, and the server handles the FA(3) invoice, sending to KSeF and the PDF with a QR code. You upload the token or certificate in the KSeF Faktury panel, not in WordPress, so it is not stored in the store's database. In both the classic and block checkout it lets the buyer tick a company invoice and enter a NIP validated by checksum, or it reads the NIP from a field you already have. It turns a WooCommerce refund into a correction, and on the order it shows the status, KSeF number and a link to the PDF. A refund of an amount only, without items, needs a manual correction. We tested it on KSeF TEST in both types of checkout.
The plugin is now in the WordPress.org directory as Ksefshop Invoices for WooCommerce. The service itself is in early access: you open an account yourself at app.ksefshop.pl/panel/signup, and testing on KSeF TEST is free.
How to create an account and get an API key
The plugin connects to the Ksefshop cabinet at app.ksefshop.pl/panel. Below is a summary; every field and button is described in detail in free KSeF module for PrestaShop, and the cabinet works the same way for WooCommerce.
- Sign up. On app.ksefshop.pl/panel/signup enter your "Email address" and click "Send link". No invite code is needed.
- Confirm your e-mail. Open the link from the message (it works for 15 minutes) and click "Sign in".
- Company details. Enter the NIP, full name and address as in CEIDG or KRS. In "Where orders will come from" keep "WooCommerce (plugin)". Set the "Invoice number pattern" and "Correction number pattern", because the service numbers the invoices of WooCommerce orders. Click "Create company".
- Test key. Copy the "API address" and the "Test key" (
sk_test_...). The key is shown only once; you can create a new one under "Stores and API keys". - KSeF connection. Under "KSeF connection" upload a certificate (how to generate it), paste a KSeF token, or on KSeF TEST click "Connect with a test certificate". After a moment the status changes to "connected".
Then install the Ksefshop Invoices plugin from the directory in WordPress (Plugins > Add New) and open WooCommerce > Ksefshop Invoices:
| Field | What to enter |
|---|---|
| API URL | https://app.ksefshop.pl |
| API key | the sk_test_... key from the cabinet; later an empty field keeps the saved key |
| NIP at checkout | tick it if the plugin should add the "I want a VAT invoice for my company (NIP)" checkbox and the NIP field to checkout (classic and block checkout) |
| Existing NIP field | optional: the order meta key if another plugin already collects the NIP, for example Flexible Checkout Fields |
Click "Save Changes", then "Test connection". A good result is "Connected to the Ksefshop invoicing service." with the KSeF environment, the seller NIP and "KSeF certificate or token: connected". Place a paid test order with a NIP and check the "KSeF invoice" box on the order and "Invoices" in the cabinet (app.ksefshop.pl/panel/invoices). Going to production works as for PrestaShop: "Live" mode in the cabinet, a certificate or token from production KSeF and an sk_live_... key. During early access live mode is shown as "Live (soon)".
Frequently asked questions
How long does it take to connect WooCommerce to KSeF?
Configuration usually takes an hour or two. Testing orders and refunds takes the longest.
By when do I need it?
Large companies (sales in 2024 over PLN 200 million) have issued invoices in KSeF since 1 February 2026, everyone else since 1 April 2026. Invoices for businesses up to PLN 10,000 gross a month can be issued outside KSeF until 31 December 2026 (art. 145m), and from 1 January 2027 KSeF applies to everyone. Under the current Act, the penalties in art. 106ni apply from 1 January 2027. Government draft UD477 from September 2026 moves them to 1 January 2028 and was sent to the Sejm on 20 October 2026 (print no. 3245), but it is still a draft and does not change the KSeF obligation itself.
This article is general information and is not tax advice.
Sources
- WooCommerce: Setting up taxes, Order statuses, Refunds, Additional Checkout Fields (as of 23.10.2026)
- WordPress Developer Resources: Cron
- Etapy wdrożenia KSeF (KSeF rollout stages)
- Act on goods and services tax (VAT Act), consolidated text Dz.U. 2026 poz. 1263: art. 106j(2) and (4), art. 106ni, art. 145m
Legal status as of 26 October 2026.