Skip to main content

Import clusters

A cluster groups products that are variants of the same item, such as one LED panel in several sizes and color temperatures. If your ERP or PIM knows which products belong together, import that grouping as clusters. The bulk cluster endpoint creates or updates clusters by source ID, together with their products, in one call. For how clusters, their configuration, their default product and Cluster Options fit together, see Clusters.

Before you start​

Make sure you have:

  • A cluster configuration. It defines which attributes tell the variants of a cluster apart. In the Backoffice it is called a Cluster Definition. You send its ID as clusterConfigId.
  • A parent category. The cluster appears in this category. Import your categories first, see Import Categories.
  • The products. Create them in the same call as nested products or add products that already exist afterwards.

Find the cluster configuration​

List the cluster configurations of your tenant:

GET /v2/clustersconfig?expands=settings

Each configuration in the response has a numeric ID and a name. With expands=settings, every setting of a configuration shows the attribute it uses in attributeName. Pick the configuration whose attributes match the way your variants differ and send its ID as clusterConfigId. Your products need values for those attributes, see Attributes.

Import order​

  1. Categories and the attribute descriptions your variants use
  2. Clusters with their products
  3. Prices and cost prices of the products, see Import prices

Prices belong to the products, not to the cluster.

Create or update clusters in bulk​

POST /v2/clusters/bulk/sourceId
{
"clusters": [
{
"source": "MY_ERP",
"sourceId": "LEDP-BACKLIT",
"code": "LEDP-BACKLIT",
"names": [
{ "language": "NL", "value": "LED paneel Backlit" },
{ "language": "EN", "value": "LED panel Backlit" }
],
"parent": { "source": "MY_ERP", "sourceId": "LIGHTING-PANELS" },
"clusterConfigId": 12,
"products": [
{
"source": "MY_ERP",
"sourceId": "LEDP-BL-6060-3000",
"sku": "LEDP-BL-6060-3000",
"names": [
{ "language": "NL", "value": "LED paneel Backlit 60x60 3000K" },
{ "language": "EN", "value": "LED panel Backlit 60x60 3000K" }
],
"status": "A"
},
{
"source": "MY_ERP",
"sourceId": "LEDP-BL-6060-4000",
"sku": "LEDP-BL-6060-4000",
"names": [
{ "language": "NL", "value": "LED paneel Backlit 60x60 4000K" },
{ "language": "EN", "value": "LED panel Backlit 60x60 4000K" }
],
"status": "A"
}
]
}
]
}

The request includes:

  • source and sourceId identify the cluster in your system. See Sources.
  • code is an optional cluster code of up to 30 characters. You can also look the cluster up by its code, see Lookup Keys.
  • names holds the name of the cluster per language.
  • parent is the category the cluster appears in, referenced by source and sourceId or by id. A cluster created without a parent is not placed in any category, so send one for every cluster.
  • clusterConfigId is the ID of the cluster configuration. A new cluster needs it: without it the cluster is not created and its result reads clusterConfigId must be an integer number. On updates you can leave it out.
  • products creates the products of the cluster inside the cluster. Nested products take the same fields as the product import, such as sku, names, status and attributes. They use the lookup key of the URL, so each needs its own source and sourceId.

The endpoint also accepts directives, such as skipIfNotEmpty to protect fields you enrich in Propeller. See Directives.

Read the response​

The call answers 200 with one result per cluster in data:

