Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ShopperStores

Search for a specific store or stores in an area.

Example with shopper auth

import { Seller, ClientConfig, Customer, slasHelpers } from "commerce-sdk";
// or
const { Seller, 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 shopperStoresClient = new Seller.ShopperStores(clientConfig);
API Version: 1.0.15
Last Updated:
beta

Hierarchy

  • BaseClient
    • ShopperStores

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 BoolFilter

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

Static BoolQuery

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

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 IntegerRangeFilter

IntegerRangeFilter: {}

Type declaration

Static L10nString

L10nString: {} & {}

Static LocaleSpecific

LocaleSpecific: {}

Type declaration

Static LocalizedString

LocalizedString: {} & {}

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 NumericRangeFilter

NumericRangeFilter: {}

Type declaration

Static OffsetPaginated

OffsetPaginated: {}

Type declaration

Static OpenObject

OpenObject: {} & {}

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 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: { field: string; from?: any; fromInclusive?: boolean; to?: any; toInclusive?: boolean } & {}

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

Store: { address1?: string; address2?: string; city?: string; countryCode?: string; distance?: number; distanceUnit?: string; email?: string; fax?: string; id: string; image?: string; inventoryId?: string; latitude?: number; longitude?: number; name?: string; phone?: string; posEnabled?: boolean; postalCode?: string; stateCode?: string; storeEvents?: string; storeHours?: string; storeLocatorEnabled?: boolean } & {}

Static StoreResult

StoreResult: { data: Array<Store>; limit: number; offset?: any; total: any } & {}

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

Constructors

constructor

  • Parameters

    • config: ClientConfig

    Returns ShopperStores

Properties

clientConfig

clientConfig: ClientConfig

Methods

getStores

  • getStores(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<StoreResult>
  • getStores<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; locale?: string; organizationId?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperStores.StoreResult>
  • 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: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; 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; locale?: string; organizationId?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<StoreResult>

    A promise of type ShopperStores.StoreResult.

  • Returns stores identified by the IDs provided as input.

    beta

    Type parameters

    • T: boolean

    Parameters

    • Optional options: { fetchOptions?: RequestInit; headers?: {}; parameters?: { ids: string; 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; 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 : ShopperStores.StoreResult>

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

searchStores

  • searchStores(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { countryCode?: string; distanceUnit?: string; latitude?: number; limit?: number; locale?: string; longitude?: number; maxDistance?: number; offset?: any; organizationId?: string; postalCode?: string; siteId?: string } & {}; retrySettings?: OperationOptions }): Promise<StoreResult>
  • searchStores<T>(options?: { fetchOptions?: RequestInit; headers?: {}; parameters?: { countryCode?: string; distanceUnit?: string; latitude?: number; limit?: number; locale?: string; longitude?: number; maxDistance?: number; offset?: any; organizationId?: string; postalCode?: string; siteId?: string } & {}; retrySettings?: OperationOptions }, rawResponse?: T): Promise<T extends true ? Response : ShopperStores.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: { fetchOptions?: RequestInit; headers?: {}; parameters?: { countryCode?: string; distanceUnit?: string; latitude?: number; limit?: number; locale?: string; longitude?: number; maxDistance?: number; offset?: any; organizationId?: string; postalCode?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { countryCode?: string; distanceUnit?: string; latitude?: number; limit?: number; locale?: string; longitude?: number; maxDistance?: number; offset?: any; organizationId?: string; postalCode?: string; siteId?: string } & {}
      • Optional retrySettings?: OperationOptions

    Returns Promise<StoreResult>

    A promise of type ShopperStores.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: { fetchOptions?: RequestInit; headers?: {}; parameters?: { countryCode?: string; distanceUnit?: string; latitude?: number; limit?: number; locale?: string; longitude?: number; maxDistance?: number; offset?: any; organizationId?: string; postalCode?: string; siteId?: string } & {}; retrySettings?: OperationOptions }

      An object containing the options for this method.

      • Optional fetchOptions?: RequestInit
      • Optional headers?: {}
        • [key: string]: string
      • Optional parameters?: { countryCode?: string; distanceUnit?: string; latitude?: number; limit?: number; locale?: string; longitude?: number; maxDistance?: number; offset?: any; organizationId?: string; postalCode?: 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 : ShopperStores.StoreResult>

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

Generated using TypeDoc