eBay API call not working for UPC/EAN

匿名 (未验证) 提交于 2019-12-03 08:48:34

问题:

eBay's API findItemsByProduct operation would work on UPC and EAN. But unfortunately it is not working.

The below HTTP GET request for example, throws an "Invalid product ID value." [error 41] http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=MY-APP-ID-GOES-HERE&OPERATION-NAME=findItemsByProduct&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&productId.@type=EAN&productId=0016000275270&paginationInput.entriesPerPage=3

Note: Please replace the SECURITY-APPNAME's value with your eBay's free APP-ID. I've replaced it with MY-APP-ID-GOES-HERE for obvious reasons. eBay's API for the above function can be found here: http://developer.ebay.com/DevZone/finding/CallRef/findItemsByProduct.html#findItemsByProduct

The output is:

<findItemsByProductResponse xmlns="http://www.ebay.com/marketplace/search/v1/services"> <ack>Failure</ack> <errorMessage> <error> <errorId>41</errorId> <domain>Marketplace</domain> <severity>Error</severity> <category>Request</category> <message>Invalid product ID value.</message> <subdomain>Search</subdomain> <parameter>0016000275270</parameter> </error> </errorMessage> <version>1.12.0</version> <timestamp>2014-03-11T18:38:13.543Z</timestamp> </findItemsByProductResponse> 

Could somebody spot any mistake with above call? Thanks.

FWIW, 0016000275270 is a valid bar code http://www.upcdatabase.com/item/0016000275270

回答1:

From ebay documentation belowl link you are limited to few categories only!! http://developer.ebay.com/DevZone/finding/CallRef/findItemsByProduct.html#findItemsByProduct

ISBN The ISBN-10 or ISBN-13 value for books. If you know a book's ISBN, you can use this instead of the eBay Reference ID to search for that book.

UPC The UPC value for products in Music (e.g., CDs), DVD and Movie, and Video Game categories (or domains). If you know a product's UPC number, you can use this value instead of the eBay Reference ID to search for that product.

EAN The EAN value for books (most commonly used in European countries). If you know a book's EAN, you can use this instead of the eBay Reference ID to search for that book.

As an example, try this sample upc = 883929106646 (Its a upccode for a movie)

  1. http://www.ebay.com/sch/i.html?_nkw=883929106646 Here search ebay.com with valid UPC (Music category). Result : Positive

  2. http://www.upcdatabase.com/item/883929106646 UPC database has a positive hit

  3. http://svcs.ebay.com/services/search/FindingService/v1?SECURITY-APPNAME=MyAppID&OPERATION-NAME=findItemsByProduct&SERVICE-VERSION=1.0.0&RESPONSE-DATA-FORMAT=XML&REST-PAYLOAD&productId.@type=UPC&productId=883929106646&paginationInput.entriesPerPage=3

positive xml response [Don't forget to change MyAppID above]

Conclusion: Nothing wrong with your query. Just ebay doesnt have upc/ean from all categories. EBAY Limitation



回答2:

Looking at the eBay documentation, is seems that you can only use an UPC value for products in Music (e.g., CDs), DVDs & Movies, and Video Games categories. The error message makes sense as your UPC refers to a product, General Mills Honey Nut Cheerios Cereal, that won't be availabe in any of those categories. In addition there also appears to be a max length of 12 when specifing a UPC.



回答3:

It looks like that's not a UPC ebay knows, so the error message looks reasonable. If you do a general search on ebay with a UPC and it doesn't come back with a product-specific results page, it's likely not in ebay's system.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!