shopify-webhooks

Register, verify, and process Shopify webhook events with HMAC validation and idempotency.

3|1|Updated Mar 21, 2026
One-click install
npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill shopify-webhooks-tomtoto757
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: shopify-webhooks
Source: https://github.com/tomtoto757/ecomm-ai-team/tree/main/skills/platform-integrations-infrastructure/finsilabs/platform-shopify/shopify-webhooks
Command: npx skills add https://github.com/tomtoto757/ecomm-ai-team --skill shopify-webhooks-tomtoto757

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires bullmq, express.

What problem does it solve? Shopify apps must react to store events in real time, but webhook delivery is at-least-once, signatures can be forged, and slow handlers trigger retries — leading to duplicate processing, missed uninstall events, and failed App Store GDPR reviews. ## Core Features & Use Cases - Programmatic Registration: Register webhook subscriptions via the Admin GraphQL API in the afterAuth hook, including the three mandatory GDPR topics and APP_UNINSTALLED, while treating ALREADY_EXISTS errors as non-fatal. - HMAC Signature Verification: Verify the X-Shopify-Hmac-SHA256 header using crypto.timingSafeEqual against a raw request body, with Express middleware that applies the raw body parser before any JSON parsing. - Idempotent Background Processing: Respond 200 within 5 seconds, deduplicate deliveries using X-Shopify-Webhook-Id, and offload work to a BullMQ queue with retries and exponential backoff. - Use Case: A logistics app listens for orders/create, immediately acknowledges the webhook, deduplicates by webhook ID, and queues ERP sync, warehouse inventory updates, and merchant notifications for reliable async processing. ## Quick Start Ask the AI to write a Shopify webhook handler that verifies the HMAC signature, registers the GDPR topics, and processes orders idempotently through a background queue.

Frequently Asked Questions about shopify-webhooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I verify a Shopify webhook HMAC signature in Node.js?▼

Compute an HMAC-SHA256 digest of the raw request body using your app secret, encode it as base64, and compare it to the X-Shopify-Hmac-SHA256 header with crypto.timingSafeEqual. Always pass the body as a Buffer and wrap the comparison in try/catch.

How do I register Shopify webhooks with the GraphQL Admin API?▼

Call the webhookSubscriptionCreate mutation with a topic and callbackUrl for each event, ideally inside the afterAuth hook so subscriptions are recreated after reinstall. Treat the 'Address for this topic has already been taken' userError as non-fatal.

Why does Shopify HMAC verification fail even with the correct secret?▼

Verification fails when the body is parsed as JSON before the HMAC check, because re-serialization changes the byte representation. Mount express.raw({ type: 'application/json' }) on webhook routes before any JSON body parser.

Which GDPR webhooks are mandatory for Shopify App Store apps?▼

Shopify requires three endpoints: customers/data_request, customers/redact, and shop/redact. Each must respond with HTTP 200 within the timeout even if your app stores no personal data, or the app will fail review.

How do I prevent duplicate processing of Shopify webhooks?▼

Use the X-Shopify-Webhook-Id header as an idempotency key: record processed IDs in a database and skip repeats, and pass the webhook ID as the BullMQ jobId so duplicate queue entries are rejected. Shopify retries up to 19 times over 48 hours.

Why does Shopify mark my webhook deliveries as failed?▼

Shopify flags deliveries that return non-2xx status or take longer than 5 seconds. Respond 200 immediately in the HTTP handler and offload heavy work like ERP syncs to a background queue with retries and exponential backoff.