OverviewPlatformsAPI ReferenceResources
Commerce

Add or remove products in a collection

POSThttps://zernio.com/api/v1/commerce/collections/{collectionId}/products

Adds and/or removes hand-picked products. Products a collection includes through its own rules are not affected. pending is true when the platform finishes the change in the background; the product count then catches up a few seconds later.

PlatformsShopify

Authentication

AuthorizationBearer tokenRequired

API key authentication: send your Zernio API key in the Authorization header, prefixed with Bearer.

Path parameters

collectionIdstringRequired

Platform-native collection id.

Body

application/json

What every request needs

accountIdstringRequired
Optional parameters2 fields
addarray of strings
removearray of strings

Responses

Success· the request worked

Errors· the request failed

POST/v1/commerce/collections/{collectionId}/products
import Zernio from '@zernio/node';const zernio = new Zernio({ apiKey: process.env.ZERNIO_API_KEY });const { data } = await zernio.commerce.changeCommerceCollectionProducts({  path: {    collectionId: 'collection_abc123',  },  body: {    accountId: 'account_abc123',  },});console.log(data);
{  "collection": {    "id": "string",    "accountId": "string",    "platform": "shopify",    "title": "string",    "handle": "string",    "descriptionHtml": "string",    "image": {      "id": "string",      "url": "string",      "altText": "string"    },    "sortOrder": "manual",    "productCount": 0,    "seo": {      "title": "string",      "description": "string"    },    "updatedAt": "2019-08-24T14:15:22Z",    "platformData": {}  },  "pending": true}
OpenAPI specification
Was this page helpful?