0

I am struggling with products API of Amazon MWS. I am using Amazon scratchpad, so implementation should be fine. I am just not sure about my API usage.

If I use reports API to get inventory report, I get list of products that I offer on co.uk marketplace containing product ASINs and SKUs. But when I try to get more details about those products using products API, I get "does not have access to the given marketplace" error for all functions requesting ASIN or SKU.

Someone got any experience with this?

PaulG
  • 13,871
  • 9
  • 56
  • 78

1 Answers1

0

This is the code I use to get LowestOfferListingForSKU and it works perfect try it:

$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);

And this below example is for 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);
Keyur Padalia
  • 2,077
  • 3
  • 28
  • 55