亚马逊 MWS ListOrderItems 节流问题

Amazon MWS ListOrderItems Throttling Problem

我正在尝试接收订单的详细信息。我有超过 50 个订单。当我尝试使用 ListOrderItems API 获取订单详细信息时,出现“Request is throttled”错误。

亚马逊说 "The ListOrderItems and ListOrderItemsByNextToken operations together share a maximum request quota of 30 and a restore rate of one request every two seconds."

每分钟 30 个请求对我来说不够。

是否有另一种方法可以让每分钟获取订单商品超过 30 次?

我为我的代码添加了一个临时解决方案:

int i = 0;
foreach (var order in orders)
{
   ....
   if (i > 29)
   {
     Thread.Sleep(2100); // wait 
   }
   i++;
}

请尝试使用 Reports API and periodically download an order report. You won't run into throttling limitations there. Or, like you suggest, slow down the rate that you make calls to the Orders API

我所做的是安排一份订单报告,然后每小时检索一次。我一个一个地处理每个订单并添加到我自己的系统中。有时您会遇到重叠,具体取决于订单状态和日期,但请在插入之前先检查一下。

对于这个问题,您可以运行在特定的时间间隔使用相同的方法进行后台作业。像 Hangfire。但是,此解决方案不会提供每分钟更多的订单。它是比 Thread.Sleep ().

更好的解决方案