Order API: Set customer language / locale for notifications

Topic summary

Setting the language for order notifications depends on the customer’s locale, not an order field. In REST, Order.customer_locale is read-only, so it cannot be set when creating orders.

Workaround: use the GraphQL Admin API to set Customer.locale (ISO language code like ā€œfrā€) via customerCreate/customerUpdate, then create/complete draft orders for that customer so notifications send in the desired language. Shopify staff provided a working mutation and noted you can query availableLocales to see supported codes. Code examples are central to understanding the solution.

Common pitfall: using languageCode in CustomerInput triggers an error; the correct field is locale.

Open questions: native support via REST (feature request noted, no ETA) and support in the Storefront API to set locale at customer creation (no update provided). Some users also asked how to perform this via REST PUT; guidance points back to GraphQL Admin API, as the REST path does not expose a writable notification-language field.

Status: partially resolved via GraphQL workaround; REST/Storefront API capability remains pending.

Summarized with AI on January 1. AI used: gpt-5.

Hi,

how can we set the language for email and sms notifications when creating orders through the Shopify Rest API?

The customer_locale seems to be read-only according to the API reference (if that is even the right parameter for it).

Best regards,

Felix

5 Likes

I’m having the same issue here…

1 Like

I would love to here an answer on this.
@Shopify_77 can you please have a look at it. Thanks

1 Like

Hi @fhelger

You are correct that the REST Order.customer_locale field is read_only.

I can add a feature request for the REST API, but for now you could also try using the customerCreate or customerUpdate mutations to set the correct locale, then creating/ completing draft orders for the customer using the GraphQL Admin API to send notifications in the desired language as a workaround.

Cheers,

this did not worked for me, I tried with customerUpdate mutation and I get a failed message saying → Error: InputObject ā€˜CustomerInput’ doesn’t accept argument ā€˜languageCode’.

Please help if there is a solution.

Hi @ShubhamDhage :waving_hand:

The notification language is determined by the Customer.locale attribute, formatted as an ISO code. The following is an example customerUpdate mutation and variables:

mutation ($input: CustomerInput!) {
    customerUpdate(input: $input) {
        customer {
            locale
        }
    }
}
{
    "input": {
        "id": "gid://shopify/Customer/5790884724854",
        "locale": "fr"
    }
}

The list of locales can be queried with the below:

{
    availableLocales {
        name
        isoCode
    }
}

Hope that helps!

Is there any news regarding this feature for StorefrontAPI? We have a similar use case where we have to set the locale when creating a customer through Storefront API.

thanks!

1 Like

Having the same issue and didn’t find a solution so far.

I am not sure how to send a PUT request with update object for the customer.

What I mean is which is the Language field in the customer object and how one can send an update object with correct information?

What I mean is:

I do have in my shop set the geolocalzation app that show to customer correct content to customer(Italian, Greek in one of those countries and English elsewhere).

The problem is that I see that every customer is saved with ā€œEnglishā€ as language no matter, because the shop default language is English(and should be).

I also set a Flow that attached a correct tag based indeed either on local or ending of email address(my only way to ā€œdiscriminateā€ between customer location when sending emails for communication.

I would still ā€œfixā€ the language assigned to customer, if italian, then italian, if greek then greek

So to sum up, how the object send via PUT API should look like?