我正在努力使用亚马逊MWS的产品API。我正在使用亚马逊暂存器,因此实施应该没问题。我只是不确定我的API用法。
如果我使用报告API获取库存报告,我会获得我在包含产品ASIN和SKU的co.uk marketplace上提供的产品列表。但是,当我尝试使用产品API获取有关这些产品的更多详细信息时,我得到了#34;无法访问给定的市场"请求ASIN或SKU的所有函数的错误。
有人有过这方面的经验吗?
答案 0 :(得分:0)
这是我用来获取LowestOfferListingForSKU的代码,它完美地尝试了它:
$service = new MarketplaceWebServiceProducts_Client($this->aws_access_key, $this->aws_secret_access_key, $this->application_name, $this->application_version, $this->config);
$request = new MarketplaceWebServiceProducts_Model_GetLowestOfferListingsForSKURequest();
$request->setSellerId($this->seller_id);
$request->setMarketplaceId($this->marketplace_id);
$request->setItemCondition("New");
$request->setExcludeMe(TRUE);//Excluding our self
$sku_list = new MarketplaceWebServiceProducts_Model_SellerSKUListType();
$skus = array("SKU1","SKU2");
$sku_list->setSellerSKU($skus);
$request->setSellerSKUList($sku_list);
$response = $service->getLowestOfferListingsForSKU($request);
$dom = new DOMDocument();
$dom->loadXML($response->toXML());
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$xml_data = $dom->saveXML();
$dom->loadXML($xml_data);
$otherOfferXml = simplexml_load_string($xml_data);
以下示例适用于LowestOfferListingForASIN:
$service = new MarketplaceWebServiceProducts_Client($this->aws_access_key, $this->aws_secret_access_key, $this->application_name, $this->application_version, $this->config);
$request = new MarketplaceWebServiceProducts_Model_GetLowestOfferListingsForASINRequest();
$request->setSellerId($this->seller_id);
$request->setMarketplaceId($this->marketplace_id);
$request->setItemCondition("New");
$request->setExcludeMe(TRUE);//Excluding our self
$asin_list = new MarketplaceWebServiceProducts_Model_ASINListType();
$asins = array("ASIN1","ASIN2");
$asin_list->setASIN($asins);
$request->setASINList($asin_list);
$response = $service->getLowestOfferListingsForASIN($request);
$dom = new DOMDocument();
$dom->loadXML($response->toXML());
$dom->preserveWhiteSpace = false;
$dom->formatOutput = true;
$xml_data = $dom->saveXML();
$dom->loadXML($xml_data);
$otherOfferXml = simplexml_load_string($xml_data);