Amazon automatic price adjustment tool

I developed a tool just for a customer, with the one the prices of own goods at Amazon can automatically adapt. In the competition to Goth are determined analyzes reliability and therefore a fair price condition of the product and seller for the goods. There are all the data, about the API are available for the determination of price with used, as e.g.. Seller feedback (Reviews of the dealer), whether Amazon itself sent, Shipping time and much more.

The tool compares the rates between the various Amazon optional platforms in Europe (DE, UK, IT, IT, FR) Platforms but also outside Europe, like Japan or America and händelt the different currencies.

The result can be sent directly to Amazon via the API and the prices will be immediately updated.

Amazon Preisanpassung

Screenshot Preisanpassungs Tool

 

The application is in PHP with symfony 3 written and has a front end with Twitter bootstrap 3 and a MySQL database. There's also a vagrant environment for developing with PHP7. 1 and nginx. Be carried out can the whole thing with a simple XAMPP environment or vagrant virtual box at the customer locally on a PC.

If you are also interested in such a tool, allows you to Contact.

Amazon MWS PHP: Compile Error: Redefinition of parameter $quotaMax

The Amazon MWS library has rightly issues in PHP7. 1 with the file: /MarketplaceWebServiceProducts/model /.ResponseHeaderMetadata.php (line 31)

Previously:

class MarketplaceWebServiceProducts_Model_ResponseHeaderMetadata {

...

  public function __construct($requestId = null, $responseContext = null, $timestamp = null,
                              $quotaMax = null, $quotaMax = null, $quotaResetsAt = null) {
    $this->metadata[self::REQUEST_ID] = $requestId;
    $this->metadata[self::RESPONSE_CONTEXT] = $responseContext;
    $this->metadata[self::TIMESTAMP] = $timestamp;
    $this->metadata[self::QUOTA_MAX] = $quotaMax;
    $this->metadata[self::QUOTA_REMAINING] = $quotaMax;
    $this->metadata[self::QUOTA_RESETS_AT] = $quotaResetsAt;
  }

After the fix:

public function __construct($requestId = null, $responseContext = null, $timestamp = null,
                            $quotaMax = null, $quotaMaxRemain = null, $quotaResetsAt = null) {
  $this->metadata[self::REQUEST_ID] = $requestId;
  $this->metadata[self::RESPONSE_CONTEXT] = $responseContext;
  $this->metadata[self::TIMESTAMP] = $timestamp;
  $this->metadata[self::QUOTA_MAX] = $quotaMax;
  $this->metadata[self::QUOTA_REMAINING] = $quotaMaxRemain;
  $this->metadata[self::QUOTA_RESETS_AT] = $quotaResetsAt;
}

Reason is, dass die Variable $quotaMax doppelt benutzt wird in der Kontrultor Definition.

 

Compare the popularity of shop system

For a small to medium-sized German company Shopware is the best solution currently in my opinion, because

  • Shopware is home from spezialisiet on the German E-commerce market and local data protection and tax characteristics
  • rising popularity is according to Google trends
  • under the hood of symfony 2 and Zend 2 and in the backend running ExtJS version 4
  • move the prices also for the professional versions of Magento
  • the System requirements challenging, but modern

PHP check, whether a string is a valid ASIN

To check, whether a string is a valid ASIN, there are 2 possible rules for ASINs:

  • a “B” followed by 2 digits and 7 alphanumeric values
  • a special ISBN Vairiante: 9 digits and at the end either a “X” or another digit (very rare)

The regular expression encapsulated in a function in PHP is:

function isAsin($string){
    $ptn = "/B[0-9]{2}[0-9A-Z]{7}|[0-9]{9}(X|0-9])/";
    if(preg_match($ptn, $string, $matches)){
        return true;
    }
}

To test the regex, I have used the following code:

$testAsins = array("B223213FCF","232342342X", "A223213FCF");
foreach ($testAsins as $testAsin)
{
    if(isAsin($testAsin)){
        echo $testAsin." is ASIN"."<br>";
    }
}

The output of the script is:

B223213FCF is ASIN
232342342X is ASIN

API products are no right Fehlermledungen only FatalError

To tickle from Amazon to the correct error messages out, must be caught and spent Fatals, otherwise you can look far:

