Quite a few integrations need to synchronize data to or from e-conomic. Here are some tips on best practices for typical scenarios:
Sending orders and/or invoices to e-conomic from e.g. a web shop
1. Use data classes – both for reading, creating and updating data.
2. If possible, queue your order/invoice creation instead of necessarily transferring data real-time. This will allow you to further exploit data class optimizations by utilizing the data array methods.
Updating a web shop with stock status from e-conomic
Relying on stock status transferred from e-conomic with some arbitrary interval can be somewhat risky – unless you transfer this with VERY short intervals, which may in turn give you a lot of API usage warnings.
A better approach would be a workflow like this:
1. Download the full product register – using GetDataArray() in batches of 500 or 1,000 products – every 2-4 hours.
2. Between updates, maintain local statistics of how many pieces of each product has been ordered or sold.
3. Calculate the current stock status from the last data transferred from e-conomic, adjusted for orders/invoices created since then.
Checking for new entries – including customer/supplier entries – or invoices
We’ve seen some developers implementing this by transferring ALL entries or invoices on EVERY transfer. This is completely unnecessary! Entries use a series of consecutive serial numbers, and expose the GetLastUsedSerialNumber() method. Thus, the fastest way to synchronize entries is to store the last used serial number, as well as any previously-transferred entries, locally – and then use the FindBySerialNumber(from, to) method to transfer only new entries.
Invoices also typically use a consecutive number series – thus allowing you to transfer only new invoices using the FindByNumber() method. There is one exception to this, though: If you need to know the Remainder or RemainderDefaultCurrency of invoices – since these can change over time, you’ll need to pull the full invoice register. In either case, use GetDataArray() in batches of 500 or 1,000 invoices.

