Search Documentation

Search for a documentation page...

Localization

Serve translated catalog content and per-currency prices through the API.

A YNS store can sell in more than one language and price in more than one currency. Both are driven by the Localization module, and both surface through the API as request parameters rather than separate endpoints — the same product, asked for differently.

Discover what's enabled

Start with GET /api/v1/me. Its settings block tells you what the merchant has switched on:

{
"store": {
"currency": "usd",
"locale": "en-US",
"settings": {
"defaultLanguage": "en-US",
"enabledLanguages": { "pl-PL": true, "de-DE": true },
"enabledCurrencies": ["usd", "eur"]
}
}
}
FieldWhat it drives
store.currencyThe base currency — always available
store.localeThe store's own locale
settings.defaultLanguageThe language content falls back to
settings.enabledLanguagesWhich extra languages to offer in a switcher
settings.enabledCurrenciesWhich currencies have prices set

Build your language and currency switchers from these two lists rather than hard-coding them, and the storefront follows whatever the merchant enables later.

Translated content

Pass lang with a locale code to overlay translated fields onto the response.

GET /api/v1/products?lang=pl-PL

Supported on:

EndpointTranslated fields
Productsname, slug, summary, content, seo.title, seo.description
CollectionsName, slug, description, SEO fields
CategoriesName, slug, description, SEO fields
BrandsName, slug, description, SEO fields

Fields with no translation keep their default-language value, so a partially translated catalog never returns blanks. Locale codes are the full form — en-US, pl-PL, es-ES, de-DE.

curl \
-H "Authorization: Bearer your_api_key" \
"https://your-store.yns.store/api/v1/products?lang=pl-PL&limit=20"

Translated slugs are returned too. If you route by slug, resolve the incoming slug in the same language you rendered the links in.

Per-currency prices

Pass currency with a three-letter code to price a response in one of the store's enabled currencies.

GET /api/v1/products?currency=EUR

Supported on Products, Variants, Carts, Events, Coupons, Promotions, Shipping, Orders, and Analytics.

Prices are set per currency by the merchant rather than converted at request time, so the number you get back is the exact price they chose for that market. Product responses only include prices for currencies the store has enabled.

When writing products you can supply the extra prices directly:

{
"name": "Ceramic Mug",
"price": 24.99,
"prices": { "EUR": 22.50 }
}

Putting it together

  1. Call GET /api/v1/me once and cache it.
  2. Render switchers from enabledLanguages and enabledCurrencies.
  3. Thread the visitor's choice through every catalog call as lang and currency.
  4. Fall back to defaultLanguage and store.currency when the visitor hasn't chosen.