Multimarket | Context Passing from FE

In order to return correct data in a search, collection or recommendation, the correct context needs to be passed to Merchandising Cloud in the request.

Here is a request sample for search-api, the multi-market part is context where locale region currency should be provided and if not the code will fallback to the default values for these fields.


{
  "user": {
    "lang": ["en-GB"],
    "uid": "test1",
    "sid": "ssid",
    "email": "[email protected]",
    "ip": "192.168.0.1",
    "ua": "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
  },
  "q": "TESTQUERY",
  "t_client": 1484742065791,
  "filters": [
    {
      "name": "category1",
      "type": "category",
      "values": [{ "value": "TEST CATEGORY" }]
    }
  ],
  "rules": [
    {
      "action": "top",
      "name": "brand",
      "type": "text",
      "values": [{ "value": "TEST BRAND" }]
    }
  ],
  "sort": [{ "field": "price", "order": "desc" }],
  "offset": 0,
  "limit": 20,
  "log": false,
  "context": { "locale": "en", "region": "SE", "currency": "SEK" }
}