Customer recommendations

Retrieve recommendations for a specific customer. This is a definition of the Customer attributes method used to retrieve customer recommendations.

Authorization

Available access typePermissions needed
Public accessNone
Private accessDefinitions > Get

Attributes object definition for Customer recommendations

Each recommendation attribute object in the Customer attributes method must have type, id, and fillWithRandom properties specified. In addition to those, there are other optional properties that can be specified.

ParameterTypeDescriptionRequired
typestring"recommendation"Required
idstringThe ID of the recommendation you want to retrieve.Required
fillWithRandombooleantrue = Fills the recommendations with random items until the size is reached. This is utilized when models cannot recommend enough items.Required
sizeint32Specifies the upper limit for the number of recommendations to return. Defaults to 10.No
itemsArrayitems - If present, the recommendations are related not only to a customer but to products with IDs specified in this array. Item IDs from the catalog used to train the recommendation model need to be used. Input product IDs in a dictionary as {[product_id]: [weight]}, where the value weight determines the preference strength for the given product (bigger number = higher preference).
For example:
json {"123": 1, "234": 2, "345": 4}
No
catalogAttributesWhitelistArrayReturns only a specified subset of attributes from catalog items. If empty or not set, returns everything.

For example:
json ["item_id", "title", "link", "image_link"]
No
catalogFilter?Adds additional constraints to the catalog when retrieving recommended items
Only properties set as searchable/indexed in the catalog can be used in the filter.
No
categoryNamesArrayCategory or categories in an array from the catalog for which the desired metric is calculated.
For example:
['shoes', 'high heels'] or ['shoes'] in case of a single category.
Used and required only with Metric based category model

Data types and operands

Data type or operandAvailable values
Commonis set, is not set, has value, has no value
Stringsequals, does not equal, in, not in, contains, does not contain
Numbersequal to, in between, less than, greater than
Booleanss true, is false
Datesmore than, less than, matches range, matches current day, matches current month, matches current year, month matches, day matches, second matches, minute matches, hour matches, year matches, weekday matches
Listsany items, all items

Payload example

{
	"customer_ids": {
		"registered": "00020296-5ead-46e1-a249-f2471ecf5a83"
	},
	 "attributes": [ 
	 	{
			"type": "recommendation",
			"id": "60d1b3714d56b91380cbef1a",
			"fillWithRandom": false,
			"size": 10
		}
	]
}
{
    "results": [
        {
            "success": true,
            "value": [
                {
                    "engine_name": "custom_1624355680",
                    "field_date": 1695765600.0,
                    "field_number": 1122,
                    "field_text": "Lorem impsum",
                    "item_id": "1000",
                    "product_id": "1000",
                    "recommendation_id": "60d1b3714d56b91380cbef1a",
                    "recommendation_source": "model_non_personalized",
                    "recommendation_variant_id": null
                },
                {
                    "engine_name": "custom_1624355680",
                    "field_date": 1695938400.0,
                    "field_number": 1124,
                    "field_text": "Lorem impsum",
                    "item_id": "1002",
                    "product_id": "1002",
                    "recommendation_id": "60d1b3714d56b91380cbef1a",
                    "recommendation_source": "model_non_personalized",
                    "recommendation_variant_id": null
                },
                {
                    "engine_name": "custom_1624355680",
                    "field_date": 1696456800.0,
                    "field_number": 1130,
                    "field_text": "Lorem impsum",
                    "item_id": "1008",
                    "product_id": "1008",
                    "recommendation_id": "60d1b3714d56b91380cbef1a",
                    "recommendation_source": "model_non_personalized",
                    "recommendation_variant_id": null
                }
            ]
        }
    ],
    "success": true
}
{
    "results": [
        {
            "error": "No permission",
            "success": false
        }
    ],
    "success": true
}