Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

eBay API call not working for UPC/EAN

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

like image 899
toddlermenot Avatar asked Mar 11 '14 18:03

toddlermenot


People also ask

How do I find my eBay ePID API?

If you do not know the ePID value for a product, use FindProducts in the eBay Shopping API to retrieve the desired ePID. See FindProducts in the Shopping API for information on retrieving eBay product data. Input ISBN, UPC, EAN, or ReferenceID (ePID) to specify the type of product for which you want to search.

Is there an API for eBay?

eBay offers developers a wide range of RESTful and Traditional APIs. For new development, eBay strongly encourages the use of our RESTful APIs.


2 Answers

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

like image 193
Faiz Mohamed Haneef Avatar answered Sep 28 '22 07:09

Faiz Mohamed Haneef


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.

like image 22
David T. Sadler Avatar answered Sep 28 '22 08:09

David T. Sadler