tims/laravel-paapi

Laravel package for Amazon Creators API, built on tims/amazon-creatorsapi-php-sdk

Maintainers

Package info

github.com/timslabs/laravel-paapi

pkg:composer/tims/laravel-paapi

Transparency log

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.0.1 2026-07-26 06:07 UTC

This package is auto-updated.

Last update: 2026-07-26 06:07:52 UTC


README

Laravel package for Amazon Creators API, built on tims/amazon-creatorsapi-php-sdk.

Requirements

  • PHP 8.1+
  • Laravel 10, 11, 12, or 13
  • Amazon Associates Creators API credentials (Credential ID, Secret, Version)

Installation

composer require tims/laravel-paapi

Publish the config (optional):

php artisan vendor:publish --tag=paapi-config

Configuration

Add these to your .env:

PAAPI_CREDENTIAL_ID=
PAAPI_CREDENTIAL_SECRET=
PAAPI_CREDENTIAL_VERSION=3.1
PAAPI_PARTNER_TAG=yourtag-20
PAAPI_MARKETPLACE=www.amazon.com

Optional:

PAAPI_HOST=https://creatorsapi.amazon
PAAPI_AUTH_ENDPOINT=
PAAPI_HTTP_TIMEOUT=30
PAAPI_DEBUG=false

Usage

use Tims\Paapi\Facades\Paapi;
use Amazon\CreatorsAPI\v1\ApiException;

try {
    // Catalog
    $response = Paapi::search(category: 'All', keyword: 'amazon', page: 1);
    $response = Paapi::browse(node: '283155');                 // or browse(['283155', '1000'])
    $response = Paapi::item(asin: 'B0XXXX');
    $response = Paapi::items(asin: ['B0XXXX', 'B0YYYY']);
    $response = Paapi::variations(asin: 'B0XXXX', page: 1);

    // Feeds
    $response = Paapi::feeds();
    $response = Paapi::feed(name: 'your-feed-name.json.gz');

    // Reports
    $response = Paapi::reports();
    $response = Paapi::report(filename: 'your-report.tsv.gz');
} catch (ApiException $e) {
    report($e);
}
Facade SDK method
search searchItems
browse getBrowseNodes
item / items getItems
variations getVariations
feeds listFeeds
feed getFeed
reports listReports
report getReport

Responses are arrays (decoded JSON), so data_get() works:

$title = data_get($response, 'itemsResult.items.0.itemInfo.title.displayValue');
$feedUrl = data_get($response, 'url');

Marketplace override

Paapi::marketplace('www.amazon.in')->search(category: 'All', keyword: 'tea');

Hooks

Tweak the underlying SDK request before it is sent (search, browse, item, variations, feed, report):

use Tims\Paapi\Facades\Paapi;

Paapi::hook('item', function ($request) {
    return $request->setResources([
        'itemInfo.title',
        'images.primary.large',
        'offersV2.listings.price',
    ]);
});

$response = Paapi::item(asin: 'B0XXXX');

Access the official SDK client

For async / *WithHttpInfo helpers, use the underlying client:

use Amazon\CreatorsAPI\v1\com\amazon\creators\api\DefaultApi;
use Tims\Paapi\Facades\Paapi;

/** @var DefaultApi $api */
$api = Paapi::api();

Notes vs Product Advertising API 5

Creators API replaces Amazon's Product Advertising API 5. Notable differences:

Product Advertising API 5 Creators API
Access key + secret + region Credential ID + secret + version (OAuth)
webservices.amazon.com host Marketplace locale (www.amazon.com) + creatorsapi.amazon
ItemIdType (EAN/UPC/…) ASINs via item / items
Browse sort Not supported (parameter kept, ignored)
Response keys ItemsResult camelCase itemsResult

OAuth access tokens are cached in Laravel Cache across requests.

License

MIT — see LICENSE.

Amazon Creators API SDK is Apache-2.0 (see the upstream SDK notice).