Create Restricted Data Tokens for Amazons Selling Partner API (SPAPI).
- PHP 7.1 or higher.
Install Zerotoprod\SpapiRdt
via Composer:
composer require zero-to-prod/spapi-rdt
This will add the package to your project’s dependencies and create an autoloader entry for it.
Access the different endpoints for getting Restricted Data Tokens for the Orders API
use Zerotoprod\SpapiRdt\SpapiRdt;
$response = SpapiRdt::from('access_token', 'targetApplication')
->orders()
->getOrders('123-1234567-1234567');
$restrictedDataToken = $response['response']['restrictedDataToken']
You can test the api by faking the response:
use Zerotoprod\SpapiRdt\SpapiRdt;
use Zerotoprod\SpapiRdt\Support\Testing\SpapiRdtFake;
use Zerotoprod\SpapiRdt\Support\Testing\SpapiRdtResponseFactory;
SpapiRdtFake::fake(
SpapiRdtResponseFactory::factory()->make()
);
$response = SpapiRdt::from('access_token', 'targetApplication')
->orders()
->getOrders();
Contributions, issues, and feature requests are welcome! Feel free to check the issues page if you want to contribute.
- Fork the repository.
- Create a new branch (
git checkout -b feature-branch
). - Commit changes (
git commit -m 'Add some feature'
). - Push to the branch (
git push origin feature-branch
). - Create a new Pull Request.