sonnenglas/laravel-amazon-mws
Laravel package for integrating Amazon Marketplace Web Service (MWS). It offers a convenient wrapper for querying orders, products, reports, and feeds, with configurable credentials and Laravel service container support.
composer require sonnenglas/laravel-amazon-mws
composer.json and README.md; most examples use the AmazonMws facade or inject the underlying client.config/amazon-mws.php and .env with MWS credentials:
AMAZON_MWS_MERCHANT_ID=your-seller-id
AMAZON_MWS_MARKETPLACE_ID=ATVPDKIKX0DER
AMAZON_MWS_KEY_ID=your-aws-access-key
AMAZON_MWS_SECRET_KEY=your-aws-secret
AMAZON_MWS_AUTH_TOKEN=your-mws-auth-token
AMAZON_MWS_SERVICE_URL=https://mws.amazonservices.com
Use the correct regional endpoint, e.g. https://mws-eu.amazonservices.com for Europe.config/amazon-mws.php for credential/key names.setService()->setOperation()->setParams()->run() chain.use AmazonMws;
$response = AmazonMws::setService('Orders', '2013-09-01')
->setOperation('ListOrders')
->setParams([
'MarketplaceId.Id.1' => config('amazon-mws.marketplace_id'),
'CreatedAfter' => now()->subDays(2)->toIso8601String(),
'OrderStatuses.Status.1' => 'Unshipped',
])
->run();
dd($response);
Inspect the raw response before writing mapping code. MWS often returns XML errors inside a normal response, so check for ErrorResponse/Error nodes as well as success payloads.AmazonOrderSync, AmazonProductService, AmazonReportService, AmazonFeedService.ListOrders with CreatedAfter/LastUpdatedAfter.NextToken with ListOrdersByNextToken until exhausted.ListOrderItems and upsert by AmazonOrderId.RequestReport to create the report.GetReportRequestList until _DONE_.GetReportList, then GetReport to download content.storage/app/amazon-mws/reports and process in queued jobs.ContentMD5Header as base64 MD5 of the feed body.SubmitFeed, then poll GetFeedSubmissionList and inspect GetFeedSubmissionResult.GetMatchingProduct, GetCompetitivePricingForASIN, or GetLowestOfferListingsForASIN.MarketplaceId.Id.1, MarketplaceId.Id.2, etc.^7.x. Composer will likely block installation on Laravel 8+. Isolate it in a Laravel 7 service or fork/upgrade it before using it in a modern application.MarketplaceId.Id.1, OrderStatuses.Status.1, ASINList.ASIN.1. If the package does not expand arrays for you, flatten them yourself.2013-09-01, Products 2011-10-01, Reports 2009-01-01, Feeds 2009-01-01.ErrorResponse, Error, and error codes in addition to transport-level success.RequestThrottled and transient 5xx responses with exponential backoff and jitter. Do not retry validation or signature errors indefinitely.NextToken yourself for operations such as ListOrders and ListOrderItems..env changes. Run php artisan config:clear after changing MWS credentials.RequestId from responses. Amazon support and debugging are much easier when you can cite the request ID.How can I help you explore Laravel packages today?