All Projects → aws-samples → selling-partner-api-bootstrap

aws-samples / selling-partner-api-bootstrap

Licence: MIT-0 license
A sample for how to properly implement the Selling Partner API rate limit and authentication.

Programming Languages

java
68154 projects - #9 most used programming language
typescript
32286 projects

selling-partner-api-bootstrap

This project is a sample implementation of how to implement rate limiter and authentication for Amazon Selling Partner API.

This implementation followed the official document here.

Overview

This project consist of two parts, one is CDK script which is able to deploy everything by one command. The other part is the Java code that pull Orders from SP-API, it is triggered by a timer in EventBridge every minute for all sellers in the credentials table. Also Fulfillment API is implemented to demo the SP-API subscription mode, which first receive notification from EventBridge.

It is based on serverless architecture, and used services are DynamoDB, Lambda, EventBridge, ElasticCache, CloudWatch. CDK scripts will start from create VPC and most of the code is running inside the VPC. After the execution of CDK scripts everything is provisioned on AWS. You should go and check the DynamoDB table, and you should put seller credentials into the table. One helper class called InitCredentialsTableHelper is provided to easy this process.

The value of the credentials can be found from the following picture. credentials.png

RateLimter is implemented by utilize Redis on ElasticCache, so seprate Lambda instances will share the same limiter during the pulling. The RateLimter will dynamically update the rate according to the HTTP header responded from server side.

Separate README.md are included in each sub-folder.

Chinese version Workshop

A Chinese version SP-API workshop can be found here.

Contribute

Pull requests and issue reports are welcome.

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].