Recently we had been tasked with connecting an existing DataFlex ERP System to use the Amazon Marketplace Web Service to integrate selling services using Amazon.
After investigating the Amazon MWS API we designed the interface which consists of a base layer for the actual communication with the Amazon API and a secondary layer implementing all the different Amazon MWS API methods.
Both layers are implemented generic and then there is a third layer implementing the connection with the ERP Systems database.
The Amazon MWS API is a standard web API that has a number of different sections for reporting, orders, fulfillment, payment, etc.
As mentioned the base layer implements the actual call to the Amazon MWS API which is a simple web service.
The API has some specific rules on the query format, the time stamps as well as the signing of the query string to ensure security in the API call. The query string has to be in canonical format and has to be signed using a RFC 2104-compliant HMAC either HmacSHA256 or HmacSHA1.
The response to the call is in XML format and is either a specific XML document based on the call or an XML document notifying the caller on the error condition. In some cases an error can also be reported using HTTP error codes.
On top of this base layer we then implemented the actual API methods in an abstracted layer. In this specific case the system uses the Order API to download orders placed on the Amazon system to synchronize the ERP system with the Amazon orders.
The implementation makes use of both Merchant fulfilled as well as Amazon fulfilled orders.
‘With Merchant fulfilled orders the system then uses Amazons fulfillment API to handle the shipping of product from generating packages with different carriers to printing labels for these packages.
In addition the system also uses the Finance API to synchronize the Accounts Receivable system with payments or other financial events.
This now allows the ERP system to automatically download pending orders from Amazon that can then be fulfilled using the standard procedures in place in the ERP system.
The shipping module has also been modified to use the Amazon API to handle fulfillment either merchant or amazon based on the product sold.