How to update prices of products with Amazon Marketplace Web Service (Amazon MWS) API
Asked Answered
Q

2

7

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.

Questionary answered 10/9, 2015 at 13:29 Comment(2)
What platform/language are you using?Caespitose
@Caespitose nothing yet - just wanted to estimate time it needs for a "simple" price change. I think customer wants me to do it in PHP.Questionary
B
8

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);
Bloomsbury answered 11/9, 2015 at 15:46 Comment(2)
The 15 request quota referenced in Amazon's docs applies to the http requests themselves, not to the number of SKU's in each request. They recommend, for example, keeping the list to under 30,000 items.Pinkeye
Is $merchant_token SellerId or MWSAuthToken?Cleaner
C
2

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.

Caespitose answered 11/9, 2015 at 14:6 Comment(1)
Thanks! Found docs for the submission docs.developer.amazonservices.com/en_US/feeds/…Questionary

© 2022 - 2024 — McMap. All rights reserved.