How to update product prices using the Amazon Marketplace Web Service (Amazon MWS) API

I just tried to figure out how easy (or maybe difficult) to update the prices of Amazon products.

After some searching, I found documents on the "Amazon Marketplace Web Service (Amazon MWS) . " I also checked the API docs and one of the client implementations, but I can’t (or blind, dumb, whatever) find any pricing documents for a specific product.

Or do I need another API?

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

+4
source share
2 answers

You need to send the following Feed to amazon mws feed api, you send a price feed from 15 different SKUs in one request by a cyclic 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);
+5
source

Amazon Feeds. , , API price FeedType. , , . , Amazon.

+2

Source: https://habr.com/ru/post/1606794/


All Articles