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
- Categories and the attribute descriptions your variants use
- Clusters with their products
- 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:
sourceandsourceIdidentify the cluster in your system. See Sources.codeis an optional cluster code of up to 30 characters. You can also look the cluster up by its code, see Lookup Keys.namesholds the name of the cluster per language.parentis the category the cluster appears in, referenced bysourceandsourceIdor byid. A cluster created without a parent is not placed in any category, so send one for every cluster.clusterConfigIdis the ID of the cluster configuration. A new cluster needs it: without it the cluster is not created and its result readsclusterConfigId must be an integer number. On updates you can leave it out.productscreates the products of the cluster inside the cluster. Nested products take the same fields as the product import, such assku,names,statusandattributes. They use the lookup key of the URL, so each needs its ownsourceandsourceId.
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
}
keyis thesourceIdyou sent andidis the Propeller ID of the cluster.actioniscreateorupdate,skipwhen nothing changed anderrorwhen the cluster failed.successandstatusCodereport the outcome per cluster. The call also answers200when some clusters fail. The top-levelerrorsdoes not list them, so checksuccesson 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. productsResultholds 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 isNo changes detected - cluster unchanged. - A cluster or product that changed comes back as
update. - A product you leave out of
productsstays in the cluster. To take a product out, usePOST /v2/clusters/{lookupKey}/{key}/products/unassignwith its ID inproductIdsand the category or cluster to move it to incategoryIdorclusterId.
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 answers400. - A product ID that does not exist comes back with
action: error. The other products are still assigned. A cluster that does not exist answers404. - 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"
}
]
}
]
}
]
}
isRequiredtakestrueorfalseand reads back asYorN.- A repeat with the same option
sourceandsourceIdleaves the option in place (skip) instead of adding a second one. - A call that sends
optionsbut noproductsleaves 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}
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
- Understanding products and categories for how clusters, cluster configurations, default products and Cluster Options fit together
- Import Products for product fields, attributes and prices
- Import Categories for the category tree your clusters go into
- Sources, Lookup Keys and Directives for source IDs, cluster codes and update behavior
- REST API Reference for the full endpoint specification