Download the PHP package tims/laravel-amazon-spapi without Composer
On this page you can find all versions of the php package tims/laravel-amazon-spapi. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-amazon-spapi
laravel-amazon-spapi
Laravel integration for Amazon’s official Selling Partner API PHP SDK (amzn-spapi/sdk).
Why this package?
amzn-spapi/sdk is the API client. This package adds the Laravel layer around it:
- Config and environment-based LWA credentials
- Single-seller and multi-seller credential storage
- Access-token and Restricted Data Token (RDT) caching
- Automatic RDT attachment for PII endpoints
- OAuth helpers for Seller Central authorization
- Grantless client helpers (Notifications, client-secret rotation)
- Feed and report document upload/download
- HTTP retries for 429 and transient 5xx responses
- Queue jobs for report/feed create → poll → download
- Test fakes via
SpApiFake
You continue to call official SpApi\Api\... classes; this package configures and supports them in Laravel.
Requirements
- PHP 8.3+
- Laravel 10, 11, or 12
Installation
Publish the config:
Configuration
Add these to your .env:
Single-seller mode
Type-hint SpApiManager or use the facade to build official SDK API clients:
In single-seller mode you can also resolve \SpApi\Configuration from the container.
Multi-seller mode
- Set
AMAZON_SPAPI_INSTALLATION_TYPE=multi(orinstallation_typein config). -
Publish and run migrations:
-
Store sellers and credentials:
- Build API clients from a credentials row:
client_id / client_secret fall back to the single-seller LWA env values when left null (shared SP-API application). Refresh tokens and client secrets are stored encrypted.
OAuth
Build Seller Central authorize URLs and exchange authorization codes for refresh tokens:
Restricted Data Tokens (RDT)
Configure dataElements once. With automatic RDT enabled, restricted calls do not need a manual restrictedDataToken argument:
Or use .env / config defaults:
Disable automatic RDT when you want to pass tokens yourself:
Manual RDT
AmazonSpApi::isRestrictedOperation('OrdersV0Api-getOrder') uses the official SDK restricted-operations list.
In sandbox mode, automatic RDT is skipped (skip_in_sandbox). Restricted sandbox calls work without an RDT.
Grantless operations
Some Notifications and Application Management calls do not use a seller refresh token. They use app client id/secret plus an LWA scope:
Feed / report documents
After createFeedDocument / getReportDocument / getFeedDocument, use Document to upload or download (including GZIP):
Retries
SP-API applies rate limits. Clients from make() / makeGrantless() retry 429, selected 5xx responses, and connection errors by default, with exponential backoff and support for Retry-After.
Disable per client:
Queued reports & feeds
Report and feed flows: create → poll → download → event.
Feeds:
Events: ReportDocumentReady, ReportFailed, FeedResultReady, FeedFailed.
Poll settings: AMAZON_SPAPI_REPORT_POLL_SECONDS, AMAZON_SPAPI_FEED_POLL_SECONDS, AMAZON_SPAPI_MAX_POLL_ATTEMPTS.
Testing fakes
In tests, swap SpApiManager so make() returns Mockery doubles:
Access token caching
LWA access tokens and RDTs are stored in Laravel’s cache. Updating a Credentials row clears that seller’s cached tokens when the cache driver supports tags (for example Redis).
License
This package is open-sourced software licensed under the MIT license.
Copyright (c) 2026 TIMS.
All versions of laravel-amazon-spapi with dependencies
amzn-spapi/sdk Version ^1.0
guzzlehttp/guzzle Version ^7.9
illuminate/cache Version ^10.0|^11.0|^12.0
illuminate/database Version ^10.0|^11.0|^12.0
illuminate/events Version ^10.0|^11.0|^12.0
illuminate/queue Version ^10.0|^11.0|^12.0
illuminate/support Version ^10.0|^11.0|^12.0