Stores resource (Data API 23.2)
Summary
| Http Method | Resource | Description | 
|---|---|---|
| GET | /sites/{site_id}/stores | Action to get all the stores with no filtering. | 
| GET | /sites/{site_id}/stores/{id} | Action to get store information. | 
| PATCH | /sites/{site_id}/stores/{id} | Updates the store with the specified information. | 
| DELETE | /sites/{site_id}/stores/{id} | Deletes the store by ID | 
| PUT | /sites/{site_id}/stores/{id} | Creates a store using the information provided. | 
Get Stores
Action to get all the stores with no filtering.Url
GET https://hostname:port/dw/data/v23_2/sites/{site_id}/stores?start={Integer}&count={Integer}&select={String}
Formats
json, xml
Authentication
| Name | Description | 
|---|---|
| OAuth | Authentication via OAuth token. | 
Response Document
Path Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| site_id | String | minLength=1 | 
Query Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| count | Integer | Optional count for retrieving only a subset of the items (default is 25). | |
| select | String | The property selector. | |
| start | Integer | Optional start index for retrieving the items from a given index (default 0). | 
Sample
REQUEST:
GET  /s/-/dw/data/v23_2/sites/SiteGenesis/stores?select=(**) HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
# in case of success:
 
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
  "_v" : "23.2",
  "count" : 2,
  "data" : [
    {
        "_v" : "23.2",
        "id" : "my-store",
        "inventory_id": "inventoryListA",
        "address1": "5 Wall St",
        "address2": "2nd Floor",
        "city": "Burlington",
        "email": "[email protected]",
        "country_code": "us",
        "phone": "877-540-3032",
        "postal_code": "01827",
        "state_code": "MA",
        "longitude": "-71.18822",
        "latitude": "42.487796",
        "fax": "877-540-3035",
        "image" : "http://example.com/on/demandware.static/-/Sites/default/v1437070303037/store99.jpg",
        "store_events" :
        {
          "default" : "50% off Sale"
        },
        "store_hours" :
        {
          "default" : "09:00 am - 06:00 pm"
        },
        "link": "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store",
        "store_locator_enabled": true,
        "demandware_pos_enabled": false
    },
    {
        "_v" : "23.2",
        "id" : "my-store2",
        "address1": "100 Mall Rd",
        "city": "Burlington",
        "email": "[email protected]",
        "country_code": "us",
        "phone": "555-555-1212",
        "postal_code": "01827",
        "state_code": "MA",
        "longitude": "-71.000000",
        "latitude": "42.000000",
        "fax": "555-555-1213",
        "link": "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store2",
        "store_locator_enabled": true,
        "demandware_pos_enabled": false
    }],
    "select": "**",
    "start" : 0,
    "total" : 2
}
Get Store
Action to get store information.Url
GET https://hostname:port/dw/data/v23_2/sites/{site_id}/stores/{id}?select={String}
Formats
json, xml
Authentication
| Name | Description | 
|---|---|
| OAuth | Authentication via OAuth token. | 
Response Document
Path Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| id | String | The id of the requested store. | maxLength=256, minLength=1 | 
| site_id | String | The site context. | minLength=1 | 
Query Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| select | String | the selector for the get. If not passed, then the defaultSelector will be used instead. | 
In case of a failure Fault Document is returned.
Faults
| Status | Type | Arguments | Description | 
|---|---|---|---|
| 404 | StoreNotFoundException | 
 storeId (String) siteId (String)  | 
Thrown in case the store does not exist matching the given id | 
Sample
REQUEST:
GET  /s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Content-Type: application/json; charset=UTF-8
# in case of success:
 
RESPONSE:
HTTP/1.1 200 OK
Expires: Thu, 01-Aug-2014 00:00:00 GMT
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "id" : "my-store",
   "inventory_id": "inventoryListA",
   "address1": "5 Wall St",
   "address2": "2nd Floor",
   "city": "Burlington",
   "email": "[email protected]",
   "country_code": "us",
   "phone": "877-540-3032",
   "postal_code": "01827",
   "state_code": "MA",
   "longitude": "-71.18822",
   "latitude": "42.487796",
   "fax": "877-540-3035",
   "image" : "http://example.com/on/demandware.static/-/Sites/default/v1437070303037/store99.jpg",
   "store_events" :
   {
       "default" : "50% off Sale"
   },
   "store_hours" :
   {
       "default" : "09:00 am - 06:00 pm"
   },
   "link": "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store",
   "store_locator_enabled": true,
   "pos_enabled": false
}
Update Store
Updates the store with the specified information.Url
PATCH https://hostname:port/dw/data/v23_2/sites/{site_id}/stores/{id}
Formats
json, xml
Authentication
| Name | Description | 
|---|---|
| OAuth | Authentication via OAuth token. | 
Request Document
Response Document
Path Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| id | String | The id of the requested store. | maxLength=256, minLength=1 | 
| site_id | String | The site context. | minLength=1 | 
In case of a failure Fault Document is returned.
Faults
| Status | Type | Arguments | Description | 
|---|---|---|---|
| 404 | StoreNotFoundException | 
 storeId (String) siteId (String)  | 
