Mapping amazon product category to the correct category XSD
Asked Answered
A

3

7

Within the _POST_PRODUCT_DATA_ feed the "ProductData" node contains data that is specific to the category that the item is within. How exactly though should the category the item is in be mapped to an XSD as there doesn't (always) seem to be a direct relationship. Calling "GetProductCategoriesForASIN" doesn't seem to help much either - what's with ProductCategoryName of "Categories"? (as below)

<?xml version="1.0"?>
<GetProductCategoriesForASINResponse xmlns="http://mws.amazonservices.com/schema/Products/2011-10-01">
<GetProductCategoriesForASINResult>
  <Self>
    <ProductCategoryId>166099011</ProductCategoryId>
    <ProductCategoryName>Building Sets</ProductCategoryName>
    <Parent>
      <ProductCategoryId>166092011</ProductCategoryId>
      <ProductCategoryName>Building Toys</ProductCategoryName>
      <Parent>
        <ProductCategoryId>165795011</ProductCategoryId>
        <ProductCategoryName>Categories</ProductCategoryName>
        <Parent>
          <ProductCategoryId>165793011</ProductCategoryId>
          <ProductCategoryName>Categories</ProductCategoryName>
        </Parent>
      </Parent>
    </Parent>
  </Self>
</GetProductCategoriesForASINResult>
<ResponseMetadata>
  <RequestId>0ce91472-4234-4222-8fd8-d56714db18ba</RequestId>
</ResponseMetadata>
</GetProductCategoriesForASINResponse>

In short what i'm really wanting to know is how, for a new product or one with an existing ASIN, to take the category ID or name and map this to the correct XSD so the correct set of category specific options can be returned.

Thanks.

Applaud answered 3/7, 2013 at 9:26 Comment(1)
I am also swimming in these waters. It's feels very odd programming against this feature, not sure how to go about it in a generic fashion. Have you found a decent way to handle this since? Thanks!Soldo
W
3

Warning This is a fragile workaround at best - you have been warned!

There is no direct mapping from the ProductCategoryId to the XSD. However, there is roughly a one-to-one mapping between BTG (Browse Tree Guide)* and the Product XSD files* (minus the BMVD¹ categories).

The BTG's Node ID column corresponds to the ProductCategoryId. Once you find out which BTG the Self category belongs to you could safely assume that the corresponding XSD file is the correct one.

For example, the Self > ProductCategoryId of 166099011 is found in the Toys and Games BTG which corresponds to the Toys and Games XSD

¹Books, Music, Videos, and DVDs
*Must be signed into your Seller Central account to access

Wipe answered 4/7, 2013 at 23:23 Comment(3)
I should have mentioned this kind of workaround - I was assuming seengee alredy knew this. You get the same result by trying to find an XSD that roughly matches the main category you're trying to list in. In this case "Toys & Games" (165795011) matches toys.xsd, and his product probably belongs into the ToysAndGames ProductType. But this is guesswork, and in many cases this match is far from obvious.Botanomancy
fragile or not, this is better than nothing. seems ridiculous to me that a workaround is even required!!Applaud
Hi how to find the product data and type of the particular category? can you please help me? #48620308Bonds
B
2

If I understand your question, you are asking if there is any way to tell what kind of <ProductData> you should put into your _POST_PRODUCT_DATA_ feed for a specific product.

E.g. for ASIN B008HRVM5U, should it be

<ProductData>
   <Home>
      <ProductType>
         <Kitchen>...</Kitchen>
      </ProductType>
   </Home>
</ProductData>

or rather

<ProductData>
   <Baby>
      <ProductType>
          <BabyProducts>...</BabyProducts>
      </ProductType>
   </Baby>
</ProductData>

To the best of my knowledge, there is no way to actually find out - neither through MWS nor Seller Central. At the same time, the correct matching of XML structures matters a lot... I've spent a total of three weeks trying to figure out why certain products were behaving funnily (you couldn't actually buy them). In the end, I had to contact Amazon support to find out I was using the 'wrong' XML structure for the specific category I was trying to list in.

Botanomancy answered 4/7, 2013 at 16:20 Comment(1)
yes, that's precisely what I was asking but not the answer I was looking for!Applaud
C
-1

Check out the GetMatchingProduct API in the Products API section. I haven't tested this thoroughly, but I believe that the ProductGroup and ProductTypeName fields correspond to the XSD categories.

Chippy answered 24/7, 2013 at 1:17 Comment(1)
Just so no one goes down this rabbit trail too far. This doesn't work.Grantland

© 2022 - 2024 — McMap. All rights reserved.