Developer guide

Shopify Webhooks
How they work, explained.

Webhooks are how a Shopify app reacts to store events in real time — orders, customers, uninstalls. This guide covers how they work, common topics, the critical HMAC verification step, the mandatory GDPR webhooks, and how to handle them reliably.

12 min read · Updated June 2026

On this page (9)
  1. What webhooks are
  2. How webhooks work
  3. Common webhook topics
  4. HMAC verification
  5. Mandatory GDPR webhooks
  6. Configuring webhooks
  7. Reliability & retries
  8. How AI builders handle it
  9. FAQ

1. What webhooks are

A webhook is an automated message that Shopify sends to your app when a specific event happens in a store. Instead of your app constantly polling Shopify — "any new orders? any new orders now?" — Shopify pushes a notification to a URL you control the instant the event occurs.

This is what makes apps feel real-time. When a customer places an order and your loyalty app instantly awards points, that's a webhook: Shopify sent your app an orders/create notification, and your app reacted. When a merchant uninstalls your app and your app cleans up their data, that's the app/uninstalled webhook firing.

Webhooks are the event-driven backbone of Shopify apps. Polling the API for changes would be slow, inefficient, and rate-limited; webhooks deliver events as they happen, which is both faster and far more efficient.

Push, not pull

The core idea: webhooks invert the usual request flow. Normally your app asks Shopify for data (pull). With webhooks, Shopify tells your app when something happened (push). This is why webhooks are essential for any app that needs to react to store activity — order processing, inventory sync, loyalty points, subscription events.

2. How webhooks work

