Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperProducts

Display product details across your storefront.

Example with shopper auth

import { Product, ClientConfig, Customer, slasHelpers } from "commerce-sdk";
// or
const { Product, 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 shopperProductsClient = new Product.ShopperProducts(clientConfig);
API Version: 0.0.33
Last Updated:

Hierarchy

  • BaseClient
    • ShopperProducts

Index

Type aliases

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 BadRequest

BadRequest: {}

Type declaration

Static BadRequest1

BadRequest1: {}

Type declaration

Static BadRequest2

BadRequest2: {}

Type declaration

Static BoolFilter

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

Static BoolQuery

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

Static BundledProduct

BundledProduct: { id: string; product: Product; quantity: number } & {}

Static Category

Category: { categories?: Array<Category>; description?: string; id: string; image?: string; name?: string; onlineSubCategoriesCount?: any; pageDescription?: string; pageKeywords?: string; pageTitle?: string; parentCategoryId?: string; parentCategoryTree?: Array<PathRecord>; thumbnail?: string } & {}

Static CategoryResult

CategoryResult: { data: Array<Category>; limit: number; total: number } & {}

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 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 Image

Image: { alt?: string; disBaseLink?: string; link: string; title?: string } & {}

Static ImageGroup

ImageGroup: { images: Array<Image>; variationAttributes?: Array<VariationAttribute>; viewType: string } & {}

Static IntegerRangeFilter

IntegerRangeFilter: {}

Type declaration

Static Inventory

Inventory: { ats?: number; backorderable?: boolean; id: string; inStockDate?: any; orderable?: boolean; preorderable?: boolean; stockLevel?: number } & {}

Static L10nString

L10nString: {} & {}

Static LocalizedString

LocalizedString: {} & {}

Static Master

Master: { masterId: string; orderable?: boolean; price?: number; priceMax?: number; prices?: {} & {} } & {}

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 NotFound

NotFound: {}

Type declaration

Static NumericRangeFilter

NumericRangeFilter: {}

Type declaration

Static OffsetPaginated

OffsetPaginated: {}

Type declaration

Static OpenObject

OpenObject: {} & {}

Static Option

Option: { description?: string; id: string; image?: string; name?: string; values?: Array<OptionValue> } & {}

Static OptionValue

OptionValue: { default?: boolean; id: string; name?: string; price?: number } & {}

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 PathRecord

PathRecord: { id?: string; name?: string } & {}

Static PriceRange

PriceRange: { maxPrice?: number; minPrice?: number; pricebook?: string } & {}

Static Product

Product: { brand?: string; bundledProducts?: Array<BundledProduct>; currency?: string; ean?: string; fetchDate?: number; id: string; imageGroups?: Array<ImageGroup>; inventories?: Array<Inventory>; inventory?: Inventory; longDescription?: string; manufacturerName?: string; manufacturerSku?: string; master?: Master; minOrderQuantity?: number; name?: string; options?: Array<Option>; pageDescription?: string; pageKeywords?: string; pageTitle?: string; price?: number; priceMax?: number; pricePerUnit?: number; pricePerUnitMax?: number; priceRanges?: Array<PriceRange>; prices?: {} & {}; primaryCategoryId?: string; productLinks?: Array<ProductLink>; productPromotions?: Array<ProductPromotion>; recommendations?: Array<Recommendation>; setProducts?: Array<Product>; shortDescription?: string; slugUrl?: string; stepQuantity?: number; tieredPrices?: Array<ProductPriceTable>; type?: ProductType; unit?: string; upc?: string; validFrom?: any; validTo?: any; variants?: Array<Variant>; variationAttributes?: Array<VariationAttribute>; variationGroups?: Array<VariationGroup>; variationValues?: {} & {} } & {}

Static ProductLink

ProductLink: { sourceProductId: string; sourceProductLink: string; targetProductId: string; targetProductLink: string; type: string } & {}

Static ProductPriceTable

ProductPriceTable: { price?: number; pricebook?: string; quantity?: number } & {}

Static ProductPromotion

ProductPromotion: { calloutMsg: string; promotionId: string; promotionalPrice: number } & {}

Static ProductResult

ProductResult: { data: Array<Product>; limit: number; total: number } & {}

Static ProductType

ProductType: { bundle?: boolean; item?: boolean; master?: boolean; option?: boolean; set?: boolean; variant?: boolean; variationGroup?: boolean } & {}

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 Recommendation

Recommendation: { calloutMsg?: string; image?: Image; longDescription?: string; name?: string; recommendationType: RecommendationType; recommendedItemId?: string; shortDescription?: string } & {}

Static RecommendationType

RecommendationType: { displayValue: string; value: number } & {}

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 } & {}

