august6th / amzn-sp-api
Amazon Selling Partner API SDK
dev-main
2023-07-28 09:55 UTC
Requires
- php: >=5.5
- ext-curl: *
- ext-json: *
- ext-mbstring: *
- guzzlehttp/guzzle: ^6.2
Requires (Dev)
- friendsofphp/php-cs-fixer: ~2.12
- phpunit/phpunit: ^4.8
- squizlabs/php_codesniffer: ~2.6
README
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.
Requirements
PHP 5.5 and later
Installation & Usage
Composer
To install the bindings via Composer
Then run composer require august6th/amzn-sp-api
Manual Installation
Download the files and include autoload.php
:
require_once('/path/to/./vendor/autoload.php');
Getting Started
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); ?>