The mechanics are straightforward once you see the flow:

  • You subscribe to a topic. A topic is an event type, like orders/create or customers/update. You tell Shopify which topics you care about and what URL to send them to.
  • The event happens. A customer places an order, updates their profile, etc.
  • Shopify sends an HTTP POST to your destination URL, with the event data as a JSON payload in the request body and several headers identifying the topic, the shop, and the HMAC signature.
  • Your app verifies and processes it. Your endpoint checks the HMAC (to confirm it's really from Shopify), then acts on the payload — awarding points, syncing inventory, whatever the app does.
  • Your app responds 200. A quick 200 status tells Shopify the webhook was received. Errors or slowness trigger retries.

The destination must be a publicly accessible HTTPS endpoint. During development you'll often use a tunneling tool so Shopify can reach your local server; in production it's your deployed app's URL.

3. Common webhook topics

Shopify offers webhook topics for a wide range of events. The ones apps use most:

TopicFires whenTypical use
orders/createAn order is placedAward points, sync, fulfill
orders/updatedAn order changesUpdate records, recalculate
orders/fulfilledAn order shipsTrigger review requests
customers/createA customer is addedEnroll in loyalty, sync CRM
customers/updateA customer changesKeep app data in sync
products/updateA product changesReindex, update bundles
app/uninstalledMerchant removes the appStop billing, flag cleanup
app_subscriptions/updateSubscription status changesActivate/deactivate features

You subscribe only to the topics your app needs. A loyalty app needs orders/create and the customer topics; a review-request app needs orders/fulfilled; every app needs app/uninstalled and the three mandatory compliance topics.

4. HMAC verification — the critical step

Because your webhook endpoint is a public URL, anyone could send a POST to it pretending to be Shopify. HMAC verification is how you confirm a webhook genuinely came from Shopify and wasn't forged or tampered with. Skipping it is a serious security hole and an App Store review failure.

How it works

Every webhook Shopify sends includes an X-Shopify-Hmac-Sha256 header containing a signature. Shopify computes this signature by running HMAC-SHA256 over the raw request body using your app's shared secret. To verify:

  • Take the raw, unparsed request body (this matters — parsing and re-serializing changes the bytes and breaks the check).
  • Compute HMAC-SHA256 of that body using your app's secret.
  • Compare your computed signature to the value in the X-Shopify-Hmac-Sha256 header, using a constant-time comparison.
  • If they match, the webhook is authentic. If not, reject it with a 401.
The most common HMAC bug

The single most frequent mistake is verifying HMAC against the parsed body instead of the raw bytes. Many web frameworks parse JSON before your handler runs, and re-serializing produces different bytes than Shopify signed — so the HMAC never matches. You must capture the raw request body before any parsing for verification to work.

5. The mandatory GDPR webhooks

Beyond the event webhooks you choose, every Shopify app must implement three compliance webhooks related to data privacy. These are required for App Store listing and are checked in review — and missing them is the single most common rejection reason.

WebhookFires whenYou must
customers/redactA customer requests data deletionDelete that customer's data
shop/redact48 hours after a store uninstallsDelete all that store's data
customers/data_requestA customer requests their dataProvide the data you hold

These must be implemented even if your app stores no customer data — the endpoints have to exist, verify HMAC, and return 200. They're configured through your app configuration file or the Partner Dashboard. For the full compliance picture, see the GDPR & compliance guide.

6. Configuring webhooks

There are three ways to subscribe to webhooks, used in different situations:

App configuration file (declarative)

You declare webhook subscriptions in your app's shopify.app.toml configuration file. This is the standard approach for the mandatory compliance webhooks and for topics every install needs. The subscriptions are applied when the app is deployed — declarative and version-controlled.

Partner Dashboard

You can configure the mandatory compliance webhook endpoints in the Partner Dashboard's app settings. This is a common place to set the GDPR webhook URLs.

Admin API (programmatic)

You can create webhook subscriptions dynamically through the Admin API (GraphQL webhookSubscriptionCreate or the REST equivalent). This is useful when subscriptions need to be created per-install at runtime or adjusted based on app state, rather than being the same for every merchant.

Most apps use a combination: declarative config for the universal and compliance webhooks, and the API for any dynamic, per-merchant subscriptions.

7. Reliability — retries, speed, and idempotency

Webhooks are reliable but not guaranteed-exactly-once. Building robust webhook handling means accounting for three realities:

Respond fast

Shopify expects a 200 response within a few seconds (around 5). If your processing is heavy, don't do it inline — acknowledge the webhook immediately with a 200, then process asynchronously (queue a background job). A slow handler causes timeouts, which Shopify treats as failures.

Handle retries and duplicates

If your endpoint fails or times out, Shopify retries the delivery over a window with backoff. This means your handler can receive the same webhook more than once. Your processing must be idempotent — processing the same event twice should not double-award points or create duplicate records. Use the event's identifiers to detect and skip duplicates.

Don't rely on webhooks alone for critical data

Webhooks can occasionally be missed (extended outages, edge cases). For critical data, supplement webhooks with periodic reconciliation via the API — a scheduled job that catches anything missed. Webhooks handle the real-time path; reconciliation is the safety net.

Idempotency is not optional

The most damaging webhook bug in production is non-idempotent processing. Because Shopify retries, a loyalty app that awards points on every orders/create delivery — without deduplicating — will over-award points when a webhook is retried. Always make webhook processing idempotent by keying on the event or resource ID.

8. How AI builders handle webhooks

Webhooks involve several things that are easy to get wrong: HMAC verification against the raw body, the three mandatory GDPR endpoints, fast acknowledgment with async processing, and idempotent handling of retries. This is exactly the layer where DIY and generic-AI apps fail — they skip HMAC verification, omit the compliance webhooks, or process non-idempotently.

A Shopify-specific builder like Shopivibe generates webhook handlers with HMAC verification, the three mandatory GDPR endpoints, and proper acknowledgment patterns by default. When you describe an app that needs to react to orders, the correct orders/create subscription and handler are generated — with the security and compliance pieces included, not bolted on later.

You still own and can extend the handlers. But you start from a webhook setup that verifies signatures, satisfies Shopify's mandatory compliance requirements, and won't fail App Store review on the most common rejection reason.

9. FAQ

What is a Shopify webhook?
A webhook is an automated message Shopify sends to your app when something happens in a store — an order is created, a customer is updated, the app is uninstalled. Instead of your app repeatedly asking Shopify 'has anything changed?', Shopify pushes a notification to a URL you specify the moment the event occurs. It's how apps react to store events in real time.
How do I verify a Shopify webhook is genuine?
Every webhook Shopify sends includes an HMAC signature in the X-Shopify-Hmac-Sha256 header. Your app computes its own HMAC-SHA256 of the raw request body using your app's secret, and compares it to the header value. If they match, the webhook is authentic. If they don't, reject it — it could be a forged request. This verification is mandatory for security and is checked in App Store review.
What are the mandatory Shopify webhooks?
Every app must implement three compliance (GDPR) webhooks: customers/redact (delete a customer's data on request), shop/redact (delete all store data 48 hours after uninstall), and customers/data_request (provide the data you hold on a customer). These are required even if your app doesn't store customer data — the endpoints must exist and respond. Missing them is the most common App Store review rejection.
How do I set up Shopify webhooks?
You can subscribe to webhooks in three ways: declaratively in your app configuration file (shopify.app.toml), through the Partner Dashboard, or programmatically via the Admin API (REST or GraphQL). The app config / Partner Dashboard approach is standard for mandatory compliance webhooks; the API approach is used for dynamic subscriptions. You specify the topic and the destination URL.
How fast does my app need to respond to a webhook?
Quickly — Shopify expects a 200 response within a few seconds (around 5 seconds). If your processing is slow, acknowledge the webhook immediately with a 200 and do the heavy work asynchronously (e.g., queue a job). If your app responds too slowly or returns an error, Shopify retries the webhook over a period, and persistent failures can lead to the webhook subscription being removed.
What happens if my app misses a webhook?
Shopify retries failed webhook deliveries over a window (with backoff), so a brief outage usually recovers. But you shouldn't rely solely on webhooks for critical data — best practice is to also reconcile periodically via the API, because webhooks can occasionally be missed. For mandatory compliance webhooks, persistent failure to respond can jeopardize your app's standing.
Do AI-built Shopify apps handle webhooks correctly?
A Shopify-specific builder like Shopivibe generates webhook handlers with HMAC verification and the three mandatory GDPR endpoints by default. Generic AI tools typically miss these — they don't generate the compliance webhooks or the HMAC check, which is why generically-built apps fail Shopify's review. The webhook layer is one of the clearest examples of why Shopify-grounded generation matters.
Get started

Build your own
Shopify app with AI

Describe the Shopify app you need — in plain language. Shopivibe handles everything Shopify requires and ships you a production-ready app. The code is yours to keep.

Start building free →
No developer neededLive app in minutesFull code ownership