How to Test Shopify Webhooks
Shopify webhooks deliver real-time notifications about events in your store — orders, products, customers, and more.
Looking for the broader picture? See the 7 best webhook testing tools (2026), or if you're already on Webhook.site, the 60-second migration to HookRay.
Shopify Official Webhook Docs1. Shopify Webhook Events
Shopify can send the following webhook events to your endpoint:
orders/createorders/fulfilledorders/cancelledproducts/createproducts/updatecustomers/createcarts/updatecheckouts/createrefunds/createinventory_levels/update2. Set Up a Test Endpoint with HookRay
Follow these steps to start receiving Shopify webhooks for testing:
- Go to HookRay and click "Start Testing — Free" to get your unique webhook URL.
- Copy the URL (e.g.,
https://h.hookray.com/abc123). - In your Shopify dashboard, navigate to the webhook settings and paste the HookRay URL as your endpoint.
- Select the events you want to receive (see list above).
- Trigger a test event — HookRay will show the incoming webhook in real-time.
3. Sample Shopify Webhook Payload
Here's an example of what a Shopify webhook payload looks like:
{
"id": 820982911946154500,
"email": "jon@example.com",
"total_price": "199.00",
"currency": "USD",
"financial_status": "paid",
"fulfillment_status": null,
"line_items": [
{
"title": "Premium Widget",
"quantity": 2,
"price": "99.50"
}
]
}4. How to Verify Shopify Webhook Signatures
- Algorithm
- HMAC-SHA256 (base64)
- Header
X-Shopify-Hmac-Sha256- Encoding
- base64
Node.js (Express)
import crypto from 'node:crypto';
import express from 'express';
const app = express();
app.post(
'/webhooks/shopify',
express.raw({ type: 'application/json' }),
(req, res) => {
const hmacHeader = req.headers['x-shopify-hmac-sha256'] as string | undefined;
if (!hmacHeader) return res.status(401).send('missing hmac');
const calculated = crypto
.createHmac('sha256', process.env.SHOPIFY_API_SECRET!)
.update(req.body) // raw Buffer
.digest('base64'); // NOTE: base64, NOT hex
if (
hmacHeader.length !== calculated.length ||
!crypto.timingSafeEqual(
Buffer.from(hmacHeader),
Buffer.from(calculated),
)
) {
return res.status(401).send('invalid hmac');
}
const event = JSON.parse(req.body.toString('utf8'));
res.json({ ok: true, topic: req.headers['x-shopify-topic'], id: event.id });
},
);Python (FastAPI)
import hmac, hashlib, base64, os
from fastapi import FastAPI, Request, HTTPException
app = FastAPI()
@app.post("/webhooks/shopify")
async def shopify_webhook(request: Request):
body = await request.body()
hmac_header = request.headers.get('x-shopify-hmac-sha256', '')
calculated = base64.b64encode(
hmac.new(
os.environ['SHOPIFY_API_SECRET'].encode(),
msg=body,
digestmod=hashlib.sha256,
).digest()
).decode()
if not hmac.compare_digest(hmac_header, calculated):
raise HTTPException(status_code=401, detail='invalid hmac')
topic = request.headers.get('x-shopify-topic')
return {'ok': True, 'topic': topic}Capture a real Shopify webhook with HookRay first, then replay the captured request against your verifier locally — that way you can iterate on the verification code without re-triggering events in Shopify. Read Shopify's official signing docs for the canonical reference, or see the cross-service signature verification guide for Ruby and timing-safe comparison patterns.
5. How Shopify Retries Failed Webhooks
- Max attempts
- 19
- Total window
- Up to 48 hours
- Backoff
- Exponential, ~hours apart between later attempts
- Retries on
- Non-2xx responses, timeouts
- Stops on
- Any 2xx response. After all retries fail, the webhook subscription is automatically removed.
If your handler is going to see the same Shopify event multiple times, you need idempotency by event ID and the right response codes — see the Webhook Retry Strategies guide for the full pattern (idempotency tables, dead-letter queues, replaying captured events for tests). Cross-reference with Shopify's official retry docs before relying on these numbers in production.
6. Frequently Asked Questions
How do I test Shopify webhooks without deploying?
Use HookRay to get an instant public webhook URL. Paste it into your Shopify dashboard's webhook configuration, trigger an event, and watch the payload arrive in real time. No code, no ngrok, no deployment required. The free tier captures 100 requests per month and works on all Shopify event types.
Why aren't my Shopify webhooks arriving?
The four most common causes: (1) the endpoint URL isn't publicly accessible — Shopify can't reach localhost; (2) the wrong events are subscribed in your Shopify dashboard; (3) signature verification is rejecting the request before your handler runs; (4) Shopify can't reach your server because of a firewall, expired SSL certificate, or wrong DNS. Use HookRay's URL to isolate which of these four is failing — if HookRay receives the webhook, the problem is in your handler. If HookRay doesn't, the problem is in Shopify configuration.
Why am I getting 400 or 500 errors from my Shopify webhook?
Shopify reports the response status your endpoint returned. HookRay accepts any payload and returns 200 OK by default, so if you see 400/500 in your Shopify dashboard while pointing at HookRay, the issue is in Shopify's configuration (wrong event, malformed signing secret, etc.). If you point at your own endpoint and get 400/500, the issue is in your handler — capture the request with HookRay, replay it locally, and debug from the captured payload.
How do I verify Shopify webhook signatures?
Shopify signs each webhook request with a shared secret. Capture the raw headers and body using HookRay, then verify the signature in your application using Shopify's SDK or a standard HMAC library. Once verification works against HookRay-captured data, you can safely deploy. Shopify's docs (linked above) cover the exact signing algorithm.
Can I replay a captured Shopify webhook?
Yes — HookRay's replay feature re-sends any captured webhook to a different endpoint with one click. This is the fastest way to fix a buggy handler: capture the payload once, fix your code, and replay until it works. No need to re-trigger the event in Shopify.
7. Next Steps
- Use HookRay's webhook replay feature to re-send captured webhooks while building your handler
- Enable smart parsing (Pro plan) to see Shopify-specific fields highlighted automatically
- Check the Shopify webhook documentation for the complete event reference
Ready to test Shopify webhooks?
Get a free webhook URL in 5 seconds. No signup required.
Start Testing Shopify Webhooks — FreeFree PDF: Webhook Testing Cheat Sheet 2026
One-page reference for 50+ APIs — canonical events, signing methods, sample payloads. Print it, pin it, share it.
📄 Download the cheat sheet (PDF, 180KB)