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\": \"query { webhookSubscription(id: \\\"gid://shopify/WebhookSubscription/892403750\\\") { id topic endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } ... on WebhookEventBridgeEndpoint { arn } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\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 query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\n }\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\n }\n }\n }\n}"
input: null
response: { "data": { "webhookSubscription": { "id": "gid://shopify/WebhookSubscription/892403750", "topic": "ORDERS_CANCELLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://example.org/fully_loaded_1" } } } }
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\": \"query { node(id: \\\"gid://shopify/WebhookSubscription/892403750\\\") { ... on WebhookSubscription { id createdAt updatedAt legacyResourceId topic format } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n node(id: \"gid://shopify/WebhookSubscription/892403750\") {\n ... on WebhookSubscription {\n id\n createdAt\n updatedAt\n legacyResourceId\n topic\n format\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 node(id: \"gid://shopify/WebhookSubscription/892403750\") {\n ... on WebhookSubscription {\n id\n createdAt\n updatedAt\n legacyResourceId\n topic\n format\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n node(id: \"gid://shopify/WebhookSubscription/892403750\") {\n ... on WebhookSubscription {\n id\n createdAt\n updatedAt\n legacyResourceId\n topic\n format\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n node(id: \"gid://shopify/WebhookSubscription/892403750\") {\n ... on WebhookSubscription {\n id\n createdAt\n updatedAt\n legacyResourceId\n topic\n format\n }\n }\n}"
input: null
response: { "data": { "node": { "id": "gid://shopify/WebhookSubscription/892403750", "createdAt": "2021-12-01T10:23:43Z", "updatedAt": "2021-12-01T10:23:43Z", "legacyResourceId": "892403750", "topic": "ORDERS_CANCELLED", "format": "JSON" } } }
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\": \"query { webhookSubscription(id: \\\"gid://shopify/WebhookSubscription/892403750\\\") { createdAt updatedAt } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n createdAt\n updatedAt\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 webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n createdAt\n updatedAt\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n createdAt\n updatedAt\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n createdAt\n updatedAt\n }\n}"
input: null
response: { "data": { "webhookSubscription": { "createdAt": "2021-12-01T10:23:43Z", "updatedAt": "2021-12-01T10:23:43Z" } } }
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\": \"query { webhookSubscription(id: \\\"gid://shopify/WebhookSubscription/892403750\\\") { format } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n format\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 webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n format\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n format\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n format\n }\n}"
input: null
response: { "data": { "webhookSubscription": { "format": "JSON" } } }
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\": \"query { webhookSubscription(id: \\\"gid://shopify/WebhookSubscription/892403750\\\") { topic } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n topic\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 webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n topic\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([\"query\" => $query]);\n" Remix example: "const { admin } = await authenticate.admin(request);\n\nconst response = await admin.graphql(\n `#graphql\n query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n topic\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webhookSubscription(id: \"gid://shopify/WebhookSubscription/892403750\") {\n topic\n }\n}"
input: null
response: { "data": { "webhookSubscription": { "topic": "ORDERS_CANCELLED" } } }
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\": \"query WebhookSubscription($id: ID!) { webhookSubscription(id: $id) { id topic endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } ... on WebhookEventBridgeEndpoint { arn } ... on WebhookPubSubEndpoint { pubSubProject pubSubTopic } } apiVersion { handle } } }\",\n \"variables\": {\n \"id\": \"gid://shopify/WebhookSubscription/892403750\"\n }\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: {\n \"query\": `query WebhookSubscription($id: ID!) {\n webhookSubscription(id: $id) {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\n }\n ... on WebhookPubSubEndpoint {\n pubSubProject\n pubSubTopic\n }\n }\n apiVersion {\n handle\n }\n }\n }`,\n \"variables\": {\n \"id\": \"gid://shopify/WebhookSubscription/892403750\"\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 WebhookSubscription($id: ID!) {\n webhookSubscription(id: $id) {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\n }\n ... on WebhookPubSubEndpoint {\n pubSubProject\n pubSubTopic\n }\n }\n apiVersion {\n handle\n }\n }\n }\nQUERY\n\nvariables = {\n \"id\": \"gid://shopify/WebhookSubscription/892403750\"\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 = <<\"gid://shopify/WebhookSubscription/892403750\",\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 WebhookSubscription($id: ID!) {\n webhookSubscription(id: $id) {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\n }\n ... on WebhookPubSubEndpoint {\n pubSubProject\n pubSubTopic\n }\n }\n apiVersion {\n handle\n }\n }\n }`,\n {\n variables: {\n \"id\": \"gid://shopify/WebhookSubscription/892403750\"\n },\n },\n);\n\nconst data = await response.json();\n" Graphql query: "query WebhookSubscription($id: ID!) {\n webhookSubscription(id: $id) {\n id\n topic\n endpoint {\n __typename\n ... on WebhookHttpEndpoint {\n callbackUrl\n }\n ... on WebhookEventBridgeEndpoint {\n arn\n }\n ... on WebhookPubSubEndpoint {\n pubSubProject\n pubSubTopic\n }\n }\n apiVersion {\n handle\n }\n }\n}"
input: { "id": "gid://shopify/WebhookSubscription/892403750" }
response: { "data": { "webhookSubscription": { "id": "gid://shopify/WebhookSubscription/892403750", "topic": "ORDERS_CANCELLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://example.org/fully_loaded_1" }, "apiVersion": { "handle": "unstable" } } } }