Skip to main content
Meridian receives your app’s Shopify webhooks over Pub/Sub and forwards the ones you routed to your app. Meridian re-serializes the event, so Shopify’s own HMAC can no longer validate the body. Verify Meridian’s signature instead.

Credentials

On Meridian hosting, your next deploy injects MERIDIAN_WEBHOOK_SECRET and MERIDIAN_API_KEY automatically, along with MERIDIAN_APP_ID and MERIDIAN_API_URL. The signing secret verifies forwards and the host challenge. The API key authenticates SDK calls such as event tracking. For hosting elsewhere, declare these credentials yourself. In local development, meridian dev injects MERIDIAN_APP_ID, a dev API key and MERIDIAN_API_URL, but not MERIDIAN_WEBHOOK_SECRET: a local app does not receive forwarded webhooks. A manually declared MERIDIAN_WEBHOOK_SECRET or MERIDIAN_API_KEY also takes precedence on Meridian hosting. See Credentials and environment for the managed values, override rules, and staging API configuration.

The receiver route

One route handles both the verification handshake and real events. Try the challenge first, then fall through:
app/routes/webhooks.shopify.tsx
Take the shop only from the verifier’s result. Most Shopify payloads carry no shop domain, and a forward’s X-Shopify-Shop-Domain header is trustworthy only because the v3 signature covers it. Code that reads the header after a check that does not cover it can be made to apply one store’s event to another.
Verify against the raw body, exactly as received. Parsing and re-serializing the JSON changes the bytes the signature was computed over, and verification fails.
topic is in Shopify’s header form: lowercase with a slash, such as orders/create or app/uninstalled, never the GraphQL enum form (ORDERS_CREATE) used in the managed topics table below. A case written in the enum form never matches, and the handler answers 200 having done nothing. Meridian waits 30 seconds for the answer and sends a timed-out forward again, so answer quickly, do slow work afterwards, and skip a webhookId you have already handled. See Retries and permanent failures. The default forward path is /webhooks/shopify. Your dashboard’s webhook configuration decides which topics reach it, and Add webhook on the Pub/Sub > Webhooks page starts every new topic there. One route that switches on the verified topic serves them all. You can give a topic another path, and your app must then serve a route at it. See Pub/Sub.

The host verification challenge

An app hosted outside Meridian (Heroku, Fly, your own server) receives forwarded webhooks at an external domain. Declare its https:// origin on the app’s Settings > Domains page, under External domains, then click Verify. Meridian sends a signed POST to your forward path on that origin with the body { type: "meridian/verify", nonce, app_id }, expecting an answer only the holder of your signing secret can compute. A domain that answers is verified: your app runs there and its SDK holds the secret. It does not prove who owns the domain. Then pick the domain in the Forward host select on the Pub/Sub > Webhooks page. The select lists your Meridian deployment when the app is deployed, and every verified external domain. Pending and failed domains are listed but can’t be picked, so the forward host you choose takes effect from the next event. See External domains. meridianChallengeResponse computes the answer. A non-null result is the JSON to respond with, at HTTP 200. null means this is not a challenge, or the signature did not verify. Fall through to the event path.

What the signature covers

verifyMeridianWebhookDetailed is the one to use. Every forward of a Shopify event carries these headers: The timestamp has to be within 300 seconds of now, in either direction, and a signature has to match, so a captured request stops verifying once the window passes. Override it with toleranceSeconds. A forward re-sent with another shop, topic or webhook id fails v3, and a v3 failure never falls back to v2. The result is { ok: true, version: 3, shop, topic, webhookId } for a verified v3 signature, { ok: true, version: 2 } for a forward that carried only v2, which proves the body but not the shop, and { ok: false } otherwise. requireVersion: 3 refuses anything but v3. The host verification challenge is not a Shopify event, so it carries no v3 signature, and meridianChallengeResponse checks it against v2. verifyMeridianWebhook runs the same checks and answers a boolean. A true from it proves the shop only when you passed requireVersion: 3. Since SDK 3.0, a request without a timestamped signature is refused. The legacy body-only X-Meridian-Signature check has no replay protection and covers neither the shop nor the topic, and it runs only when you pass requireTimestamp: false. verifyForwardedWebhook(rawBody, signatureHeader, secret) is that legacy check on its own and is deprecated. Meridian stops sending the header once no supported SDK version falls back to it.

Rotating the signing secret

The signing secret comes from your app in the Meridian dashboard. Meridian hosting injects it as MERIDIAN_WEBHOOK_SECRET, and for a hosted app the Signing secret row of Pub/Sub > Webhooks says so. Elsewhere, set that variable yourself. When you rotate it, the v3 and v2 headers carry a signature for both secrets for 24 hours, so a receiver still holding the old value keeps verifying while you roll out the new one. Two details matter during that window:
  • The legacy body-only check carries one signature, so it switches to the new secret immediately. An app still on verifyForwardedWebhook gets no grace period.
  • The challenge answer is accepted from either secret for the same 24 hours.
