Register a French product title
Description
A successfully registered translation will be immediately visible to buyers if the locale is already published. In this example, the registered content will be visible to all buyers browsing in French from any market, unless there exists a market-specific translation for that market. To retrieve the `translatableContentDigest`, call the `translatableResource` query beforehand.
Query
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}
Variables
{
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6"
}
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { userErrors { message field } translations { key value } } }",
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'\''élément",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6"
}
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}`,
{
variables: {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6"
}
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
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 translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}
QUERY
variables = {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6"
}
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}`,
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6"
}
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}' \
--variables \
'{
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6"
}
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-04/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}
`,
variables: {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6"
}
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"translationsRegister": {
"userErrors": [],
"translations": [
{
"key": "title",
"value": "L'élément"
}
]
}
}
Register a French product title specific to a market
Description
To register content that surfaces only to buyers in a specific market, make use of the `TranslationInput` object's optional `marketId` field. In this example, the words "L'élément canadien" will only be visible to buyers in the specified market, which has an ID of `gid://shopify/Market/128989799`.
Query
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}
Variables
{
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément canadien",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { userErrors { message field } translations { key value market { id name } } } }",
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'\''élément canadien",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}`,
{
variables: {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément canadien",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
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 translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}
QUERY
variables = {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément canadien",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}`,
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément canadien",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}' \
--variables \
'{
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément canadien",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-04/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}
`,
variables: {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "fr",
"key": "title",
"value": "L'élément canadien",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"translationsRegister": {
"userErrors": [],
"translations": [
{
"key": "title",
"value": "L'élément canadien",
"market": {
"id": "gid://shopify/Market/128989799",
"name": "Canada"
}
}
]
}
}
Register a French translation for a metafield value
Description
Register a translation for a metafield's value. Metafield translations work on any resource that supports metafields, including those that don't have translatable fields of their own. Use the `compareDigest` field from the metafield to get the `translatableContentDigest`.
Query
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}
Variables
{
"resourceId": "gid://shopify/Metafield/1069228933",
"translations": [
{
"locale": "fr",
"key": "value",
"value": "Bienvenue dans notre boutique",
"translatableContentDigest": "5e26a5fac20ecd9904062cb62837b52ec94079c722b895a801501078031512e2"
}
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { userErrors { message field } translations { key value } } }",
"variables": {
"resourceId": "gid://shopify/Metafield/1069228933",
"translations": [
{
"locale": "fr",
"key": "value",
"value": "Bienvenue dans notre boutique",
"translatableContentDigest": "5e26a5fac20ecd9904062cb62837b52ec94079c722b895a801501078031512e2"
}
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}`,
{
variables: {
"resourceId": "gid://shopify/Metafield/1069228933",
"translations": [
{
"locale": "fr",
"key": "value",
"value": "Bienvenue dans notre boutique",
"translatableContentDigest": "5e26a5fac20ecd9904062cb62837b52ec94079c722b895a801501078031512e2"
}
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
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 translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}
QUERY
variables = {
"resourceId": "gid://shopify/Metafield/1069228933",
"translations": [
{
"locale": "fr",
"key": "value",
"value": "Bienvenue dans notre boutique",
"translatableContentDigest": "5e26a5fac20ecd9904062cb62837b52ec94079c722b895a801501078031512e2"
}
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}`,
"variables": {
"resourceId": "gid://shopify/Metafield/1069228933",
"translations": [
{
"locale": "fr",
"key": "value",
"value": "Bienvenue dans notre boutique",
"translatableContentDigest": "5e26a5fac20ecd9904062cb62837b52ec94079c722b895a801501078031512e2"
}
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}' \
--variables \
'{
"resourceId": "gid://shopify/Metafield/1069228933",
"translations": [
{
"locale": "fr",
"key": "value",
"value": "Bienvenue dans notre boutique",
"translatableContentDigest": "5e26a5fac20ecd9904062cb62837b52ec94079c722b895a801501078031512e2"
}
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-04/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
}
}
}
`,
variables: {
"resourceId": "gid://shopify/Metafield/1069228933",
"translations": [
{
"locale": "fr",
"key": "value",
"value": "Bienvenue dans notre boutique",
"translatableContentDigest": "5e26a5fac20ecd9904062cb62837b52ec94079c722b895a801501078031512e2"
}
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"translationsRegister": {
"userErrors": [],
"translations": [
{
"key": "value",
"value": "Bienvenue dans notre boutique"
}
]
}
}
Register a product title in the shop default language specific to a market
Description
To register content in the shop default language that surfaces only to buyers in a specific market, make use of the `TranslationInput` object's optional `marketId` field. In this example, the shop default language is English, and the words "Canadian element" will only be visible to buyers in the specified market, which has an ID of `gid://shopify/Market/128989799`.
Query
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}
Variables
{
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "en",
"key": "title",
"value": "Canadian element",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}
cURL
curl -X POST \
https://your-development-store.myshopify.com/admin/api/2026-04/graphql.json \
-H 'Content-Type: application/json' \
-H 'X-Shopify-Access-Token: {access_token}' \
-d '{
"query": "mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { userErrors { message field } translations { key value market { id name } } } }",
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "en",
"key": "title",
"value": "Canadian element",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}
}'
React Router
import { authenticate } from "../shopify.server";
export const loader = async ({request}) => {
const { admin } = await authenticate.admin(request);
const response = await admin.graphql(
`#graphql
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}`,
{
variables: {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "en",
"key": "title",
"value": "Canadian element",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
},
},
);
const json = await response.json();
return json.data;
}
Ruby
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 translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}
QUERY
variables = {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "en",
"key": "title",
"value": "Canadian element",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}
response = client.query(query: query, variables: variables)
Node.js
const client = new shopify.clients.Graphql({session});
const data = await client.query({
data: {
"query": `mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}`,
"variables": {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "en",
"key": "title",
"value": "Canadian element",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
},
},
});
Shopify CLI
shopify app execute \
--query \
'mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}' \
--variables \
'{
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "en",
"key": "title",
"value": "Canadian element",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
}'
Direct API Access
const response = await fetch('shopify:admin/api/2026-04/graphql.json', {
method: 'POST',
body: JSON.stringify({
query: `
mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {
translationsRegister(resourceId: $resourceId, translations: $translations) {
userErrors {
message
field
}
translations {
key
value
market {
id
name
}
}
}
}
`,
variables: {
"resourceId": "gid://shopify/Product/20995642",
"translations": [
{
"locale": "en",
"key": "title",
"value": "Canadian element",
"translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6",
"marketId": "gid://shopify/Market/128989799"
}
]
},
}),
});
const { data } = await response.json();
console.log(data);
Response
{
"translationsRegister": {
"userErrors": [],
"translations": [
{
"key": "title",
"value": "Canadian element",
"market": {
"id": "gid://shopify/Market/128989799",
"name": "Canada"
}
}
]
}
}