Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

amazon-mws

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.

like image 688
everyman Avatar asked Sep 10 '15 13:09

everyman


People also ask

Does Amazon have API for prices?

AWS offers two APIs that you can use to query prices: With the AWS Price List Bulk API, you can query the prices of AWS services in bulk. The API returns either a JSON or a CSV file.

How do I integrate with Amazon marketplace?

Integration Setup To enable the Amazon Marketplace integration, click on Manage Integrations under the Integrations menu in the left sidebar: All of the available regions can be found under the Shopping Carts tab: Amazon North America, Amazon Europe, Amazon Australia, and Amazon Japan.

Is Amazon MWS API free?

Note: Amazon MWS is available free of charge to anyone who has a non-individual Amazon seller account. Eligible accounts include: Amazon Webstore accounts, Checkout-by-Amazon accounts, and Amazon Product Ads accounts.

Does Amazon have an API for sellers?

The Selling Partner API (SP-API) is a REST-based API that helps Amazon selling partners programmatically access their data on orders, shipments, payments, and much more.


2 Answers

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);
like image 129
Keyur Padalia Avatar answered Nov 05 '22 03:11

Keyur Padalia


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.

like image 22
ScottG Avatar answered Nov 05 '22 04:11

ScottG