只是试图找出更新亚马逊市场商店的产品价格是多么容易(或者可能是困难)。
经过一番搜索,我找到了关于 "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/