Test Shopify webhooks
Get a URL for store or app webhooks, see each delivery with its topic, check X-Shopify-Hmac-Sha256 with your secret, and forward deliveries to your local server. Free, no signup.
Get a webhook URLAdd the URL in Shopify
- Open webhookcat.com, copy your URL and add
/webhooks/shopifyto the end. Sub-paths are kept when requests are forwarded, so this one reaches the route in the code below. - In your Shopify admin, open Settings, then Notifications, then Webhooks, and click Create webhook.
- Choose the event and the JSON format, paste your WebhookCat URL, pick a webhook API version and save.
- Open the menu on the webhook's row and click Send test.
What Shopify sends
- X-Shopify-Topic
- The topic, such as
orders/create. - X-Shopify-Hmac-Sha256
- The base64 HMAC-SHA256 of the body.
- X-Shopify-Shop-Domain
- The store's
myshopify.comdomain. - X-Shopify-Webhook-Id
- A unique ID for the delivery. Use it to spot duplicates.
- X-Shopify-API-Version
- The API version the payload was serialized with.
Check the signature
Open a request in WebhookCat and paste the secret into the Signature box under it. You'll see right away whether it matches. The check runs in your browser, and the secret is never sent or saved.
Webhooks created in the admin are signed with a key shown on the same Webhooks page. Webhooks an app subscribes to are signed with the app's client secret.
The same check in your own Node.js server:
import crypto from "node:crypto";
import express from "express";
const app = express();
const secret = process.env.SHOPIFY_CLIENT_SECRET;
const raw = express.raw({ type: "application/json" });
// Constant-time comparison; timingSafeEqual needs equal lengths.
const matches = (a, b) => {
const x = Buffer.from(a);
const y = Buffer.from(b);
return x.length === y.length && crypto.timingSafeEqual(x, y);
};
app.post("/webhooks/shopify", raw, (req, res) => {
const hmac = crypto.createHmac("sha256", secret).update(req.body);
if (!matches(hmac.digest("base64"), req.get("x-shopify-hmac-sha256") ?? "")) {
return res.status(401).send("Bad signature");
}
console.log(req.get("x-shopify-topic"), JSON.parse(req.body));
res.sendStatus(200);
});Forward to your local server
In the inbox you pasted into Shopify, open Share and run the command shown there. It forwards each request to localhost:3000/webhooks/shopify with the same headers and body, so the signature check in your code passes too. Needs Node.js 22 or later.
$ npx webhookcat listen 3000 --inbox "https://webhookcat.com/#<id>/<key>"Starting from the terminal instead? npx webhookcat listen 3000 creates a new URL and prints it. Paste that URL plus /webhooks/shopify into Shopify. More in the docs.
Good to know
- Shopify allows one second to connect and five seconds in total, and counts anything outside 2xx, including redirects, as a failure.
- Failed deliveries are retried 8 times over about 4 hours. A subscription made through the Admin API is deleted after 8 failures in a row, so don't leave a 500 response set for long.