Get common data

Retrieve commonly used global data such as currencies and languages.

Request Parameters

🏷️ header · unmarked parameters are query params

ParameterTypeRequiredDescription
Locally-Api-Token 🏷️stringYesLocally API token must be passed in the header to authenticate the API consumer.

Example Request

curl 'https://www.locally.com/headless/api/1.0/conversion/common' \
--header 'Locally-Api-Token: {{API_TOKEN}}'
const response = await fetch('https://www.locally.com/headless/api/1.0/conversion/common', {
  headers: {
    'Locally-Api-Token': '{{API_TOKEN}}'
  }
});
const data = await response.json();
import requests

response = requests.get(
    'https://www.locally.com/headless/api/1.0/conversion/common',
    headers={'Locally-Api-Token': '{{API_TOKEN}}'}
)
data = response.json()

Example Response

{
  "success": true,
  "data": {
    "languages": {
      "en-us": {
        "name": "English",
        "level": 3
      },
      "fr-fr": {
        "name": "French",
        "level": 3
      },
      "de-at": {
        "name": "German (Austria)",
        "level": 0,
        "use": "de-de"
      }
    },
    "currencies": {
      "USD": {
        "name": "US Dollar",
        "symbol": "$",
        "group": "USD",
        "is_indexable": 1
      },
      "CAD": {
        "name": "Canadian Dollar",
        "symbol": "$",
        "group": "CAD",
        "is_indexable": 1
      },
      "EUR": {
        "name": "European Euro",
        "symbol": "€",
        "group": "EUR",
        "is_indexable": 1
      }
    },
    "countries": [
      {
        "name": "United States",
        "code": "US"
      },
      {
        "name": "Canada",
        "code": "CA"
      },
      {
        "name": "Germany",
        "code": "DE"
      }
    ],
    "us_ca_states": [
      {
        "code": "AL",
        "name": "Alabama"
      },
      {
        "code": "IL",
        "name": "Illinois"
      },
      {
        "code": "AB",
        "name": "Alberta"
      }
    ],
    "session": {
      "id": "abc999"
    }
  },
  "msg": ""
}

Response Explanation

  • success — Boolean outcome of the call. When false, the response also carries a top-level error_code and explanatory msg — always check success, not just the HTTP status.
  • data.languages — Supported locales keyed by language-region code. level is the support tier: 0 mirror-only, 1 basic store locator, 2 adds stock and catalog support, 3 full site support.
  • data.languages.de-at.use — Present only on level-0 mirrored locales: the locale whose content is actually served (requests for de-at render de-de content).
  • data.currencies — Keyed by currency code; country variants like EUR-AT share their parent group (EUR). symbol is for display and is not unique — USD and CAD both use $.
  • data.currencies.USD.is_indexable1 when product prices in this currency are indexed for product search. Booleans are serialized as 1/0 integers throughout the Headless API.
  • data.us_ca_states — A single list covering both US states and Canadian provinces (Alberta appears alongside Alabama); code is the two-letter abbreviation used in store addresses.
  • data.session.id — Locally session ID, returned on every response. Replay it via the Locally-Api-Session-Id header to persist the shopper's session between calls; expired IDs are transparently replaced with fresh ones.
  • msg — Human-readable error text; empty string on success. In production, unexpected server errors are masked as App server error with a lookup reference — see Handling Errors in Production.
Headers
string
required

Locally API token must be passed in the header to authenticate the API consumer

Responses
200

Successful

400

Bad Request

401

Unauthorized

402

Request Failed

403

Forbidden

404

Not Found

429

Too Many Requests

500

Server Error

Language
LoadingLoading…
Response
Click Try It! to start a request and see the response here!