Integrating with e-conomic
This article details how to integrate with e-conomic, a widely used Danish accounting program which aims to address all your bookkeeping needs.
An integration with e-conomic involves the following features:
- Orders placed in Dynamicweb are exported to e-conomic, where you can then handle the billing procedure
- Products and product groups created in e-conomic can be imported to Dynamicweb
The following e-conomic modules are a prerequisite:
- Small/Standard agreements
- Add-on API (integration)
The following Dynamicweb modules are a prerequisite:
- e-conomic Integration
- Data Integration
e-conomic setup
In order for e-conomic to handle orders created in Dynamicweb Ecommerce, you must create two items; one for discounts and one for fees.
First, create two product groups - this is necessary to handle VAT properly. We recommend that you set up the same VAT rules in both e-conomic and Dynamicweb Ecommerce, so your orders and bills align.
First, create the two DW_FEE and DW_DISCOUNT product groups (Figure 2.1):
- Click Products in the left menu
- Click Product Groups and then Create Product Group
- Provide a number and name
- Choose tax and VAT-free
- Save
- Repeat the process for DW_DISCOUNT

Then, create the two Fee and Discount products (Figure 2.2):
- Click Products in the left menu
- Click Products and then New Product
- Select the appropriate product group
- Provide a number, name, sales price, etc.

Dynamicweb Setup
The e-conomic Integration module for Dynamicweb Ecommerce consists of two main features:
- Export of orders to e-conomic
- Import of Products Data to Dynamicweb Ecommerce
To set up the Dynamicweb side of the integration:
- Go to Settings > Integration > e-conomic
- Click the Use Dynamicweb e-conomic application button – the public and secret token parameters will be auto-filled with data from our e-conomic app (Figure 3.1)

- Click Authorize to open a new tab in your browser and login to your e-conomic account
- You will be prompted to add the Dynamicweb app to your agreement – do so (Figure 3.2)

After clicking “Add app” you will be redirected back to Dynamicweb and see the generated grant token and connection information (Figure 3.3).

Export orders to e-conomic
Once the connection is successful, you can configure the Order settings (Figure 4.1) which control how orders are exported from Dynamicweb to e-conomic.

You should:
- Check Export to e-conomic on complete to activate order exports
- Provide a prefix for orders from Dynamicweb when they are create in e-conomic
- Enter the product number for the Fee and Discount products you created earlier
You must select values for the three dropdowns; Invoice Layout, Payment Condition, and Debitor Group.
If exporting an order fails, the error is saved in an XML document in the following path: /Files/Files/Integration/eCommerce/economic/OrderErrors/*.xml. This file contains the information about the failed order and line items as well as the actual error message.
Import products and product groups
To import products and groups from e-conomic you must do two things:
- First, select the product groups which you want to import alongside all their products
- Second, create a data integration job to handle the import
Selecting product groups
To select the product groups & products you want to import, go to Settings > Integration > e-conomic and check the relevant checkboxes (Figure 6.1).

Creating the integration job
To actually import the products and groups you just selected, you must create and configure a Data Integration job in Dynamicweb. Read more about Data Integration Module.
For an e-conomic integration:
- Go to Settings > Integration > Data Integration and select a new activity
- As the source provider, select the E-conomic provider (Figure 7.1)
- Select a language and a shop to import to

- As the destination provider, select the Dynamicweb Provider and select the same language and shop as on the source provider(Figure 7.2)

- Map the source tables to their relevant targets (Figure 7.3)

- Name the activity (Figure 8.1)

- Save and run the activity
After the activity has been successfully run, the products and groups you selected has been imported to the shop and language you selected.
Extensibility
With the following items it is possible to expand the product import as well as modify order, debtor, etc at the order export.
Extending the product import
You can implement own ProductImportActivityExtender which allows you to manipulate the products and groups from e-conomic before they are being imported to Dynamicweb.
Here is some example code:
Extending the order export
To extend the order export, can implement own OrderCompleteNotificationExtender and override the methods you want in order to manipulate order objects before they are sent to e-conomic:
- DynamicwebOrder - to modify Dynamicweb order information
- EconomicDebitor - to do manipulation with the EconomicDebitor object
- EconomicOrder - to do manipulation with the EconomicOrder object
- EconomicOrderLine - to do manipulation with the ordinary EconomicOrderline
- EconomicDiscountOrderline - to do manipulation with the Discount EconomicOrderline
- EconomicPaymentFeeOrderline - to do manipulation with the Payment Fee EconomicOrderline
- EconomicShippingFeeOrderline - to do manipulation with the Shipping Fee EconomicOrderline