Type aliases
Static AsyncCreated
AsyncCreated: {}
Static AttributeGrouping
AttributeGrouping: { attributeId: string; groupType: string; returnedAttributes?: Array<string> }
Type declaration
-
attributeId: string
-
groupType: string
-
Optional returnedAttributes?: Array<string>
Static AttributeSorting
AttributeSorting: { attributeId: string; direction: string; sortType: string }
Type declaration
-
attributeId: string
-
direction: string
-
sortType: string
Static AttributesQuery
Attributes
Query: { correctableAttributes?: CorrectableAttributes; highlighting?: Highlighting; queryType: string; value: { attributes: Array<string>; phrase: string } & {} }
Type declaration
-
-
-
queryType: string
-
value: { attributes: Array<string>; phrase: string } & {}
Static AuthenticationFailure
AuthenticationFailure: {}
Static AuthorizationFailure
AuthorizationFailure: {}
Static BadRequest
BadRequest: {}
Static BaseError
BaseError: { detail?: string; instance?: string; title?: string; type: string }
Type declaration
-
Optional detail?: string
-
Optional instance?: string
-
Optional title?: string
-
type: string
Static BoolFilter
BoolFilter: { filters?: Array<any>; operator: string } & {}
Static BoolQuery
BoolQuery: { must?: Array<any>; mustNot?: Array<any>; should?: Array<any> } & {}
Static ClosedObject
ClosedObject: {} & {}
Static CommonErrors
CommonErrors: {}
Static CorrectableAttributes
CorrectableAttributes: { attributes: Array<string> } & {}
Static DateConditionalRequest
DateConditionalRequest: {}
Static ErrorResponse
ErrorResponse: { detail?: string; instance?: string; title?: string; type: string } & {}
Static EtagConditionalRequest
EtagConditionalRequest: {}
Static EtagResponse
EtagResponse: {}
Static ExpansionAttribute
ExpansionAttribute: { attributeId: string; path: string; value: any } & {}
Static FacetInput
FacetInput: { attributeId: string; facetType: string } & {}
Static FacetOutput
FacetOutput: { attributeId: string; facetType: string } & {}
Static FacetRequest
Facet
Request: { facetLimit?: any; facets?: Array<FacetInput> } & {}
Static Filter
Static Filterable
Filterable: {}
Static FilteredQuery
FilteredQuery: { filter: any; query: any } & {}
Static Grouping
Grouping: { groupType: string } & {}
Static Highlight
Highlight: { attributeId: string; value: string } & {}
Static Highlighting
Highlighting: { attributes: Array<string> } & {}
Static InternalServerError
InternalServerError: {}
Static InvalidRequest
InvalidRequest: {}
Static ItemReference
Static MatchAllQuery
MatchAllQuery: {} & {}
Static Money
Money: { currencyMnemonic?: string; value?: number } & {}
Static MoneyMnemonic
MoneyMnemonic: { currencyMnemonic?: string; value?: number } & {}
Static NestedQuery
NestedQuery: { path: string; query: any; scoreMode?: string } & {}
Static NoPropertiesAllowed
NoPropertiesAllowed: {}
Static NonReadableHttpMessage
NonReadableHttpMessage: {}
Static NotFound
NotFound: {}
Static OffsetPaginated
OffsetPaginated: {}
Static OpenObject
OpenObject: {} & {}
Static PaginatedSearchResult
Paginated
SearchResult: { hits?: Array<object>; limit: number; offset: any; query: any; sorts?: Array<Sort>; total: any } & {}
Static PaginatedSearchResultBase
Paginated
SearchResultBase: { hits?: Array<object>; limit: number; offset: any; query: any; sorts?: Array<Sort>; total: any } & {}
Static Pagination
Type declaration
-
Optional next?: Self
-
Optional prev?: Self
-
Static PaginationLinks
Pagination
Links: { next?: Self; prev?: Self; self: Self } & {}
Static PhraseQuery
Type declaration
-
-
-
queryType: string
-
value: string
Static Query
Static QueryFilter
QueryFilter: { query: any } & {}
Static QueryInput
Type declaration
-
-
Optional facets?: Array<FacetInput>
-
Optional grouping?: Grouping
-
Optional query?: Query
-
Optional refinements?: Array<Refinement>
-
Optional returnedAttributes?: Array<string>
-
Static QueryOutput
Type declaration
-
Optional facets?: Array<FacetOutput>
-
hits: Array<Result>
-
limit: number
-
-
offset: any
-
total: any
Static QueryParamsLimit
QueryParamsLimit: {}
Static QueryParamsOffset
QueryParamsOffset: {}
Static Range2Filter
Range2Filter: { filterMode?: string; fromField: string; fromInclusive?: boolean; fromValue?: any; toField: string; toInclusive?: boolean; toValue?: any } & {}
Static RangeFacetInput
RangeFacetInput: {}
Static RangeFacetOutput
RangeFacetOutput: { attributeId: string; facetType: string; max: any; min: any }
Type declaration
-
attributeId: string
-
facetType: string
-
max: any
-
min: any
Static RangeFilter
RangeFilter: { field: string; from?: any; fromInclusive?: boolean; to?: any; toInclusive?: boolean } & {}
Static RangeRefinement
RangeRefinement: { attributeId: string; max: any; min: any; refinementType: string }
Type declaration
-
attributeId: string
-
max: any
-
min: any
-
refinementType: string
Static RateLimitExceeded
RateLimitExceeded: { detail?: string; instance?: string; requestLimit: any; title?: string; type: string }
Type declaration
-
Optional detail?: string
-
Optional instance?: string
-
requestLimit: any
-
Optional title?: string
-
type: string
Static RateLimited
RateLimited: {}
Static RateLimited2
RateLimited2: {}
Static RateLimited3
RateLimited3: {}
Static RateLimited4
RateLimited4: {}
Static RateLimited5
RateLimited5: {}
Static Refinement
Refinement: { attributeId: string; refinementType: string } & {}
Static RelevanceSorting
RelevanceSorting: {}
Static ResourceBadRequest
ResourceBadRequest: {}
Static ResourceCommonErrors
ResourceCommonErrors: {}
Static ResourceInvalidRequest
ResourceInvalidRequest: {}
Static ResourceLink
Resource
Link: { self: Self } & {}
Static ResourceNonReadableHttpMessage
ResourceNonReadableHttpMessage: {}
Static Result
Type declaration
-
Optional groupId?: string
-
Optional groupedItems?: Array<ItemReference>
-
Optional highlights?: Array<Highlight>
-
-
Optional totalGroupedItems?: any
Static SearchRequest
Search
Request: { limit?: number; offset?: any; query: any; sorts?: Array<Sort> } & {}
Static SearchRequestBase
Search
RequestBase: { limit?: number; offset?: any; query: any; sorts?: Array<Sort> } & {}
Static Self
Self: { href: string }
Static SelfResourceLink
Self
ResourceLink: { self: Self }
Static ServiceUnavailable
ServiceUnavailable: {}
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: {}
Static Sort
Sort: { field: string; sortOrder?: string } & {}
Static Sorting
Sorting: { sortType: string } & {}
Static SpecifiedPropertiesAllowed
SpecifiedPropertiesAllowed: {} & {}
Static Suggestion
Suggestion: { phrase: string }
Static Suggestions
Type declaration
-
Optional popularSearchPhrases?: Array<Suggestion>
-
Optional recentSearchPhrases?: Array<Suggestion>
-
Optional suggestedSearchPhrases?: Array<Suggestion>
Static SyncCreated
SyncCreated: {}
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 } & {}
Static Traceable
Traceable: {}
Static ValueFacetInput
ValueFacetInput: { attributeId: string; facetType: string; mask?: Array<string> }
Type declaration
-
attributeId: string
-
facetType: string
-
Optional mask?: Array<string>
Static ValueFacetOutput
Type declaration
-
attributeId: string
-
facetType: string
-
Static ValueFacetOutputEntity
ValueFacetOutputEntity: { count: any; value: string } & {}
Static ValueRefinement
ValueRefinement: { attributeId: string; refinementType: string; values: Array<any> }
Type declaration
-
attributeId: string
-
refinementType: string
-
values: Array<any>
Shopper Discovery Search
Einstein-powered product search and search suggestions.
Example with shopper auth
API Version: 1.1.6import { Discovery, ClientConfig, Customer, slasHelpers } from "commerce-sdk"; // or const { Discovery, 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 shopperDiscoverySearchClient = new Discovery.ShopperDiscoverySearch(clientConfig);
Last Updated: