Skip to main content

Create cross-sell and upsell relations

Link two products or clusters as related, accessories, parts, alternatives or options.

Mutation

mutation CreateCrossupsell($input: CrossupsellCreateInput!) {
crossupsellCreate(input: $input) {
id
type
subType
productFrom {
... on Product {
productId
names(language: "NL") { value }
}
}
productTo {
... on Product {
productId
names(language: "NL") { value }
}
}
createdAt
}
}

Variables

{
"input": {
"type": "ACCESSORIES",
"productIdFrom": 25,
"productIdTo": 31
}
}

Response

{
"data": {
"crossupsellCreate": {
"id": "a1b2c3d4e5f6",
"type": "ACCESSORIES",
"subType": null,
"productFrom": {
"productId": 25,
"names": [{ "value": "Industriële Kachel HT-1001" }]
},
"productTo": {
"productId": 31,
"names": [{ "value": "Hitteschild Links HT-101" }]
},
"createdAt": "2026-03-05T10:00:00.000Z"
}
}
}

Linking clusters

To link clusters instead of individual products, use clusterIdFrom and clusterIdTo:

{
"input": {
"type": "RELATED",
"clusterIdFrom": 100,
"clusterIdTo": 200
}
}

You can also mix products and clusters (e.g. productIdFrom with clusterIdTo).

Available relation types

TypeUse case
RELATEDGeneral "you might also like" recommendations
ACCESSORIESAdd-on items that complement the main product
PARTSReplacement or spare parts for the main product
ALTERNATIVESSimilar products the buyer could choose instead
OPTIONSConfigurable options or upgrades

Use the optional subType string field to further classify relations within a type (e.g. "subType": "mounting-kit").

How it works

The relation is directional: productIdFrom is the source product and productIdTo is the target. To create a bidirectional relation, create two crossupsell records with the IDs swapped. On the storefront side, use crossupsellsFrom on the product query to fetch outgoing relations.

See also