A webhook (also called a web callback or HTTP push API) is a way for an app to provide other applications with real-time information. A webhook delivers data to other applications as it happens, meaning you get data immediately. Unlike typical APIs where you would need to poll for data very frequently in order to get it real-time. This makes webhooks much more efficient for both provider and consumer.
Anatomy of a webhook
After you configure a webhook subscription, the events that you specified will trigger a webhook notification each time they occur. This notification contains a JSON payload, and HTTP headers that provide context. For example, the
orders/create webhook includes the following headers:
Some HTTP headers are particularly useful for your app. For example,
X-Shopify-Hmac-Sha256 is used to verify webhooks, and
X-Shopify-Shop-Domain is used to identify the store that’s associated with them.
X-Shopify-API-Version is used to confirm what version of the Admin API used to serialize the webhook event payload. You can configure your app to use a specific API version for all webhooks and that version will be used whenever possible. If an app is set to use an API version that is no longer supported, then Shopify will fall forward to use the oldest supported version.
Webhook subscriptions are scoped only to the app that they’re registered to. This means that when a webhook subscription is registered to an app, other apps can’t view, modify, or delete it. For more information about how to authenticate webhooks, see Using webhooks. For general information about authentication, see the OAuth documentation.