# translationsRegister - admin-graphql - MUTATION Version: 2025-01 ## Description Creates or updates translations. ### Access Scopes `write_translations` access scope. ## Arguments * [resourceId](/docs/api/admin-graphql/2025-01/scalars/ID): ID! - ID of the resource that is being translated. * [translations](/docs/api/admin-graphql/2025-01/input-objects/TranslationInput): TranslationInput! - Specifies the input fields for a translation. ## Returns * [translations](/docs/api/admin-graphql/2025-01/objects/Translation): Translation The translations that were created or updated. * [userErrors](/docs/api/admin-graphql/2025-01/objects/TranslationUserError): TranslationUserError! The list of errors that occurred from executing the mutation. ## Examples ### Register a French product title Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { userErrors { message field } translations { key value } } }\",\n \"variables\": {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"fr\",\n \"key\": \"title\",\n \"value\": \"L'\\''élément\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\"\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n }\n }\n }`,\n \"variables\": {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"fr\",\n \"key\": \"title\",\n \"value\": \"L'élément\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\"\n }\n ]\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n }\n }\n }\nQUERY\n\nvariables = {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [{\"locale\"=>\"fr\", \"key\"=>\"title\", \"value\"=>\"L'élément\", \"translatableContentDigest\"=>\"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\"}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n }\n }\n }`,\n {\n variables: {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"fr\",\n \"key\": \"title\",\n \"value\": \"L'élément\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\"\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n }\n }\n}" #### Graphql Input { "resourceId": "gid://shopify/Product/20995642", "translations": [ { "locale": "fr", "key": "title", "value": "L'élément", "translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6" } ] } #### Graphql Response { "data": { "translationsRegister": { "userErrors": [], "translations": [ { "key": "title", "value": "L'élément" } ] } } } ### Register a French product title specific to a market Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { userErrors { message field } translations { key value market { id name } } } }\",\n \"variables\": {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"fr\",\n \"key\": \"title\",\n \"value\": \"L'\\''élément canadien\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\",\n \"marketId\": \"gid://shopify/Market/128989799\"\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n }`,\n \"variables\": {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"fr\",\n \"key\": \"title\",\n \"value\": \"L'élément canadien\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\",\n \"marketId\": \"gid://shopify/Market/128989799\"\n }\n ]\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [{\"locale\"=>\"fr\", \"key\"=>\"title\", \"value\"=>\"L'élément canadien\", \"translatableContentDigest\"=>\"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\", \"marketId\"=>\"gid://shopify/Market/128989799\"}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n }`,\n {\n variables: {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"fr\",\n \"key\": \"title\",\n \"value\": \"L'élément canadien\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\",\n \"marketId\": \"gid://shopify/Market/128989799\"\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n}" #### Graphql Input { "resourceId": "gid://shopify/Product/20995642", "translations": [ { "locale": "fr", "key": "title", "value": "L'élément canadien", "translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6", "marketId": "gid://shopify/Market/128989799" } ] } #### Graphql Response { "data": { "translationsRegister": { "userErrors": [], "translations": [ { "key": "title", "value": "L'élément canadien", "market": { "id": "gid://shopify/Market/128989799", "name": "Canada" } } ] } } } ### Register a product title in the shop default language specific to a market Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2025-01/graphql.json \\\n-H 'Content-Type: application/json' \\\n-H 'X-Shopify-Access-Token: {access_token}' \\\n-d '{\n\"query\": \"mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) { translationsRegister(resourceId: $resourceId, translations: $translations) { userErrors { message field } translations { key value market { id name } } } }\",\n \"variables\": {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"en\",\n \"key\": \"title\",\n \"value\": \"Canadian element\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\",\n \"marketId\": \"gid://shopify/Market/128989799\"\n }\n ]\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n }`,\n \"variables\": {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"en\",\n \"key\": \"title\",\n \"value\": \"Canadian element\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\",\n \"marketId\": \"gid://shopify/Market/128989799\"\n }\n ]\n },\n },\n});\n" Ruby example: "session = ShopifyAPI::Auth::Session.new(\n shop: \"your-development-store.myshopify.com\",\n access_token: access_token\n)\nclient = ShopifyAPI::Clients::Graphql::Admin.new(\n session: session\n)\n\nquery = <<~QUERY\n mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [{\"locale\"=>\"en\", \"key\"=>\"title\", \"value\"=>\"Canadian element\", \"translatableContentDigest\"=>\"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\", \"marketId\"=>\"gid://shopify/Market/128989799\"}]\n}\n\nresponse = client.query(query: query, variables: variables)\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n }`,\n {\n variables: {\n \"resourceId\": \"gid://shopify/Product/20995642\",\n \"translations\": [\n {\n \"locale\": \"en\",\n \"key\": \"title\",\n \"value\": \"Canadian element\",\n \"translatableContentDigest\": \"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\",\n \"marketId\": \"gid://shopify/Market/128989799\"\n }\n ]\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "mutation translationsRegister($resourceId: ID!, $translations: [TranslationInput!]!) {\n translationsRegister(resourceId: $resourceId, translations: $translations) {\n userErrors {\n message\n field\n }\n translations {\n key\n value\n market {\n id\n name\n }\n }\n }\n}" #### Graphql Input { "resourceId": "gid://shopify/Product/20995642", "translations": [ { "locale": "en", "key": "title", "value": "Canadian element", "translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6", "marketId": "gid://shopify/Market/128989799" } ] } #### Graphql Response { "data": { "translationsRegister": { "userErrors": [], "translations": [ { "key": "title", "value": "Canadian element", "market": { "id": "gid://shopify/Market/128989799", "name": "Canada" } } ] } } }