Webhooks
Webhook handlers export app.defineWebhook().
import { app } from '#app'
export const ordersCreate = app.defineWebhook({ async run({ topic, shop, shopifyApp, payload, apiVersion }) { console.log({ topic, shop, shopifyApp, apiVersion, payload }) },})Register handlers in config:
import { app } from '#app'import { ordersCreate } from '#webhooks/ordersCreate'
export default app.defineConfig({ flows: {}, webhooks: { 'orders/create': ordersCreate, },})Context
Section titled “Context”| Field | Purpose |
|---|---|
topic |
Shopify webhook topic. |
shop |
Shop domain. |
shopifyApp |
Internal app handle. |
payload |
Parsed webhook payload. |
apiVersion |
Shopify API version used by the webhook. |
OpenShop verifies Shopify webhook HMAC signatures before calling handlers.