Introduction
Welcome!
This project aims to make it as easy as possible to build a Laravel application that interacts with Amazon's Selling Partner API. It handles a few particular points of complexity in the SP API, particularly:
Managing credentials
Working with Selling Partner API credentials can be somewhat confusing, because a single seller may have multiple sets of credentials for a single seller account across different regions (and in the case of the Far East region, a different set of credentials in every marketplace within the region).
The starter kit makes it so you don't have to worry about managing those seller-to-credential-to-marketplace relationships, and can get right to making calls to the API with any set of credentials. Details here.
OAuth
Adding to the complexity of credentials management, some credentials are effectively "child credentials" of other sets of credentials, if the former are generated by a seller authorizing a Selling Partner API application via OAuth. As mentioned above, a single seller authorizing your app on their account might need to go through the OAuth flow several times, depending which regions and marketplaces they sell in. This makes implementing the OAuth flow rather complex and time-consuming.
This project handles that for you – a complete OAuth implementation is provided out of the box. All you need to do is fill in a few environment variables (and restyle the OAuth UI if you so choose).
Feeds and Reports
The Selling Partner API has asynchronous reports and feeds for uploading and downloading bulk data. They are often the only way for large sellers to manage their inventory and sales effectively, but there are several steps involved in uploading feeds and downloading reports, each of which is dependent on the step before it. The number of steps, plus the relatively strict rate limits imposed on the API calls that make up those steps, can make it challenging to work with feeds and reports at scale.
In this project, those processes are mostly hidden behind queueable job chains that you can dispatch via Laravel's queue connector, instead of needing to worry about each step and its accompanying rate limit. But if you have specific needs beyond our built-in jobs, all the business logic is exposed and easy to modify.
Notifications
One of the Selling Partner API's most powerful features is its notifications system, a way of getting data about various events pushed to your application rather than needing to constantly poll the API to check for new data. Polling often isn't even possible with the SP API, due to relatively low rate limits, so often notifications are the only way to capture the data you need.
Setting up notifications is a many-step process, and much of the complexity of that process is abstracted into Artisan commands in this project. There is still some manual configuration required, because of the SP API notifications' dependence on AWS, but the Notifications documentation guides you through the entire process.
Ethos
This SP API starter kit is built on top of my open-source Laravel SP API library, highsidelabs/laravel-spapi
, which is itself a wrapper around another one of my open-source packages, jlevers/selling-partner-api
. Part of the ethos of this project (and all the work I do) is to be as durable as possible. The entire dependency tree is open-source, so if at any point, for any reason, some dependency doesn't do what you want it to, you can fork it and modify it to suit your needs. That means that you are not dependent on me for your code to continue working in the long term.
Let's get started.
Last updated