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 { webhookSubscriptions(first: 2) { edges { node { id topic endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } ... on WebhookEventBridgeEndpoint { arn } ... on WebhookPubSubEndpoint { pubSubProject pubSubTopic } } } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query {\n webhookSubscriptions(first: 2) {\n edges {\n node {\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 }\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 webhookSubscriptions(first: 2) {\n edges {\n node {\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 }\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 webhookSubscriptions(first: 2) {\n edges {\n node {\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 }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webhookSubscriptions(first: 2) {\n edges {\n node {\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 }\n }\n }\n}"
input: null
response: { "data": { "webhookSubscriptions": { "edges": [ { "node": { "id": "gid://shopify/WebhookSubscription/892403750", "topic": "ORDERS_CANCELLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://example.org/fully_loaded_1" } } }, { "node": { "id": "gid://shopify/WebhookSubscription/901431826", "topic": "APP_UNINSTALLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://apple.com/uninstall" } } } ] } } }
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 { webhookSubscriptions(first: 2, topics: APP_UNINSTALLED) { edges { node { 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 webhookSubscriptions(first: 2, topics: APP_UNINSTALLED) {\n edges {\n node {\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 }`,\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 webhookSubscriptions(first: 2, topics: APP_UNINSTALLED) {\n edges {\n node {\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 }\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 webhookSubscriptions(first: 2, topics: APP_UNINSTALLED) {\n edges {\n node {\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 }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query {\n webhookSubscriptions(first: 2, topics: APP_UNINSTALLED) {\n edges {\n node {\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}"
input: null
response: { "data": { "webhookSubscriptions": { "edges": [ { "node": { "id": "gid://shopify/WebhookSubscription/901431826", "topic": "APP_UNINSTALLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://apple.com/uninstall" } } }, { "node": { "id": "gid://shopify/WebhookSubscription/1014196360", "topic": "APP_UNINSTALLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://example.org/app_uninstalled" } } } ] } } }
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 WebhookSubscriptionList { webhookSubscriptions(first: 3) { edges { node { id topic endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } ... on WebhookEventBridgeEndpoint { arn } ... on WebhookPubSubEndpoint { pubSubProject pubSubTopic } } createdAt updatedAt apiVersion { handle } format includeFields metafieldNamespaces privateMetafieldNamespaces } } } }\"\n}'\n" Node example: "const client = new shopify.clients.Graphql({session});\nconst data = await client.query({\n data: `query WebhookSubscriptionList {\n webhookSubscriptions(first: 3) {\n edges {\n node {\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 createdAt\n updatedAt\n apiVersion {\n handle\n }\n format\n includeFields\n metafieldNamespaces\n privateMetafieldNamespaces\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 WebhookSubscriptionList {\n webhookSubscriptions(first: 3) {\n edges {\n node {\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 createdAt\n updatedAt\n apiVersion {\n handle\n }\n format\n includeFields\n metafieldNamespaces\n privateMetafieldNamespaces\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 WebhookSubscriptionList {\n webhookSubscriptions(first: 3) {\n edges {\n node {\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 createdAt\n updatedAt\n apiVersion {\n handle\n }\n format\n includeFields\n metafieldNamespaces\n privateMetafieldNamespaces\n }\n }\n }\n }`,\n);\n\nconst data = await response.json();\n" Graphql query: "query WebhookSubscriptionList {\n webhookSubscriptions(first: 3) {\n edges {\n node {\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 createdAt\n updatedAt\n apiVersion {\n handle\n }\n format\n includeFields\n metafieldNamespaces\n privateMetafieldNamespaces\n }\n }\n }\n}"
input: null
response: { "data": { "webhookSubscriptions": { "edges": [ { "node": { "id": "gid://shopify/WebhookSubscription/892403750", "topic": "ORDERS_CANCELLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://example.org/fully_loaded_1" }, "createdAt": "2021-12-01T10:23:43Z", "updatedAt": "2021-12-01T10:23:43Z", "apiVersion": { "handle": "unstable" }, "format": "JSON", "includeFields": [], "metafieldNamespaces": [], "privateMetafieldNamespaces": [] } }, { "node": { "id": "gid://shopify/WebhookSubscription/901431826", "topic": "APP_UNINSTALLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://apple.com/uninstall" }, "createdAt": "2024-11-04T18:56:43Z", "updatedAt": "2024-11-04T18:56:43Z", "apiVersion": { "handle": "unstable" }, "format": "JSON", "includeFields": [], "metafieldNamespaces": [], "privateMetafieldNamespaces": [] } }, { "node": { "id": "gid://shopify/WebhookSubscription/1014196360", "topic": "APP_UNINSTALLED", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://example.org/app_uninstalled" }, "createdAt": "2024-11-04T18:56:43Z", "updatedAt": "2024-11-04T18:56:43Z", "apiVersion": { "handle": "unstable" }, "format": "JSON", "includeFields": [], "metafieldNamespaces": [], "privateMetafieldNamespaces": [] } } ] } } }