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
零售采购交易状态的Selling Partner API提供对特定异步POST交易的程序化访问状态信息。
此PHP包由Swagger Codegen项目自动生成(https://github.com/swagger-api/swagger-codegen)
- API版本:v1
- 构建包:io.swagger.codegen.languages.PhpClientCodegen 了解更多信息,请访问 https://sellercentral.amazon.com/gp/mws/contactus.html
此PHP包未修改任何自动生成的代码,因此即使Amazon官方更新模型或API,它也能轻松适应。
要求
PHP 5.5及更高版本
安装与使用
Composer
要安装绑定,请通过Composer
然后运行composer require august6th/amzn-sp-api
手动安装
下载文件并包含autoload.php
require_once('/path/to/./vendor/autoload.php');
入门指南
请遵循安装步骤,然后运行以下命令
<?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); ?>