How do I get all the smart collections a product belongs to?

Shopify Partner
3 0 2

I need to get all the collections each product id belongs to. These collections are: smart and custom collections.


I was able to get the data needed by using GraphQL however, my client requires us to use the REST API.


In the documentation I found the following conflicting information:


Smart Collection documentation says: "The Collect resource is used to connect a product to a smart collection."


Collects documentation says: "Collects are for placing products in custom collections only. Smart collections use rules to determine which products are their members."


How can I get the smart AND custom collections a product belongs to without me needing to iterate through all collections (smart and custom) available?


Ideally I want to just have an association like the collects table has which associates custom collection id and product id.


Why the collects table does not keep an association between smart collection and product id?

Replies 2 (2)

Shopify Partner
2 0 1

Did you manage to solve this?

Shopify Partner
1 0 1

Same issue