2017 © Pedro Peláez

library amazon-mws-orders

Amazon Marketplace Web Service Orders PHP Client Library



Amazon Marketplace Web Service Orders PHP Client Library

  • Friday, September 22, 2017
  • by emullaraj
  • Repository
  • 1 Watchers
  • 0 Stars
  • 52 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 2 % Grown


Enter your credentials

  1. Open /Samples/.config.inc.php
  2. Edit the following lines replacing the <> values with your credentials, (*1)

    define('AWS_ACCESS_KEY_ID', '<Your Access Key ID>');
    define('AWS_SECRET_ACCESS_KEY', '<Your Secret Key>');
    define('APPLICATION_NAME', '<Your Application Name>');
    define('APPLICATION_VERSION', '<Your Application Version or Build Number>');
    define('MERCHANT_ID', '<Your Merchant Id>'); // If you are making calls on another seller's behalf, put their merchantID here.
    define('MARKETPLACE_ID', '<Your Marketplace Id>');

Edit the samples

In the /Samples folder you will find files that correspond to a particular Amazon Marketplace Web Service (Amazon MWS) operation. These files serve as examples to illustrate the code required to make the call for that particular operation. We will be using the SubmitFeed operation from the Feeds API section as an example., (*2)

  1. Open /Samples/SubmitFeedSample.php
  2. Uncomment the appropriate $serviceURL for the marketplace that you want to sell in. Example:, (*3)

    $serviceUrl = "https://mws.amazonservices.com";
  3. Populate the $feed variable with the feed contents. Examples:, (*4)

    // From a string
    $feed = "Feed content";
    // From a file
    $feed = file_get_contents("feed.txt");
  4. Uncomment $marketplaceIdArray and fill the array with the MarketplaceId values that you want to submit the feed to., (*5)

  5. Uncomment one of the two Amazon MWS request building methods between lines 126 - 170.
  6. Uncomment the following lines:, (*6)

    invokeSubmitFeed($service, $request);
  7. Start your server and navigate to the script's address to run it., (*7)


Why does cURL return Error Response Status Code: 0?

If you receive the error Error Response Status Code: 0 from cURL when attempting to send a request to Amazon MWS using cURL, find and set CURLOPT_SSL_VERIFYPEER to false., (*8)

Why is FeedSubmissionResult being cut off?

This occurs when the server response is saved to memory. To avoid this, save the response to a file., (*9)

$responseFile = fopen("response.xml", "w");
fwrite($responseFile, $dom->saveXML());

What is in the /Mock folder?

The mock folder contains canned responses that simulate an Amazon MWS response. Mock responses are useful for testing without actually sending a request to Amazon MWS., (*10)

The Versions

22/09 2017


9999999-dev https://developer.amazonservices.com/

Amazon Marketplace Web Service Orders PHP Client Library

  Sources   Download

The Requires

  • php >=5.2.8
  • ext-curl *


by Eno Mullraj

api library amazon client mws orders