Class ShopperExperience<ConfigParameters>

Shopper Experience

**

Simple example:

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

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

Type Parameters

Hierarchy

  • ShopperExperience

Constructors

Methods

Properties

Constructors

Methods

  • Get a Page Designer page based on a single page ID. The results will apply the visibility rules for the page's components, such as personalization or scheduled visibility.

    Important*: Currently, the Shopper Experience API can’t be used when the storefront password protection feature is enabled.

    Important*: Because this resource uses the GET method, you must not pass sensitive data (payment card information, for example) and must not perform any transactional processes within the server-side scripts that are run for the page and components.

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

    Parameters

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

      An object containing the options for this method.

    Returns Promise<Page>

    A promise of type Page.

  • Get a Page Designer page based on a single page ID. The results will apply the visibility rules for the page's components, such as personalization or scheduled visibility.

    Important*: Currently, the Shopper Experience API can’t be used when the storefront password protection feature is enabled.

    Important*: Because this resource uses the GET method, you must not pass sensitive data (payment card information, for example) and must not perform any transactional processes within the server-side scripts that are run for the page and components.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "parameters" | "aspectAttributes" | "pageId"]: (Omit<{
                  aspectAttributes?: string;
                  locale?: string;
                  organizationId: string;
                  pageId: string;
                  parameters?: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  aspectAttributes?: string;
                  locale?: string;
                  organizationId: string;
                  pageId: string;
                  parameters?: 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
        : Page>

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

  • Get Page Designer pages. The results will apply the visibility rules for each page's components, such as personalization or scheduled visibility.

    Either categoryId or productId must be given in addition to aspectTypeId. Because only a single page-to-product and page-to-category assignment per aspect type can be authored today, the returned result contains one element at most.

    Important*: Currently, the Shopper Experience API can’t be used when the storefront password protection feature is enabled.

    Important*: Because this resource uses the GET method, you must not pass sensitive data (payment card information, for example) and must not perform any transactional processes within the server-side scripts that are run for the page and components.

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

    Parameters

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

      An object containing the options for this method.

    Returns Promise<PageResult>

    A promise of type PageResult.

  • Get Page Designer pages. The results will apply the visibility rules for each page's components, such as personalization or scheduled visibility.

    Either categoryId or productId must be given in addition to aspectTypeId. Because only a single page-to-product and page-to-category assignment per aspect type can be authored today, the returned result contains one element at most.

    Important*: Currently, the Shopper Experience API can’t be used when the storefront password protection feature is enabled.

    Important*: Because this resource uses the GET method, you must not pass sensitive data (payment card information, for example) and must not perform any transactional processes within the server-side scripts that are run for the page and components.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in "organizationId" | "siteId" | "locale" | "parameters" | "categoryId" | "productId" | "aspectTypeId" | "aspectAttributes"]: (Omit<{
                  aspectAttributes?: string;
                  aspectTypeId: string;
                  categoryId?: string;
                  locale?: string;
                  organizationId: string;
                  parameters?: string;
                  productId?: string;
                  siteId: string;
              }, keyof ConfigParameters> & Partial<{
                  aspectAttributes?: string;
                  aspectTypeId: string;
                  categoryId?: string;
                  locale?: string;
                  organizationId: string;
                  parameters?: string;
                  productId?: 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
        : PageResult>

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

Properties

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