@@ -15,6 +15,11 @@ You can find [examples here](https://github.com/bhushankumarl/amazon-mws/tree/ma
1515$ npm install amazon-mws --save
1616```
1717
18+ ## Test Cases
19+ ```bash
20+ $ npm run test.mocha
21+ ```
22+
1823## Debugging
1924
2025Run the DEBUG:
@@ -31,14 +36,24 @@ export AWS_ACCESS_KEY_ID=KEY
3136export AWS_SECRET_ACCESS_KEY=SECRET
3237```
3338
34- ## Configuration
39+ ## Configuration Using JavaScript
3540
3641Set your Access Key and Access Secret.
3742
3843```js
3944var amazonMws = require('amazon-mws')('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY');
4045```
4146
47+ ## Configuration Using TypeScript
48+
49+ ```
50+ import * as MwsApi from 'amazon-mws';
51+
52+ const amazonMws = new MwsApi();
53+ amazonMws.setApiKey(accessKey, accessSecret);
54+ ```
55+
56+
4257### Feeds
4358
4459#### Submit Feed
@@ -346,6 +361,44 @@ var amazonMws = require('amazon-mws')('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY
346361
347362### Products
348363
364+ #### Get Lowest Priced Offers For ASIN
365+ ```js
366+ amazonMws.products.searchFor({
367+ 'Version': '2011-10-01',
368+ 'Action': 'GetLowestPricedOffersForASIN',
369+ 'SellerId': 'SELLER_ID',
370+ 'MWSAuthToken': 'MWS_AUTH_TOKEN',
371+ 'MarketplaceId': 'MARKET_PLACE_ID',
372+ 'ASIN': 'ASIN',
373+ 'ItemCondition': 'New'
374+ }, function (error, response) {
375+ if (error) {
376+ console.log('error products', error);
377+ return;
378+ }
379+ console.log('response ', response);
380+ });
381+ ```
382+
383+ #### Get Lowest Priced Offers For SKU
384+ ```js
385+ amazonMws.products.searchFor({
386+ 'Version': '2011-10-01',
387+ 'Action': 'GetLowestPricedOffersForSKU',
388+ 'SellerId': 'SELLER_ID',
389+ 'MWSAuthToken': 'MWS_AUTH_TOKEN',
390+ 'MarketplaceId': 'MARKET_PLACE_ID',
391+ 'SellerSKU': 'SELLER_SKU',
392+ 'ItemCondition': 'New'
393+ }, function (error, response) {
394+ if (error) {
395+ console.log('error ', error);
396+ return;
397+ }
398+ console.log('response ', response);
399+ });
400+ ```
401+
349402#### List Matching Products
350403```js
351404 amazonMws.products.search({
@@ -438,6 +491,7 @@ var amazonMws = require('amazon-mws')('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY
438491
439492#### Get Report
440493###### This will provide you JSON report/data.
494+ ###### This will not provide you Throttling details in Header.
441495```js
442496 amazonMws.reports.search({
443497 'Version': '2009-01-01',
@@ -479,6 +533,31 @@ var amazonMws = require('amazon-mws')('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY
479533 });
480534```
481535
536+ #### Get Report
537+ ###### Using TypeScript.
538+ ```
539+ const accessKey = process.env.AWS_ACCESS_KEY_ID || 'YOUR_KEY';
540+ const accessSecret = process.env.AWS_SECRET_ACCESS_KEY || 'YOUR_SECRET';
541+
542+ import * as MwsApi from 'amazon-mws';
543+
544+ const amazonMws = new MwsApi();
545+ amazonMws.setApiKey(accessKey, accessSecret);
546+
547+ try {
548+ const response: any = await amazonMws.reports.search({
549+ 'Version': '2009-01-01',
550+ 'Action': 'GetReport',
551+ 'SellerId': 'SELLER_ID',
552+ 'MWSAuthToken': 'MWS_AUTH_TOKEN',
553+ 'ReportId': 'REPORT_ID'
554+ });
555+ console.log('response', response);
556+ } catch (error: any) {
557+ console.log('error ', error);
558+ }
559+ ```
560+
482561#### Additionally all api returns Throttling: Limits to how often you can submit requests
483562Reference : http://docs.developer.amazonservices.com/en_CA/dev_guide/DG_Throttling.html
484563```json
0 commit comments