1. Go to this page and download the library: Download andrewyj/amazon-sp-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/ */
andrewyj / amazon-sp-api example snippets
$auth = [
'refresh_token' => '', // Aztr|...
'client_id' => '', // App ID from Seller Central, amzn1.sellerapps.app.cfbfac4a-......
'client_secret' => '', // The corresponding Client Secret
'region' => \AmazonSellingPartnerAPI\Client::REGION_NORTH_AMERICA,
'access_key' => '', // Access Key of AWS IAM User, for example AKIAABCDJKEHFJDS
'secret_key' => '', // Secret Key of AWS IAM User
'role_arn' => '', // AWS IAM Role ARN for example: arn:aws:iam::123456789:role/Your-Role-Name
];
$oAuth = new \AmazonSellingPartnerAPI\OAuth($auth['client_id'], $auth['client_secret']);
$auth['access_token'] = $oAuth->getAccessToken($auth['refresh_token'])->access_token;
$sign = new \AmazonSellingPartnerAPI\Signature\V4Signature();
$client = new \AmazonSellingPartnerAPI\Client($sign);
$client->setAuth($auth);
var_dump($client->get('/orders/v0/orders/XXX-XXXXXX-XXXXXXX'));
$sign = new \AmazonSellingPartnerAPI\Signature\V4Signature();
$cache = new Cache();
$order = new \AmazonSellingPartnerAPI\Module\Order($auth, $cache, $sign);