PHPackages                             serhatdurum/amazon-mws - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. serhatdurum/amazon-mws

ActiveLibrary

serhatdurum/amazon-mws
======================

Library to interface with Amazon MWS

0.1.26(8y ago)016MITPHPPHP &gt;= 5.4

Since May 7Pushed 7y ago1 watchersCompare

[ Source](https://github.com/serhatdurum/amazon-mws)[ Packagist](https://packagist.org/packages/serhatdurum/amazon-mws)[ RSS](/packages/serhatdurum-amazon-mws/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (55)Used By (0)

Amazon Marketplace Webservices
==============================

[](#amazon-marketplace-webservices)

[![Latest Stable Version](https://camo.githubusercontent.com/370f8882791830333695c7d397fd65b171292bf72b05d87144a71db1a3c06f9b/68747470733a2f2f706f7365722e707567782e6f72672f6d63732f616d617a6f6e2d6d77732f762f737461626c65)](https://packagist.org/packages/mcs/amazon-mws) [![Latest Unstable Version](https://camo.githubusercontent.com/14b5c8e0e085d6f96119cc77a45e4cd5d1f9588a5617b16fc37a4acdd62ee9cd/68747470733a2f2f706f7365722e707567782e6f72672f6d63732f616d617a6f6e2d6d77732f762f756e737461626c65)](https://packagist.org/packages/mcs/amazon-mws) [![License](https://camo.githubusercontent.com/9d716115ae81380d1b70936728960034b4c0d9884dd4298139e69b4c7955f592/68747470733a2f2f706f7365722e707567782e6f72672f6d63732f616d617a6f6e2d6d77732f6c6963656e7365)](https://packagist.org/packages/mcs/amazon-mws) [![Total Downloads](https://camo.githubusercontent.com/3e9c9b3af093b87a0a06157d85f36ae45b230e7335e7016662b800887387971c/68747470733a2f2f706f7365722e707567782e6f72672f6d63732f616d617a6f6e2d6d77732f646f776e6c6f616473)](https://packagist.org/packages/mcs/amazon-mws)

[![paypal](https://camo.githubusercontent.com/e1ff554a09e8e92bef25abc553ff05b88f45afd695877cf12f3a46558ef65b2e/68747470733a2f2f7777772e70617970616c6f626a656374732e636f6d2f656e5f55532f692f62746e2f62746e5f646f6e61746543435f4c472e676966)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=FQG5EWN987PJW)

Interaction with the Amazon Api for vendors called MWS

### Installation:

[](#installation)

```
$ composer require mcs/amazon-mws
```

### Initiate the client

[](#initiate-the-client)

```
require_once 'vendor/autoload.php';

$client = new MCS\MWSClient([
    'Marketplace_Id' => '',
    'Seller_Id' => '',
    'Access_Key_ID' => '',
    'Secret_Access_Key' => '',
    'MWSAuthToken' => '' // Optional. Only use this key if you are a third party user/developer
]);

// Optionally check if the supplied credentials are valid
if ($client->validateCredentials()) {
    // Credentials are valid
} else {
    // Credentials are not valid
}
```

### Get orders

[](#get-orders)

```
$fromDate = new DateTime('2016-01-01');
$orders = $client->ListOrders($fromDate);
foreach ($orders as $order) {
    $items = $client->ListOrderItems($order['AmazonOrderId']);
    print_r($order);
    print_r($items);
}
```

### Get product attributes

[](#get-product-attributes)

```
$searchField = 'ASIN'; // Can be GCID, SellerSKU, UPC, EAN, ISBN, or JAN

$result = $client->GetMatchingProductForId([
    '', '', ''
], $searchField);

print_r($result);
```

### Create or update a product

[](#create-or-update-a-product)

```
$product = new MCS\MWSProduct();
$product->sku = 'TESTNOTFORSALE';
$product->price = '1000.00';
$product->product_id = 'B0031S9***';
$product->product_id_type = 'ASIN';
$product->condition_type = 'New';
$product->quantity = 10;

if ($product->validate()) {
    // You can also submit an array of MWSProduct objects
    $result = $client->postProduct($product);
} else {
    $errors = $product->getValidationErrors();
}
```

### Update product stock

[](#update-product-stock)

```
$result = $client->updateStock([
    'sku1' => 20,
    'sku2' => 9,
]);
print_r($result);

$info = $client->GetFeedSubmissionResult($result['FeedSubmissionId']);
print_r($info);
```

### Update product stock with fulfillment latency specified

[](#update-product-stock-with-fulfillment-latency-specified)

```
$result = $client->updateStockWithFulfillmentLatency([
    ['sku' => 'sku1', 'quantity' => 20, 'latency' => 1],
    ['sku' => 'sku2', 'quantity' => 20, 'latency' => 1],
]);
print_r($result);

$info = $client->GetFeedSubmissionResult($result['FeedSubmissionId']);
print_r($info);
```

### Update product pricing

[](#update-product-pricing)

```
$result = $client->updatePrice([
    'sku1' => '20.99',
    'sku2' => '100.00',
]);
print_r($result);

$info = $client->GetFeedSubmissionResult($result['FeedSubmissionId']);
print_r($info);
```

### Reports

[](#reports)

For all report types, visit: [http://docs.developer.amazonservices.com](http://docs.developer.amazonservices.com/en_US/reports/Reports_ReportType.html#ReportTypeCategories__ListingsReports)

```
$reportId = $client->RequestReport('_GET_MERCHANT_LISTINGS_DATA_');
// Wait a couple of minutes and get it's content
$report_content = $client->GetReport($reportId);
print_r($report_content);
```

### Available methods

[](#available-methods)

View source for detailed argument description. All methods starting with an uppercase character are also documented in the [Amazon MWS documentation](http://docs.developer.amazonservices.com/en_US/dev_guide/index.html)

```
// Returns the current competitive price of a product, based on ASIN.
$client->GetCompetitivePricingForASIN($asin_array = []);

// Returns the feed processing report and the Content-MD5 header.
$client->GetFeedSubmissionResult($FeedSubmissionId);

// Returns pricing information for the lowest-price active offer listings for up to 20 products, based on ASIN.
$client->GetLowestOfferListingsForASIN($asin_array = [], $ItemCondition = null);

// Returns lowest priced offers for a single product, based on ASIN.
$client->GetLowestPricedOffersForASIN($asin, $ItemCondition = 'New');

// Returns a list of products and their attributes, based on a list of ASIN, GCID, SellerSKU, UPC, EAN, ISBN, and JAN values.
$client->GetMatchingProductForId($asin_array, $type = 'ASIN');

// Returns a list of products and their attributes, based on an open text based query
$client->ListMatchingProducts($query, $query_context_id = null);

// Returns pricing information for your own offer listings, based on ASIN.
$client->GetMyPriceForASIN($asin_array = [], $ItemCondition = null);

// Returns pricing information for your own offer listings, based on SKU.
$client->GetMyPriceForSKU($sku_array = [], $ItemCondition = null);

// Returns an order based on the AmazonOrderId values that you specify.
$client->GetOrder($AmazonOrderId);

// Returns the parent product categories that a product belongs to, based on ASIN.
$client->GetProductCategoriesForASIN($ASIN);

// Returns the parent product categories that a product belongs to, based on SellerSKU.
$client->GetProductCategoriesForSKU($SellerSKU);

// Get a report's content
$client->GetReport($ReportId);

// Returns a list of reports that were created in the previous 90 days.
$client->GetReportList($ReportTypeList = []);

// Get a report's processing status
$client->GetReportRequestStatus($ReportId);

// Get a list's inventory for Amazon's fulfillment
$client->ListInventorySupply($sku_array = []);

// Returns a list of marketplaces that the seller submitting the request can sell in, and a list of participations that include seller-specific information in that marketplace
$client->ListMarketplaceParticipations();

// Returns order items based on the AmazonOrderId that you specify.
$client->ListOrderItems($AmazonOrderId);

// Returns orders created or updated during a time frame that you specify.
$client->ListOrders($from, $allMarketplaces = false, $states = ['Unshipped', 'PartiallyShipped'], $FulfillmentChannel = 'MFN');

// Returns your active recommendations for a specific category or for all categories for a specific marketplace.
$client->ListRecommendations($RecommendationCategory = null);

// Creates a report request and submits the request to Amazon MWS.
$client->RequestReport($report, $StartDate = null, $EndDate = null);

// Uploads a feed for processing by Amazon MWS.
$client->SubmitFeed($FeedType, $feedContent, $debug = false);

// Call this method to get the raw feed instead of sending it
$client->debugNextFeed();

// Post to create or update a product (_POST_FLAT_FILE_LISTINGS_DATA_)
$client->postProduct($MWSProduct);

// Update a product's price
$client->updatePrice($array);

// Update a product's stock quantity
$client->updateStock($array);

// A method to quickly check if the supplied credentials are valid
$client->validateCredentials();
```

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~13 days

Recently: every ~89 days

Total

54

Last Release

2942d ago

### Community

---

Top Contributors

[![meertensm](https://avatars.githubusercontent.com/u/10245984?v=4)](https://github.com/meertensm "meertensm (20 commits)")[![mabuak](https://avatars.githubusercontent.com/u/15919105?v=4)](https://github.com/mabuak "mabuak (12 commits)")[![omygod9138](https://avatars.githubusercontent.com/u/11039161?v=4)](https://github.com/omygod9138 "omygod9138 (5 commits)")[![Annoraaq](https://avatars.githubusercontent.com/u/4518664?v=4)](https://github.com/Annoraaq "Annoraaq (4 commits)")[![bchaikin](https://avatars.githubusercontent.com/u/1738282?v=4)](https://github.com/bchaikin "bchaikin (3 commits)")[![Elompenta](https://avatars.githubusercontent.com/u/6824545?v=4)](https://github.com/Elompenta "Elompenta (3 commits)")[![serhatdurum](https://avatars.githubusercontent.com/u/7244399?v=4)](https://github.com/serhatdurum "serhatdurum (3 commits)")[![bethrezen](https://avatars.githubusercontent.com/u/260284?v=4)](https://github.com/bethrezen "bethrezen (2 commits)")[![Sinevia](https://avatars.githubusercontent.com/u/3450815?v=4)](https://github.com/Sinevia "Sinevia (2 commits)")[![temirfe](https://avatars.githubusercontent.com/u/10124797?v=4)](https://github.com/temirfe "temirfe (1 commits)")[![clicktrend](https://avatars.githubusercontent.com/u/1344095?v=4)](https://github.com/clicktrend "clicktrend (1 commits)")[![ebogdanov](https://avatars.githubusercontent.com/u/922644?v=4)](https://github.com/ebogdanov "ebogdanov (1 commits)")[![abdfork](https://avatars.githubusercontent.com/u/16870508?v=4)](https://github.com/abdfork "abdfork (1 commits)")

### Embed Badge

![Health badge](/badges/serhatdurum-amazon-mws/health.svg)

```
[![Health](https://phpackages.com/badges/serhatdurum-amazon-mws/health.svg)](https://phpackages.com/packages/serhatdurum-amazon-mws)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
