Anchor to shopLocaleEnableshop
shopLocaleEnable
mutation
Requires access scope.
Adds a locale for a shop. The newly added locale is in the unpublished state.
Anchor to Arguments
Arguments
- Anchor to localelocale•String!required
ISO code of the locale to enable.
- Anchor to marketWebPresenceIdsmarket•
Web Presence Ids The list of markets web presences to add the locale to.
Was this section helpful?
Anchor to ShopLocaleEnablePayload returnsShopLocaleEnablePayload returns
- Anchor to shopLocaleshop•
Locale ISO code of the locale that was enabled.
- Anchor to userErrorsuser•
Errors [UserError!]! non-null The list of errors that occurred from executing the mutation.
Was this section helpful?
- Enable a locale
- shopLocaleEnable reference
Examples
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation enableLocale($locale: String!) {
shopLocaleEnable(locale: $locale) {
userErrors {
message
field
}
shopLocale {
locale
name
primary
published
}
}
}`,
{
variables: {
"locale": "ko"
},
},
);
const data = await response.json();
mutation enableLocale($locale: String!) {
shopLocaleEnable(locale: $locale) {
userErrors {
message
field
}
shopLocale {
locale
name
primary
published
}
}
}
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2025-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation enableLocale($locale: String!) { shopLocaleEnable(locale: $locale) { userErrors { message field } shopLocale { locale name primary published } } }",
"variables": {
"locale": "ko"
}
}'
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation enableLocale($locale: String!) {
shopLocaleEnable(locale: $locale) {
userErrors {
message
field
}
shopLocale {
locale
name
primary
published
}
}
}`,
{
variables: {
"locale": "ko"
},
},
);
const data = await response.json();
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation enableLocale($locale: String!) {
shopLocaleEnable(locale: $locale) {
userErrors {
message
field
}
shopLocale {
locale
name
primary
published
}
}
}`,
"variables": {
"locale": "ko"
},
},
});
session = ShopifyAPI::Auth::Session.new(
shop: "your-development-store.myshopify.com",
access_token: access_token
)
client = ShopifyAPI::Clients::Graphql::Admin.new(
session: session
)
query = <<~QUERY
mutation enableLocale($locale: String!) {
shopLocaleEnable(locale: $locale) {
userErrors {
message
field
}
shopLocale {
locale
name
primary
published
}
}
}
QUERY
variables = {
"locale": "ko"
}
response = client.query(query: query, variables: variables)
Input variables
JSON{
"locale": "ko"
}
Response
JSON{
"shopLocaleEnable": {
"userErrors": [],
"shopLocale": {
"locale": "ko",
"name": "Korean",
"primary": false,
"published": false
}
}
}