Focusing on managing products, variants, and collections through the API.
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."
https://shopify.dev/docs/api/admin-rest/2023-04/resources/collect
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?
Did you manage to solve this?
Same issue