Ad

Add Multiple Products To Collection With One API Call

- 1 answer

was wondering if the Shopify API allows for multiple products to be added to a custom collection in one single call? I've already managed to have one product only per call added to a custom collection via PHP. However I can't get multiple products added at once.

Below is a sample of the call I'm making to "/admin/collects.json"

$producs_array = array(
        "collect"=>array(
            "product_id"=>123456789,
            "product_id"=>123456789,
            "product_id"=>123456789,
        "collection_id"=> "123456789")
    );

Anyone managed to do this before?

Ad

Answer

You can PUT to an existing collection. See https://help.shopify.com/api/reference/customcollection#update

Ad
source: stackoverflow.com
Ad