Amazon Web Service with UPC Element Finder

My Working Envirnment is Visual Studio 2008 + C #

I am working on Amazon WebService, I want to get data from Amazon using SOAP, but when I try to pass IDType = UPC, it gives me an error message below, so what can I do for this?

Error:

036725229884 invalid value for ItemId. Change this value and retry the request

MyCode:

ItemLookupRequest request1 = new ItemLookupRequest(); request1.IdType = ItemLookupRequestIdType.UPC; request1.IdTypeSpecified = true; request1.ItemId = new string[] { ProductID }; request1.ResponseGroup = new string[] { "Request", "Large", "OfferFull", "BrowseNodes" }; request1.MerchantId = "All"; request1.Condition = Condition.All; request1.SearchIndex = "Books"; 

Note: How to add multiple SearchIndex ("Books", "Photos", "Videos")?

I used the following WebService: http://webservices.amazon.com/AWSECommerceService/2009-11-01/US/AWSECommerceService.wsdl

+4
source share
2 answers

Also get tired of the difference between UPC and EAN.

UPC = 12 digits, EAN = 13 digits

If you just click on UPC 738678251584 (12 digits) or EAN 3253581057803 (13 digits) on Amazon.com, it will show as UPC in the description, but using the API, you must specify EAN when the search is.

We have products with both, and you need to specify the type of search accordingly or it will not be found.

Edit : OR you can simply add 0 to any 12-digit numbers and always look for EAN. This is probably the best solution. By definition, "0" + UPC = EAN

This request worked for me (searchType is a UPC or EAN):

  ItemLookup itemLookup = new ItemLookup() { AssociateTag = "XXXXX-20", }; itemLookup.AWSAccessKeyId = ACCESS_ID; ItemLookupRequest itemLookupRequest = new ItemLookupRequest(); itemLookupRequest.IdTypeSpecified = true; itemLookupRequest.IdType = searchType; itemLookupRequest.SearchIndex = "All"; itemLookupRequest.ItemId = upcEanList; itemLookupRequest.ResponseGroup = new[] { "OfferSummary", "ItemAttributes" }; itemLookup.Request = new ItemLookupRequest[] { itemLookupRequest }; 
+2
source

I don’t think Amazon supports queries on multiple search indexes. However, there is a special index called All , which you can use with UPC lookups. There are some restrictions on the parameters used with this index, but since you specify All for MerchantId and Condition , this may work. If not, you can make a request without these parameters, and then issue a new request if you have ASINs for UPC that interest you.

0
source

Source: https://habr.com/ru/post/1303207/


All Articles