klabeh/amazon-mws-repricing

亚马逊定价助手类

dev-master 2017-05-02 11:23 UTC

This package is not auto-updated.

Last update: 2024-09-29 03:25:52 UTC


README

亚马逊MWS定价助手类

获取库存数据

获取库存数据的用法

$config = new \Twinsen\AmazonMwsRepricing\Models\MwsConfigModel();
$config->setServiceUrl("https://mws.amazonservices.de/");
$config->setKeyId('****');
$config->setAccessKey('****');
$config->setMarketPlaceId('****');
$config->setMerchantId('****');
$mwsService = new \Twinsen\AmazonMwsRepricing\MwsService();
$mwsService->connect($config);
$inventory = $mwsService->getInventoryItems();
print_r($inventory[0]);

请随意实现MwsConfigInterface接口,用于传递配置。

获取产品价格更新

  1. 注册AWS账户

  2. 创建IAM用户,并授予其SQS支持

  3. 创建SQS队列

  4. 请使用以下教程:http://docs.developer.amazonservices.com/en_IT/subscriptions/Subscriptions_ReceivingNotifications.html 来获取对亚马逊MWS的访问权限

  5. 使用Mws将密钥放入其中

$mwsService = new \Twinsen\AmazonMwsRepricing\MwsSubscriptionService();
$mwsService->connect($mwsConfig);
$mwsService->registerDestination('https://sqs.eu-central-1.amazonaws.com/***');
$mwsService->createSubscription('https://sqs.eu-central-1.amazonaws.com/***');
  1. 在控制台管理器中查看队列

  2. 如果您想了解格式,请使用以下链接:https://gist.github.com/hakanensari/9f3e14d18a44f0d1c153

待办:实现价格更新推送

请使用以下API将价格传回:http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html

获取价格(已弃用且不再工作,因为亚马逊更新)

获取价格信息,您可以使用两种不同的方法

  1. 使用MWS产品API
$config = new \Twinsen\AmazonMwsRepricing\Models\MwsConfigModel();
$config->setServiceUrl("https://mws.amazonservices.de/");
$config->setKeyId('****');
$config->setAccessKey('****');
$config->setMarketPlaceId('****');
$config->setMerchantId('****');
$mwsService = new \Twinsen\AmazonMwsRepricing\MwsProductService();
$mwsService->connect($config);
$asin = "****";
$priceModel = $mwsService->getCompetitivePriceForASIN($asin);
  1. 使用亚马逊广告API
$conf = new \Twinsen\AmazonMwsRepricing\Models\PaaConfigModel();
$conf->setCountry('de');
$conf->setAccessKey("***");
$conf->setSecretKey("***");
$conf->setAssociateTag("***");
$paaService = new \Twinsen\AmazonMwsRepricing\PaaService();
$paaService->connect($conf);
$response = $paaService->getCompetivePriceForAsin("****");
echo $paaService->debugResponse($response);

与项目相关的其他有趣项目

https://github.com/wp-plugins/wp-lister-for-amazon/blob/0cfdc6f7e143454ab5ed6b0b12b7d4272250fb6e/classes/helper/WPLA_FeedDataBuilder.php