Retrieve ISBN from eBay listing via Shopping API - ebay-api

I'm trying to use the eBay shopping API to try and retrieve the ISBNs from listings for books. I already have the eBay IDs for the listings which I'm interested in. Likely that most will have the ISBNs included in the Item Specifics for the listing (some won't, these can be disregarded).
One would therefore assume that retrieving the Item Specifics from the API would give the ISBN as a value, but it appears that the output gives pretty much everything apart from the ISBN. For example, the following API request gives lots of interesting detail about the listing, apart from the ISBN itself:
http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML&appid=MYAPPID&siteid=1&version=897&ItemID=EBAYID&IncludeSelector=ItemSpecifics
I haven't had much joy searching the API docs for a solution to getting this particular element from the listing - does anybody have a solution for this? Or if it simply isn't possible to get the ISBN via the API cleanly, is there an alternative method? (This is for very small scale personal use.)

ISBN, UPC, EAN and suchlike come under the productID field.
This field is returned by using the Details value of IncludeSelector. So the url you would want is:
http://open.api.ebay.com/shopping?callname=GetSingleItem&responseencoding=XML&appid=MYAPPID&siteid=1&version=897&ItemID=EBAYID&IncludeSelector=Details
http://developer.ebay.com/devzone/shopping/docs/CallRef/GetSingleItem.html#Response.Item.ProductID
EDIT:
To get the ISBN form a catalogue product you need to use the productID value to make a request to the Product API.
You need to call getProductDetails with the input:
<productDetailsRequest>
<productIdentifier>
<ePID>91515717</ePID>
</productIdentifier>
<datasetPropertyName>ISBN</datasetPropertyName>
</productDetailsRequest>
You can use ISBN10 or ISBN13 as the value of datasetPropertyName depending on which one you want.
http://svcs.ebay.com/services/marketplacecatalog/ProductService/v1?OPERATION-NAME=getProductDetails&SECURITY-APPNAME=APPID&SERVICE-VERSION=1.3.0&productDetailsRequest.productIdentifier.ePID=REFERENCE&productDetailsRequest.datasetPropertyName=ISBN
http://developer.ebay.com/DevZone/product/CallRef/getProductDetails.html

Related

Is there an API call to list all available product id's (ID's alone) in Shopify?

I use POSTMAN GUI for retrieving a list of items from Shopify API.
I would like to know if there exists a way to get available product id's alone, preferably as a list of values over a single api GET call. The one I know of is
/admin/api/2022-04/products.json
It returns a list of all product information, and looping over them/traversing the json is not very efficient. I hope there must be an easy way to fetch all ID's alone in one go. Should there be not?
You can add /admin/api/2022-04/products.json?fields=id to the end of your request to limit the output only for a single field or multiply.
Please note that if you have more than 250 products you will need to make more than one request, since the request is limited to 250 products.
You can make one call to the Admin API for all your product IDs using the Bulk Query. That will result in you receiving a URL where you download a file in JSONL format with every single product ID in your store, without the paging or limits of other approaches.

Retrieve customer related to payment

Anyone know if it's possible to retrieve the customer name related to a transaction from the API?
I see it under "Paid by" if I follow the "payment_url" in the connect v1 https://connect.squareup.com/v1/{{location_id}}/payments/{{payment_id}} endpoint but can't see to find it anywhere else
Background: I'm working on a ticketing system that breaks out items by item_category so a kitchen gets only food items and the bar gets only drink items.
I have queues and itemized tickets by category BUT I can't seem to find the customer's name anywhere
You'll need to utilize the V2 Transactions API. When you call ListTransactions or RetrieveTransaction (ListTransactions), the Transaction object will have an array of Tenders, tenders, which has a field called customer_id. With this id, you will be able to pass it to RetrieveCustomer (RetrieveCustomer) to find out their name. Note that if you're not explicitly filling out their name, the name might not be available (an "instant profile" (Instant Profiles) will be created with whatever information can be retrieve from the card used to pay).
Update: Alternatively, as suggested by #Dan, would be to strip the payment_url from a V1 RetrievePayment (RetrievePayment) which includes the transaction_id at the end of the URL: https://squareup.com/dashboard/sales/transactions/TRANSACTION_ID. This is more efficient as you won't need to loop through transactions, and allow you to send it straight to RetrieveTransaction.

Get seller items count by various criteria

I want to retrieve the total number of items of a seller, by various aspects like number of all items, number of active items, number of sold items, number of returned items, etc. I just need the count, not the complete item details. Couldn't find any good API for that.
GetMyeBaySelling does return the items by various aspects but it returns the complete item details. I can't find any option to 'exclude' item details from the results, so that only pagination is returned that gives the total count.
What other method in the eBay API can I use to achieve this purpose?
In order to get the number of items only you can add an OutputSelector to the GetMyeBaySelling call. For you purpose <OutputSelector>TotalNumberOfEntries</OutputSelector> would be sufficient. But you are able to add more OutputSelectors according to your needs. For most of the eBay Trading API calls the OutputSelector field is available.
I've created an example for the GetMyeBaySelling call in our API playground with the OutputSelectors "TotalNumberOfEntries" and "Summary". Feel free to modify the call and see the result directly in the response area. For example if you don't need the Summary just remove the field from the request.

Searching products using details.name and details.value using the Best Buy API

The Best Buy Search allows to search products specifying a criterion on details.name and details.value fields.
http://api.remix.bestbuy.com/v1/products(details.name="Processor Speed" & details.value="2.4Ghz")?apiKey=YOURKEY
However details is a collection. The query above actually returns all products has a detail entry named "processor" and a detail entry whose value is "2.4Ghz" but not necessarily in the same details entry. Is there a way to create a query that will return only products for which those value and name are for the same details entry ?
Unfortunately there is no way to do this unless the particular detail you are interested in has been exposed as a top level attribute (processor speed has not). To accomplish this you will need to run your query as you have described, and then comb through the results and remove the irrelevant products in your own code.

How to get /admin/products.json in a chronological order?

I need to be able to poll more than 250 products from the Shopify API. In order to do so, I need to retrieve the products from the API in a chronological order, with the oldest products first. Once I have the first 250 items, I retrieve another 250 items filtered by max_created_at.
I noticed that: GET /admin/products.json returns the products in a random order, but GET /admin/products.json?since_id=0 returns the products in a chronological order. Is this the intended behaviour? Or is there a flag that I can send with GET /admin/products.json to specify the sorting order?
Edit: I guess my question boils down to this: Is there a field that I can set that the results returned by the Shopify API will be ordered by?
Maybe the API has been updated since the last post but now you can do that like that :
https://yourshop.myshopift.com/admin/products.json?limit=50&fields=id,images,title&order=created_at+desc
Just add the query string parameter order=created_at+asc
This is an undocumented feature but it seems to work for most fields.
This is unintended behaviour, reliable sort orders for Product are limited to title and total, and then filtering options are as listed in the API docs.