Context
The store context contains information about available languages and sales markets. Fetch it to see their codes and identifiers, the default language and the base market. You’ll use this information when choosing a language or market in subsequent requests.
- languages
- The languages available in the store and their codes.
- markets
- The sales markets, their identifiers and currencies.
- default_locale
- Store's default language code.
- base_market_id
- Identifier of the store's base market.
Get context
This request requires an access token.
GET
/api/v1/contextcURL request
curl --disable --globoff --fail-with-body --silent --show-error \
--proto '=https' --connect-timeout 5 --max-time 30 \
--request GET \
--url https://shop.onshopently.com/api/v1/context \
--header 'Authorization: Bearer EXAMPLE_ACCESS_TOKEN'
Response
{
"data": {
"base_market_id": "example",
"default_locale": "en",
"global_enabled": false,
"languages": [
{
"code": "en",
"direction": "ltr",
"is_default": true,
"name": "English",
"native_name": "English",
"status": "draft"
}
],
"markets": [
{
"code": "PL",
"currency": {
"code": "PLN",
"minor_units": 2
},
"id": "example",
"is_default": true,
"name": "Poland",
"price_list": null,
"status": "draft"
}
],
"multilingual_enabled": false
},
"meta": {
"locale": "en",
"market_code": "PL",
"market_id": "example",
"request_id": "example"
}
}
Choosing a language
When fetching content from the store, choose the language you want to receive it in. You’ll find its code in the response to the context request.
You choose the language and market separately. Selecting German does not automatically select the German market.