Static Unauthorized

Unauthorized: {}

Type declaration

Static Variant

Variant: { orderable?: boolean; price?: number; productId: string; tieredPrices?: Array<ProductPriceTable>; variationValues?: {} & {} } & {}

Static VariationAttribute

VariationAttribute: { id: string; name?: string; values?: Array<VariationAttributeValue> } & {}

Static VariationAttributeValue

VariationAttributeValue: { description?: string; image?: Image; imageSwatch?: Image; name?: string; orderable?: boolean; value: string } & {}

Static VariationGroup

VariationGroup: { orderable: boolean; price: number; productId: string; variationValues: {} & {} } & {}

Constructors

constructor

  • Parameters

    • config: ClientConfig

    Returns ShopperProducts

Properties

clientConfig

clientConfig: ClientConfig

Methods

getCategories

  • getCategories(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<CategoryResult>
  • getCategories<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperProducts.CategoryResult>
  • When you use the URL template, the server returns multiple categories (a result object of category documents). You can use this template as a convenient way of obtaining multiple categories in a single request, instead of issuing separate requests for each category. You can specify up to 50 multiple IDs. You must enclose the list of IDs in parentheses. If a category identifier contains parenthesis or the separator sign, you must URL encode the character. The server only returns online categories.

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

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

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

    Returns Promise<CategoryResult>

    A promise of type ShopperProducts.CategoryResult.

  • When you use the URL template, the server returns multiple categories (a result object of category documents). You can use this template as a convenient way of obtaining multiple categories in a single request, instead of issuing separate requests for each category. You can specify up to 50 multiple IDs. You must enclose the list of IDs in parentheses. If a category identifier contains parenthesis or the separator sign, you must URL encode the character. The server only returns online categories.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { ids: string; levels?: number; locale?: string; organizationId?: 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 : ShopperProducts.CategoryResult>

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

getCategory

  • getCategory(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { id: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<Category>
  • getCategory<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { id: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperProducts.Category>
  • When you use the URL template below, the server returns a category identified by its ID; by default, the server also returns the first level of subcategories, but you can specify another level by setting the levels parameter. The server only returns online categories.

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

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { id: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

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

    Returns Promise<Category>

    A promise of type ShopperProducts.Category.

  • When you use the URL template below, the server returns a category identified by its ID; by default, the server also returns the first level of subcategories, but you can specify another level by setting the levels parameter. The server only returns online categories.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { id: string; levels?: number; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { id: string; levels?: number; locale?: string; organizationId?: 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 : ShopperProducts.Category>

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

getProduct

  • getProduct(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; id: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<Product>
  • getProduct<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; id: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperProducts.Product>
  • Allows access to product details for a single product ID. Only products that are online and assigned to a site catalog are returned. Along with product details, the availability, images, price, bundled_products, set_products, recommedations, product options, variations, and promotions for the products will be included, as appropriate.

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

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; id: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; id: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<Product>

    A promise of type ShopperProducts.Product.

  • Allows access to product details for a single product ID. Only products that are online and assigned to a site catalog are returned. Along with product details, the availability, images, price, bundled_products, set_products, recommedations, product options, variations, and promotions for the products will be included, as appropriate.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; id: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; id: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: 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 : ShopperProducts.Product>

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

getProducts

  • getProducts(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; ids: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<ProductResult>
  • getProducts<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; ids: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperProducts.ProductResult>
  • Allows access to multiple products by a single request. Only products that are online and assigned to a site catalog are returned. The maximum number of productIDs that can be requested are 24. Along with product details, the availability, product options, images, price, promotions, and variations for the valid products will be included, as appropriate.

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

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; ids: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; ids: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<ProductResult>

    A promise of type ShopperProducts.ProductResult.

  • Allows access to multiple products by a single request. Only products that are online and assigned to a site catalog are returned. The maximum number of productIDs that can be requested are 24. Along with product details, the availability, product options, images, price, promotions, and variations for the valid products will be included, as appropriate.

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; ids: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { allImages?: boolean; currency?: string; expand?: Array<string>; ids: string; inventoryIds?: string; locale?: string; organizationId?: string; perPricebook?: boolean; select?: 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 : ShopperProducts.ProductResult>

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

Generated using TypeDoc