Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperStores<ConfigParameters>

Search for a specific store or stores in an area.

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: 1.0.15
Last Updated:
beta

Type parameters

Hierarchy

  • ShopperStores

Index

Constructors

constructor

Properties

clientConfig

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

Static Readonly defaultBaseUri

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

Static Readonly paramKeys

paramKeys: { getStores: ["organizationId", "siteId", "ids", "locale"]; getStoresRequired: ["organizationId", "siteId", "ids"]; searchStores: ["organizationId", "countryCode", "distanceUnit", "latitude", "longitude", "maxDistance", "postalCode", "siteId", "locale", "offset", "limit"]; searchStoresRequired: ["organizationId", "siteId"] } = {searchStores: ['organizationId','countryCode','distanceUnit','latitude','longitude','maxDistance','postalCode','siteId','locale','offset','limit',],searchStoresRequired: ['organizationId','siteId',],getStores: ['organizationId','siteId','ids','locale',],getStoresRequired: ['organizationId','siteId','ids',],} as const

Type declaration

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

Methods

getStores

  • Returns stores identified by the IDs provided as input.

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

    beta

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ ids: string; locale?: undefined | string; organizationId: string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<StoreResult>

    A promise of type StoreResult.

  • Returns stores identified by the IDs provided as input.

    beta

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ ids: string; 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 : StoreResult>

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

searchStores

  • searchStores(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ countryCode?: undefined | string; distanceUnit?: undefined | string; latitude?: undefined | number; limit?: undefined | number; locale?: undefined | string; longitude?: undefined | number; maxDistance?: undefined | number; offset?: any; organizationId: string; postalCode?: undefined | string; siteId: string } & {}, ConfigParameters> }>): Promise<StoreResult>
  • searchStores<T>(options?: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ countryCode?: undefined | string; distanceUnit?: undefined | string; latitude?: undefined | number; limit?: undefined | number; locale?: undefined | string; longitude?: undefined | number; maxDistance?: undefined | number; offset?: any; organizationId: string; postalCode?: undefined | string; siteId: string } & {}, ConfigParameters> }>, rawResponse?: T): Promise<T extends true ? Response : StoreResult>
  • This resource retrieves a list of stores for the given site that are within a configured distance of a geolocation:

    • 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.

    beta

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ countryCode?: undefined | string; distanceUnit?: undefined | string; latitude?: undefined | number; limit?: undefined | number; locale?: undefined | string; longitude?: undefined | number; maxDistance?: undefined | number; offset?: any; organizationId: string; postalCode?: undefined | string; siteId: string } & {}, ConfigParameters> }>

      An object containing the options for this method.

    Returns Promise<StoreResult>

    A promise of type StoreResult.

  • This resource retrieves a list of stores for the given site that are within a configured distance of a geolocation:

    • 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.
    beta

    Type parameters

    • T: boolean

    Parameters

    • Optional options: RequireParametersUnlessAllAreOptional<{ headers?: undefined | {}; parameters?: CompositeParameters<{ countryCode?: undefined | string; distanceUnit?: undefined | string; latitude?: undefined | number; limit?: undefined | number; locale?: undefined | string; longitude?: undefined | number; maxDistance?: undefined | number; offset?: any; organizationId: string; postalCode?: 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 : StoreResult>

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

Generated using TypeDoc