PHPackages                             imarasoft-ltd/amazon-sp-api-sdk - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [HTTP &amp; Networking](/categories/http)
4. /
5. imarasoft-ltd/amazon-sp-api-sdk

ActiveLibrary[HTTP &amp; Networking](/categories/http)

imarasoft-ltd/amazon-sp-api-sdk
===============================

Amazon Selling Partner API - PHP SDK

1.0(3y ago)013[9 PRs](https://github.com/imarasoft/amazon-sp-api-sdk/pulls)MITPHPPHP ^7.4 || ~8.0 || ~8.1

Since May 3Pushed 2y ago1 watchersCompare

[ Source](https://github.com/imarasoft/amazon-sp-api-sdk)[ Packagist](https://packagist.org/packages/imarasoft-ltd/amazon-sp-api-sdk)[ Docs](https://openapi-generator.tech)[ RSS](/packages/imarasoft-ltd-amazon-sp-api-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (1)Dependencies (9)Versions (11)Used By (0)

Amazon Selling Partner API - PHP SDK
====================================

[](#amazon-selling-partner-api---php-sdk)

This repository is not an official Amazon PHP library for their SP API.

[![social-preview](https://repository-images.githubusercontent.com/372302167/e16f602b-c263-48ee-a36a-a06177d1fa68)](https://repository-images.githubusercontent.com/372302167/e16f602b-c263-48ee-a36a-a06177d1fa68)

### Why next library?

[](#why-next-library)

The main goal of this SDK is to provide SDK's for the Amazon SP API in a way that would let the application to pass Amazon audit.

Amazon audit might happen to systems that must access API endpoints with PII.

There are already few php sp api SDKs available for [PHP](https://packagist.org/?query=sp%20api%20)however most of them comes with many issues of auto generated code.

- hardcoded dependencies like `guzzlehttp/guzzle` or `aws/aws-sdk-php`
- legacy code base (7.2)
- no logger
- SDK's are oriented around single seller which is not suitable for bigger systems
- missing or lacking support for `client_credentials` grant type
- not all API covered
- no extensions

This library goal is to resolve all above mentioned issues.

### Installations

[](#installations)

```
composer require amazon-php/sp-api-sdk

```

This library is not in a stable stage yet, please use with caution.

### Releases

[](#releases)

branchmaintained[1.x](https://github.com/amazon-php/sp-api-sdk/tree/1.x)🚫[2.x](https://github.com/amazon-php/sp-api-sdk/tree/2.x)🚫[3.x](https://github.com/amazon-php/sp-api-sdk/tree/3.x)✅[4.x](https://github.com/amazon-php/sp-api-sdk/tree/4.x)✅[5.x](https://github.com/amazon-php/sp-api-sdk/tree/5.x)✅Version  [1.x](https://github.com/amazon-php/sp-api-sdk/tree/1.x)  is deprecated becuase of the attempt to make a little more sense of what Amazon is doing with using "tags" in their Open API specification. This attempt failed and in order to keep Backward Compatibility promise, changes in the class names had to be introduced in [2.x](https://github.com/amazon-php/sp-api-sdk/tree/2.x). Version 1.0 is not going to be updated anymore, please migrate to version 2.0 that will stay consistent with [Amazon Models](https://github.com/amzn/selling-partner-api-models)Branch [3.x](https://github.com/amazon-php/sp-api-sdk/tree/3.x) comes with BC breaks introduced by Amazon in [Catalog Item](https://raw.githubusercontent.com/amzn/selling-partner-api-models/main/models/catalog-items-api-model/catalogItems_2020-12-01.json) models. Until old model won't go away, branches 2.x and 3.x should be maintained in parallel.

[4.x](https://github.com/amazon-php/sp-api-sdk/tree/4.x) comes with BC breaks in following Amazon api models:

- Listings
- Reports
- Vendor
    - Direct Fulfillment Shipping
    - Direct Fulfillment Orders
    - Direct Fulfillment Transactions

[5.x](https://github.com/amazon-php/sp-api-sdk/tree/5.x) moves to Catalog Item API version 2022-04-01 which is replacing version 2020-12-01. Additionally, uuid used to generate correlation identifiers was replaced with IdGenerator interface that by default is using php internal uniqid(). This change allowed us to drop one additional dependency. Some minor adjustments were made in the template files for models/api.

### Available SDKs

[](#available-sdks)

[SellingPartnerSDK](/src/AmazonPHP/SellingPartner/SellingPartnerSDK.php) - Facade for all SDK's

- [APlusSDK](/src/AmazonPHP/SellingPartner/Api/AplusContentApi/APlusSDK.php)
- [AuthorizationSDK](/src/AmazonPHP/SellingPartner/Api/AuthorizationApi/AuthorizationSDK.php)
- [CatalogItemSDK](/src/AmazonPHP/SellingPartner/Api/CatalogApi/CatalogItemSDK.php)
- [FBAInboundSDK](/src/AmazonPHP/SellingPartner/Api/FbaInboundApi/FBAInboundSDK.php)
- [FBAInventorySDK](/src/AmazonPHP/SellingPartner/Api/FbaInventoryApi/FBAInventorySDK.php)
- [FulfillmentInboundSDK](/src/AmazonPHP/SellingPartner/Api/FbaInboundApi/FulfillmentInboundSDK.php)
- [FBASmallAndLightSDK](/src/AmazonPHP/SellingPartner/Api/SmallAndLightApi/FBASmallAndLightSDK.php)
- [FeedsSDK](/src/AmazonPHP/SellingPartner/Api/FeedsApi/FeedsSDK.php)
- [FinancesSDK](/src/AmazonPHP/SellingPartner/Api/DefaultApi/FinancesSDK.php)
- [FulfillmentOutboundSDK](/src/AmazonPHP/SellingPartner/Api/FbaOutboundApi/FulfillmentOutboundSDK.php)
- [ListingsItemsSDK](/src/AmazonPHP/SellingPartner/Api/ListingsApi/ListingsItemsSDK.php)
- [MessagingSDK](/src/AmazonPHP/SellingPartner/Api/MessagingApi/MessagingSDK.php)
- [NotificationsSDK](/src/AmazonPHP/SellingPartner/Api/NotificationsApi/NotificationsSDK.php)
- [OrdersSDK](/src/AmazonPHP/SellingPartner/Api/OrdersV0Api/OrdersSDK.php)
- [Shipment/OrdersSDK](/src/AmazonPHP/SellingPartner/Api/ShipmentApi/OrdersSDK.php)
- [ProductFeesSDK](/src/AmazonPHP/SellingPartner/Api/FeesApi/ProductFeesSDK.php)
- [ProductPricingSDK](/src/AmazonPHP/SellingPartner/Api/ProductPricingApi/ProductPricingSDK.php)
- [ProductTypesDefinitionsSDK](/src/AmazonPHP/SellingPartner/Api/DefinitionsApi/ProductTypesDefinitionsSDK.php)
- [ReportsSDK](/src/AmazonPHP/SellingPartner/Api/ReportsApi/ReportsSDK.php)
- [SalesSDK](/src/AmazonPHP/SellingPartner/Api/SalesApi/SalesSDK.php)
- [SellersSDK](/src/AmazonPHP/SellingPartner/Api/SellersApi/SellersSDK.php)
- [ServicesSDK](/src/AmazonPHP/SellingPartner/Api/ServiceApi/ServicesSDK.php)
- [ShipmentInvoicingSDK](/src/AmazonPHP/SellingPartner/Api/ShipmentInvoiceApi/ShipmentInvoicingSDK.php)
- [ShippingSDK](/src/AmazonPHP/SellingPartner/Api/ShippingApi/ShippingSDK.php)
- [SolicitationsSDK](/src/AmazonPHP/SellingPartner/Api/SolicitationsApi/SolicitationsSDK.php)
- [TokensSDK](/src/AmazonPHP/SellingPartner/Api/TokensApi/TokensSDK.php)
- [UploadsSDK](/src/AmazonPHP/SellingPartner/Api/UploadsApi/UploadsSDK.php)
- VendorSDK
    - [VendorInvoicesSDK](/src/AmazonPHP/SellingPartner/Api/VendorPaymentsApi/VendorInvoicesSDK.php)
    - [VendorOrdersSDK](/src/AmazonPHP/SellingPartner/Api/VendorOrdersApi/VendorOrdersSDK.php)
    - [VendorShipmentsSDK](/src/AmazonPHP/SellingPartner/Api/VendorShippingApi/VendorShipmentsSDK.php)
    - [VendorTransactionStatusSDK](/src/AmazonPHP/SellingPartner/Api/VendorTransactionApi/VendorTransactionStatusSDK.php)
    - [VendorDirectFulfillmentInventorySDK](/src/AmazonPHP/SellingPartner/Api/UpdateInventoryApi/VendorDirectFulfillmentInventorySDK.php)
    - [VendorDirectFulfillmentTransactionsSDK](/src/AmazonPHP/SellingPartner/Api/VendorTransactionApi/VendorDirectFulfillmentTransactionsSDK.php)
    - [VendorDirectFulfillmentShippingSDK](/src/AmazonPHP/SellingPartner/Api/VendorShippingLabelsApi/VendorDirectFulfillmentShippingSDK.php)
    - [VendorDirectFulfillmentOrdersSDK](/src/AmazonPHP/SellingPartner/Api/VendorOrdersApi/VendorDirectFulfillmentOrdersSDK.php)
    - [VendorDirectFulfillmentPaymentsSDK](/src/AmazonPHP/SellingPartner/Api/VendorInvoiceApi/VendorDirectFulfillmentPaymentsSDK.php)

### Authorization

[](#authorization)

In order to start using SP API you need to first register as a Developer and create application. Whole process is described in [Amazon Official Guides](https://github.com/amzn/selling-partner-api-docs/blob/main/guides/en-US/developer-guide/SellingPartnerApiDeveloperGuide.md).

Amazon recommends to use Role IAM when creating application however this requires and additional API request in order to obtain access token. It's easier to use User IAM and just make sure that the user has following Inline Policy

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "execute-api:Invoke",
            "Resource": "arn:aws:execute-api:*:*:*"
        }
    ]
}

```

#### IAM User

[](#iam-user)

Example of changing refresh token into access token.

```
