Discussing APIs and development related to customers, discounts, and order management.
Hi Shopify,
When creating orders through the Shopify API we noticed that in the resulting order the field `customer_locale` is always empty.
In the docs it does say that it's a read-only property, so we can't send this data when creating the order. However, how does it get filled in? Is there any way that we can make sure this field is filled in?
The docs:
https://help.shopify.com/en/api/reference/orders/order
Solved! Go to the solution
This is an accepted solution.
Hey @Channable_INT ,
In doing some testing it looks like the customer_locale field is set by the language that a shop's theme is set to - so if they're using Shopify's theme translations/languages this should be set on any orders that go through the storefront. Since API-created orders bypass the storefront entirely though, orders created with the Order API won't have a customer_locale.
Josh | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
This is an accepted solution.
Hey @Channable_INT ,
In doing some testing it looks like the customer_locale field is set by the language that a shop's theme is set to - so if they're using Shopify's theme translations/languages this should be set on any orders that go through the storefront. Since API-created orders bypass the storefront entirely though, orders created with the Order API won't have a customer_locale.
Josh | Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit the Shopify Help Center or the Shopify Blog
Hi Josh,
Thanks for looking into it for us and the clear explanation. Good to know where the field comes from.
We'll look into alternatives for our purpose, probably we'll stick with using the country in the address data.
Kind regards,
Koen