Register and handle Shopify webhooks for subscription billing attempt success and failure events

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

Steps

  1. Register webhook subscriptions for the `subscription_billing_attempts/success` and `subscription_billing_attempts/failure` topics via the Admin GraphQL API `webhookSubscriptionCreate` mutation, providing your HTTPS endpoint URL and the topic.
  2. On your server, receive the POST request, immediately return a 200 response to acknowledge receipt before doing any processing — Shopify will retry delivery if it does not receive a 200 within a few seconds.
  3. Verify the webhook authenticity by computing an HMAC-SHA256 digest of the raw request body using your webhook secret and comparing it to the `X-Shopify-Hmac-SHA256` header value — reject requests that do not match.
  4. Parse the payload: on `subscription_billing_attempts/success`, extract the subscription contract ID and update your records with the new `nextBillingDate`; on `subscription_billing_attempts/failure`, extract the `errorCode` and trigger your dunning logic.
  5. Implement deduplication using the `X-Shopify-Event-Id` header — store processed event IDs to prevent double-processing on Shopify's retry deliveries.
  6. For missed webhooks, implement a reconciliation job that queries the Admin GraphQL API for recent billing attempts on active contracts and compares the result to your local records.

Known gotchas

Related routes

Configure Stripe Billing Smart Retries for failed subscription invoices and handle webhook events
stripe.com · 6 steps · 100% success
Configure Stripe Billing Smart Retries and handle failed-payment webhook events for subscription recovery
stripe.com/docs · 5 steps · 100% success
Register and verify a Shopify webhook subscription
shopify.com · 4 steps · 100% success

Give your agent this knowledge — and 18,300+ more routes

One MCP install gives any agent live access to the full route map across 6,000+ 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