About market-aware auth URLs for headless stores
Headless storefronts need to manually construct authorization URLs that include market context. This guide explains the parameters that control the market-aware login experience. It applies to any headless storefront, whether you're using Hydrogen or building a custom implementation.
Two query parameters control the market-aware login experience:
| Parameter | Controls |
|---|---|
locale | Sets the language of the login screen. |
region_country | Sets the market context for policies and branding. |
Anchor to How ,[object Object], and ,[object Object], work togetherHow locale and region_country work together
locale and region_country work togetherThe locale and region_country parameters can be used independently or together:
- Setting
locale=fr-CA®ion_country=CAdisplays the login screen in French Canadian with Canadian market policies. - Setting
locale=en®ion_country=CAdisplays the login screen in English but still applies Canadian market policies. - Using
localealone changes the language without market-specific context. - Using
region_countryalone applies market-specific policies without changing the language.
If the specified region_country doesn't match a configured market, then the primary market context is used.
The order of locale and region_country parameters in the URL doesn't matter.
Use both parameters together for a fully localized, market-aware login experience. For example, a customer browsing a Canadian French market should see the login screen in French with Canadian market policies applied.
The following example shows how to build an authorization URL with locale and region_country parameters using the discovery endpoint:
Market-aware authorization URL
Anchor to Next stepsNext steps
- Refer to the Customer Account API authorization reference for the full list of authorization parameters.
- If using Hydrogen, learn about internationalization in Hydrogen for handling markets.