Amazon marketplace barcode to product quantity

260 views Asked by At

I'm writing an automated script to list products on the Amazon marketplace, It works fine for 95% of products i'm trying to list, but i'm having problems with particular items, such as "bulk deals" or "packs of X" listings.

For example, I have a product with an EAN barcode of 7613032631703, and I can query the Amazon API for information about products with a barcode with something like this

$amazon_api = new MarketplaceWebServiceProducts_Client(
    AWS_ACCESS_KEY_ID,
    AWS_SECRET_ACCESS_KEY,
    APPLICATION_NAME,
    APPLICATION_VERSION,
    [
        'ServiceURL' => 'https://mws-eu.amazonservices.com/Products/2011-10-01',
        'ProxyHost' => null,
        'ProxyPort' => -1,
        'ProxyUsername' => null,
        'ProxyPassword' => null,
        'MaxErrorRetry' => 3,
    ]
);

$list = new MarketplaceWebServiceProducts_Model_IdListType();
$list->setId('7613032631703');

$request = new MarketplaceWebServiceProducts_Model_GetMatchingProductForIdRequest();
$request->setSellerId(SELLER_ID);
$request->setIdType('EAN');
$request->setMarketplaceId(MARKETPLACE_ID);
$request->setIdList($list);
$response = $amazon_api->getMatchingProductForId($request);

Which then returns me a MarketplaceWebServiceProducts_Model_GetMatchingProductForIdResponse object, which I can use fine.

But the all the results Amazon has returned are for product listings of bulk buys for this product, which as far as I can tell means Amazon have it wrong, as in this example the EAN barcode 7613032631703 translates to one package of x12 of this product, where Amazon are saying it's the same product, but in a multi-pack of 4 (so 48 packets total).

Obviously I do not want to set my product to the same ASIN as the "bulk deal" listings, as I'm selling them individually.

Is there a way to prevent this? I cannot find anywhere in the Amazon API docs mention of a "listing quantity" or "stock relation value" or something I could use to identify when they're using a singular barcode for listings that are actually multipacks.

Many thanks for any ideas anyone can give me.

Edit:

After looking further into this, I'm at the point where I don't think it's possible. Simply put, there are incorrect listings on Amazon and you cannot trust the information Amazon gives you to be able to automate every listing.

The highest hope I had was an attribute on the result of MarketplaceWebServiceProducts_Model_ListMatchingProductsRequest, if you dig down into AttributeSets you can find PackageQuantity for the listing. In the example I gave for barcode 7613032631703 some of the listings returned have a PackageQuantity of 4, which would be correct! And you could then use in automating this process. But several other listings for the same product have a PackageQuantity of 1, one of them has a PackageQuantity of 48.... the data Amazon provides is just inaccurate (it's not really their fault that these listings are wrong, whoever created the listing in the first place did it wrong. But I do think they should police and fix these listings better).

I'm really interested if someone has found a solid solution that allows automation, but if someone else is here with the same problem, I don't think it looks likely, and I'd advise against trying to automate it as the potential mistakes it could make are huge.

1

There are 1 answers

0
Tech Savant On

I did this for a client. I ended up having to scrape the page they let you view. I'm not sure where you find it but it exists. I did this about a year ago and like you I was like, it's impossible. But I had a client throwing massive amounts of money at me to figure it out, so I made it happen.

It took me hours to code the algorithm for scraping as it was so complicated to get exactly what I needed and also required calls to the API in between. I'm sure this was all some sort of violation of their TOS so let me disclaim this by saying, it is possible, but this is just for informational purposes only. You should not violate the TOS.

Hope this helps. :)