Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperProducts<ConfigParameters>

Display product details across your storefront.

Simple example:

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

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

Type parameters

Hierarchy

  • ShopperProducts

Index

Constructors

constructor

Properties

clientConfig

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

Static Readonly defaultBaseUri

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

Static Readonly paramKeys

paramKeys: { getCategories: ["organizationId", "ids", "levels", "locale", "siteId"]; getCategoriesRequired: ["organizationId", "ids", "siteId"]; getCategory: ["organizationId", "id", "levels", "locale", "siteId"]; getCategoryRequired: ["organizationId", "id", "siteId"]; getProduct: ["organizationId", "id", "select", "inventoryIds", "currency", "expand", "locale", "allImages", "perPricebook", "siteId"]; getProductRequired: ["organizationId", "id", "siteId"]; getProducts: ["organizationId", "select", "ids", "inventoryIds", "currency", "expand", "locale", "allImages", "perPricebook", "siteId"]; getProductsRequired: ["organizationId", "ids", "siteId"] } = {getProducts: ['organizationId','select','ids','inventoryIds','currency','expand','locale','allImages','perPricebook','siteId',],getProductsRequired: ['organizationId','ids','siteId',],getProduct: ['organizationId','id','select','inventoryIds','currency','expand','locale','allImages','perPricebook','siteId',],getProductRequired: ['organizationId','id','siteId',],getCategories: ['organizationId','ids','levels','locale','siteId',],getCategoriesRequired: ['organizationId','ids','siteId',],getCategory: ['organizationId','id','levels','locale','siteId',],getCategoryRequired: ['organizationId','id','siteId',],} as const

Type declaration

  • getCategories: ["organizationId", "ids", "levels", "locale", "siteId"]
  • getCategoriesRequired: ["organizationId", "ids", "siteId"]
  • getCategory: ["organizationId", "id", "levels", "locale", "siteId"]
  • getCategoryRequired: ["organizationId", "id", "siteId"]
  • getProduct: ["organizationId", "id", "select", "inventoryIds", "currency", "expand", "locale", "allImages", "perPricebook", "siteId"]
  • getProductRequired: ["organizationId", "id", "siteId"]
  • getProducts: ["organizationId", "select", "ids", "inventoryIds", "currency", "expand", "locale", "allImages", "perPricebook", "siteId"]
  • getProductsRequired: ["organizationId", "ids", "siteId"]

Methods

getCategories

  • 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ ids: string; levels?: undefined | number; locale?: undefined | string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<CategoryResult>

    A promise of type 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ ids: string; levels?: undefined | number; locale?: undefined | string; organizationId: 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 : CategoryResult>

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

getCategory

  • getCategory(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ id: string; levels?: undefined | number; locale?: undefined | string; organizationId: string; siteId: string } & {}, ConfigParameters> }>): Promise<Category>
  • getCategory<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ id: string; levels?: undefined | number; locale?: undefined | string; organizationId: string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ id: string; levels?: undefined | number; locale?: undefined | string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<Category>

    A promise of type 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ id: string; levels?: undefined | number; locale?: undefined | string; organizationId: 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 : Category>

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

getProduct

  • getProduct(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; id: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: undefined | string; siteId: string } & {}, ConfigParameters> }>): Promise<Product>
  • getProduct<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; id: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: undefined | string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; id: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: undefined | string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<Product>

    A promise of type 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; id: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: 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 : Product>

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

getProducts

  • getProducts(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; ids: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: undefined | string; siteId: string } & {}, ConfigParameters> }>): Promise<ProductResult>
  • getProducts<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; ids: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: undefined | string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; ids: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: undefined | string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<ProductResult>

    A promise of type 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: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ allImages?: undefined | false | true; currency?: undefined | string; expand?: Array<string>; ids: string; inventoryIds?: undefined | string; locale?: undefined | string; organizationId: string; perPricebook?: undefined | false | true; select?: 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 : ProductResult>

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

Generated using TypeDoc