Version: 2025-01
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\": \"query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) { appInstallation(id: $ownerId) { apiKey: metafield(namespace: $namespace, key: $key) { value } } }\",\n \"variables\": {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n \"variables\": {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\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 query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }\nQUERY\n\nvariables = {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\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 query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }\nQUERY;\n\n$variables = [\n \"namespace\" => \"secret_keys\",\n \"key\" => \"api_key\",\n \"ownerId\" => \"gid://shopify/AppInstallation/1002334195\",\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 query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n }`,\n {\n variables: {\n \"namespace\": \"secret_keys\",\n \"key\": \"api_key\",\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query AppInstallationMetafield($namespace: String!, $key: String!, $ownerId: ID!) {\n appInstallation(id: $ownerId) {\n apiKey: metafield(namespace: $namespace, key: $key) {\n value\n }\n }\n}"
input: { "namespace": "secret_keys", "key": "api_key", "ownerId": "gid://shopify/AppInstallation/1002334195" }
response: { "data": { "appInstallation": { "apiKey": { "value": "aSBhbSBhIHNlY3JldCBrZXk=" } } } }
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\": \"query AppInstallationMetafields($ownerId: ID!) { appInstallation(id: $ownerId) { metafields(first: 3) { edges { node { namespace key value } } } } }\",\n \"variables\": {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\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 query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\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 query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"ownerId\" => \"gid://shopify/AppInstallation/1002334195\",\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 query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"ownerId\": \"gid://shopify/AppInstallation/1002334195\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query AppInstallationMetafields($ownerId: ID!) {\n appInstallation(id: $ownerId) {\n metafields(first: 3) {\n edges {\n node {\n namespace\n key\n value\n }\n }\n }\n }\n}"
input: { "ownerId": "gid://shopify/AppInstallation/1002334195" }
response: { "data": { "appInstallation": { "metafields": { "edges": [ { "node": { "namespace": "secret_keys", "key": "api_key", "value": "aSBhbSBhIHNlY3JldCBrZXk=" } } ] } } } }
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\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/1002334195\\\") { launchUrl } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\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 query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n launchUrl\n }\n}"
input: null
response: { "data": { "appInstallation": { "launchUrl": "https://snowdevil.myshopify.com/admin/api_permissions/1002334195/redirect" } } }
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\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/688276949\\\") { uninstallUrl } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\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 query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n appInstallation(id: \"gid://shopify/AppInstallation/688276949\") {\n uninstallUrl\n }\n}"
input: null
response: { "data": { "appInstallation": { "uninstallUrl": null } } }
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\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/1002334195\\\") { accessScopes { handle description } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\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 query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n accessScopes {\n handle\n description\n }\n }\n}"
input: null
response: { "data": { "appInstallation": { "accessScopes": [ { "handle": "write_content", "description": "Modify store content like articles, blogs, comments, pages, and redirects" }, { "handle": "write_themes", "description": "Modify theme templates and theme assets" }, { "handle": "write_products", "description": "Modify products, variants, and collections" }, { "handle": "write_customers", "description": "Modify customer details and customer groups" }, { "handle": "write_orders", "description": "Modify orders, transactions, and fulfillments" }, { "handle": "write_script_tags", "description": "Modify script tags in your store's theme template files" }, { "handle": "write_shipping", "description": "Modify shipping rates, countries, and provinces" }, { "handle": "read_content", "description": "Read store content like articles, blogs, comments, pages, and redirects" }, { "handle": "read_themes", "description": "Read theme templates and theme assets" }, { "handle": "read_products", "description": "Read products, variants, and collections" }, { "handle": "read_customers", "description": "Read customer details and customer groups" }, { "handle": "read_orders", "description": "Read orders, transactions, and fulfillments" }, { "handle": "read_script_tags", "description": "Read script tags in your store's theme template files" }, { "handle": "read_shipping", "description": "Read shipping rates, countries, and provinces" } ] } } }
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\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/881878037\\\") { activeSubscriptions { id } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\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 query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n appInstallation(id: \"gid://shopify/AppInstallation/881878037\") {\n activeSubscriptions {\n id\n }\n }\n}"
input: null
response: { "data": { "appInstallation": { "activeSubscriptions": [ { "id": "gid://shopify/AppSubscription/1029266946" } ] } } }
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\": \"query { appInstallation(id: \\\"gid://shopify/AppInstallation/1002334195\\\") { app { id } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\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 query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n }\nQUERY\n\nresponse = client.query(query: query)\n" PHP example: "use Shopify\\Clients\\Graphql;\n\n$client = new Graphql(\"your-development-store.myshopify.com\", $accessToken);\n$query = <<<QUERY\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n }\nQUERY;\n\n$response = $client->query([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n appInstallation(id: \"gid://shopify/AppInstallation/1002334195\") {\n app {\n id\n }\n }\n}"
input: null
response: { "data": { "appInstallation": { "app": { "id": "gid://shopify/App/1002334195" } } } }
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\": \"query GetAppInstallationCredits($appInstallationId: ID!) { appInstallation(id: $appInstallationId) { credits(first: 10) { edges { node { amount { amount currencyCode } createdAt description id } } } } }\",\n \"variables\": {\n \"appInstallationId\": \"gid://shopify/AppInstallation/236444539\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query GetAppInstallationCredits($appInstallationId: ID!) {\n appInstallation(id: $appInstallationId) {\n credits(first: 10) {\n edges {\n node {\n amount {\n amount\n currencyCode\n }\n createdAt\n description\n id\n }\n }\n }\n }\n }`,\n \"variables\": {\n \"appInstallationId\": \"gid://shopify/AppInstallation/236444539\"\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 query GetAppInstallationCredits($appInstallationId: ID!) {\n appInstallation(id: $appInstallationId) {\n credits(first: 10) {\n edges {\n node {\n amount {\n amount\n currencyCode\n }\n createdAt\n description\n id\n }\n }\n }\n }\n }\nQUERY\n\nvariables = {\n \"appInstallationId\": \"gid://shopify/AppInstallation/236444539\"\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 query GetAppInstallationCredits($appInstallationId: ID!) {\n appInstallation(id: $appInstallationId) {\n credits(first: 10) {\n edges {\n node {\n amount {\n amount\n currencyCode\n }\n createdAt\n description\n id\n }\n }\n }\n }\n }\nQUERY;\n\n$variables = [\n \"appInstallationId\" => \"gid://shopify/AppInstallation/236444539\",\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 query GetAppInstallationCredits($appInstallationId: ID!) {\n appInstallation(id: $appInstallationId) {\n credits(first: 10) {\n edges {\n node {\n amount {\n amount\n currencyCode\n }\n createdAt\n description\n id\n }\n }\n }\n }\n }`,\n {\n variables: {\n \"appInstallationId\": \"gid://shopify/AppInstallation/236444539\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query GetAppInstallationCredits($appInstallationId: ID!) {\n appInstallation(id: $appInstallationId) {\n credits(first: 10) {\n edges {\n node {\n amount {\n amount\n currencyCode\n }\n createdAt\n description\n id\n }\n }\n }\n }\n}"
input: { "appInstallationId": "gid://shopify/AppInstallation/236444539" }
response: { "data": { "appInstallation": { "credits": { "edges": [] } } } }