amazon-mws - 如何使用 Amazon Marketplace Web Service (Amazon MWS) API 更新产品价格

标签 amazon-mws

只是试图找出更新亚马逊市场商店的产品价格是多么容易(或者可能是困难)。

经过一番搜索,我找到了关于 "Amazon Marketplace Web Service (Amazon MWS)" 的文档.我还检查了 API 文档和其中一个客户端实现,但我无法(或盲目、愚蠢等)找到任何有关为特定产品设定价格的文档。

还是我需要另一个 API?

编辑:感谢@ScottG 和@Keyur,我找到了“缺少的链接”提要。 http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html#
对于 PHP,PHP-Client library 中有一个很好的例子。下 src\MarketplaceWebService\Samples\SubmitFeedSample.php .
请参阅@Keyur 对 _POST_PRODUCT_PRICING_DATA_ 的回答FeedType例子。

最佳答案

您需要将以下 Feed 发送到 amazon mws feed api,通过循环每个 SKU 的元素,您可以在一个请求中发送 15 个不同 SKU 的价格 Feed

$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);

关于amazon-mws - 如何使用 Amazon Marketplace Web Service (Amazon MWS) API 更新产品价格,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32503294/

相关文章:

php - 亚马逊 MWS : How to specify the language of _GET_MERCHANT_LISTINGS_DATA_

amazon-web-services - MWS API 更新库存?

php - Amazon MWS Api SubmitFeed _POST_FLAT_FILE_INVLOADER_DATA_ incorrect template type 错误

amazon-web-services - Amazon MWS 节流是否意味着您可以更新 15 条记录或执行 15 条更新 API 调用?

php - 亚马逊 MWS 的 Webhooks

amazon-mws - Amazon Reports API 提供子级和父级 ASIN。是否有任何字段可以让我分别识别两者?

node.js - 在 Amazon MWS API 上创建出库货件时出现签名错误

php - 我在哪里可以获得亚马逊 MWS 产品类别的完整列表?

php - 亚马逊MWS PHP5.3错误: Timestamp Must Follow ISO8601

testing - 我如何测试(QA)我的Amazon应用程序MWS