PHP code example of jasara / php-amzn-selling-partner-api

1. Go to this page and download the library: Download jasara/php-amzn-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 / php-amzn-selling-partner-api example snippets


use Jasara\AmazonSPA\AmznSPA;

$amazon = new AmznSPA($config);
$response = $amzn->feeds->getFeed($feed_id);
if($response->errors) {
    return $response->errors; // ErrorListSchema
}

if($response->feed) {
    $document = $amazon->feeds->getFeedDocument($feed->result_feed_document_id);
}

use Jasara\AmznSPA\AmznSPAConfig;

$config = new AmznSPAConfig(
    marketplace_id: 'ATVPDKIKX0DER',
    application_id: '***',
    lwa_access_token: '***',
    lwa_refresh_token: '***', // If you would like the SDK to automatically fetch a new access token if necessary
    lwa_client_id: '***',
    lwa_client_secret: '***',
    aws_access_key: '***',
    aws_secret_key: '***',
);