{
"data": [
{
"message": "Cluster created successfully",
"action": "create",
"lookupKey": "sourceId",
"key": "LEDP-BACKLIT",
"uuid": "01a1f3c2-5b7e-7c41-9d2a-3e8f6b1c0a42",
"id": 1042,
"sku": "LEDP-BACKLIT",
"code": "LEDP-BACKLIT",
"statusCode": 201,
"success": true,
"productsResult": {
"processed": 2,
"successful": 2,
"failed": 0,
"details": [
{
"action": "create",
"lookupKey": "sourceId",
"key": "LEDP-BL-6060-3000",
"id": 20511,
"productId": 20511,
"success": true,
"statusCode": 201
},
{
"action": "create",
"lookupKey": "sourceId",
"key": "LEDP-BL-6060-4000",
"id": 20512,
"productId": 20512,
"success": true,
"statusCode": 201
}
]
}
}
],
"errors": null
}
  • key is the sourceId you sent and id is the Propeller ID of the cluster.
  • action is create or update, skip when nothing changed and error when the cluster failed.
  • success and statusCode report the outcome per cluster. The call also answers 200 when some clusters fail. The top-level errors does not list them, so check success on every result.
  • The results do not always come back in the order of your request: a cluster that failed can come first. Match each result to your record on key.
  • productsResult holds a result per nested product.

A cluster that fails has success: false and the reason in message, for example when its parent category does not exist:

{
"message": "Parent category with source 'MY_ERP' and sourceId 'LIGHTING-PANELS' not found.",
"action": "error",
"lookupKey": "sourceId",
"key": "LEDP-BACKLIT",
"sku": null,
"code": null,
"statusCode": 400,
"success": false
}

Send the same clusters again​

Send updates with the same call. Propeller matches clusters and nested products on their own source and sourceId:

  • A cluster or product that did not change comes back as skip. For a cluster the message is No changes detected - cluster unchanged.
  • A cluster or product that changed comes back as update.
  • A product you leave out of products stays in the cluster. To take a product out, use POST /v2/clusters/{lookupKey}/{key}/products/unassign with its ID in productIds and the category or cluster to move it to in categoryId or clusterId.

This means you can send your full set of clusters on every run.

Find cluster IDs by source ID​

The bulk response returns the ID of each cluster. To look up IDs later, for example in a separate run that adds products, resolve your source IDs (see also Find Propeller IDs for many source IDs):

POST /v2/clusters/search/id
{
"sources": [
{ "source": "MY_ERP", "sourceId": "LEDP-BACKLIT" },
{ "source": "MY_ERP", "sourceId": "LEDP-EDGELIT" }
]
}
{
"total": 2,
"data": [
{
"source": "MY_ERP",
"sourceId": "LEDP-BACKLIT",
"id": 1042,
"clusterId": 1042,
"success": true
},
{
"source": "MY_ERP",
"sourceId": "LEDP-EDGELIT",
"success": false,
"error": "Cluster not found"
}
],
"messages": ["Source resolution completed successfully"]
}

A source ID that matches no cluster comes back with success: false. One call resolves up to 1,000 source IDs. POST /v2/products/search/id takes the same body and returns the IDs of products, which you need in the next step.

Add existing products to a cluster​

If the products already exist in Propeller, for example because your ERP imports the products and your PIM knows how they are grouped, assign them to the cluster by their Propeller IDs:

POST /v2/clusters/sourceId/LEDP-BACKLIT/products/assign?source=MY_ERP
{
"productIds": [20498, 20499]
}

The response has a result per product. In this example the second product ID does not exist:

{
"data": [
{
"action": "move",
"lookupKey": "id",
"key": 20498,
"success": true,
"message": "Product assigned to cluster"
},
{
"action": "error",
"lookupKey": "id",
"key": 20499,
"success": false,
"error": "Product with ID 20499 not found"
}
],
"messages": ["Completed"]
}
  • Address the cluster in the URL with any of its lookup keys. With sourceId, add ?source=: without it the call answers 400.
  • A product ID that does not exist comes back with action: error. The other products are still assigned. A cluster that does not exist answers 404.
  • Assigning a product that is already in the cluster changes nothing, so you can repeat the call.
  • A product is a variant of one cluster at a time. Assigning a product that belongs to another cluster moves it out of that cluster.
  • When the cluster has no products yet, the first product it gets becomes its default product. When the default product leaves the cluster, another product of the cluster becomes the default. A cluster without products has no default product.

Set the default product​

