PHPackages                             zero-to-prod/spapi-tokens-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. zero-to-prod/spapi-tokens-sdk

ActiveLibrary[API Development](/categories/api)

zero-to-prod/spapi-tokens-sdk
=============================

A Software Development Kit for the Amazons Selling Parterns API (SPAPI) Tokens API.

v1.1.0(1y ago)19MITPHPPHP &gt;=8.1CI passing

Since Feb 3Pushed 10mo ago1 watchersCompare

[ Source](https://github.com/zero-to-prod/spapi-tokens-sdk)[ Packagist](https://packagist.org/packages/zero-to-prod/spapi-tokens-sdk)[ Docs](https://github.com/zero-to-prod/spapi-tokens-sdk)[ Fund](https://github.com/sponsors/zero-to-prod)[ RSS](/packages/zero-to-prod-spapi-tokens-sdk/feed)WikiDiscussions main Synced today

READMEChangelog (7)Dependencies (8)Versions (8)Used By (0)

Zerotoprod\\SpapiTokensSdk
==========================

[](#zerotoprodspapitokenssdk)

[![](art/logo.png)](art/logo.png)

[![Repo](https://camo.githubusercontent.com/9a90a3efeee26aed7d7f2feee9cd84566a26f9c362cc773b184d076210906e1c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6769746875622d677261793f6c6f676f3d676974687562)](https://github.com/zero-to-prod/spapi-tokens-sdk)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/8371bb8880b1ea570d6b0828c09040a3cd774f8f4452bc8c49e7cc320f024e19/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b2f746573742e796d6c3f6c6162656c3d74657374)](https://github.com/zero-to-prod/spapi-tokens-sdk/actions)[![GitHub Actions Workflow Status](https://camo.githubusercontent.com/0eaf6a50247c36e8f3392dcb2d2916d24d87fb70a1bbf397e135fd2a09fa203d/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b2f6261636b77617264735f636f6d7061746962696c6974792e796d6c3f6c6162656c3d6261636b77617264735f636f6d7061746962696c697479)](https://github.com/zero-to-prod/spapi-tokens-sdk/actions)[![Packagist Downloads](https://camo.githubusercontent.com/61dfaf492cf2eda9582d764b7207f844d757531cf26e46ff9e4bae837ad1aa91/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b3f636f6c6f723d626c7565)](https://packagist.org/packages/zero-to-prod/spapi-tokens-sdk/stats)[![php](https://camo.githubusercontent.com/81b409db40551882e1b130d11c739e7b3b45d24da3153913ccd3926d1e796c4f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b2e7376673f636f6c6f723d707572706c65)](https://packagist.org/packages/zero-to-prod/spapi-tokens-sdk/stats)[![Packagist Version](https://camo.githubusercontent.com/8293153a5a41e2f029ad499e418e9422017e88eeb4347586048af08fc2a5720e/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b3f636f6c6f723d663238643161)](https://packagist.org/packages/zero-to-prod/spapi-tokens-sdk)[![License](https://camo.githubusercontent.com/02c1760161aaa4fe7f453a9fd94b2149e83ee7cb9cbc3b85d2c730113ac5cd25/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b3f636f6c6f723d70696e6b)](https://github.com/zero-to-prod/spapi-tokens-sdk/blob/main/LICENSE.md)[![wakatime](https://camo.githubusercontent.com/5a482ec8313d2fa7ab41c69a20650f706dea7027835a42e50b93b78e710ece0a/68747470733a2f2f77616b6174696d652e636f6d2f62616467652f6769746875622f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b2e737667)](https://wakatime.com/badge/github/zero-to-prod/spapi-tokens-sdk)[![Hits-of-Code](https://camo.githubusercontent.com/f2665bc95d98ea86014d3ea644fc9acc8cf7e8d5ebcd8a87c4a0c8c851623efc/68747470733a2f2f686974736f66636f64652e636f6d2f6769746875622f7a65726f2d746f2d70726f642f73706170692d746f6b656e732d73646b3f6272616e63683d6d61696e)](https://hitsofcode.com/github/zero-to-prod/spapi-tokens-sdk/view?branch=main)

Contents
--------

[](#contents)

- [Introduction](#introduction)
- [Requirements](#requirements)
- [Installation](#installation)
- [Documentation Publishing](#documentation-publishing)
    - [Automatic Documentation Publishing](#automatic-documentation-publishing)
- [Usage](#usage)
- [Local Development](./LOCAL_DEVELOPMENT.md)
- [Contributing](#contributing)

Introduction
------------

[](#introduction)

A Software Development Kit for the Amazons Selling Parterns API (SPAPI) [Tokens API](https://developer-docs.amazon.com/sp-api/docs/tokens-api-v2021-03-01-reference).

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

[](#requirements)

- PHP 7.1 or higher.

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

[](#installation)

Install `Zerotoprod\SpapiTokensSdk` via [Composer](https://getcomposer.org/):

```
composer require zero-to-prod/spapi-tokens-sdk
```

This will add the package to your project’s dependencies and create an autoloader entry for it.

Documentation Publishing
------------------------

[](#documentation-publishing)

You can publish this README to your local documentation directory.

This can be useful for providing documentation for AI agents.

This can be done using the included script:

```
# Publish to default location (./docs/zero-to-prod/spapi-tokens-sdk)
vendor/bin/zero-to-prod-spapi-tokens-sdk

# Publish to custom directory
vendor/bin/zero-to-prod-spapi-tokens-sdk /path/to/your/docs
```

### Automatic Documentation Publishing

[](#automatic-documentation-publishing)

You can automatically publish documentation by adding the following to your `composer.json`:

```
{
    "scripts": {
        "post-install-cmd": [
            "zero-to-prod-spapi-tokens-sdk"
        ],
        "post-update-cmd": [
            "zero-to-prod-spapi-tokens-sdk"
        ]
    }
}
```

Usage
-----

[](#usage)

Call the Tokens API to get a Restricted Data Token (RDT) for restricted resources.

```
use Zerotoprod\SpapiTokensSdk\SpapiTokensSdk;

$CreateRestrictedDataTokenResponse = SpapiTokensSdk::createRestrictedDataToken(
    'access_token',     // The access token to create the RDT
    'path',             // The path in the restricted resource.
    ['dataElements'],   // Indicates the type of Personally Identifiable Information requested.
    'targetApplication',// The application ID for the target application to which access is being delegated
    'base_uri',         // The user agent for the request.
    'user_agent'        // Optional. The URL for the api.
    ['options']         // Merge curl options
);

// Get Restricted Data Token
$token = $CreateRestrictedDataTokenResponse->response->restrictedDataToken

// Errors
$CreateRestrictedDataTokenResponse->response->errors[0]->message;
```

Contributing
------------

[](#contributing)

Contributions, issues, and feature requests are welcome! Feel free to check the [issues](https://github.com/zero-to-prod/spapi-tokens-sdk/issues) page if you want to contribute.

1. Fork the repository.
2. Create a new branch (`git checkout -b feature-branch`).
3. Commit changes (`git commit -m 'Add some feature'`).
4. Push to the branch (`git push origin feature-branch`).
5. Create a new Pull Request.

###  Health Score

30

—

LowBetter than 62% of packages

Maintenance48

Moderate activity, may be stable

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

7

Last Release

516d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/502649f05d36c87d494988bd99193a4d908d345335d99c080928a726277371f5?d=identicon)[zero-to-prod](/maintainers/zero-to-prod)

---

Top Contributors

[![zero-to-prod](https://avatars.githubusercontent.com/u/61474950?v=4)](https://github.com/zero-to-prod "zero-to-prod (18 commits)")

---

Tags

zero-to-prodspapi-tokens-sdk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/zero-to-prod-spapi-tokens-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/zero-to-prod-spapi-tokens-sdk/health.svg)](https://phpackages.com/packages/zero-to-prod-spapi-tokens-sdk)
```

###  Alternatives

[zero-to-prod/data-model

Transforms Data into Type-Safe DTOs.

14231.6k32](/packages/zero-to-prod-data-model)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
