Download the PHP package lai3221/amazon-ads-api-v1 without Composer
On this page you can find all versions of the php package lai3221/amazon-ads-api-v1. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lai3221/amazon-ads-api-v1
More information about lai3221/amazon-ads-api-v1
Files in lai3221/amazon-ads-api-v1
Package amazon-ads-api-v1
Short Description A complete Laravel 11 SDK generated from the Amazon Ads API v1 full OpenAPI specification.
License MIT
Homepage https://github.com/lai3221/amazon-ads-api-v1
Informations about the package amazon-ads-api-v1
Amazon Ads API v1 SDK for Laravel 11
A complete, generated Laravel 11 SDK for the Amazon Ads API v1 full specification. The bundled specification combines generally available and beta v1 operations. It does not include legacy Amazon Ads API v0 endpoints.
The package currently contains:
- 73 generated API operations across 34 resource APIs;
- 1,270 generated schemas, including 216 string enums and 66
oneOfunions; - Sponsored Products, Sponsored Brands, Sponsored Display, Sponsored Television, Amazon DSP, and cross-product v1 models;
- Login with Amazon authorization-code exchange and automatic refresh-token authentication;
- NA, EU, and FE endpoint routing;
- typed response hydration, request validation, retries, exceptions, Laravel configuration, facade, and service-container bindings;
- a deterministic PHP generator and CI coverage verification against the exact OpenAPI SHA-256 hash.
See the README.zh-CN.md.
Beta notice: The full specification includes beta operations. Amazon may make breaking changes during a beta, and closed-beta resources require allowlisting for your client ID. Generating a method does not grant access to that resource.
Requirements
- PHP 8.2 or later
- Laravel 11
- An approved Amazon Ads API application and Login with Amazon credentials
Installation
Laravel discovers the service provider and facade automatically. Publish the configuration when you need to customize it:
Configure Login with Amazon and the default regional/account context:
Valid regions are NA, EU, and FE.
Quick start
Every OpenAPI tag has an explicit client accessor, and every operation has an explicit method. Generated request models accept constructor arrays or fluent setters.
Dependency injection is also supported:
Arrays remain supported at API boundaries for incremental adoption, but generated models provide enum hydration, date-time hydration, nested model hydration, required-field validation, and array size validation.
Request headers and account context
The SDK always supplies Authorization, Amazon-Ads-ClientId, Accept, and User-Agent. The following official headers are resolved from config/amazon-ads.php or a per-call RequestContext:
| SDK value | Amazon header | Typical use |
|---|---|---|
profileId |
Amazon-Advertising-API-Scope |
Sponsored Ads profile-scoped operations |
accountId |
Amazon-Ads-AccountId |
Amazon DSP and cross-product operations |
managerAccountId |
Amazon-Ads-Manager-AccountId |
Manager account operations |
acceptLanguage |
Accept-Language |
Localized response content |
Generated methods enforce every header marked as required by that operation's OpenAPI definition. Missing required context produces a ConfigurationException before a request is transmitted.
Login with Amazon onboarding
Build an authorization URL and exchange the returned code for the long-lived refresh token:
Store client secrets and refresh tokens outside source control. In Laravel, refreshed access tokens are cached through the configured cache store. Set AMAZON_ADS_TOKEN_CACHE=false to disable the shared token cache.
Models, enums, and oneOf values
Object schemas expose English-documented getters and fluent setters:
String enum components are generated as PHP backed enums. oneOf components extend AbstractUnion and accept the selected JSON object shape:
Unknown response fields are preserved so minor server-side additions do not discard data.
Errors and retries
Non-2xx responses throw ApiException. Its responseBody is hydrated into the generated error model declared for that status code.
HTTP 408, 429, 500, 502, 503, and 504 responses, plus transient transport failures, are retried with Retry-After support or exponential backoff and jitter. Retry behavior is configurable with the AMAZON_ADS_MAX_RETRIES and AMAZON_ADS_RETRY_BASE_DELAY_MS environment variables.
Using the SDK outside Laravel
The generated client is framework-friendly but not framework-locked:
Updating the generated SDK
The authoritative source is committed at .openapi/amazon-ads-v1-all.json. To update it:
composer spec:check compares every schema, resource tag, operation ID, HTTP method, and path against generated-manifest.json. CI also verifies that generated files are deterministic and current.
Official sources
- Amazon Ads API v1 overview
- Amazon Ads API v1 getting started
- Amazon Ads API v1 specification
- Amazon Ads API v1 betas and full specification
- Amazon Ads API v1 full OpenAPI document
Contributing and security
Read SECURITY.md.
This is an independent open-source SDK and is not an official Amazon package. Amazon, Amazon Ads, and related marks are trademarks of Amazon.com, Inc. or its affiliates.
License
Released under the MIT License.
All versions of amazon-ads-api-v1 with dependencies
ext-json Version *
guzzlehttp/guzzle Version ^7.9
illuminate/contracts Version ^11.0
illuminate/support Version ^11.0
psr/log Version ^3.0
psr/simple-cache Version ^3.0