Summary
For importing orders into your system, you take the following steps:
- Set a batch job to run every 15 minutes which calls the AB Commerce web service ExportOrders which downloads all orders with a status of “New Order”.
- Upload each order into your system.
- Each time you upload an order into your system, call the web service UpdateOrderStatus to move the status of the order from “New Order” to the next status (so that order does not download the next time ExportOrders is called).
- For failover, in case your batch job falls over, each time you are about to upload an order, check your system to see if that order has already been uploaded (the ORDERID is the unique reference for each order BUT you can also use the ORDERNUMBER as this is also unique for each order) and if it has, go straight to the next step to update the order’s status from “New Order” - i.e. if the order is inserted into your system and the batch job falls over, it wont matter as the next time the batch job runs, it will still move the order to it’s next status.
Sample Code – ExportOrders & UpdateOrderStatus
We have sample code for downloading web orders. To get a copy of this sample code, just contact our help desk and they will send you a zip file with the same code.
In the sample project, you will see sample code under the method btnExportOrders_Click(object sender, EventArgs e) which calls the method ProcessOrders(string OrdersXML). These 2 methods cover most of the code that you need.
Order Workflow
An order goes through the following stages:
Change in Order Status |
Description |
ORDER PENDING -> NEW ORDER |
When a new order is made |
NEW ORDER -> ORDER DOWNLOADED |
When the order is downloaded to the ERP/ePos, the order status changes to ORDER DOWNLOADED |
ORDER DOWNLOADED -> ORDER DISPATCHED |
When the order is collected by the courier, the order status can then be changed to ORDER DISPATCHED |
ORDER DISPATCHED -> ORDER COMPLETED |
When the order is delivered by the courier, the order status can then be changed to ORDER COMPLETED. For some systems where the courier does not tell the ERP that the order has been delivered, then this status is not achieved and the order only goes as far as ORDER DISPATCHED. |
ORDER DOWNLOADED -> READY FOR COLLECTION |
When the order is ready for collection. |
READY FOR COLLECTION -> ORDER COMPLETED |
When the order has been collected by the customer. |
??? -> ORDER CANCELLED |
At any stage, you can change an order to being cancelled |
Please note that you can send the customer 2 emails from the AB Commerce system (1) when the order is placed and (2) when the order is collected OR dispatched. This is triggered each time the order status is changed.
Comments
0 comments
Please sign in to leave a comment.