klabeh / amazon-mws-repricing
亚马逊定价助手类
dev-master
2017-05-02 11:23 UTC
Requires
- aws/aws-sdk-php: ~3.0
- exeu/apai-io: dev-master
- klabeh/mws-product-api: dev-master
- parsecsv/php-parsecsv: 0.4.5
- plugmystore/amazon-mws-feeds: dev-master
- sunra/php-simple-html-dom-parser: v1.5.0
- twinsen/mws-subscription-api: dev-master
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接口,用于传递配置。
获取产品价格更新
-
注册AWS账户
-
创建IAM用户,并授予其SQS支持
-
创建SQS队列
-
请使用以下教程:http://docs.developer.amazonservices.com/en_IT/subscriptions/Subscriptions_ReceivingNotifications.html 来获取对亚马逊MWS的访问权限
-
使用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/***');
-
在控制台管理器中查看队列
-
如果您想了解格式,请使用以下链接:https://gist.github.com/hakanensari/9f3e14d18a44f0d1c153
待办:实现价格更新推送
请使用以下API将价格传回:http://docs.developer.amazonservices.com/en_US/feeds/Feeds_SubmitFeed.html
获取价格(已弃用且不再工作,因为亚马逊更新)
获取价格信息,您可以使用两种不同的方法
- 使用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);
- 使用亚马逊广告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);