The default product is the variant a storefront shows before a customer picks one, for example on listing pages. Set it with a PATCH on the cluster and choose one of the products of the cluster:

PATCH /v2/clusters/sourceId/LEDP-BACKLIT?source=MY_ERP
{
"defaultProductId": 20512
}

The call answers with the updated cluster:

{
"data": {
"uuid": "01a1f3c2-5b7e-7c41-9d2a-3e8f6b1c0a42",
"id": 1042,
"clusterId": 1042,
"type": "cluster",
"code": "LEDP-BACKLIT",
"sku": "LEDP-BACKLIT",
"clusterConfigId": 12,
"names": [
{ "language": "NL", "value": "LED paneel Backlit" },
{ "language": "EN", "value": "LED panel Backlit" }
],
"sources": [{ "source": "MY_ERP", "sourceId": "LEDP-BACKLIT" }],
"hidden": "N",
"exclusive": "N",
"defaultProductId": 20512
}
}

A defaultProductId that does not exist answers 404 and leaves the default product as it was:

{
"error": {
"status": 404,
"messages": ["Product with ID 20599 not found"],
"code": 80006,
"type": "ProductNotFound"
}
}

Import cluster options​

Cluster Options are add-on product groups on a cluster, such as mounting frames for an LED panel. Send them in options on the same bulk call. Each option has its own source and sourceId, its names, isRequired and the products a customer can choose from:

POST /v2/clusters/bulk/sourceId
{
"clusters": [
{
"source": "MY_ERP",
"sourceId": "LEDP-BACKLIT",
"names": [
{ "language": "NL", "value": "LED paneel Backlit" },
{ "language": "EN", "value": "LED panel Backlit" }
],
"parent": { "source": "MY_ERP", "sourceId": "LIGHTING-PANELS" },
"clusterConfigId": 12,
"options": [
{
"source": "MY_ERP",
"sourceId": "LEDP-BL-FRAME",
"names": [
{ "language": "NL", "value": "Opbouwframe" },
{ "language": "EN", "value": "Surface mounting frame" }
],
"isRequired": false,
"products": [
{
"source": "MY_ERP",
"sourceId": "FRAME-6060-WHITE",
"sku": "FRAME-6060-WHITE",
"names": [
{ "language": "NL", "value": "Opbouwframe 60x60 wit" },
{ "language": "EN", "value": "Surface mounting frame 60x60 white" }
],
"status": "A"
}
]
}
]
}
]
}
  • isRequired takes true or false and reads back as Y or N.
  • A repeat with the same option source and sourceId leaves the option in place (skip) instead of adding a second one.
  • A call that sends options but no products leaves the products of the cluster as they are.

Read the options of a cluster back with:

GET /v2/clusters/id/1042/options
{
"data": [
{
"uuid": "01a1f3c4-0d2e-7b9a-8c11-5f4e3a2b1c90",
"id": 88,
"clusterOptionId": 88,
"clusterUuid": "01a1f3c2-5b7e-7c41-9d2a-3e8f6b1c0a42",
"isRequired": "N",
"hidden": "N",
"defaultProductId": 20520,
"names": [
{ "language": "NL", "value": "Opbouwframe" },
{ "language": "EN", "value": "Surface mounting frame" }
],
"productIds": [20520],
"sources": [{ "source": "MY_ERP", "sourceId": "LEDP-BL-FRAME" }]
}
],
"errors": null,
"items": 1
}

Delete a cluster​

DELETE /v2/clusters/{lookupKey}/{key}
warning

Deleting a cluster also deletes the products in it, including products you assigned to the cluster from a category.

To keep products, take them out of the cluster first. Send their IDs in productIds to POST /v2/clusters/{lookupKey}/{key}/products/unassign, with the category to place them in as categoryId, and then delete the cluster:

{
"productIds": [20498],
"categoryId": 651
}

The unassigned products stay in that category, and only the products still in the cluster are deleted with it.

Batch size​

One bulk request takes up to 1,000 clusters, each with its products and options.

See also​