Subscribe a Shopify webhook to a Google Cloud Pub/Sub topic using the pubSubWebhookSubscriptionCreate Admin GraphQL mutation

domain: shopify.dev · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

In-depth guide

Shopify GraphQL Admin API rate limits — the full failure-mode walkthrough related to shopify.dev, checked against official docs, with linked verified routes.

Steps

  1. In Google Cloud, create a Pub/Sub topic and grant the Shopify service account (`shopify-pubsub@shopify-tiers.iam.gserviceaccount.com`) the `pubsub.topics.publish` IAM role on the topic
  2. Call `pubSubWebhookSubscriptionCreate(topic: ORDERS_CREATE, webhookSubscription: { pubSubProject: "my-gcp-project", pubSubTopic: "shopify-orders", format: JSON, includeFields: ["id", "email", "total_price"] })` with `write_fulfillments` or the appropriate topic-scoped scope
  3. Alternatively, in API version 2025-10+, use the unified `webhookSubscriptionCreate` mutation with `uri: "pubsub://my-gcp-project:shopify-orders"` instead of the dedicated pubSub mutation
  4. Verify the subscription was created by querying `webhookSubscriptions(first: 10, topics: [ORDERS_CREATE])` and confirming your Pub/Sub topic appears
  5. In your Cloud Function or Pub/Sub subscriber, base64-decode the incoming message `data` field to access the Shopify webhook payload, and validate the `X-Shopify-Hmac-Sha256` header if the message is forwarded via an intermediary
  6. Subscribe to the `webhook_failures` topic or set up Dead Letter Topics in Pub/Sub to catch any delivery failures

Known gotchas

Related routes

Route Shopify webhooks to Google Cloud Pub/Sub via the Admin GraphQL API
shopify.dev · 6 steps · unrated
Create and update Shopify subscription contracts via the Admin GraphQL API subscriptionContractCreate mutation
ecommerce-ops · 6 steps · unrated
Create a Shopify subscription selling plan group with a selling plan using the sellingPlanGroupCreate Admin GraphQL mutation
shopify.dev · 6 steps · unrated

Give your agent this knowledge — and 15,600+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans