Search code examples
phpapie-commerceamazon-mws

how to publish products to specific amazon marketpalce


i am a seller and i have 2 marketplaces,

1) amazon.com

2) webstore

i want to send via mws product feed to my webstore,i have the marketplace id.

this is the code i am using.

$parameters =  array ('MarketplaceIdList' => $this->marketPlaceId,
'Merchant' =>  $this->merchantId, 'FeedType' =>
$feedType,'FeedContent' => $feedHandle, 'PurgeAndReplace' =>
false,'ContentMd5' =>
base64_encode(md5(stream_get_contents($feedHandle), true)),);       

$request = new
MarketplaceWebService_Model_SubmitFeedRequest($parameters);

this is what is written in the amazpn PDF

Do not confuse the optional MarketplaceIdList parameter with the Marketplace parameter in a request. The Marketplace parameter is no longer used for authentication and is deprecated, but it remains in the request for backward compatibility.

the parameter "MarketplaceIdList" is not working when i use it, it publish to both marketplaces instend of only to one marketplace.

please help, thank you.


Solution

  • Try this

    $marketplaceIdArray = array("Id" => array($MARKETPLACE_ID));
    $parameters = array(
                 'Merchant' => $MERCHANT_ID,
                 'MarketplaceIdList' => $marketplaceIdArray,
                 'FeedType' => '_POST_INVENTORY_AVAILABILITY_DATA_',
                 'FeedContent' => $feedHandle,
                 'PurgeAndReplace' => false, //Leave this PurgeAndReplace to false so that it want replace whole product in amazon inventory
                 'ContentMd5' => base64_encode(md5(stream_get_contents($feedHandle), true))
             );