Version: 2024-10
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/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" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<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\n$variables = [\n \"resourceId\" => \"gid://shopify/Product/20995642\",\n \"translations\" => [{\"locale\"=>\"fr\", \"key\"=>\"title\", \"value\"=>\"L'élément\", \"translatableContentDigest\"=>\"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\"}],\n];\n\n$response = $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}"
input: { "resourceId": "gid://shopify/Product/20995642", "translations": [ { "locale": "fr", "key": "title", "value": "L'élément", "translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6" } ] }
response: { "data": { "translationsRegister": { "userErrors": [], "translations": [ { "key": "title", "value": "L'élément" } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/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" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<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\n$variables = [\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\n$response = $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}"
input: { "resourceId": "gid://shopify/Product/20995642", "translations": [ { "locale": "fr", "key": "title", "value": "L'élément canadien", "translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6", "marketId": "gid://shopify/Market/128989799" } ] }
response: { "data": { "translationsRegister": { "userErrors": [], "translations": [ { "key": "title", "value": "L'élément canadien", "market": { "id": "gid://shopify/Market/128989799", "name": "Canada" } } ] } } }
Curl example: "curl -X POST \\\nhttps://your-development-store.myshopify.com/admin/api/2024-10/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" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<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\n$variables = [\n \"resourceId\" => \"gid://shopify/Product/20995642\",\n \"translations\" => [{\"locale\"=>\"en\", \"key\"=>\"title\", \"value\"=>\"Canadian element\", \"translatableContentDigest\"=>\"4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6\", \"marketId\"=>\"gid://shopify/Market/128989799\"}],\n];\n\n$response = $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}"
input: { "resourceId": "gid://shopify/Product/20995642", "translations": [ { "locale": "en", "key": "title", "value": "Canadian element", "translatableContentDigest": "4e5b548d6d61f0006840aca106f7464a4b59e5a854317d5b57861b8423901bf6", "marketId": "gid://shopify/Market/128989799" } ] }
response: { "data": { "translationsRegister": { "userErrors": [], "translations": [ { "key": "title", "value": "Canadian element", "market": { "id": "gid://shopify/Market/128989799", "name": "Canada" } } ] } } }