Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperExperience<ConfigParameters>

**

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.5
Last Updated:

Type parameters

Hierarchy

  • ShopperExperience

Index

Constructors

constructor

Properties

clientConfig

clientConfig: ClientConfig<ConfigParameters> & { baseUri: string }

Static Readonly defaultBaseUri

defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/experience/shopper-experience/{version}" = "https://{shortCode}.api.commercecloud.salesforce.com/experience/shopper-experience/{version}"

Static Readonly paramKeys

paramKeys: { getPage: ["organizationId", "pageId", "aspectAttributes", "parameters", "siteId", "locale"]; getPageRequired: ["organizationId", "pageId", "siteId"]; getPages: ["organizationId", "categoryId", "productId", "aspectTypeId", "aspectAttributes", "parameters", "siteId", "locale"]; getPagesRequired: ["organizationId", "aspectTypeId", "siteId"] } = {getPages: ['organizationId','categoryId','productId','aspectTypeId','aspectAttributes','parameters','siteId','locale',],getPagesRequired: ['organizationId','aspectTypeId','siteId',],getPage: ['organizationId','pageId','aspectAttributes','parameters','siteId','locale',],getPageRequired: ['organizationId','pageId','siteId',],} as const

Type declaration

  • getPage: ["organizationId", "pageId", "aspectAttributes", "parameters", "siteId", "locale"]
  • getPageRequired: ["organizationId", "pageId", "siteId"]
  • getPages: ["organizationId", "categoryId", "productId", "aspectTypeId", "aspectAttributes", "parameters", "siteId", "locale"]
  • getPagesRequired: ["organizationId", "aspectTypeId", "siteId"]

Methods

getPage

  • getPage(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; locale?: undefined | string; organizationId: string; pageId: string; parameters?: undefined | string; siteId: string } & {}, ConfigParameters> }>): Promise<Page>
  • getPage<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; locale?: undefined | string; organizationId: string; pageId: string; parameters?: undefined | string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : 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.

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

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; locale?: undefined | string; organizationId: string; pageId: string; parameters?: undefined | string; siteId: string } & {}, ConfigParameters> }>

      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: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; locale?: undefined | string; organizationId: string; pageId: string; parameters?: undefined | string; siteId: string } & {}, ConfigParameters> }>

      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.

getPages

  • getPages(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; aspectTypeId: string; categoryId?: undefined | string; locale?: undefined | string; organizationId: string; parameters?: undefined | string; productId?: undefined | string; siteId: string } & {}, ConfigParameters> }>): Promise<PageResult>
  • getPages<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; aspectTypeId: string; categoryId?: undefined | string; locale?: undefined | string; organizationId: string; parameters?: undefined | string; productId?: undefined | string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : 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.

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

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; aspectTypeId: string; categoryId?: undefined | string; locale?: undefined | string; organizationId: string; parameters?: undefined | string; productId?: undefined | string; siteId: string } & {}, ConfigParameters> }>

      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: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ aspectAttributes?: undefined | string; aspectTypeId: string; categoryId?: undefined | string; locale?: undefined | string; organizationId: string; parameters?: undefined | string; productId?: undefined | string; siteId: string } & {}, ConfigParameters> }>

      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.

Generated using TypeDoc