Get a set of recommendations.
curl "https://api.cquotient.com/v3/personalization/recs/{siteId}/{recommenderName}" \
-X POST \
-H "x-cq-client-id: " \
-H "content-type: application/json" \
-d '{
"products": [
{
"id": "",
"sku": "",
"altId": "",
"altIdType": ""
}
],
"categories": [
{
"id": ""
}
],
"rules": [
{
"type": "show",
"field": "current_price",
"operator": "greaterThan",
"values": [
19.99
]
}
],
"userId": "",
"cookieId": "",
"clientIp": "",
"clientUserAgent": "",
"realm": ""
}'
The Einstein Site ID. Locate this ID in the upper-right corner of the Einstein Configurator. The ID has the format xxxx-<Commerce Cloud Site ID>
.
Name of the recommender to use for recommendations. This item should exist in a response to GET /recommenders for the same site id.
Make sure to pass the x-cq-client-id
header with your Commerce Cloud Account Manager API Client ID.
Locate this value in Business Manager, under Administration > Site Development > Open Commerce API Settings.
This settings page displays a JSON object containing the current OCAPI configuration.
You can use any of the values in a client_id
field, but ideally you should create one specifically for Einstein API calls.
{
"products": [
{
"id": "",
"sku": "",
"altId": "",
"altIdType": ""
}
],
"categories": [
{
"id": ""
}
],
"rules": [
{
"type": "show",
"field": "current_price",
"operator": "greaterThan",
"values": [
19.99
]
}
],
"userId": "",
"cookieId": "",
"clientIp": "",
"clientUserAgent": "",
"realm": ""
}
The products to use as context for generating recommendations. Any given request must have only one of categories or products.
The product categories to use as context for generating recommendations. Any given request must have only one of categories or products.
Extra rules to add filtering on the set of recommendations
Application-provided unique identifier for logged in users (hashed).
The unique identifier of an anonymous shopper.
If you're making API requests from a traditional Commerce Cloud storefront, pass the dwanonymous_*
cookie value
(See Browser-Based Local Data Storage for more information).
The IP address of the end user. Use this parameter if you're sending activities server-side for a client application.
The User Agent of the end user. Use this paramenter if you're sending activities server-side for a client application.
A unique four-character ID that you can get from your Account Executive (AE) or Customer Success Manager (CSM). The realm is often the first four characters of the Einstein Site ID. However, if your site changes realms in Commerce Cloud, the Einstein Site ID won’t use the correct realm.