I have implemented a system to download an Amazon seller's orders. The system works like this:
Some of these orders are pending and, if so, we store them in our database and check them next time to see if they are ready for download. Our next job would run for the next two hour interval, asking for all orders from 2:00 to 3:58.
This operation was working fine, but our customers started to report missing orders on their end. Apparently every now and then an order will slip through the proverbial cracks and we are not sure why. To try to fix this we set up a 30 minute overlap so that each time we downloaded orders we looked 30 minutes in the past. In addition to the penalty of downloading redundant orders we have to check the database to see if the order has already been processed so it slows things down quite a bit.
And to rub salt in the wound, it still has not fixed the problem! It doesn't happen as often, but a 0-4 orders show up missing on an average day.
Getting orders via ListOrders seems to have a number of pitfalls.
The following is a response from MWS support staff,
Please note that an order is only populated in the ListOrders data when it has cleared some internal checks (mostly for fraudulent orders). This means that there will be a delay between when the order is created, and when it shows up in API queries (or in SellerCentral, for that matter). This delay is usually a few minutes, occasionally half an hour, and very rarely multiple hours.
And some orders can move from pending status to unshipped status very soon. The order id --- is been in pending status only for 7 seconds and all the requests you have made are before the time this order is actually available for API to populate in ListOrders. And even the order --- is in pending status for 17 seconds and you made the requests before that. Once you receive the email notification they are no longer in pending status.
Since you are selecting orders by their creation date, you may easily miss orders that were created, but haven't passed pending state.
In my experience, a reliable way to get all orders is to call GetReportList
, asking for all _GET_ORDERS_DATA_
reports which haven't been acknowledged yet - then acknowledge the ones you've stored in your system. The "Acknowledged" flag in the Amazon system keeps the two systems in sync. The beauty of this solution is that you don't have to worry about time stamps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With