Skip to main content

API Parameters Reference

This page provides a comprehensive reference for all parameters supported by the Recommendations API.

Required Parameters

At least one of these parameters is required for every API call:

ParameterTypeDescription
currentUrlstringURL used to determine which route to use. Required unless routeName is provided.
routeNamestringDirectly specify which recommendation route to use. Can be used instead of currentUrl.

Common Parameters

These parameters are frequently used to customize recommendations:

ParameterTypeDefaultDescription
customerIdGUID-User identifier for personalized recommendations. Required for personalized results like Recently Viewed items.
refIdstring-Product ID/reference for PDP recommendations. Critical for "Similar Items" and "Frequently Bought Together" recommendations.
productsInCart[]array-Array of product IDs currently in the cart. Format: productsInCart[0]=product1&productsInCart[1]=product2
expandProductDetailsbooleanfalseWhen true, returns complete product information. When false, returns only refId and isInStock.
showInStockOnlybooleantrueControls whether out-of-stock products are included in recommendations.

Content Customization Parameters

These parameters control the content returned in recommendations:

ParameterTypeDefaultDescription
returnMultipleProductsInSlotbooleanfalseWhen true, may return multiple products per slot based on configuration.
maxNumberOfProductWithinASlotinteger-Limits the maximum number of products per slot. Only applies when returnMultipleProductsInSlot is true.
languageTagstring-Language code for localized content (e.g., "en-US", "fr-FR"). When provided, returns product information in this language if available.
currencyCodestring-ISO currency code (e.g., "USD", "EUR") for pricing. When provided, converts and displays prices in this currency if supported.

Advanced Filtering Parameters

These parameters provide advanced filtering capabilities:

ParameterTypeDescription
indexFilterValuestringFilters recommendations based on specific indexed values/attributes in your catalog.
searchQuerystringIncorporates a search term to influence recommendations, returning products related to both the current context and the search.
elementsarrayAdvanced targeting using CSS-like selectors and values. Each ElementSelector contains a selector (s) and array of values (v).
customerSegmentsarrayList of customer segment identifiers. Filters/prioritizes recommendations based on segment-specific rules.

ElementSelector Format

The elements parameter uses a special format for advanced content selection:

// Example elements parameter structure
elements: [
{
s: "category", // Selector
v: ["mens", "clothing"] // Values
},
{
s: "price-range",
v: ["100-200"]
}
]

When making API calls, these would be formatted as query parameters:

&elements[0][s]=category&elements[0][v][0]=mens&elements[0][v][1]=clothing&elements[1][s]=price-range&elements[1][v][0]=100-200

Parameter Usage Examples

Basic Product Detail Page Request

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com/product/12345&refId=12345

Language and Currency Specific Request

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&languageTag=fr-FR&currencyCode=EUR

Personalized Recommendations with Cart Context

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&customerId=user123&productsInCart[0]=item1&productsInCart[1]=item2&expandProductDetails=true

Advanced Filtering with Customer Segments

GET https://<PA_END_POINT>/3.0/recommendations?currentUrl=https://www.example.com&customerSegments[0]=premium&customerSegments[1]=frequent-buyer&indexFilterValue=department:electronics