                try
                {
                    $this->getListMatchingProductsForEanOrQueryData($ean, $country);
                }
                catch(MarketplaceWebServiceProducts_Exception $e)
                {
                    var_dump($e);
                    die();
                }

MWS Products API wird ersetzt durch Amazon Product Advertising API (PA-API)

At the 6. February there was this Email from Amazon:

Amazon Marketplace Web Service (Amazon MWS) is pleased to announce the availability of the new Amazon MWS Products API section. The Amazon MWS Products API section will replace the Amazon Product Advertising API (PA-API) as the means for sellers to obtain sourcing, listing matching, and pricing information for offering products on Amazon marketplace sites. PA-API will be discontinued for Amazon sellers use on August 31, 2012.

This means, that all operations must be changed, with the old Products Advertising API for Sellers do have. Undeterred, the Amazon Product Advertising API (PA-API) für Affiliate User, d.h. those, advertising to earn money off un. It will also be so fast to change anything, because Amazon has an interest, these users not to lose.

Gives a very good overview of the differences between sellers and affiliate it here.

Amazon MWS: SellerSKUList failed a validation check: Extraneous whitespace for input value

In the following error message at the Amazon MWS API:

Fatal error: Uncaught exception 'MarketplaceWebServiceProducts_Exception' with message 'parameter SellerSKUList.SellerSKU.x failed a validation check: Extraneous whitespace for input value: "64145345473 "' in foo\\MarketplaceWebServiceProducts\Client.php on line 533
MarketplaceWebServiceProducts_Exception: parameter SellerSKUList.SellerSKU.x failed a validation check: Extraneous whitespace for input value: "64145345473 " in foo\MarketplaceWebServiceProducts\Client.php on line 533

Was the solution, as the error message suggests, to remove the white spaces with trim:

                for($i = 0; $i < count($skus); $i++)
                {
                    $skus[$i] = trim($skus[$i]);
                }

Strangely does not work in PHP:

array_walk($skus, "trim");

or

function trim_value(&$value) 
{ 
    $value = trim($value); 
}
array_walk($skus, 'trim_value');

Amazon MWS Products API Request Limit

Amazon has built a not very simple request limit for the entire MWS API. Generally, no more than that 10000 Requests can be made per hour.

Amazon has chosen the so-called leaky bucket algorithm, to relieve the Web.

Für die MWS Products API, can be purchased with the product information from Amazon, the following limits of the MWS Products API Referenz (Stand 6.9.2012).

Operation / Maximum Request Quota / Restore Rate
ListMatchingProducts / 20 / 1 for 5 seconds

GetMatchingProduct  / 20 / 2 Items per second

GetMatchingProductForId/ 20 / 1 Item per second (new)

GetCompetitivePricingForSKU and  GetCompetitivePricingForASIN / 20&nbsp; / 10 Items per second

GetLowestOfferListingsForSKU and GetLowestOfferListingsForASIN / 20 / 10 Items per second

GetMyPriceForSKU and GetMyPriceForASIN / 20 / 10 Items per second (new)

GetProductCategoriesForSKU and GetProductCategoriesForASIN / 20 / 1for 5 seconds

 maximale Requests für ListMatchingProducts proStunde

It can 20 Requests can be made at the beginning of the hour, then the points must be replenished. After that, the rate again Restore points are filled. When every second request fills again, gives the 3600 per hour, at best, if the requests are not at the top of the hour charges, rather evenly distributed over the entire hour.

Total result for the ListMatchingProducts request for a restore rate of 5 Seconds maximum 6 * 60 = 360 Requests per hour so. Per request can 20 Items will be sent with, What does mean, that 7200 Queried by the article can in the best case.

Amazon Product Advertising API nach AWS Products API Migration

The next change in the Amazon Product Advertising API is to, After the WSDL service will be disconnected, is at the end of August 2012 the Amazon product advertising API for sellers abolished and replaced by the new service:&nbsp; AWS Products API. For advertisers, the service is still available.

This is a package of the new AWS services entahlten, The library can here be related. There is a migration guide here, Also important is the API Dokumentation.

We can say roughly, that the new API is divided more and you have to sell more requests over a product than with the old API, In order to receive the same information.

 

Cloudfront String could not be parsed as XML

If you are using the Cloudfront library for Amazon Advertising API and you get the following error message, contact me I can help you with this issue. I got this error when I tried to retrieve amazon.fr (France) data.

exception 'Exception' with message 'String could not be parsed as XML' in cloudfusion\sdk.class.php:1209
Stack trace:
#0 \sdk.class.php(1209): SimpleXMLElement->__construct('parse_callback('pas_authenticate('ItemLookup', Array)
#3 amazonProductAdvertisingApi.php(233): AmazonPAS->item_lookup('B000091xxx', Array)
#4 amazonProductAdvertisingApi.php(90): amazonProductAdvertisingApi->getAsinData()
#5 amazonProductAdvertisingApi.php(65): amazonProductAdvertisingApi->getResult('FR')
#6 \index.php(248): amazonProductAdvertisingApi->getResults()
#7 {main}EOL#0 cloudfusion\sdk.class.php(1209): SimpleXMLElement->__construct('parse_callback('pas_authenticate('ItemLookup', Array)
#3 amazonProductAdvertisingApi.php(233): AmazonPAS->item_lookup('B000091xxx', Array)
#4 amazonProductAdvertisingApi.php(90): amazonProductAdvertisingApi->getAsinData()
#5 amazonProductAdvertisingApi.php(65): amazonProductAdvertisingApi->getResult('FR')
#6 eansuche\index.php(248): amazonProductAdvertisingApi->getResults()
#7 {main}