Skip to main content

Economic - Item sync

Economic Connector - ItemUpdate This function synchronizes item data and associated price lists from Economic to App4Sales. It runs on-dem...

Updated over a week ago

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

product.productNumber

Direct mapping from the Economic product number.

Description

product.name

Direct mapping from the Economic product name.

CreatedDate

product.lastUpdated

Timestamp of the last update in Economic.

SalesPrice

product.salesPrice

The default sales price for the item.

EanCode

product.barCode

Direct mapping from the Economic barcode.

Unit

product.unit?.name

Name of the sales unit from Economic.

PurchasePackageSize

product.recommendedPrice

If the connector setting "Use recommend price field as purchase package size" is true, this field is mapped from product.recommendedPrice. Otherwise, it defaults to 1.

LastAvailableStock

product.Inventory?.Available

Available stock quantity from Economic's inventory module.

VatPercentage

Settings.ItemVatPercentage / ApplicationSettings.HighVatSE

Uses the value from the connector setting "Item VAT percentage". If this setting is 0 or not configured, it defaults to ApplicationSettings.HighVatSE.

ItemClass[0].Name

Derived

Hardcoded to "Filter".

ItemClass[0].ItemClassValues[0].Value

product.productGroup.name

The name of the product group in Economic.

FreeItemFields (Recommended Retail Price)

product.recommendedPrice

Added as a free field if product.recommendedPrice is greater than 0 and the connector setting "Use recommend price field as purchase package size" is false.

FreeItemFields (Description)

product.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)

product.unit?.unitNumber

The unit number from Economic is stored in the item's ExtraData.

ExtraData (CostPrice)

product.Inventory?.RecommendedCostPrice

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

currency.code

The currency code (e.g., "DKK", "EUR").

Currency

currency.code

The currency code.

Description

currency.name

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 true.

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

CurrencySpecificSalesPrice.Product.productNumber

The product number from Economic for which the price applies.

Price

CurrencySpecificSalesPrice.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 barred status is true and the connector setting "Skip blocked items" is enabled.

  • Stock Retrieval: If LastAvailableStock is 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.salesPrice in 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.recommendedPrice can 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.description can 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 recommendedPrice field will be mapped to the App4Sales PurchasePackageSize. 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.

Did this answer your question?