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
| Type | Use case |
|---|---|
RELATED | General "you might also like" recommendations |
ACCESSORIES | Add-on items that complement the main product |
PARTS | Replacement or spare parts for the main product |
ALTERNATIVES | Similar products the buyer could choose instead |
OPTIONS | Configurable 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
- Display cross-sell and upsell products — query and render related products on a product detail page