The Magento ERP integration supports both importing new Orders to the ERP system and also to update Order statuses back from ERP to Magento. This is achieved by letting the ERP-supplier call for (a list of) New Orders from Magento using a JSON request, and afterwards fetching new Orders into the ERP system one by one.
Here you will find the necessary details on how to Export orders (from Magento) and also how to Update order statuses back to Magento.
There are three requests that should be implemented:
- Get list of new Orders from Magento
- Get specific Order from Magento
- Order update from ERP to Magento
- How to handle order update when the item number (SKU) has been changed
- The "Order_status" can have one of the following statuses
- The response from Order Updates can be either XML or JSON
- XML example
- XML Error example
- JSON example
Get list of new Orders from Magento
The request will give a list of all new orders from Magento that are ready to be imported into the ERP-system (i.e. that are not yet marked as exported, which our Magento module will take care of).
The request is a simple and easy JSON format.
URL to call: http://yourstore.com/navimage/order/list/
Example of response
Get specific Order from Magento
There will be created one single XML (file/response) per Magento Order.
URL to call: http://yourstore.com/navimage/order/export/id/[id]
XML format of the Order in the response
Order update from ERP to Magento
The integration supports sending back Order updates from the ERP system to Magento, so that the Magento Order can be set to Completed once ERP has packed and shipped the items.
When Magento gets an order update from the ERP system, it will create a standard Magento Shipment and also capture the payment for the lines supplied in the update. Based on the "Order_status", it will either cancel any undelivered items on the Order and finish it, or keep the Order open for later deliveries (part deliveries).
Each Order Update POST must include only one Order.
Tracking_number is optional.
URL to POST to: http://yourstore.com/navimage/order/update/
XML format of the Order Update file
How to handle order update when the item number (SKU) has been changed
There are two ways to handle this, both supporting capture of the original item.
Alternative 1 (recommended)
Include the unique <Line_no> per row which was sent in the original Order Import from Magento to the ERP system.
Send the original SKU in a new <Sku2></Sku2> field (in the Order Update file), and include the NEW SKU (replacement SKU) in the <Sku></Sku> field.
The "Order_status" can have one of the following statuses
|Partially Shipped||Magento will create a shipment for the items specified. If there are remaining items in the order, they will be kept for later delivery. If all items are delivered the order will be closed.|
|Completely Shipped||Magento will create a shipment for the items specified. If there are remaining items in the order, they will be cancelled and the order will be closed.|
The response from Order Updates can be either XML or JSON
|OK||Everything went OK. The message tag will contain "Order processed"|
|Error||Something went wrong. The message tag will contain a message about what went wrong.|
XML Error example