Shopify: Remove product from collection via API call

obs

I'm trying to use the Shopify API to remove products from a collection.

In the docs (https://docs.shopify.com/api/collect) overview it says:

DELETE /admin/collects/#{id}.json
Remove a Collect from the database

While when you jump to the description it says:

Remove a product from a collection
Destroy the link between a product an a collection
DELETE /admin/collects/#{id}.json

So can I use this to remove a product form a collection or remove a collection from the DB?

And if it's possible to remove a product from a collection - what I want to do - shall I pass the collection ID or the product ID - actually I think I have to pass both, or how shall it work otherwise?

Thanks for your help!

bknights

Collect is the join table for a many-to-many relationship between a product and a collection. It has its own id. To remove the product from a collection you are just removing the join so you only have to use the collect id not the product id or the collection id.

If you have the product id and the collection id you can get the collect id via:

GET /admin/collects.json?product_id=1925263361&collectionid=29722105

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Create unpublished product in Shopify via API

Shopify API: Retrieve multiple records via id in a single call

How to get all product id from Shopify Python API

Shopify Product API (custom fields)

How to retrieve all products from a Smart Collection through Shopify API?

On Shopify, check if a given product is not on any collection

Shopify Interact with product page HTML via app

Creating a Shopify Order via postman / Shopify API

Getting a product collection via Cron

Shopify import reviews via API?

Shopify Order API call Interval

Remove a collection from a collection

Using Shopify API to create product in PHP

Shopify REST API cannot delete product images

How to call api from localhost via https

Call to an external API via HTTPS from LotusScript

How to delete product from inventory on Amazon via mws api

Displaying the current collection on a product info page (shopify liquid)

Shopify, displaying price of first in stock product variant on Collection page

How to determine if a product is part of a hidden collection in Shopify liquid templates?

How to add "you added this" bellow the product in the collection SHOPIFY

Shopify - Add Number (1,2,3) before Product in Collection

How to remove a PayPal product from v1/catalogs API?

In Shopify add a product via SKU rather than Variant ID

How to call option.value in the loop of product.variants in Shopify?

Call Shopify api in laravel with Particular shopify store data?

Magento call a .phtml file in template with product collection

How do I generate a json object and send via PUT request from Rails app to Shopify API?

Silent authenticate customer via Shopify API