Skip to main content

Webhooks

The list of all webhook topics you can subscribe to. You can use webhook subscriptions to receive notifications about particular events in a shop.

Caution

If your app is distributed through the Shopify App Store, it must be subscribed to Shopify's mandatory compliance topics. You can create mandatory compliance webhook subscriptions either using your Partner Dashboard or by updating your app configuration file.


Anchor to getting-started-creating-subscriptions-using-the-app-configuration-fileCreating subscriptions using the app configuration file

You can subscribe to most topics through your app configuration file using CLI version 3.63.0 or greater.

If you create and manage your subscriptions in your app configuration file, they will be used across all shops that your app is installed on.

You can make app-specific subscriptions to all non-compliance topics through your app configuration file, or shop-specific subscriptions by Shopify's GraphQL Admin API.

For subscriptions managed with the GraphQL Admin API, the mutation you use will depend on how your webhooks will be delivered. For example, for HTTPS or local delivery, use the webhookSubscriptionCreate mutation to set up new webhook subscription. Specify the $topic and $webhookSubscription parameters to create subscriptions.

For Google Pub/Sub, use the pubSubWebhookSubscriptionCreate mutation, and for Amazon EventBridge, use the eventBridgeWebhookSubscriptionCreate mutation.

Creating subscriptions using app configuration file

[webhooks]
api_version = "2023-04"

[[webhooks.subscriptions]]
topics = [
"products/create",
"products/update",
"products/delete"
]
uri = "pubsub://example:pub-sub-topic1"

[[webhooks.subscriptions]]
topics = ["orders/create"]
uri = "pubsub://example:pub-sub-topic2"

Was this section helpful?

app/scopes_update: Sample Payload

{
"id": 1,
"shop_id": "gid://shopify/Shop/548380009",
"previous": [
"read_products"
],
"current": [
"read_products",
"write_products"
],
"updated_at": "2024-06-25T00:00:00.000Z"
}

Manage the number of event messages your app receives by filtering events. Unlike payload modifications, filters are made up of rules, applied to a webhook subscription, which act as a gate for whether or not webhooks are delivered when an event occurs.

Shopify provides you with a way to modify the payload you receive when you subscribe to webhook topics. Unlike filters, which always return the same payload, this feature enables you to specify what subset of information is most relevant to your use case from a webhook.

Filter events

[[webhooks.subscriptions]]
topics = ["products/update"]
uri = "https://example.com/webhooks"
filter = "id:* AND status:active AND (product_type:Music OR product_type:Movies) AND -invalid_field:* AND variants.taxable:true AND variants.weight:<5 AND variants.price:>=100 AND variants.title:Album*"