StoreSearch resource (Data API 19.5)

Summary

Http Method Resource Description
POST /sites/{site_id}/store_search

Searches for stores.

The query attribute specifies a complex query that can be used to narrow down the search. This is the list of searchable attributes:

  • address1 - String
  • address2 - String
  • city - String
  • country_code - String
  • email - String
  • fax - String
  • id - String
  • inventory_id - String
  • latitude - double
  • longitude - double
  • name - String
  • phone - String
  • postal_code - String
  • state_code - String
  • store_hours - String
  • store_events - String

Search Stores

Searches for stores.

The query attribute specifies a complex query that can be used to narrow down the search. This is the list of searchable attributes:

Url

POST https://hostname:port/dw/data/v19_5/sites/{site_id}/store_search

Formats

json, xml

Authentication

Name Description
OAuth Authentication via OAuth token.

Request Document

SearchRequest

Response Document

StoreSearchResult

Path Parameters

Parameter Type Description Constraints
site_id String The site context.  

In case of a failure Fault Document is returned.

Faults

Status Type Arguments Description
400 MalformedSearchParameterException   Thrown if the query is ill-formed.

Sample

REQUEST:
POST /s/-/dw/data/v19_5/sites/MySite/store_search HTTP/1.1
Host: example.com
Authorization: Bearer a5b6eb0d-8312-41a3-88f3-2c53c4507367
Accept: application/json

{
    "query" : {
        "text_query": {
            "field": ["id", "description"],
            "search_phrase": "my"
        }
    },
    "select" : "(**)"
}

RESPONSE:
HTTP/1.1 200 OK
Content-Length: 67
Content-Type: application/json; charset=UTF-8

{
  "_v" : "19.5",
  "count" : 2,
  "hits" : [
    {
       "_resource_state" : "860cde3040519cce439cd99e209f8a87c3ad0b7e2813edbf6f5501f763b73bd5",
       "id" : "my-store1",
       "description" : "description for store 1.",
       "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",
       "link": "https://example.com/s/-/dw/data/v19_5/sites/SiteGenesis/stores/my-store1"
    },
    {
       "_resource_state" : "045f07bb655171dc37d8eb8bf4b0db7ac1fb3a160002eb96fbe6e2f95aa4b6cc",
       "id" : "my-store2",
       "description" : "description for store 2.",
       "address1": "555 Wall St",
       "city": "New York",
       "email": "[email protected]",
       "country_code": "us",
       "phone": ">1 (888) 555 1212",
       "postal_code": "10001",
       "state_code": "NY",
       "link": "https://example.com/s/-/dw/data/v19_5/sites/SiteGenesis/stores/my-store2"
    }
  ],
  "query" : { "text_query": { "fields": ["id", "description"], "search_phrase": "my" } },
  "select": "**",
  "start" : 0,
  "total" : 2
}