Amazon get Orders

Program provides downloading orders from Amazon and saving/updating them in the local database of company. For non-individual sellers only!
Allows saving orders in: MSSQL, Oracle, MySQL, MS Access, Firebird / Interbase.
Allows mapping of elements of Amazon orders to columns of tables. Allows using of expressions and scripts to map.

In the first case Amazon returns all orders created between passed dates. You have to check each order, and determine if it already exist in ERP date before acceptance. This is essential in case when program passes orders to ERP as text files.

In the second case Amazon returns orders which were created earlier (must be accepted before) and were updated.

There are small differences in program behavior for these two date types in cases when data is passed to ERP as text files.

Two ways to pass orders received from Amazon to ERP:

Saving as text files into exchange folder. Your additional program listens to folder and imports text files into ERP; then the imported text files are removed.

Saving/updating orders directly in tables of database.

Each time the program retrives orders by "created" date and saves them into exchange folder as text files, it checks if "Imported" subfolder of exchange directory exist. If "Imported" subfolder exists, program searches all files with "dtoazoh" extension and finds Order ID in each line of each such file. If Order ID found, then program skips this order.

So, if you need to skip orders, which are already accepted, just rename OrderHeaders.dtoazoh after importing into ERP, and move it into "Imported" subfolder.

In case when you get orders by "updated" dates, or when you save them directly into database, this rule does not apply.

Configurator

Program with window which includes several pages.

Program has "document" behavior. It means that, like any office document, configurator has "New", "Open", "Save" buttons and allows the creation of several files with settings to provide getting orders from several Amazon marketplaces ( com, com.uk, de, ... ) and to map them to different databases or to the same.

Click button at right of field with expression of any column. Next dialog allows to select the element of XML-response from Amazon.

You may fill the table of translation for each element of response from Amazon. Table contains column with values from Amazon and values in ERP.

Click button at right of field with expression of any column. Next dialog allows to select common methods.

Column names don't matter if you export orders into text files. But when you save/update orders in tables of database, column names must match the names of real columns of tables.

Use "Add..." and "Delete" button to add/delete columns.

!!! The column with "AmazonOrderId" expression must be defined in the table of mapping! This is the key for Amazon.

When you save/update orders in ERP database, you have to select/type: the table and the primary key for this table. Click "..." button at right of "Table" box to select from list of tables queried from database. Then click "..." button after "Key" box to select field from table structure queried from database.

Also you may define additional "Join" and "Where" clauses for queries, which program makes to select existing order headers from database. Use valid syntax for selected database type! Refer to tables by their real names without any aliases.

Order items mapping

Define columns of text files or tables and expressions to fill them with data.

Main difference is: in case of saving/updating orders directly in database you have to define additional property - "Order Key". This is the foreign key in your table with order items, which relates items with headers.

But when you export orders as text files, this table must contain column with "AmazonOrderId" expression!

Payment mapping

Amazon may return information about payment transactions inside response. Not all marketplaces do this. So, you may omit this mapping.

Define columns of text files or tables and expressions to fill them with data.

Like for items, the main difference is: in case of saving/updating orders directly in database you have to define additional property - "Order Key". This is the foreign key in your table with payments, which relates payments with headers.

But when you export orders as text files, this table must contain column with "AmazonOrderId" expression!

"Try" page

Check your configuration by request to Amazon and try to save the response in ERP.

Program will show orders received from amazon mapped to columns in intermediate dialog, where you may click "Save to ERP source" button to try to save received orders in ERP.

Fix all errors and save configuration.

Command line program to run by scheduler

Use following parameters to run C:\Program Files (x86)\DataOdyssey\AzGetOrders\AgO.exe

c=Full name of configuration file. For example: с=E:\_DataOdyssey_Projects\Other\MyAmazon.dtoago

f=YYYYMMDDhhmmss - date "from". For example: f=20160601000000

t=YYYYMMDDhhmmss - date "to". For example: t=20160622235959

u - simply pass "u" as one of parameters to query by "updated" dates. By default, program queries orders by "created" dates.

Do not forget to analyze the journal of errors! Path and file are defined on the first page of configurator.