Fortnox Connector - Item Update
This document describes the process of synchronizing item data from the Fortnox API to the App4Sales platform. The process includes retrieving item information, prices, stock levels, and images.
Data Source Configuration
The connector retrieves data from the following Fortnox API endpoints:
Articles: Used to retrieve item information. The connector fetches active articles and can be configured to only sync items marked for the webshop.
Prices: Used to retrieve item prices, including tier prices.
PriceLists: Used to retrieve price lists.
ArticleFileConnections: Used to find files associated with articles, which are then downloaded as images.
WarehouseItemSummaries: Used to retrieve stock information for specific warehouses.
PurchaseOrders: Used to determine the next delivery date for an item.
WayOfDeliveries: Used to retrieve the available delivery methods.
Data Mapping Table
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
ItemCode | ArticleNumber | Direct mapping. |
Description | Description | Direct mapping. |
SalesPrice | SalesPrice | The value is converted to a decimal. This is the base sales price. |
EanCode | EAN | Direct mapping. |
Unit | Unit | Direct mapping. |
VatPercentage | VAT | The value is converted to a decimal. |
VatIncluded | N/A | Hardcoded to 'E' (Exclusive). |
LastAvailableStock | DisposableQuantity | The value is converted to a decimal. This is used when no specific warehouse is configured. |
PurchasePackageSize | ManufacturerArticleNumber | Mapped only if the "Use ManufacturerArticleNumber For PurchasePackageSize" setting is enabled. Otherwise, defaults to 1. |
NextDelivery | Derived | Calculated from purchase orders if the "Sync Next delivery date for items based on purchase orders" setting is enabled. |
ItemCategories (Width) | Width | Added as an item category named "Width". |
ItemCategories (Height) | Height | Added as an item category named "Height". |
ItemCategories (Depth) | Depth | Added as an item category named "Depth". |
ItemCategories (Weight) | Weight | Added as an item category named "Weight". |
ItemCategories (Bulky) | Bulky | Added as an item category named "Bulky". |
FreeItemFields | Note, Manufacturer |
|
Special Logic & Filters
Item Filtering: The connector only retrieves active items. It can be configured to "Synchronize only items marked for 'External webshop'" or to "Don't synchronize discontinued items".
Error Handling: The process includes error handling for API requests. If a request fails, the connector will log the error and may abort parts of the synchronization process (e.g., price sync).
Domain Specifics
Price Logic
The connector retrieves all price lists from Fortnox and creates corresponding price lists in App4Sales. It then fetches all prices and tier prices (staffle prices) and associates them with the correct item and price list.
Base Prices: The main sales price for an item in a specific price list.
Tier Prices: Prices that depend on the quantity ordered. Fortnox supports tier prices for a specific item and price list combination.
Image Handling
The connector synchronizes images by finding file connections for each article. It then downloads these files and attempts to process them as images. This functionality is disabled if the "Use images only from PIM" setting is active in the App4Sales environment.
The connector downloads files from the Fortnox archive and stores them temporarily.
It verifies that the downloaded file is a valid image before associating it with the item.
The temporary files are deleted after being processed.
Stock & Availability
Stock information is retrieved based on the connector settings:
Default Stock: If no specific warehouse is configured, the stock is based on the item's `DisposableQuantity` (Available Stock), `QuantityInStock` (Shelf Stock), and `ReservedQuantity` (To Be Delivered).
Warehouse-specific Stock: If the "Show only stock from this warehouse" setting is configured with one or more warehouse codes (separated by ';'), the connector will fetch stock summaries for those warehouses and sum up the quantities.
Related Settings & Prerequisites
Don't synchronize private customers: This setting is for customer sync, but is in the same settings file.
Delivered quantity is the same as ordered quantity: This setting is for orders.
Use ManufacturerArticleNumber For PurchasePackageSize: When enabled, the `ManufacturerArticleNumber` from Fortnox is used as the `PurchasePackageSize` in App4Sales.
Use Order date as Delivery date: This setting is for orders.
Store Order Notes in Comments: This setting is for orders.
Use your reference as your order number: This setting is for orders.
Use notes as your reference: This setting is for orders.
Synchronize only items marked for 'External webshop': If enabled, only items with the `WebshopArticle` flag will be synchronized.
Don't synchronize discontinued items: If enabled, items marked as `Expired` in Fortnox will not be synchronized.
Get order history from backoffice: This setting is for order history.
Use item note as free item field: When enabled, the `Note` field from a Fortnox item is added as a free field in App4Sales.
Send orderline discount instead of the price: This setting is for orders.
Retrieve item manufacturer as free field: When enabled, the `Manufacturer` field from a Fortnox item is added as a free field in App4Sales.
Send instruction on orderline as item description of the orderlines: This setting is for orders.
Use comments (Anteckningar) field as customer classification: This setting is for customers.
Send order as 'not completed' to Fortnox: This setting is for orders.
Creating customers: set salesrep name as Our Reference: This setting is for customers.
Use customer manager as sales rep on the order: This setting is for orders.
Use comments (Anteckningar) field as customer manager: This setting is for customers.
Sync OurReference as Customer Manager: This setting is for customers.
Show only stock from this warehouse (stock point codes separated by ';'): Defines which warehouse(s) to retrieve stock from.
Sync the invoice email instead of the email for contact persons: This setting is for customers.
Default CostCenter value: This setting is for orders.
Sync Next delivery date for items based on purchase orders: When enabled, the connector will check for open purchase orders to determine the next delivery date for an item.