---
schema_version: "1"
id: bdeb9ebed9a267daf80ffd59373f6a4c37770240e49fd7cafccaec6e6145ea12
title: Shop Stores (deprecated)
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/commerce-cloud/b2c-commerce/references/generated-api-specs/ocapi-shop-stores.md
canonical_url: https://developer.salesforce.com/docs/commerce/b2c-commerce/references/ocapi-shop-stores
source_site: developer.salesforce.com
content_type: documentation
content_hash: 32c53a2c4eb48151d7e886afbf04b1a46c0dde016efba70544357dac4246bdcc
products:
  - B2C Commerce
  - Salesforce APIs
---
Shop Stores (deprecated)

# Shop Stores (deprecated)

The Shop API endpoints enable developers to build full shopper-experience applications such as storefronts. They are designed for high-scale usage, and include a number of areas such as Baskets & Orders, Customers, Products and Pricing. Shop API endpoints are typically read-only APIs, with the exception of baskets and orders.

**Version:** 25.6

## Servers

*   `https://{host}/s/{siteId}/dw/shop/v25_6`

Protocols: https.

## Security

*   `customers_auth` (basic) User authentication either for a registered or a guest customer (selectable in request body). Access via Base64 encoded customer:password string as 'Authorization: Basic' header.
*   `oauth2_application` (oauth2) Authentication flow with client ID and password with account manager.
    *   OAuth flow application (tokenUrl: https://account.demandware.com:443/dwsso/oauth2/access\_token)
    *   Scope x-info: Scopes are NOT supported. This is just a dummy, because the 'scopes' field is required.
*   `client_id` (apiKey) Add client ID for application identification. Alternative as 'client\_id' query parameter.
    *   API key in header: x-dw-client-id

## Operations

### GET Get nearest stores

`GET /stores`

Operation ID: `Get nearest stores`. Tags: stores. Security: client\_id; customers\_auth.

This resource retrieves a list of stores, for the given site, that are within a configured distance of a location on the earth. The stores and their distance from the specified location are returned as a result set of Store objects. The distance is interpreted either in miles or kilometers depending on the distance\_unit input parameter.

The location can be specified by either directly providing a latitude/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 will return an empty list of stores.
    
*   If coordinates are passed, the values for country and postal code are ignored.
    

This endpoint may return the following faults:

*   400 - MalformedDistanceUnitException - Invalid distance\_unit given.
*   400 - MissingCoordinatesException - Thrown if only one of latitude or longitude are provided.
*   400 - MissingCountryCodeException - Thrown if no coordinates (latitude and longitude) are provided and in addition no country code is given.
*   400 - MissingPostalCodeException - Thrown if no coordinates (latitude and longitude) are provided and in addition no postal code is given..

#### Parameters

*   `latitude` (query, number (double)) The geo coordinate latitude to search for stores (value range -90.00 .. 90.00).  
    Minimum: -90. Maximum: 90.
*   `longitude` (query, number (double)) The geo coordinate longitude to search for stores (value range -180.00 .. 180.00).  
    Minimum: -180. Maximum: 180.
*   `country_code` (query, string) The two letter ISO country code e.g. "US".  
    Minimum length: 2. Maximum length: 2.
*   `postal_code` (query, string) The postal code e.g. "01801".  
    Minimum length: 3. Maximum length: 10.
*   `distance_unit` (query, string) The distance unit. Supported values are "mi" and "km" (for miles and kilometers respectively, default is "km").
*   `max_distance` (query, number (double)) The area (radius) in distancUnit where stores will be searched for (default is half of the earth's perimeter).  
    Minimum: 0. Maximum: 20012.
*   `start` (query, integer (int32)) The result set index to return the first instance for. Default value is 0.  
    Minimum: 0.
*   `count` (query, integer (int32)) The maximum number of instances per request. Default value is 25.  
    Minimum: 1. Maximum: 200.

#### Responses

*   **400** `MalformedDistanceUnitException` - Invalid distance\_unit given. or `MissingCoordinatesException` - Thrown if only one of latitude or longitude are provided. or `MissingCountryCodeException` - Thrown if no coordinates (latitude and longitude) are provided and in addition no country code is given. or `MissingPostalCodeException` - Thrown if no coordinates (latitude and longitude) are provided and in addition no postal code is given..
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `store_result`.
    

### GET Get multiple stores

`GET /stores/({ids})`

Operation ID: `Get multiple stores`. Tags: stores. Security: client\_id; customers\_auth.

To access multiple stores, you construct a URL using the template shown below. This template requires you to specify a store id. In the response, the server returns a corresponding store document.

#### Parameters

*   `ids` (path, array of string, required) The ids of the requested stores.  
    Maximum length: 256.

#### Responses

*   **default**
    
    Media type: `application/json, text/xml`. Schema: `store_result`.
    

### GET Get store

`GET /stores/{id}`

Operation ID: `Get store`. Tags: stores. Security: client\_id; customers\_auth.

To access a store, you construct a URL using the template shown below. This template requires you to specify a store id. In the response, the server returns a corresponding store document.

This endpoint may return the following faults:

*   404 - StoreNotFoundException - Thrown if the requested store was not found

#### Parameters

*   `id` (path, string, required) The id of the requested store.  
    Maximum length: 256.

#### Responses

*   **404** `StoreNotFoundException` - Thrown if the requested store was not found
    
    Media type: `application/json, text/xml`. Schema: `fault`.
    
*   **default**
    
    Media type: `application/json, text/xml`. Schema: `store`.
    

## Schemas

### fault

Document representing a fault message that is returned whenever the HTTP status code is greater than or equal to 400 (which indicates an error).

*   `arguments` (_object_)
    
    A map that provides fault arguments.
    
    Data can be used to provide error messages on the client side.
    
    Additional properties: `object`.
    
*   `cause` (_cause_)
*   `display_message_pattern` (_string_) The localized display message pattern, if the request parameter display\_locale was given
*   `message` (_string_) The message text of the java exception.
*   `stack_trace` (_string_)
*   `type` (_string_) The name of the java exception.

### store\_result

Result document containing an array of stores.

*   `count` (_integer (int32)_) The number of search results in the current page.
*   `data` (_array of store_)
*   `next` (_string_) The URL of the next result page.
*   `previous` (_string_) The URL of the previous result page.
*   `start` (_integer (int32)_) The zero-based index of the first search result to include in the document.  
    Minimum: 0.
*   `total` (_integer (int32)_) The total number of search results.

_Example_

```
{
  "count": 4,
  "data": [
    {
      "address1": "333 Washington St",
      "city": "Boston",
      "country_code": "US",
      "distance": 0,
      "distance_unit": "mi",
      "email": "contact@downtowntvshop.com",
      "id": "store10",
      "name": "Downtown TV Shop",
      "phone": "+1-617-695-1565",
      "pos_enabled": false,
      "postal_code": "02108",
      "state_code": "MA",
      "store_locator_enabled": true
    },
    {
      "address1": "1001 Cambridge St",
      "city": "Cambridge",
      "country_code": "US",
      "distance": 1.41,
      "distance_unit": "mi",
      "email": "store4@company.com",
      "id": "store4",
      "name": "Champaign Electronic Shop",
      "phone": "+1-617-714-2640",
      "pos_enabled": false,
      "postal_code": "02141",
      "state_code": "MA",
      "store_locator_enabled": true
    },
    {
      "address1": "584 Columbus Ave",
      "city": "Boston",
      "country_code": "US",
      "distance": 1.94,
      "distance_unit": "mi",
      "id": "store5",
      "name": "Short Electro",
      "phone": "+1-617-888-7276",
      "pos_enabled": false,
      "postal_code": "02118",
      "state_code": "MA",
      "store_locator_enabled": true
    },
    {
      "address1": "363 Hancock St",
      "city": "North Quincy",
      "country_code": "US",
      "distance": 6.56,
      "distance_unit": "mi",
      "email": "store3@company.com",
      "id": "store3",
      "name": "Wire-Wire",
      "phone": "+1-617-318-2860",
      "pos_enabled": false,
      "postal_code": "02171",
      "state_code": "MA",
      "store_locator_enabled": true
    }
  ],
  "next": "http://example.com/dw/shop/{version}/stores?count=4&start=4&country_code=US&postal_code=02108&distance_unit=mi&max_distance=10.00",
  "start": 0,
  "total": 8
}
```

### store

Document representing a store.

*   `address1` (_string_) The first address of the store.  
    Minimum length: 1.
*   `address2` (_string_) The second address of the store.
*   `city` (_string_) The city of the store.
*   `country_code` (_string_) The country code of the store.  
    Allowed values: `CA`, `DE`, `US`. Value meanings: `CA`: Canada; `DE`: Germany; `US`: United States.
*   `distance` (_number (double)_) The distance to the given geo location in the unit of attribute distance (miles or kilometers).
*   `distance_unit` (_string_) The distance unit the distance attribute is measured in (either in miles or kilometers).
*   `email` (_string_) The email address of the store.
*   `fax` (_string_) The fax number of the store.
*   `id` (_string_, required) The id of the store.  
    Minimum length: 1. Maximum length: 256.
*   `image` (_string_) The store image.
*   `inventory_id` (_string_) The inventory list id associated with this store.  
    Maximum length: 256.
*   `latitude` (_number (double)_) The latitude of the store.  
    Minimum: -90. Maximum: 90.
*   `longitude` (_number (double)_) The longitude of the store.  
    Minimum: -180. Maximum: 180.
*   `name` (_string_) The store name.
*   `phone` (_string_) The phone number of the store.
*   `pos_enabled` (_boolean_) Whether this store uses Store Point-of-Sale.
*   `postal_code` (_string_) The postal code of the store.
*   `state_code` (_string_) The state code of the store.
*   `store_events` (_string (html)_) The store events.
*   `store_hours` (_string (html)_) The store opening hours.
*   `store_locator_enabled` (_boolean_) Whether this store should show up in store locator results.

_Example_

```
{
  "address1": "333 Washington St",
  "city": "Boston",
  "country_code": "US",
  "email": "contact@downtowntvshop.com",
  "id": "ma-bos-dt",
  "name": "Downtown TV Shop",
  "phone": "+1-617-695-1565",
  "pos_enabled": false,
  "postal_code": "02108",
  "state_code": "MA",
  "store_locator_enabled": true
}
```

### cause

*   `cause` (_cause_)
*   `message` (_string_)
*   `type` (_string_)