Retrieving specific Products by Product ID by using the Shopify API gem

TeejO
New Member
4 0 0

I have been looking at the Shopify API gem. I have been trying to retrieve only a specific products and haven't cracked it.

ShopifyAPI::Product.find(:all, params: { id: @Product_ids } )
ShopifyAPI::Product.find(:all, params: { ids: @Product_ids } )

Has anyone found a way to do this?

0 Likes
_JB
Shopify Staff
Shopify Staff
834 98 188

Hey @TeejO 

You should just have to pass in the id. This is working for me:

ShopifyAPI::Product.find(4359735181334)

 

JB | Developer Support @ Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit Shopify.dev or the Shopify Web Design and Development Blog

0 Likes
TeejO
New Member
4 0 0

The thing is I wanted multiple products and not a single product. I am thinking that we ca do it by creating a multiple product query in GraphQL.

0 Likes