younifyd
Menu

Add or update items in a collection

Add or update items in a collection

PUT/v1/collections/{collection_id}/items

Use it in a workflow

  1. Add a step and choose the Constructor connector.
  2. Pick the Add or update items in a collection action (under Collections).
  3. Fill in the fields below, then reference the result from later steps as {{addOrUpdateItemsInACollection.response.data}}.

Request

Path parameters

collection_idstringrequired

Query parameters

sectionstring

The section of the index to use. Defaults to `Products`.

cstring

The ID of the client and version that the request is coming from, such as `cio-js-2.90`.

on_missingany

The strategy for handling items or variations that do not exist in the catalog. `FAIL` (default) returns an error if any items or variations are missing. `IGNORE` silently skips missing items and missing variations from the request. `CREATE` adds items to the collection even if they or their variations don't exist in the catalog yet (allows future item/variation IDs).

Default "FAIL"

Request body

Enter the body as JSON in the step's Body field.

itemsarray<object>required

A list of item IDs to add to the collection.

idstringrequired

The ID of the item, must be unique.

sourcestring

Arbitrary identifier of the source of the item manually added to the collection.

variation_idsarray<string>

List of variation IDs to include in this collection for the item. If not provided, all variations of the item are included.

json
{
  "items": [
    {
      "id": "string",
      "source": "string",
      "variation_ids": [
        "string"
      ]
    }
  ]
}

Response

Returns 200 with an object. Read it in later steps with {{addOrUpdateItemsInACollection.response.data.<field>}}.

itemsarray<object>
idstringrequired

The ID of the item, added to the collection.

sourcestring

Arbitrary identifier of the source of the item manually added to the collection.

variation_idsarray<string>

List of variation IDs to include in this collection for the item. If not provided, all variations of the item are included.

created_atstring (date-time)

Collection Item creation date in ISO 8601 format. Present only for manually added items.

updated_atstring (date-time)

Collection Item update date in ISO 8601 format. Present only for manually added items.

typeany

Describes the method of addition for the item - `manual` if it was manually added to the collection, dynamic if it matches collection's filter expression.

Default "manual"

json
{
  "items": [
    {
      "id": "string",
      "source": "string",
      "variation_ids": [
        "string"
      ],
      "created_at": "2025-01-01T00:00:00Z",
      "updated_at": "2025-01-01T00:00:00Z",
      "type": "manual"
    }
  ]
}

Need more? See the Constructor guide for connection setup and behaviour shared by every action.