The Selling Partner API for Retail Procurement Transaction Status provides programmatic access to status information on specific asynchronous POST transactions for vendors.
This PHP package is automatically generated by the Swagger Codegen project:
- API version: v1
- Build package: io.swagger.codegen.languages.PhpClientCodegen For more information, please visit https://sellercentral.amazon.com/gp/mws/contactus.html
This PHP package has not modified any auto-generated code, so it can easily adapt even if Amazon officially updates the model or API.
PHP 5.5 and later
To install the bindings via Composer
Then run composer require august6th/amzn-sp-api
Download the files and include autoload.php
:
require_once('/path/to/./vendor/autoload.php');
Please follow the installation procedure and then run the following:
<?php
use SellingPartnerApi\Endpoint\Endpoint;
require_once(__DIR__ . '/vendor/autoload.php');
Endpoint::$sandbox = true;
// You can create SellingPartner with specific options
//$sp = SellingPartner::withOptions([
// [
// 'client_id' => 'xxx',
// 'client_secret' => 'xxx',
// 'refresh_token' => 'xxx',
// 'access_key_id' => 'xxx',
// 'secret_access_key' => 'xxx',
// 'role_arn' => 'xxx',
// 'endpoint' => Endpoint::NA(),
// ]
//]);
// Or create SellingPartner with default options
// You can change defaultOptionsFunc before create SellingPartner
//SellingPartner::setDefaultOptionsFunc(function () {
// return [
// 'client_id' => 'xxx',
// 'client_secret' => 'xxx',
// 'refresh_token' => 'xxx',
// 'access_key_id' => 'xxx',
// 'secret_access_key' => 'xxx',
// 'role_arn' => 'xxx',
// 'endpoint' => Endpoint::NA(),
// ];
//});
$sp = SellingPartner::instance();
$res = $sp->sellersApi()->getMarketplaceParticipations();
print_r($res);
?>