How to use operators in REST API?

Highlighted
Shopify Partner
13 1 0

Hey,

I have a  question regarding the REST API. So, right now there's an API to get products by their collection:

/admin/api/2020-04/collections/12345/products.json

What we get here are all the products with collection_id:12345.

 

Is that possible to get all the product that excludes the product with collection_id:12345?

 

Thank You

0 Likes
Highlighted
Shopify Expert
9872 100 1710

No. For what you want there's not an exclusion operator.

★ Winning Partner of the Build a Business competition. ★ http://freakdesign.com.au
0 Likes
Highlighted
Shopify Partner
13 1 0

Thank you @Jason  for your reply.

 

So, is there a way to do this either via Rest or GraphQL? or should we just loop through all the product and exclude the specific collection_id.

0 Likes
Highlighted
Shopify Partner
38 7 12
@aldoalprak wrote:

Hey,

I have a  question regarding the REST API. So, right now there's an API to get products by their collection:

/admin/api/2020-04/collections/12345/products.json

What we get here are all the products with collection_id:12345.

 

Is that possible to get all the product that excludes the product with collection_id:12345?

 

Thank You



What's the condition/rule of that collection?

0 Likes