Retrieve collection id inside product API

Filippinifra
New Member
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?

0 Likes
L_J_K
Shopify Staff
Shopify Staff
137 15 23

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!

 

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