Menu
Recommendations
Execute a recommendations query
POST
/rest/organizations/{organizationId}/commerce/v2/recommendationsUse it in a workflow
- Add a step and choose the Coveo connector.
- Pick the Recommendations action (under Commerce).
- Fill in the fields below, then reference the result from later steps as
{{recommendations.response.data}}.
Request
Path parameters
Request body
Enter the body as JSON in the step's Body field.
{
"context": {
"view": {
"url": "https://acme.com/summersale",
"referrer": "https://example.com/"
},
"capture": true,
"cart": [
{
"productId": "shoe-a1-red",
"quantity": 2
}
],
"custom": {
"fitmentProducts": [
"sku_123",
"sku_456"
]
},
"labels": {
"brand": "ACME",
"category": "garden > garden-tools > chainsaws"
},
"product": {
"productId": "shoe-a1-red"
},
"purchased": [
{
"productId": "shoe-a1-red",
"quantity": 2
}
],
"source": [
"@coveo/headless@2.61.0",
"custom.library.js@2.0.0"
],
"user": {
"userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36"
}
},
"country": "US",
"currency": "USD",
"language": "en",
"slotId": "77f997a1-5143-490e-aeff-f219c7718c5f",
"trackingId": "acmecorporation_ca",
"clientId": "58bb4b98-1daa-4767-8c15-90a0ea67645c",
"debug": true,
"page": 7,
"perPage": 30
}
Response
Returns 200 with an object. Read it in later steps with {{recommendations.response.data.<field>}}.
{
"headline": "Recommended for you",
"pagination": {
"page": 1,
"perPage": 10,
"totalEntries": 100,
"totalPages": 10
},
"products": [
null
],
"responseId": "123e4567-e89b-12d3-a456-426614174000",
"triggers": [
{
"content": "https://www.example.com",
"type": "redirect"
}
]
}
Need more? See the Coveo guide for connection setup and behaviour shared by every action.
Was this page helpful?