Re: Unable to call `Remove product from collect/collection` Api

Unable to call `Remove product from collect/collection` Api

Johnp_3i
Shopify Partner
2 0 2

Hello everyone, I am currently having trouble calling the Remove product from collect/collection. I noticed that there is a missing property product id.

 

Johnp_3i_0-1698242323916.png

Is there a way to call the API differently ?

 

Thanks in advance.

Replies 2 (2)

Kalen_Jordan
Shopify Partner
669 26 109

The collect is actually the relationship specifically between the product and the custom collection. So by the time you have a collect_id, you already have within that the specific product_id in question.

 

What you probably need to do is get the collect_id by querying the list of collects for the given product_id and collection_id:
https://shopify.dev/docs/api/admin-rest/2023-04/resources/collect#get-collects

 

Screenshot 2023-10-31 at 3.56.23 PM.png

Johnp_3i
Shopify Partner
2 0 2

Thanks.