Economic Connector - ItemUpdate
This function synchronizes item data and associated price lists from Economic to App4Sales. It runs on-demand or as part of a scheduled process, updating App4Sales Items, Price Lists, and Price List Prices.
Data Source Configuration
The connector retrieves item and pricing data from the Economic REST API. It utilizes the following endpoints:
/products: To retrieve core product information./products/{itemCode}/pricing/currencyspecificsalesprices: To fetch sales prices specific to different currencies for each item./currencies: To get available currency definitions.
Data retrieval for products and currencies is paginated, fetching 1000 records per page.
Data Mapping Table (App4Sales Item)
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
ItemCode |
| Direct mapping from the Economic product number. |
Description |
| Direct mapping from the Economic product name. |
CreatedDate |
| Timestamp of the last update in Economic. |
SalesPrice |
| The default sales price for the item. |
EanCode |
| Direct mapping from the Economic barcode. |
Unit |
| Name of the sales unit from Economic. |
PurchasePackageSize |
| If the connector setting "Use recommend price field as purchase package size" is true, this field is mapped from |
LastAvailableStock |
| Available stock quantity from Economic's inventory module. |
VatPercentage |
| Uses the value from the connector setting "Item VAT percentage". If this setting is 0 or not configured, it defaults to |
ItemClass[0].Name | Derived | Hardcoded to "Filter". |
ItemClass[0].ItemClassValues[0].Value |
| The name of the product group in Economic. |
FreeItemFields (Recommended Retail Price) |
| Added as a free field if |
FreeItemFields (Description) |
| Added as a free field if the connector setting "Add description as free field" is true and the product description is not empty. |
ExtraData (Unit) |
| The unit number from Economic is stored in the item's ExtraData. |
ExtraData (CostPrice) |
| The recommended cost price from Economic is stored in the item's ExtraData. |
Data Mapping Table (App4Sales Price Lists)
App4Sales Price Lists are created based on the currencies available in Economic, plus a default DKK price list.
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
Code |
| The currency code (e.g., "DKK", "EUR"). |
Currency |
| The currency code. |
Description |
| The name of the currency (e.g., "Danish Krone", "Euro"). |
Id | Derived | A hash code generated from the lowercase currency code. |
Selectable | Hardcoded | Always set to |
Data Mapping Table (App4Sales Price List Prices)
Price List Prices are created for each item and currency combination.
App4Sales Field | Source Field (API/Excel/DB) | Logic/Notes |
ItemCode |
| The product number from Economic for which the price applies. |
Price |
| The specific sales price for the item in the given currency. |
PriceListId | Derived | A hash code generated from the lowercase currency code to link to the correct price list. |
Special Logic & Filters
Item Exclusion: Products from Economic are skipped if their
barredstatus is true and the connector setting "Skip blocked items" is enabled.Stock Retrieval: If
LastAvailableStockis null after attempting to retrieve stock, an error is logged, indicating that the Economic inventory module might not be enabled or accessible.Currency Management: The connector dynamically fetches currencies and their specific sales prices. It also explicitly adds "DKK" (Danish Krone) as a currency, as Economic is a Danish ERP system. These currencies are used to create corresponding App4Sales Price Lists.
Custom Extra Field for Currency: A dropdown custom extra field named "Currency" is managed for customer entities in App4Sales, populated with currencies retrieved from Economic and "DKK". This allows App4Sales users to select a currency for customers, which can influence pricing.
Domain Specifics
Price Logic
The connector handles multiple price points for items:
The default sales price for an item is sourced directly from
product.salesPricein Economic. This price is associated with a default "DKK" price list in App4Sales.For each currency defined in Economic, the connector retrieves currency-specific sales prices for items via the Economic API endpoint
/products/{itemCode}/pricing/currencyspecificsalesprices. These prices are then used to populate additional App4Sales Price Lists, each corresponding to a specific currency.
Stock & Availability
Item stock is synchronized using the Available quantity from Economic's product inventory data. The `LastAvailableStock` field in App4Sales reflects this value. If the inventory data is unavailable (e.g., if the inventory module is not active in Economic), an error message is logged.
Matrix & Attributes
App4Sales items are assigned to a hardcoded "Filter" item class, with the value derived from the Economic
product.productGroup.name. This effectively categorizes items based on their Economic product group.Additional attributes can be added as free fields:
The
product.recommendedPricecan be included as a "Recommended Retail Price" free field, contingent on the "Use recommend price field as purchase package size" setting being false.The
product.descriptioncan be included as a "Description" free field if the "Add description as free field" setting is true.
Related Settings & Prerequisites
Skip blocked items: (Boolean) If enabled, items marked as 'barred' in Economic will not be synchronized to App4Sales.
Use recommend price field as purchase package size: (Boolean) If enabled, the Economic
recommendedPricefield will be mapped to the App4SalesPurchasePackageSize. Otherwise, it can be used for a free field.Add description as free field: (Boolean) If enabled, the Economic product description will be added as a free item field in App4Sales.
Item VAT percentage: (Numeric) Specifies a fixed VAT percentage to be applied to items. If set to 0, a default high VAT percentage for Sweden (`ApplicationSettings.HighVatSE`) is used as a fallback.
AgreementGrantToken: (String) Your Economic API Agreement Grant Token, essential for authenticating API requests.
VismaEconomicAppSecret: (String) Your App4Sales application secret for Economic, used for API authentication.
Known Limitations
The connector may be unable to set item stock if the inventory module is not enabled or properly configured in Economic, resulting in an error log entry.