How to update prices of products with Amazon Marke

2019-04-08 11:50发布

Just tried to find out, how easy (or maybe difficult) it is to update prices of products of a amazon marketplace shop.

After some search I found docs about "Amazon Marketplace Web Service (Amazon MWS)". I have also checked the API docs and one of the client implementation, but I am not able (or blind, stupid, whatever) to find any docs about setting a price for a specific product.

Or do I need another API?

EDIT: Thanks to @ScottG and @Keyur I found the 'missing link' Feeds. http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html# For PHP there is a nice example in the PHP-Client library under src\MarketplaceWebService\Samples\SubmitFeedSample.php. See @Keyur's answer for the _POST_PRODUCT_PRICING_DATA_ FeedType example.

标签: amazon-mws
2条回答
Emotional °昔
2楼-- · 2019-04-08 12:36

You need to send following Feed to amazon mws feed api, you send price feed of 15 different SKU in one request by looping through element for each SKU

$feed = <<< EOD
<?xml version="1.0" encoding="utf-8"?>
<AmazonEnvelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="amzn-envelope.xsd">
<Header>
<DocumentVersion>1.01</DocumentVersion>
<MerchantIdentifier>$merchant_token</MerchantIdentifier>
</Header>
<MessageType>Price</MessageType>
<Message>
  <MessageID>$i</MessageID>
  <Price>
    <SKU>$sku</SKU>
    <StandardPrice currency="$currency">$new_price</StandardPrice>
  </Price>
</Message>
</AmazonEnvelope>
EOD;

$feedHandle = @fopen('php://temp', 'rw+');
fwrite($feedHandle, $feed);
rewind($feedHandle);

$parameters = array(
    'Merchant' => $MERCHANT_ID,
    'MarketplaceIdList' => $marketplaceIdArray,
    'FeedType' => '_POST_PRODUCT_PRICING_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))
);

$request = new MarketplaceWebService_Model_SubmitFeedRequest($parameters);
$return_feed = invokeSubmitFeed($service, $request);
fclose($feedHandle);
查看更多
Anthone
3楼-- · 2019-04-08 12:39

Products are sent to Amazon using Feeds. We use a third party to handle ours for us, but you can do so yourself using the Feeds API and the pricing FeedType. There are templates you can download to help you out. You can then use one of the client libraries to send this feed to Amazon.

查看更多
登录 后发表回答