Fortnox · Craft Commerce 5
The invoice matches what the customer paid
A Swedish Fortnox company almost always rounds every invoice to the nearest krona. A webshop charges to the öre. Those two facts cannot both hold, and nothing in either system ever mentions it — until the bank reconciliation. Knox refuses to be quiet about it.
It tells you before it sends
Knox models Fortnox's own arithmetic, predicts what your company's öresutjämning setting will do to the total, and re-checks the figure Fortnox returns. When they disagree, the invoice says so — with both numbers and the cause on it.
Charged to the customer 499,50
Invoiced in Fortnox 500,00
Fortnox öresutjämning +0,50
▸ Does not match the order
Fortnox applied an öresutjämning of 0,50. Turn it off
under Inställningar → Fakturering → Registreringsvy
to make invoices match what customers pay.
Features
A reconciliation guard, a VAT resolver that shows its working, and an idempotency model built for numbered documents.
Öresavrundning, handled four ways
Knox models Fortnox's arithmetic rather than restating its own, closes its own residual with a real 0% rounding row against 3740, predicts what your company's setting will do, and re-checks the total Fortnox returns.
- Fortnox exposes no endpoint for the setting — Knox infers it from your recent invoices
- A changed setting shows up as a mismatched invoice, not a surprise at year end
It refuses to send something wrong
An invoice that does not add up to what the customer was charged is blocked, with both figures and the reason on it — not sent with a warning in a log nobody reads.
Swedish VAT, resolved per order
Domestic, EU reverse charge, EU consumers with or without One Stop Shop, and export — decided from where the goods go and whether the buyer gave a VAT number, and booked to the right BAS account.
- The reasoning is stored on the invoice, because reverse charge is a claim to Skatteverket
- Account numbers are validated against your own chart before you go live
Never two invoices for one order
A create whose outcome is unknown is never repeated. Knox stamps the Craft order reference on every invoice in a field Fortnox lets you filter on, so an unanswered request is looked up rather than gambled on.
Customers, bookkeeping and payments
Pro keeps a real Fortnox customer per buyer — which is what makes reverse-charged and export invoices possible at all — books invoices with a financial-year pre-check, and moves payments in both directions.
- Register the payment your checkout already took
- Or poll Fortnox for invoices paid there, because a poll cannot miss what a webhook can
Rehearse before you go live
A dry run prints what every uninvoiced order would be invoiced at, which VAT treatment it would get and why, and which orders would be refused — without sending anything.
Frequently Asked Questions
The questions worth answering before you install it.
No — both editions are paid. Lite is a one-off $79 with a $29/year renewal and invoices domestic Swedish sales completely: the full reconciliation and öresavrundning apparatus, the control panel, the console. Pro is $149 with a $49/year renewal, and adds Fortnox customers and everything that depends on them — reverse charge, OSS, export, bookkeeping, payments and credit invoices.
Almost certainly not — it is your Fortnox company's öresutjämning setting, and it is the single most common thing wrong with a Fortnox webshop integration. Fortnox rounds every invoice to the nearest krona and books the difference to 3740, while your shop charges to the öre. Press Detect from Fortnox on Knox's settings screen and read what it says.
Because Fortnox stores the VAT type on the customer record, not on the invoice. An invoice booked against a collective customer whose VATType is SEVAT is reported as a domestic Swedish sale whatever its rows say — so a reverse-charged sale sent that way shows 0% VAT and files as domestic, which looks right and is wrong. Knox blocks it instead. Turn on Sync customers on Pro and it goes through.
No. It checks the shape — two letters, the right country prefix, a plausible length — and says so in the reasoning it stores on the invoice. Confirming a number is actually registered is a VIES lookup and your responsibility; zero-rating a sale on an unverified number leaves you owing the tax.
No, and that is the design's central concern. A unique index means two queue workers racing collide locally rather than in Fortnox's invoice numbering — and a create whose outcome is unknown is never repeated. knox/sync/reconcile looks the invoice up by the order reference Knox stamps on every one, and either claims it or clears the way.
No. Invoicing is a queue job, pushed inside a try/catch from the order-complete handler. If Fortnox is down, slow, or your token has expired, the order completes exactly as it would have and the invoice arrives later.
Deliberately not. Fortnox's webhook coverage is a small and shifting set of resources, and a webhook that never arrives is indistinguishable from a quiet week — silence is the one failure mode a bookkeeping integration must not have. Payments are polled over lastmodified instead.
Fortnox invalidates a refresh token 45 days after it is issued, and the clock only restarts when it is used — so a shop that takes no orders for seven weeks comes back to a dead connection. Knox warns in the control panel once the deadline is inside a fortnight; a weekly knox/connect/refresh cron prevents it entirely.
Nothing happens until you ask. knox/sync/backfill --dry prints what each order would be invoiced at and which ones would be refused, without sending anything; drop the flag when you are happy.
Craft CMS 5.3+, Craft Commerce 5.0+, PHP 8.2+, and a Fortnox account with an API licence — which is not the same as a Fortnox subscription.
Stop reconciling by hand
Lite is $79 with a $29/year renewal and invoices domestic Swedish sales completely. Pro is $149 with a $49/year renewal, and adds Fortnox customers, reverse charge, OSS, export, bookkeeping, payments and credit invoices.