Stores Resource (Data API 16.2)

Summary

Http Method Resource Description
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 Store

Action to get store information.

Url

GET https://hostname:port/dw/data/v16_2/sites/{site_id}/stores/{id}?select={String}

Formats

json, xml

Response Document

Store

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/v16_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
ETag: 43c2d7a118bd0a4034399ed86c86654b40c198ea64fd3195e5587d9211d10d7e
{
   "_v" : "16.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": "01803",
   "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/v16_2/sites/SiteGenesis/stores/my-store"
}

Update Store

Updates the store with the specified information.

Url

PATCH https://hostname:port/dw/data/v16_2/sites/{site_id}/stores/{id}

Formats

json, xml

Request Document

Store

Response Document

Store

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

Header Parameters

Parameter Type Description Constraints
If-Match String    

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/v16_2/sites/SiteGenesis/stores/my-store HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
If-Match: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5

{
  "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
ETag: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
   "_v" : "16.2",
   "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": "01803",
   "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/v16_2/sites/SiteGenesis/stores/my-store"
}

# 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":"16.2",
  "fault":{
    "type":"StoreNotFoundException",
    "message":"No store with id 'my-store' found."
  }
}

Delete Stores

Deletes the store by ID

Url

DELETE https://hostname:port/dw/data/v16_2/sites/{site_id}/stores/{id}

Formats

json, xml

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/v16_2/sites/SiteGenesis/stores/my-store HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367

# 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/v16_2/sites/{site_id}/stores/{id}

Formats

json, xml

Request Document

Store

Response Document

Store

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/v16_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": "01803",
   "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"
}

# in case of success:

RESPONSE:
HTTP/1.1 201 CREATED
Location: https://example.com/s/-/dw/data/v16_2/sites/SiteGenesis/stores/my-store
Content-Length: 67
Content-Type: application/json; charset=UTF-8
ETag: 860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5
{
   "_v" : "16.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": "01803",
   "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/v16_2/sites/SiteGenesis/stores/my-store"
}