Solved

`customer_locale` empty when creating order through API

Channable_INT
Shopify Partner
2 0 0

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


customer_locale.png

Accepted Solution (1)

Josh
Shopify Staff
1134 84 233

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

View solution in original post

Replies 2 (2)

Josh
Shopify Staff
1134 84 233

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

Channable_INT
Shopify Partner
2 0 0

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