Class ShopperStores<ConfigParameters>

Shopper Stores

*# API Overview

Provides access to stores via search or ID lookup.

Authentication & Authorization

The Shopper Stores API requires a shopper access token from the Shopper Login and API Access Service (SLAS).

You must include the relevant scope(s) in the client ID used to generate the SLAS token. For details, see Authorization Scopes Catalog.*

Simple example:

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

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

Type Parameters

Hierarchy

  • ShopperStores

Constructors

Methods

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

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in string | number]: (Omit<{
                  ids: string;
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              } & QueryParameters, keyof ConfigParameters> & Partial<{
                  ids: string;
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              } & QueryParameters>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<StoreResult>

    A promise of type StoreResult.

  • Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in string | number]: (Omit<{
                  ids: string;
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              } & QueryParameters, keyof ConfigParameters> & Partial<{
                  ids: string;
                  locale?: string;
                  organizationId: string;
                  siteId: string;
              } & QueryParameters>)[K]
          };
      }>

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

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

    • The distance is interpreted either in miles or kilometers, depending on the distanceUnit input parameter.
    • The location is specified by either directly providing a latitude and longitude coordinate pair, or by providing a country and a postal code. If a postal code is passed, the resource looks in the system's geolocation mappings in Business Manager to find the coordinates for this postal code. If no matching geolocation is found, the resource returns an empty list of stores. If coordinates are passed, the values for country and postal code are ignored.

    To verify site latitude and longitude information in Business Manager:

    • Navigate to Merchant Tools -> Online Marketing -> Stores.
    • Select the applicable site.
    • In the Address tab, verify that valid information is provided in the following fields: Address, City, Postal Code, State, and Country. For latitude and longitude values, you can manually enter values or provide all field values to auto-populate Latitude and Longitude. You must provide valid values for all of the previous fields for latitude and longitude to auto-populate Latitude and Longitude values.

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

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in string | number]: (Omit<{
                  countryCode?: string;
                  distanceUnit?: DistanceUnit;
                  latitude?: number;
                  limit?: number;
                  locale?: string;
                  longitude?: number;
                  maxDistance?: number;
                  offset?: number;
                  organizationId: string;
                  postalCode?: string;
                  siteId: string;
              } & QueryParameters, keyof ConfigParameters> & Partial<{
                  countryCode?: string;
                  distanceUnit?: DistanceUnit;
                  latitude?: number;
                  limit?: number;
                  locale?: string;
                  longitude?: number;
                  maxDistance?: number;
                  offset?: number;
                  organizationId: string;
                  postalCode?: string;
                  siteId: string;
              } & QueryParameters>)[K]
          };
      }>

      An object containing the options for this method.

    Returns Promise<Stores>

    A promise of type Stores.

    • The distance is interpreted either in miles or kilometers, depending on the distanceUnit input parameter.
    • The location is specified by either directly providing a latitude and longitude coordinate pair, or by providing a country and a postal code. If a postal code is passed, the resource looks in the system's geolocation mappings in Business Manager to find the coordinates for this postal code. If no matching geolocation is found, the resource returns an empty list of stores. If coordinates are passed, the values for country and postal code are ignored.

    To verify site latitude and longitude information in Business Manager:

    • Navigate to Merchant Tools -> Online Marketing -> Stores.
    • Select the applicable site.
    • In the Address tab, verify that valid information is provided in the following fields: Address, City, Postal Code, State, and Country. For latitude and longitude values, you can manually enter values or provide all field values to auto-populate Latitude and Longitude. You must provide valid values for all of the previous fields for latitude and longitude to auto-populate Latitude and Longitude values.

    Type Parameters

    • T extends boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              [K in string | number]: (Omit<{
                  countryCode?: string;
                  distanceUnit?: DistanceUnit;
                  latitude?: number;
                  limit?: number;
                  locale?: string;
                  longitude?: number;
                  maxDistance?: number;
                  offset?: number;
                  organizationId: string;
                  postalCode?: string;
                  siteId: string;
              } & QueryParameters, keyof ConfigParameters> & Partial<{
                  countryCode?: string;
                  distanceUnit?: DistanceUnit;
                  latitude?: number;
                  limit?: number;
                  locale?: string;
                  longitude?: number;
                  maxDistance?: number;
                  offset?: number;
                  organizationId: string;
                  postalCode?: string;
                  siteId: string;
              } & QueryParameters>)[K]
          };
      }>

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

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

Properties

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

Type declaration

  • baseUri: string
apiPaths: {
    getStores: string;
    searchStores: string;
}

Type declaration

  • getStores: string
  • searchStores: string
defaultBaseUri: "https://{shortCode}.api.commercecloud.salesforce.com/store/shopper-stores/v1" = "https://{shortCode}.api.commercecloud.salesforce.com/store/shopper-stores/v1"
paramKeys: {
    getStores: readonly ["organizationId", "ids", "siteId", "locale"];
    getStoresRequired: readonly ["organizationId", "ids", "siteId"];
    searchStores: readonly ["organizationId", "siteId", "countryCode", "distanceUnit", "latitude", "longitude", "maxDistance", "postalCode", "locale", "limit", "offset"];
    searchStoresRequired: readonly ["organizationId", "siteId"];
}

Type declaration

  • Readonly getStores: readonly ["organizationId", "ids", "siteId", "locale"]
  • Readonly getStoresRequired: readonly ["organizationId", "ids", "siteId"]
  • Readonly searchStores: readonly ["organizationId", "siteId", "countryCode", "distanceUnit", "latitude", "longitude", "maxDistance", "postalCode", "locale", "limit", "offset"]
  • Readonly searchStoresRequired: readonly ["organizationId", "siteId"]