PHP code example of jasara / laravel-selling-partner-api
1. Go to this page and download the library: Download jasara/laravel-selling-partner-api library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
jasara / laravel-selling-partner-api example snippets
$amzn = new \Jasara\LaravelAmznSPA\LaravelAmznSPA(
tokens: new \Jasara\AmznSPA\DataTransferObjects\AuthTokensDTO(
access_token: $access_token, // optional if there is a refresh token
expires_at: $expires_at, // optional, instance of CarbonImmutable
refresh_token: $refresh_token, // optional if there is an access token, Passing in the refresh token will automatically generate a new access token when needed
),
http: $http, // instance of Illuminate\Http\Client\Factory - if you would like to stub tests, you can pass in a faked HTTP instance
grantless_token: new \Jasara\AmznSPA\DataTransferObjects\GrantlessTokenDTO(
access_token: $access_token, // optional, a new token will be automatically generated if not passed in
expires_at: $expires_at, // optional, instance of CarbonImmutable
),
marketplace_id: $marketplace_id, // e.g. ATVPDKIKX0DER
);