Skip to content

bricre/amazon-selling-partner-sdk-fba-small-and-light

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

(Unofficial) Amazon Selling Partner API client (PHP) - Selling Partner API for FBA Small And Light

Code generated from Amazon's Swagger file using allansun/openapi-code-generator.

Generated code is well self-documented with proper PHPDoc annotations.

Please refer to Amazon's documentation for detailed API behaviour explanation.

Installation

composer require bricre/amazon-selling-partner-sdk-fba-small-and-light

You will also need a PSR-7 based client or Symfony's HTTP Foundation based client

So either use Guzzle (or any other PSR-7 compatible clients)

composer require guzzlehttp/guzzle

or Symfony HTTP Client

composer require symfony/http-client

Versioning

This project matches Amazon's API versioning.

Due to the restriction of Composer, version number like '2021-01-01' will be changed to '2021.01.01'.

Should you found a matching version not being available. Please contact the author to generate against correct version.

Usage

First you need to configure OpenAPI\RunTime\Client with required credentials and predefined responses types. You only need to do this once (or create a service in your dependency injection).

You may also want to check out Amazon's document about how to authorize your request

<?php
use Amz\FbaSmallAndLight\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())
);

Then in your business logic you can call API operations directly

<?php
use Amz\AplusContent\Api\AplusContent;
use Ebay\Sell\Account\Api\Program;

$api = new AplusContent();

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

Author

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages