PHP code example of bricre / amazon-selling-partner-sdk-authorization

1. Go to this page and download the library: Download bricre/amazon-selling-partner-sdk-authorization 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/ */

    

bricre / amazon-selling-partner-sdk-authorization example snippets



use Amz\Authorization\ResponseTypes;
use OpenAPI\Runtime\Client;
use OpenAPI\Runtime\SimplePsrResponseHandlerStack;

Client::configure(
    new \GuzzleHttp\Client([
        'base_uri' => 'https://sellingpartnerapi-na.amazon.com/',
        'headers'=>[
            'Authorization'=> 'Bearer <accessToken>'
        ]
    ]),
    new SimplePsrResponseHandlerStack(new ResponseTypes())
);



use Amz\AplusContent\Api\AplusContent;
use Ebay\Sell\Account\Api\Program;

$api = new AplusContent();

$docs = $api->searchContentDocuments(['marketplaceId'=>'xxxxxx']);