Looking to hire Laravel developers? Try LaraJobs

creatorsapi-laravel maintained by cre8-it

Description
Laravel wrapper for amazon creatorsapi-php-sdk
Last update
2026/11/04 14:40 (dev-main)
Links
Downloads
127

Comments
comments powered by Disqus

Creators API Laravel Wrapper

Small Laravel wrapper around the Amazon Creators API PHP SDK.

Requirements

  • PHP 8.2+ (Laravel 13 requires PHP 8.3+)
  • Laravel 12 or 13

The committed development lockfile targets Laravel 13 / PHP 8.3. The CI matrix also tests Laravel 12 / PHP 8.2 with Orchestra Testbench (see .github/workflows/tests.yml). To run the default suite locally:

composer install
vendor/bin/phpunit

Configuration

Publish the config:

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

Environment options:

CREATORSAPI_CREDENTIAL_ID=
CREATORSAPI_CREDENTIAL_SECRET=
CREATORSAPI_CREDENTIAL_VERSION=
CREATORSAPI_AUTH_ENDPOINT=
CREATORSAPI_HOST=https://creatorsapi.amazon
CREATORSAPI_USER_AGENT=creatorsapi-laravel
CREATORSAPI_DEBUG=false
CREATORSAPI_DEBUG_FILE=php://output
CREATORSAPI_TEMP_FOLDER=
CREATORSAPI_HTTP_TIMEOUT=30
CREATORSAPI_HTTP_CONNECT_TIMEOUT=10
CREATORSAPI_HTTP_PROXY=
CREATORSAPI_HTTP_VERIFY=true

Usage

Examples below follow the SDK samples (SampleSearchItems.php, SampleGetItems.php), adapted for Laravel with fluent chaining.

SearchItems

use CreatorsApi\Laravel\Facades\CreatorsApi;
use Amazon\CreatorsAPI\v1\com\amazon\creators\model\SearchItemsResource;
use Amazon\CreatorsAPI\v1\ApiException;

try {
    $response = CreatorsApi::searchItems()
        ->marketplace('www.amazon.com')
        ->partnerTag('yourtag-20')
        ->keywords('Harry Potter')
        ->searchIndex('Books')
        ->itemCount(2)
        ->resources([
            SearchItemsResource::IMAGES_PRIMARY_MEDIUM,
            SearchItemsResource::ITEM_INFO_TITLE,
            SearchItemsResource::OFFERS_V2_LISTINGS_AVAILABILITY,
            SearchItemsResource::OFFERS_V2_LISTINGS_PRICE,
        ])
        ->send();
} catch (ApiException $e) {
    report($e);
}

GetItems

use CreatorsApi\Laravel\Facades\CreatorsApi;
use Amazon\CreatorsAPI\v1\com\amazon\creators\model\GetItemsResource;
use Amazon\CreatorsAPI\v1\ApiException;

try {
    $response = CreatorsApi::getItems()
        ->marketplace('www.amazon.com')
        ->partnerTag('yourtag-20')
        ->itemIds(['B0DLFMFBJW', 'B0BFC7WQ6R', 'B00ZV9RDKK'])
        ->resources([
            GetItemsResource::IMAGES_PRIMARY_MEDIUM,
            GetItemsResource::ITEM_INFO_TITLE,
            GetItemsResource::ITEM_INFO_FEATURES,
            GetItemsResource::OFFERS_V2_LISTINGS_PRICE,
            GetItemsResource::OFFERS_V2_LISTINGS_AVAILABILITY,
        ])
        ->send();
} catch (ApiException $e) {
    report($e);
}