younifyd
Menu

Get Search Suggestions

Get Search Suggestions

GET/organizations/{organizationId}/search-suggestions

Use it in a workflow

  1. Add a step and choose the Salesforce Commerce Cloud connector.
  2. Pick the Get Search Suggestions action (under Shopper Search).
  3. Fill in the fields below, then reference the result from later steps as {{getSearchSuggestions.response.data}}.

Request

Path parameters

organizationIdstringrequired

An identifier for the Salesforce Commerce Cloud organization the request is being made by. It consists of a prefix 'f_ecom_' followed by a 4-character [realm identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#realm-id) and a 3-character [instance type identifier](https://developer.salesforce.com/docs/commerce/commerce-api/guide/base-url.html#instance-id).

Query parameters

siteIdstringrequired

The identifier of the site that a request is being made in the context of. Attributes might have site specific values, and some objects may only be assigned to specific sites.

qstringrequired

The search phrase (q) for which suggestions are evaluated. Search suggestions are determined when the search phrase input is at least three (default) characters long. The value is configurable in the Business Manager.

limitinteger

The maximum number of suggestions made per request. If no value is defined, by default five suggestions per suggestion type are evaluated. This affects all types of suggestions (category, product, brand, and custom suggestions).

Default 5

currencystring

A three letter uppercase currency code conforming to the [ISO 4217](https://www.iso.org/iso-4217-currency-codes.html) standard, or the string `N/A` indicating that a currency is not applicable.

localeoneOf

A descriptor for a geographical region by both a language and country code. By combining these two, regional differences in a language can be addressed, such as with the request header parameter `Accept-Language` following [RFC 2616](https://tools.ietf.org/html/rfc2616) & [RFC 1766](https://tools.ietf.org/html/rfc1766). This can also just refer to a language code, also RFC 2616/1766 compliant, as a default if there is no specific match for a country. Finally, can also be used to define default behavior if there is no locale specified.

expandarray<string>

A comma-separated list that allows values `images`, `prices`, `custom_product_properties`. By default, the expand parameter includes `prices`.

includedCustomProductPropertiesarray<string>

A comma-separated list of custom property ids to be returned for product suggestions. The `custom_product_properties` expand parameter is required for these properties to be returned.

includeEinsteinSuggestedPhrasesboolean

The flag that determines whether or not to show recent and popular suggested phrases from Einstein.

Response

Returns 200 with an object. Read it in later steps with {{getSearchSuggestions.response.data.<field>}}.

brandSuggestionsany

Returns the suggested brands.

categorySuggestionsany

Returns the suggested categories.

productSuggestionsany

Returns the suggested products.

customSuggestionany

Returns custom suggestions.

einsteinSuggestedPhrasesany

Returns Einstein suggested phrases containing popular and recent search phrases.

searchPhrasestring

The query phrase (q) for which suggestions where made.

json
{
  "searchPhrase": "dresses",
  "brandSuggestions": null,
  "categorySuggestions": null,
  "productSuggestions": null,
  "customSuggestion": null,
  "einsteinSuggestedPhrases": null
}

Need more? See the Salesforce Commerce Cloud guide for connection setup and behaviour shared by every action.

Get Search Suggestions — Salesforce Commerce Cloud — Documentation