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

    Parameters

    • apiOptions: NullableParameters<{
          headers?: {
              [key: string]: string;
          };
          parameters?: {
              countryCode?: string;
              distanceUnit?: DistanceUnit;
              latitude?: number;
              limit?: number;
              locale?: string;
              longitude?: number;
              maxDistance?: number;
              offset?: number;
              organizationId?: string;
              postalCode?: string;
              siteId?: string;
          };
      }>
    • queryOptions: ApiQueryOptions<{
          (options?): Promise<Stores>;
          <T>(options?, rawResponse?): Promise<T extends true
              ? Response
              : Stores>;
      }> = {}

    Returns UseQueryResult<Stores, unknown>

    A TanStack Query query hook with data from the Shopper Search productSearch endpoint.

    Parameter

    apiOptions - Options to pass through to commerce-sdk-isomorphic, with null accepted for unset API parameters.

    Parameter

    queryOptions - TanStack Query query options, with enabled by default set to check that all required API parameters have been set.

    See