@@ -36,14 +36,24 @@ export AWS_ACCESS_KEY_ID=KEY
3636export AWS_SECRET_ACCESS_KEY=SECRET
3737```
3838
39- ## Configuration
39+ ## Configuration Using JavaScript
4040
4141Set your Access Key and Access Secret.
4242
4343``` js
4444var amazonMws = require (' amazon-mws' )(' AWS_ACCESS_KEY_ID' ,' AWS_SECRET_ACCESS_KEY' );
4545```
4646
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+
4757### Feeds
4858
4959#### Submit Feed
@@ -523,6 +533,31 @@ var amazonMws = require('amazon-mws')('AWS_ACCESS_KEY_ID','AWS_SECRET_ACCESS_KEY
523533 });
524534```
525535
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+
526561#### Additionally all api returns Throttling: Limits to how often you can submit requests
527562Reference : http://docs.developer.amazonservices.com/en_CA/dev_guide/DG_Throttling.html
528563``` json
0 commit comments