PHPackages                             thewirecutter/paapi5-php-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. [API Development](/categories/api)
4. /
5. thewirecutter/paapi5-php-sdk

ActiveLibrary[API Development](/categories/api)

thewirecutter/paapi5-php-sdk
============================

Amazon Creators API PHP SDK

v2.1.0(2mo ago)691.8M↓63.4%325Apache-2.0PHPPHP ^8.1CI failing

Since Oct 17Pushed 2mo ago11 watchersCompare

[ Source](https://github.com/thewirecutter/paapi5-php-sdk)[ Packagist](https://packagist.org/packages/thewirecutter/paapi5-php-sdk)[ Docs](https://affiliate-program.amazon.com/creatorsapi)[ RSS](/packages/thewirecutter-paapi5-php-sdk/feed)WikiDiscussions main Synced 2d ago

READMEChangelog (10)Dependencies (9)Versions (15)Used By (5)

Amazon Creators API PHP SDK
===========================

[](#amazon-creators-api-php-sdk)

[![Version](https://camo.githubusercontent.com/15744f798a6c0c03424e9d2df3abfb6f0daf74c1ac8eb3660f4eaf194c3050af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f746865776972656375747465722f7061617069352d7068702d73646b)](https://packagist.org/packages/thewirecutter/paapi5-php-sdk)[![Total Downloads](https://camo.githubusercontent.com/95309781c78163a1d954e7937037fbce9ed2600abd74316cd1ede94385ff2935/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f746865776972656375747465722f7061617069352d7068702d73646b2e7376673f7374796c653d666c6174)](https://packagist.org/packages/thewirecutter/paapi5-php-sdk)[![CircleCI](https://camo.githubusercontent.com/9c2ca9935918754882065fa30c320a05f30f40a513df844565cd61b6b520e1ab/68747470733a2f2f636972636c6563692e636f6d2f67682f746865776972656375747465722f7061617069352d7068702d73646b2e7376673f7374796c653d737667)](https://circleci.com/gh/thewirecutter/paapi5-php-sdk)

This repository contains the open source PHP SDK that allows you to access the [Amazon Creators API](https://affiliate-program.amazon.com/creatorsapi) from your PHP app.

> **Note:** This package was previously the PAAPI5 PHP SDK. As of v2.0.0 it has been migrated to wrap Amazon's Creators API PHP SDK. Existing consumers should update their namespace references from `Amazon\ProductAdvertisingAPI\v1\` to `Amazon\CreatorsAPI\v1\` and switch from AWS Signature V4 credentials to OAuth 2.0 credentials (Client ID, Client Secret, Version).

Copy of Amazon's Provided Code
------------------------------

[](#copy-of-amazons-provided-code)

This is a near-identical public copy of [Amazon's provided Creators API PHP SDK](https://affiliate-program.amazon.com/creatorsapi), as their version is not available through Packagist. The Composer package name remains `thewirecutter/paapi5-php-sdk` for backwards compatibility with existing consumers.

We have not changed the API behavior in any way. A listing of our additions and changes are provided below, which primarily enforce a code-sniff standard and support running an continuous integration pipeline.

### Changes from Amazon

[](#changes-from-amazon)

- Added `squizlabs/php_codesniffer` dev dependency and PSR-2 CI linting.
- Updated CircleCI configuration for automated builds.
- Upgraded `friendsofphp/php-cs-fixer` to `^3.5` with updated `.php_cs` config.
- Added integration tests that run the example scripts and verify they execute without any errors.
- Added typehints to method signatures where possible (without breaking backwards compatibility).
- Exposed the `DefaultApi`'s `buildAuthenticatedHeaders()` method as protected so it can be overridden for caching tokens (see below for example).

Installation
------------

[](#installation)

The Creators API PHP SDK can be installed with [Composer](https://getcomposer.org/). The SDK is available via [Packagist](http://packagist.org/) under the [`thewirecutter/paapi5-php-sdk`](https://packagist.org/packages/thewirecutter/paapi5-php-sdk) package.

```
composer require thewirecutter/paapi5-php-sdk
```

Requirements
------------

[](#requirements)

- PHP 8.1 or greater
- Guzzle 7.3+
- Amazon Creators API credentials: Client ID, Client Secret, and Version

Authentication
--------------

[](#authentication)

This SDK uses **OAuth 2.0** (not AWS Signature V4). You will need:

- **Credential ID** (Client ID) — from the Amazon Associates program
- **Credential Secret** (Client Secret)
- **Version** — the credential version string
- **Marketplace** — e.g. `www.amazon.com`
- **Partner Tag** — your Amazon Associates tracking ID

The SDK handles token caching automatically via `OAuth2TokenManager`. This caching only persists as long as the same instance of `DefaultApi` is used.

Usage
-----

[](#usage)

Simple example for [GetItems](https://affiliate-program.amazon.com/creatorsapi/docs/en-us/api-reference/operations/get-items) to retrieve product details for specific ASINs:

```