Thrown in case the store does not exist matching the given id | 
Sample
REQUEST:
PATCH  /s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
  "_resource_state" : "847f9c3c5867f641470b3046aeec31f07757991b792d722e10079926f7a289fb",
  "address1":"10 Van De Graff Ln",
  "address2":"5th Floor"
}
# in case of success:
RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "id" : "my-store",
   "inventory_id": "inventoryListA",
   "address1": "10 Van De Graff Ln",
   "address2": "5th Floor",
   "city": "Burlington",
   "email": "[email protected]",
   "country_code": "us",
   "phone": "877-540-3032",
   "postal_code": "01827",
   "state_code": "MA",
   "longitude": "-71.18822",
   "latitude": "42.487796",
   "fax": "877-540-3035",
   "image" : "http://example.com/on/demandware.static/-/Sites/default/v1437070303037/store99.jpg",
   "store_events" :
   {
       "default" : "50% off Sale"
   },
   "store_hours" :
   {
       "default" : "09:00 am - 06:00 pm"
   },
   "link": "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store",
   "store_locator_enabled": true,
   "pos_enabled": false
}
# in case of failure:
RESPONSE:
HTTP/1.1 404 Not Found
Content-Type: application/json;charset=UTF-8
Cache-Control: max-age=0,no-cache,no-store,must-revalidate
{
  "_v" : "23.2",
  "fault":{
    "type":"StoreNotFoundException",
    "message":"No store with ID 'my-store' was found."
  }
}
Delete Stores
Deletes the store by IDUrl
DELETE https://hostname:port/dw/data/v23_2/sites/{site_id}/stores/{id}
Formats
json, xml
Authentication
| Name | Description | 
|---|---|
| OAuth | Authentication via OAuth token. | 
Path Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| id | String | One store id to remove | maxLength=256, minLength=1 | 
| site_id | String | The site context. | minLength=1 | 
In case of a failure Fault Document is returned.
Faults
| Status | Type | Arguments | Description | 
|---|---|---|---|
| 404 | StoreNotFoundException | 
 storeId (String) siteId (String)  | 
Thrown in case the store does not exist matching the given id | 
Sample
REQUEST:
DELETE /s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
x-dw-resource-state: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
# in case of success:
RESPONSE:
HTTP/1.1 204 No Content
Create Store
Creates a store using the information provided.Url
PUT https://hostname:port/dw/data/v23_2/sites/{site_id}/stores/{id}
Formats
json, xml
Authentication
| Name | Description | 
|---|---|
| OAuth | Authentication via OAuth token. | 
Request Document
Response Document
Path Parameters
| Parameter | Type | Description | Constraints | 
|---|---|---|---|
| id | String | The id of the store to create. | maxLength=256, minLength=1 | 
| site_id | String | The site context. | minLength=1 | 
In case of a failure Fault Document is returned.
Faults
| Status | Type | Arguments | Description | 
|---|---|---|---|
| 400 | IdConflictException | 
 bodyID (String) urlID (String)  | 
if the Id in request is not the same as the ID in document. | 
Sample
REQUEST:
PUT /s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
{
   "inventory_id": "inventoryListA",
   "address1": "5 Wall St",
   "address2": "2nd Floor",
   "city": "Burlington",
   "email": "[email protected]",
   "country_code": "us",
   "phone": "877-540-3032",
   "postal_code": "01827",
   "state_code": "MA",
   "longitude": "-71.18822",
   "latitude": "42.487796",
   "image" : "http://example.com/on/demandware.static/-/Sites/default/v1437070303037/store99.jpg",
   "store_events" :
   {
       "default" : "50% off Sale"
   },
   "store_hours" :
   {
       "default" : "09:00 am - 06:00 pm"
   },
   "fax": "877-540-3035",
   "store_locator_enabled": true,
   "pos_enabled": false
}
# in case of success:
RESPONSE:
HTTP/1.1 201 CREATED
Location: https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store
Content-Length: 67
Content-Type: application/json; charset=UTF-8
{
   "_v" : "23.2",
   "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
   "id" : "my-store",
   "inventory_id": "inventoryListA",
   "address1": "5 Wall St",
   "address2": "2nd Floor",
   "city": "Burlington",
   "email": "[email protected]",
   "country_code": "us",
   "phone": "877-540-3032",
   "postal_code": "01827",
   "state_code": "MA",
   "longitude": "-71.18822",
   "latitude": "42.487796",
   "fax": "877-540-3035",
   "image" : "http://example.com/on/demandware.static/-/Sites/default/v1437070303037/store99.jpg",
   "store_events" :
   {
       "default" : "50% off Sale"
   },
   "store_hours" :
   {
       "default" : "09:00 am - 06:00 pm"
   },
   "link": "https://example.com/s/-/dw/data/v23_2/sites/SiteGenesis/stores/my-store",
   "store_locator_enabled": true,
   "pos_enabled": false
}
X
OCAPI versions 15.x and 16.x will be retired on March 31, 2021. For dates and more information, see the OCAPI versioning and deprecation policy and this Knowledge Article.