亚马逊 MWS API:我们下载订单时丢失了一些订单

Amazon MWS API: Some orders are missing when we download orders

我实现了一个系统来下载亚马逊卖家的订单。系统是这样工作的:

其中一些订单处于待处理状态,如果是,我们会将它们存储在我们的数据库中,并在下次检查它们是否可以下载。我们的下一个工作将在接下来的两个小时间隔内 运行,请求从 2:00 到 3:58 的所有订单。

此操作运行良好,但我们的客户开始报告他们的订单丢失。显然,订单有时会从众所周知的裂缝中溜走,我们不确定为什么。为了解决这个问题,我们设置了 30 分钟的重叠,这样每次我们下载订单时,我们都会查看过去 30 分钟。除了下载冗余订单的惩罚之外,我们还必须检查数据库以查看订单是否已被处理,因此它会减慢速度。

往伤口上撒盐,还是没有解决问题!这种情况并不经常发生,但平均每天会丢失 0-4 个订单。

通过 ListOrders 获取订单似乎有很多陷阱。

以下是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.

由于您是按 创建日期 选择订单,因此您可能很容易错过已创建但尚未通过挂起状态的订单。

根据我的经验,获得所有订单的可靠方法是致电 GetReportList,询问所有尚未确认的 _GET_ORDERS_DATA_ 报告 - 然后确认您已存储的报告在你的系统中。 Amazon 系统中的 "Acknowledged" 标志使两个系统保持同步。这个解决方案的美妙之处在于您不必担心时间戳。