Ad

Shopify API Post One Product In Multiple Collections

- 1 answer

we're managing a marketplace in Shopify, and we're doing a lot of calls. We'd like to improve the number of calls and one of the keypoints is when we introduce the product in collections. One product can be inserted in multiple collections, and we do this for each post/collection:

public function pushCollection($shopifyProductId, $collectionId)
    {
        $collectData = [
            "product_id" => $shopifyProductId,
            "collection_id" => $collectionId
        ];
        $this->client->Collect()->post($collectData);

        return;
    }

The question is, is there any way to post 1 product in multiple collections with a single call?

Thank you so much

Ad

Answer

You cannot do that. But if you can accumulate products to add to collections you can add multiple products to a collection in a single call.

see https://help.shopify.com/api/reference/customcollection#update

Ad
source: stackoverflow.com
Ad