Class ShopperSearch<ConfigParameters>

Shopper Search

product search and helpful search suggestions.

Simple example:

  import { ShopperSearch } from "commerce-sdk-isomorphic";

const clientConfig = {
parameters: {
clientId: "XXXXXX",
organizationId: "XXXX",
shortCode: "XXX",
siteId: "XX"
}
};
const shopperSearchClient = new ShopperSearch(clientConfig);
API Version: 1.0.29
Last Updated:

Type Parameters

Hierarchy

  • ShopperSearch

Constructors

Methods

  • Provides keyword search functionality for products, categories, and brands suggestions. Returns suggested products, suggested categories, and suggested brands for the given search phrase.

    If you would like to get a raw Response object use the other getSearchSuggestions function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "currency" | "q" | "limit"]: (Omit<{
                  currency?: string;
                  limit?: number;
                  locale?: string;
                  organizationId: string;
                  q: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  currency?: string;
                  limit?: number;
                  locale?: string;
                  organizationId: string;
                  q: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<SuggestionResult>

    A promise of type SuggestionResult.

  • Provides keyword search functionality for products, categories, and brands suggestions. Returns suggested products, suggested categories, and suggested brands for the given search phrase.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "currency" | "q" | "limit"]: (Omit<{
                  currency?: string;
                  limit?: number;
                  locale?: string;
                  organizationId: string;
                  q: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  currency?: string;
                  limit?: number;
                  locale?: string;
                  organizationId: string;
                  q: string;
                  siteId: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : SuggestionResult>

    A promise of type Response if rawResponse is true, a promise of type SuggestionResult otherwise.

  • Provides keyword and refinement search functionality for products. Only returns the product ID, link, and name in the product search hit. The search result contains only products that are online and assigned to site catalog.

    If you would like to get a raw Response object use the other productSearch function.

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "currency" | "sort" | "q" | "offset" | "limit" | "expand" | "refine"]: (Omit<{
                  currency?: string;
                  expand?: string[];
                  limit?: number;
                  locale?: string;
                  offset?: any;
                  organizationId: string;
                  q?: string;
                  refine?: string[];
                  siteId: string;
                  sort?: string;
              }, keyof ConfigParameters> & Partial<{
                  currency?: string;
                  expand?: string[];
                  limit?: number;
                  locale?: string;
                  offset?: any;
                  organizationId: string;
                  q?: string;
                  refine?: string[];
                  siteId: string;
                  sort?: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<ProductSearchResult>

    A promise of type ProductSearchResult.

  • Provides keyword and refinement search functionality for products. Only returns the product ID, link, and name in the product search hit. The search result contains only products that are online and assigned to site catalog.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "currency" | "sort" | "q" | "offset" | "limit" | "expand" | "refine"]: (Omit<{
                  currency?: string;
                  expand?: string[];
                  limit?: number;
                  locale?: string;
                  offset?: any;
                  organizationId: string;
                  q?: string;
                  refine?: string[];
                  siteId: string;
                  sort?: string;
              }, keyof ConfigParameters> & Partial<{
                  currency?: string;
                  expand?: string[];
                  limit?: number;
                  locale?: string;
                  offset?: any;
                  organizationId: string;
                  q?: string;
                  refine?: string[];
                  siteId: string;
                  sort?: string;
              }>)[K]
          };
      }>

      An object containing the options for this method.

    • Optional rawResponse: T

      Set to true to return entire Response object instead of DTO.

    Returns Promise<T extends true
        ? Response
        : ProductSearchResult>

    A promise of type Response if rawResponse is true, a promise of type ProductSearchResult otherwise.

Properties

clientConfig: ClientConfig<ConfigParameters> & {
    baseUri: string;
}
defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/{version}/" = "https://{shortCode}.api.commercecloud.salesforce.com/search/shopper-search/{version}/"