Redeploy each Meridian-hosted environment promptly to receive the new secret. If you set MERIDIAN_WEBHOOK_SECRET yourself, update its value before redeploying.

What the SDK registers for you

You don’t declare the topics Meridian forwards in shopify.app.toml. afterAuth reconciles a shop’s Pub/Sub subscriptions from the set Meridian resolves (the managed billing topics plus whatever you routed), and unions the managed ones in even when the configuration is unreachable, so an outage cannot drop billing events. An outage does not send them to another environment either: the SDK keeps the Pub/Sub topic Meridian last served, and falls back to the production topic only on the production API. On staging, dev or a local API with no topic known yet, it registers nothing and reports the failure in errors. See afterAuth. Five topics are managed by the platform and always registered: SHOP_UPDATE is newer than the other four. A store installed before it was added gets the subscription the next time it authenticates (its next afterAuth), or as soon as you call registerWebhooks for it. On Meridian hosting, saving your webhook routes in the dashboard registers it on every installed store at once. Until then, the store’s plan and domain still refresh whenever it authenticates. If you had already routed shop/update to your app, that route is now the managed topic’s forward path: your app keeps receiving it, and you edit the path where you edit the other managed topics. Apps on the same Meridian environment publish to that environment’s Pub/Sub topic, so each subscription’s name tells Meridian which app it belongs to. The name carries your app’s routing key, a private value the SDK reads from Meridian along with the topic to target, so you configure neither. Treat the key like a credential: the dashboard never shows it, and it should stay out of your logs too. registerMeridianWebhooks registers the five managed topics alone and, because it takes no API key, defaults to the production topic (pass delivery to target another environment). registerWebhooks on the app object reconciles the full set, including your own topics, against the served target.

Subscriptions named with your app’s ID

Subscriptions registered before the routing key are named with your app’s ID. Meridian keeps routing them for a transition period, then stops: after that, a delivery under an ID-named subscription no longer reaches your app. With a current SDK, a store moves to the routing key on its own at its next afterAuth, which renames its subscriptions in place. To move every store at once, call registerWebhooks on the app object for each of them. registerMeridianWebhooks cannot do it: it takes no API key, so it cannot read the routing key and keeps the ID-based name. On Meridian hosting, saving your webhook routes in the dashboard renames them on every installed store. Meridian subscribes these topics, managed and routed, on Shopify Admin API version 2026-04, whatever your app’s own apiVersion and the api_version in your shopify.app.toml, so their payloads keep that version’s shape when you upgrade your app. The version moves with SDK and platform releases. A forward does not carry X-Shopify-API-Version.

Webhooks declared in shopify.app.toml

A topic in the [webhooks] section of shopify.app.toml is a different path: Shopify sends it straight to the uri you gave, and Meridian never sees it.
  • It never shows in Meridian’s deliveries (the Pub/Sub tab or webhook_deliveries_list), so “no delivery row” says nothing about it.
  • Verify it with Shopify’s HMAC (authenticate.webhook in the React Router template), not with verifyMeridianWebhookDetailed.
  • Its payload follows the toml’s [webhooks] api_version.
  • A topic declared there and routed on Meridian reaches your app twice. Pick one path per topic.
The template declares app/uninstalled and app/scopes_update in the toml. They keep working beside Meridian’s managed APP_UNINSTALLED, which Meridian handles itself and forwards only if you route it.

Testing your receiver

A forward needs a deployed app and a real event:
  1. Deploy to your production environment. Forwards never reach a development or staging environment, or a local meridian dev (see Where forwards go).
  2. Trigger the event on a development store that has the app installed (create an order for orders/create, for example).
  3. Check the delivery on the Pub/Sub tab, or with webhook_deliveries_list in Meridian MCP: processed with a 200 response code is a success. failed gives the status and path your app answered.
shopify app webhook trigger sends Shopify-signed test requests with no Meridian signature, so the receiver above rightly refuses them with 401. Don’t loosen verification to make them pass. A delivery that failed is not sent again: trigger a new event after a fix.

Signature constants

If you build the verification yourself, the header names and the default window are exported: MERIDIAN_SIGNATURE_HEADER, MERIDIAN_SIGNATURE_V2_HEADER, MERIDIAN_SIGNATURE_V3_HEADER, MERIDIAN_TIMESTAMP_HEADER and MERIDIAN_SIGNATURE_TOLERANCE_SECONDS. If you do, take the shop, topic and webhook id only from headers your v3 check covered.
Last modified on November 22, 2026