Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperExperience

**

Example with shopper auth

import { Experience, ClientConfig, Customer, slasHelpers } from "commerce-sdk";
// or
const { Experience, ClientConfig, Customer, slasHelpers } = require("commerce-sdk");

const clientConfig: ClientConfig = {
  parameters: {
    clientId: "XXXXXX",
    organizationId: "XXXX",
    shortCode: "XXX",
    siteId: "XX"
  }
};

// must be registered in SLAS. On server, redirectURI is never called
const redirectURI = "http://localhost:3000/callback";
const slasClient = new Customer.ShopperLogin(clientConfig);
token = await slasHelpers.loginGuestUser(slasClient, { redirectURI });

clientConfig.headers['authorization'] = `Bearer ${token.access_token}`;
const shopperExperienceClient = new Experience.ShopperExperience(clientConfig);
API Version: 1.0.5
Last Updated:

Hierarchy

  • BaseClient
    • ShopperExperience

Index

Type aliases

Static AspectAttributeInvalid

AspectAttributeInvalid: {}

Type declaration

Static AspectTypeNotFound

AspectTypeNotFound: {}

Type declaration

Static AsyncCreated

AsyncCreated: {}

Type declaration

Static AttributeDefinition

AttributeDefinition: { defaultValue?: PropertyValueDefinition; description: L10nString; id?: string; key?: boolean; localizable?: boolean; mandatory?: boolean; max?: number; min?: number; minLength?: number; multiValueType?: boolean; name: L10nString; possibleValues?: Array<PropertyValueDefinition>; regularExpression?: string; scale?: number; searchable?: boolean; siteSpecific?: boolean; system?: boolean; type: string; unit?: L10nString; visible?: boolean }

Type declaration

  • Optional defaultValue?: PropertyValueDefinition
  • description: L10nString
  • Optional id?: string
  • Optional key?: boolean
  • Optional localizable?: boolean
  • Optional mandatory?: boolean
  • Optional max?: number
  • Optional min?: number
  • Optional minLength?: number
  • Optional multiValueType?: boolean
  • name: L10nString
  • Optional possibleValues?: Array<PropertyValueDefinition>
  • Optional regularExpression?: string
  • Optional scale?: number
  • Optional searchable?: boolean
  • Optional siteSpecific?: boolean
  • Optional system?: boolean
  • type: string
  • Optional unit?: L10nString
  • Optional visible?: boolean

Static BoolFilter

BoolFilter: { filters?: Array<Filter>; operator: string } & {}

Static BoolQuery

BoolQuery: { must?: Array<Query>; mustNot?: Array<Query>; should?: Array<Query> } & {}

Static BusinessObjectIdInvalid

BusinessObjectIdInvalid: {}

Type declaration

Static ChangeControlled

ChangeControlled: { createdBy?: string; creationDate?: any; lastModifiedBy?: string; modificationDate?: any } & {}

Static ChangeControlledDataType

ChangeControlledDataType: { createdBy?: string; creationDate?: any; lastModifiedBy?: string; modificationDate?: any } & {}

Static ClosedObject

ClosedObject: {} & {}

Static Component

Component: { custom?: {} & {}; data?: {} & {}; id: string; regions?: Array<Region>; typeId: string } & {}

Static DateConditionalRequest

DateConditionalRequest: {}

Type declaration

Static DateRangeFilter

DateRangeFilter: {}

Type declaration

Static DatetimeRangeFilter

DatetimeRangeFilter: {}

Type declaration

Static Error

Error: { detail?: string; instance?: string; title?: string; type: string } & {}

Static ErrorResponse

ErrorResponse: { detail?: string; instance?: string; title?: string; type: string } & {}

Static EtagConditionalRequest

EtagConditionalRequest: {}

Type declaration

Static EtagResponse

EtagResponse: {}

Type declaration

Static Filter

Filter: { boolFilter?: BoolFilter; queryFilter?: QueryFilter; range2Filter?: Range2Filter; rangeFilter?: RangeFilter; termFilter?: TermFilter } & {}

Static FilteredQuery

FilteredQuery: { filter: Filter; query: Query } & {}

Static IntegerRangeFilter

IntegerRangeFilter: {}

Type declaration

Static L10nString

L10nString: {} & {}

Static LocaleSpecific

LocaleSpecific: {}

Type declaration

Static LocalizedString

LocalizedString: {} & {}

Static MatchAllQuery

MatchAllQuery: {} & {}

Static Money

Money: { currencyMnemonic?: string; value?: number } & {}

Static MoneyMnemonic

MoneyMnemonic: { currencyMnemonic?: string; value?: number } & {}

Static NestedQuery

NestedQuery: { path: string; query: Query; scoreMode?: string } & {}

Static NoPropertiesAllowed

NoPropertiesAllowed: {}

Type declaration

Static NumericRangeFilter

NumericRangeFilter: {}

Type declaration

Static OffsetPaginated

OffsetPaginated: {}

Type declaration

Static OpenObject

OpenObject: {} & {}

