Retrieve collection id inside product API

Filippinifra
Visitor
1 0 0

I'm using this API:

 

const product = await client.product.fetch(productId);

 

I saw that in the response object there is no way to get the collection (or collections) id.

Is there an alternative way to fetch it when I'm fetching a product?

Reply 1 (1)

Luke_K
Shopify Staff
402 66 98

Hey @Filippinifra 

You could try fetching it the other way around by trying to fetch the Collection ID's holding Products this way - hope that helps!

 

| Shopify |
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution!