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:
| Field | What it drives |
|---|---|
store.currency | The base currency — always available |
store.locale | The store's own locale |
settings.defaultLanguage | The language content falls back to |
settings.enabledLanguages | Which extra languages to offer in a switcher |
settings.enabledCurrencies | Which 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.
Supported on:
| Endpoint | Translated fields |
|---|---|
| Products | name, slug, summary, content, seo.title, seo.description |
| Collections | Name, slug, description, SEO fields |
| Categories | Name, slug, description, SEO fields |
| Brands | Name, 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.
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.
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:
Putting it together
- Call
GET /api/v1/meonce and cache it. - Render switchers from
enabledLanguagesandenabledCurrencies. - Thread the visitor's choice through every catalog call as
langandcurrency. - Fall back to
defaultLanguageandstore.currencywhen the visitor hasn't chosen.
Related
- Store API — what's enabled for this store
- Products API — the main consumer of both parameters
- Merchant-facing setup: Sell in multiple languages