Ready to Download and Run

by arcesb | September 30, 2019


Amazon Direct Fulfillment EDI to MySQL

Receive 850s from Amazon and map information to a MySQL database. Query it to generate outgoing EDI documents.


Download Flow
logo background logo logo

The Amazon Direct Fulfillment EDI to MySQL sample flow has pre-configured connectors for translating the following transaction sets from Amazon's EDI integration specifications:

  • 810 Invoice
  • 846 Inventory Inquiry/Advice
  • 850 Purchase Order
  • 855 Purchase Order Acknowledgement
  • 856 Advance Shipment Notice

The following connectors make up the core elements of the flow:

  • X12 Connector: Generates EDI files from XML or converts EDI files into XML for further processing.
  • Copy Connector: Duplicates a file to route it to two different parts of the workflow.
  • File Match Connector: Routes files to different parts of the workflow depending on the filename.
  • XML Map Connector: Transforms data from one XML format to another, mapping data from the preceeding data format/model into a format/model appropriate for the next connector.
  • MySQL Connector: Allows you to insert or retrieve the data in these documents to or from a MySQL database.

These connectors are configured to automatically move files from one connector to the next until either the incoming EDI files are transformed and inserted into MySQL, or the data retrieved from MySQL is transformed into outgoing EDI documents. You can modify the automation settings for each connector in its Automation tab, or you can manually process each step in the workflow using the Send button in the connector's Input tab.

In addition to the pre configured connectors, the sample flow also provides a setup.sql file that contains the SQL commands required to create a generic database schema for these transactions. You can either run this file in your database management system or, copy its contents into the system's query editor to create the tables in your SQLite database

If you would like to use this sample flow in your workspace, please follow these instructions:

Importing Workspace

Create Workspace

First, navigate to the Flows tab and click on the cogwheel icon in the top right corner. Choose the Create Workspace option to create a new Workspace for this sample flow.

Import Workspace

Then, from the same cogwheel dropdown, click Import Workspace. In the resulting dialog, choose the downloaded sample flow amazondfedimysql.arcflow to import the relevant connectors and settings. You can choose to import the flow into any Workspace you like, but we recommend using separate Workspaces for distinct workflows.

Once you have successfully imported the sample flow, you can begin configuring the connectors to best suit your specific use case.

MySQL Connector

Connect to MySQL Database & Test the Connection

Navigate to the Settings tab of the MySQL Connector. In order to establish a connection with your MySQL database, you must enter your Server, Database, User and Password. Click the Test Connection button to verify that you can connect to your MySQL database from CData Arc.

Set up your Output Mapping

After successfully setting up and testing a connection, you can choose to query your MySQL database for information that will then be used to generate EDI documents. Exactly what data is queried is controlled by the Output Mapping configured in the MySQL Connector's settings. If you would like to execute all output mappings, navigate to the Output tab and click Receive to start retrieving Invoice, Items and Advance Shipment Notice data from the database.

X12 Connectors

Review Interchange Settings for Outgoing Documents

Navigate to the Settings tab of the X12_Amazon_Out Connector. Review the Interchange Settings and ensure that the following segments contain the correct information:

  1. ISA05 - Sender ID Qualifier
  2. ISA06 - Sender Identifier
  3. ISA07 - Receiver ID Qualifier
  4. ISA08 - Receiver Identifier

Review the Functional Group Settings for Outgoing Documents

Ensure the following segments contain the correct information:

  1. GS02 - Sender Identifier
  2. GS03 - Receiver Identifier

Since outgoing documents are sent from the vendor to Amazon, the value VENDOR is pre configured as the Sender Identifier, and AMAZONDS as the Receiver Identifier.

Review the Interchange and Functional Group Settings for Incoming Documents

Navigate to the Settings tab of the X12_Amazon_In Connector. Follow the same process as you did for outgoing documents, except since this connector translates documents sent from Amazon to the vendor, the value AMAZONDS is pre configured as the Sender Identifier, and VENDOR as the Receiver Identifier.

Once you configure the MySQL and X12 Connectors, the sample flow is ready for use! For a better understanding of which connectors process an individual EDI document as it flows from start to finish, please continue reading.


Tracking Each Document

810 Invoice

When invoice data is queried from MySQL, the results will first be filtered by the FileMatch_Invoice Connector, then sent to the XMLMap_810_Invoice Connector for XML transformation, and finally passed onto the X12_Amazon_Out Connector, which outputs an EDI 810 as per the relevant specifications. You can navigate to the Output tab of the X12_Amazon_Out Connector to find the EDI 810.

846 Inventory Inquiry/Advice

When inventory data is extracted from MySQL, the resultant files will first be filtered by the FileMatch_Invoice Connector and FileMatch_Items Connector, then sent to the XMLMap_846_Items Connector for XML transformation, and finally passed on to the X12_Amazon_Out Connector, which outputs an EDI 846 as per the relevant specifications. You can navigate to the Output tab of the X12_Amazon_Out Connector to find the EDI 846.

Note: This document requires a four-character code assigned to your warehouse by Amazon's' vendor portal. Please ensure that the Items table in MySQL contains the appropriate warehouse code, since this is where the flow expects to find this information.

846 Inventory Inquiry/Advice

When inventory data is extracted from MySQL, the resultant files will first be filtered by the FileMatch_Invoice Connector and FileMatch_Items Connector, then sent to the XMLMap_846_Items Connector for XML transformation, and finally passed on to the X12_Amazon_Out Connector, which outputs an EDI 846 as per the relevant specifications. You can navigate to the Output tab of the X12_Amazon_Out Connector to find the EDI 846.

850 Purchase Order

To test the functionality of this segment of the workflow, you can process a sample 850. Navigate to the Input tab of the X12_Amazon_In Connector. Select the sample file and click Send to trigger the workflow. The file is then processed and subsequently sent to the XMLMap_850_SalesOrder Connector, the Copy Connector, and finally to the MySQL Connector.

855 Purchase Order Acknowledgement

When a Purchase Order is received from Amazon, the Copy Connector duplicates the XML for the Purchase Order and routes it to the XMLMap_855_POAck Connector. There, it is transformed into the XML for the Order Acknowledgement and sent to the X12_Amazon_Out Connector, which outputs an EDI 855 as per the relevant specifications. You can navigate to the Output tab of the X12_Amazon_Out Connector to find the EDI 855.

856 Advance Shipment Notice

When inventory and shipping data is queried from MySQL, results will first be filtered by the FileMatch_Invoice Connector and FileMatch_Items Connector, then sent to the XMLMap_856_ASN Connector, and finally passed on to the X12_Amazon_Out Connector, which outputs an EDI 856 as per the relevant specifications. You can navigate to the Output tab of the X12_Amazon_Out Connector to find the EDI 856.

Amazon Direct Fulfillment EDI to MySQL


Are You Up & Running?

If the answer is yes, congratulations for successfully configuring the Amazon Direct Fulfillment EDI to MySQL sample flow! However, if you are confronted by any issues or have any further questions, please do not hesitate to contact us.