Download the PHP package amzn-spapi/sdk without Composer

On this page you can find all versions of the php package amzn-spapi/sdk. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package sdk

PHP SDK for Selling Partner API

Packagist

Video Thumbnail

Click on the image to watch the video.

The Selling Partner API SDK for PHP enables you to easily connect your PHP application to Amazon's REST-based SP-API.

This SDK helps developers:

Getting started

Credentials

Before you can use the SDK, you need to be registered as a Selling Partner API developer. If you haven't done that yet, please follow the instructions in the documentation. You also need to register your application to get valid credentials to call SP-API. If you haven't done that yet, please follow the instructions in the documentation. If you are already registered successfully, you can find instructions on how to view your credentials in the documentation.

Installation & Usage

Minimum Requirements

To run the SDK you need PHP 8.3 or higher.

Installation

Install the SDK via Composer:

Manual Installation

By using the download files, composer dependencies are already installed. You only need to include autoload.php:

Use the SDK

In order to call one of the APIs included in the Selling Partner API, you need to:

Built-in rate limiter

The SDK comes with a built-in rate limiter. In case you hit a certain rate limit, calling an operation will throw RateLimitExceededException. Catch this exception and handle it appropriately. By default, a standard rate limit configuration is applied. You can find the current rate limit configuration for each API on a dedicated page in the documention (e.g. for Listings Items API).

It is possible to disable the built-in rate limiter by setting rateLimiterEnabled to false when instantiating a API instance:

It is also possible to override the default rate limit configuration. This has to be done after the API instance has been created and for each operation separately:

Skipping model validation

Model classes contain additional validations in their setters (allowable enum values, string length, numeric range, regular expression pattern, and item counts) that are derived from the OpenAPI model definitions. Backend responses are not always consistent with those constraints, so deserializing a response can throw an \InvalidArgumentException even though the response itself is valid.

To handle these cases, you can disable the additional model validations at the configuration level. When enabled, model setters still store the returned values but no longer throw for values that violate the declared constraints. This applies to every response (including error responses) deserialized by an API instance that uses the configuration:

The flag defaults to false, so validation is applied unless you explicitly opt out.

⚠️ Use with caution. Skipping model validation disables the safeguards that normally reject malformed values. It is intended as a workaround for responses that are known to be valid but do not match the OpenAPI constraints. When the flag is enabled, unverified values pass through unchecked, which can lead to downstream errors (for example, invalid enum or out-of-range values propagating into your application logic or into subsequent API requests). Only enable it when you understand the responses you are processing, and validate the data yourself before relying on it.

Restricted Data Token (RDT) Support

The SDK provides built-in support for working with Restricted Data Tokens (RDTs), which are required to access personally identifiable information (PII) in certain API operations.

To use Restricted Data Token with the SDK:

  1. Request an RDT token using the Tokens API.

  2. Use the token when calling restricted operations:

Check the full implementation example. If you pass the Restricted Data Token to operations which does not require it, the SDK will return an exception error. Operation does not require a Restricted Data Token (RDT). Remove the RDT parameter for non-restricted operations.

Giving Feedback

Feedback and Contributions

Your feedback is invaluable in improving this SDK! You can contribute by:

Disclaimer


All versions of sdk with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-json Version *
guzzlehttp/guzzle Version ^7.9
guzzlehttp/psr7 Version ^2.0
aws/aws-sdk-php Version ^3.228
symfony/rate-limiter Version ^7.2
vlucas/phpdotenv Version ^5.6
ext-openssl Version *
dallgoot/yaml Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package amzn-spapi/sdk contains the following files

Loading the files please wait ...