Localization
Some Sync API endpoints support localization for price value and currency. This guide will help you learn how to use localization in the Rye API.
Introduction
For Shopify stores that have the Rye Shopify app installed, some Rye API operations support localization for price value and currency. This means that you can use the Rye API to get the price value and currency in the language and currency that the customer prefers. To enable localization, you should pass a header that includes information about the preferred country and currency. Note that the Shopify store must have local currencies enabled for this feature to work within Rye.
Header
For localization, the Rye API expects a header key of x-rye-localization-context
to be passed with certain GraphQL requests. The value should be a base64-encoded string of a JSON object that resembles the following:
{
"countryCode": "CA",
"currencyCode": "CAD"
}
This value would be encoded as the base64 string ewogICJjb3VudHJ5Q29kZSI6ICJDQSIsCiAgImN1cnJlbmN5Q29kZSI6ICJDQUQiCn0=
and passed as the value of the x-rye-localization-context
header. Here’s a more in-depth example using a Shopify store that defaults to USD, but supports CAD currency:
Example request and response without localization (default USD)
Example request and response with localization (CAD)
Supported operations
- The
integratedShopifyStore
query - The
shopifyCollection
query
Was this page helpful?