Static Page

Page: { aspectTypeId?: string; custom?: {} & {}; data?: {} & {}; description?: string; id: string; name?: string; pageDescription?: string; pageKeywords?: string; pageTitle?: string; regions?: Array<Region>; typeId: string } & {}

Static PageNotFound

PageNotFound: {}

Type declaration

Static PageResult

PageResult: { data: Array<Page> } & {}

Static PaginatedSearchResult

PaginatedSearchResult: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static PaginatedSearchResultBase

PaginatedSearchResultBase: { hits?: Array<object>; limit: number; offset: any; query: Query; sorts?: Array<Sort>; total: any } & {}

Static PropertyDefinition

PropertyDefinition: { defaultValue?: PropertyValueDefinition; description: L10nString; id?: string; key?: boolean; localizable?: boolean; mandatory?: boolean; max?: number; min?: number; minLength?: number; multiValueType?: boolean; name: L10nString; possibleValues?: Array<PropertyValueDefinition>; regularExpression?: string; scale?: number; searchable?: boolean; siteSpecific?: boolean; system?: boolean; type: string; unit?: L10nString; visible?: boolean } & {}

Static PropertyValueDefinition

PropertyValueDefinition: { description: L10nString; displayValue: L10nString; id: string; position?: number; value: string }

Type declaration

  • description: L10nString
  • displayValue: L10nString
  • id: string
  • Optional position?: number
  • value: string

Static Query

Query: { boolQuery?: BoolQuery; filteredQuery?: FilteredQuery; matchAllQuery?: MatchAllQuery; nestedQuery?: NestedQuery; termQuery?: TermQuery; textQuery?: TextQuery } & {}

Static QueryFilter

QueryFilter: { query: Query } & {}

Static QueryParamsLimit

QueryParamsLimit: {}

Type declaration

Static QueryParamsOffset

QueryParamsOffset: {}

Type declaration

Static Range2Filter

Range2Filter: { filterMode?: string; fromField: string; fromInclusive?: boolean; fromValue?: any; toField: string; toInclusive?: boolean; toValue?: any } & {}

Static RangeFilter

RangeFilter: {}

Type declaration

Static RateLimited

RateLimited: {}

Type declaration

Static RateLimited2

RateLimited2: {}

Type declaration

Static RateLimited3

RateLimited3: {}

Type declaration

Static RateLimited4

RateLimited4: {}

Type declaration

Static RateLimited5

RateLimited5: {}

Type declaration

Static Region

Region: { components?: Array<Component>; id: string } & {}

Static SearchRequest

SearchRequest: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}

Static SearchRequestBase

SearchRequestBase: { limit?: number; offset?: any; query: Query; sorts?: Array<Sort> } & {}

Static Selectable

Selectable: {}

Type declaration

Static SimpleSearchResult

SimpleSearchResult: { hits?: Array<object>; limit: number; offset: any; total: any } & {}

Static SimpleSearchResultBase

SimpleSearchResultBase: { hits?: Array<object>; limit: number; offset: any; total: any } & {}

Static SiteSpecific

SiteSpecific: {}

Type declaration

Static Sort

Sort: { field: string; sortOrder?: string } & {}

Static SpecifiedPropertiesAllowed

SpecifiedPropertiesAllowed: {} & {}

Static SyncCreated

SyncCreated: {}

Type declaration

Static TermFilter

TermFilter: { field: string; operator: string; values?: Array<any> } & {}

Static TermQuery

TermQuery: { fields: Array<string>; operator: string; values?: Array<any> } & {}

Static TextQuery

TextQuery: { fields: Array<string>; searchPhrase: string } & {}

Constructors

constructor

  • Parameters

    • config: ClientConfig

    Returns ShopperExperience

Properties

clientConfig

clientConfig: ClientConfig

Methods

getPage

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

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { aspectAttributes?: string; locale?: string; organizationId?: string; pageId: string; parameters?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Page>

    A promise of type ShopperExperience.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: { fetchOptions?: RequestInit; headers?: {}; parameters?: { aspectAttributes?: string; locale?: string; organizationId?: string; pageId: string; parameters?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { aspectAttributes?: string; locale?: string; organizationId?: string; pageId: string; parameters?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

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

    Returns Promise<T extends true ? Response : ShopperExperience.Page>

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

getPages

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

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { aspectAttributes?: string; aspectTypeId: string; categoryId?: string; locale?: string; organizationId?: string; parameters?: string; productId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<PageResult>

    A promise of type ShopperExperience.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: { fetchOptions?: RequestInit; headers?: {}; parameters?: { aspectAttributes?: string; aspectTypeId: string; categoryId?: string; locale?: string; organizationId?: string; parameters?: string; productId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { aspectAttributes?: string; aspectTypeId: string; categoryId?: string; locale?: string; organizationId?: string; parameters?: string; productId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions
    • Optional rawResponse: T

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

    Returns Promise<T extends true ? Response : ShopperExperience.PageResult>

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

Generated using TypeDoc