php Amazon MWS API在GetMyFeesEstimate请求时返回无效参数值

a6b3iqyw  于 2023-02-18  发布在  PHP
关注(0)|答案(1)|浏览(153)

我有一个脚本,发送一些ASIN到亚马逊,以检索他们的费用估计,我正在使用一个PHP客户端的API。
下面是我的代码的主要部分:

$n = count($products);
       $amazonFeesAux['MarketplaceId'] = 'my-market-place-id';
       $amazonFeesAux['IdType'] = 'ASIN';
       $amazonFeesAux['ListingPrice']['CurrencyCode'] = 'EUR';  
       $amazonFeesAux['IsAmazonFulfilled'] = true;

       echo 'Total number of unique ASINs: ' . $n;

       for($i = 1; $i <= $n; ++$i)
       {
            $amazonFeesAux['IdValue'] = $products[$i - 1]['ASIN'];
            $amazonFeesAux['ListingPrice']['Value'] = $products[$i - 1]['price'];
            $amazonFeesAux['Identifier'] = $i;   
            array_push($amazonFees, $amazonFeesAux);

            if($i % $this->requestQuota == 0)
            {
                if (++$batchN > $this->requestQuota) sleep(2);    //  wait 2 seconds to restore 20 items before next request

                echo "\n========================================= Batch number: " . $batchN . " =============================================== \n";

                $newAmazonProductRanks = $this->getAmazonProductFeesData($amazonFees);
                $amazonFees = [];       // reset array as to re-populate with next batch
                $this->updateProductFees($newAmazonProductRanks); <-- do something with the fees
            }
       }

在这里,我的$products只是ASIN数组,$this->getAmazonProductFeesData只是我的函数,它将请求发送到amazon,所有操作都正常,但对于某些ASIN,我返回了一个模糊的Client Side Error,如下所示:

有人知道我做错了什么吗?
PS:此代码使用GetMyFeesEstimate原始MWS API请求。

gojuced7

gojuced71#

我也有这个问题,与一个特定的ASIN。我能够验证这使用MWS的Scratchpad。其他ASIN使用Scratchpad工程发现虽然。

相关问题