Appearance
Fortnox ​
Fortnox connects OCP to customer, item and order data in Fortnox. After connecting an administration with OAuth, you can use Fortnox as a source for item and customer synchronization and for retrieving orders, or as a destination for order export.
| Data | Supported capabilities |
|---|---|
| Items | Synchronize articles, stock and associated files |
| Customers | Synchronize customers and their contact and address details |
| Orders | Export new orders and retrieve imported orders with their lines |
Retrieving orders ​
Select Fortnox as the connector source in a retrieve orders flow. Orders are served from the orders saved by the Fortnox order import job, so the job must have run before orders can be retrieved. Results include Fortnox document numbers, customer numbers, order dates, amounts and order lines, sorted by order date with the newest orders first.
A modification date narrows the results to orders that the import job added, or that changed in Fortnox, since that moment. Order line prices include line discounts and are given both excluding and including VAT.
Order import job ​
The Fortnox order import job can be scheduled or started manually from jobs. Its first run reads every order. Later runs fetch orders modified since the last successful run, overlapping the preceding minute so boundary updates are not missed. Orders are identified by their Fortnox document number: an order that changed in Fortnox is overwritten, and its order lines are replaced by the lines currently in Fortnox. Imports never delete previously imported orders, and an order that is deleted in Fortnox while the job runs is skipped.
Orders are saved in batches of 100. An order that cannot be processed, for example because its VAT settings or quantities are incomplete, is skipped while the other orders are still saved. The job then fails with an overview of the skipped document numbers and the reason for each, and the next run retries them. Correct the orders in Fortnox and rerun the job.
Fortnox refuses to return some orders that break its own rules, for example orders with tax reduction rows in a currency other than SEK. These orders cannot be opened or corrected in Fortnox either, so the job skips them with a warning in the logs and completes successfully.
If Fortnox cannot be reached or rejects any other request, the run stops and fails. The batches saved before the failure are kept, and the next run retries the remaining orders. Check the job failure and its logs, resolve the cause, then rerun the job.
INFO
Fortnox allows a limited number of requests per minute. OCP stays within that limit, and the job retrieves each order's details separately, so the first run for an administration with many orders can take a long time.