To configure shop-specific subscriptions, use the GraphQL Admin API. Shopify recommends using your app configuration file in most instances, and when when configuring app-specific subscriptions. Refer to the tutorial for [setting up a subscription](/docs/apps/build/webhooks/subscribe/get-started) to learn how.
## Requirements
- You have created an app either using the Shopify CLI and the [Remix template](https://github.com/Shopify/shopify-app-template-remix), or if you are creating a custom app in the Shopify Admin.
- You have [Google Cloud Pub/Sub](https://cloud.google.com/pubsub) or [Amazon EventBridge](https://aws.amazon.com/eventbridge/) set up, or a server available for HTTPS delivery. To learn more about setting these event buses up, find the first steps in [the tutorial for setting up a webhook subscription](/docs/apps/build/webhooks/subscribe/get-started).
> Note:
> Shopify recommends using Google Pub/Sub as a cloud-based solution for delivering webhooks. You can also use Amazon EventBridge.
>
> In instances where you want to build your own webhooks infrastructure, you might prefer your webhooks be delivered through HTTPS - just know there are [extra considerations you'll need to take into account](/docs/apps/build/webhooks/subscribe/https).
## What you'll learn
In this guide, you'll learn how to do the following tasks:
1. Use the GraphQL Admin API to create a webhook subscription.
1. Test your subscription is configured correctly and you are receiving webhooks.
## Step 1: Create a webhook subscription
### Recommended: Use the Shopify CLI and Remix template
Shopify recommends that you use the Shopify CLI and Remix template when subscribing to webhooks using the GraphQL Admin API. The template abstracts away the actual GraphQL mutation you would otherwise have to write.
1. You might want to create a subscription to the `ORDERS_CREATE` topic using the GraphQL Admin API. Specify the topic name using GraphQL's enum screaming case syntax, as well as the subscription endpoint you want to use to receive webhooks.
> Info:
> Webhooks are divided by topic. Refer to the [Webhooks references](/docs/api/webhooks) for the complete list of supported webhook topics.
1. Add this information and the following code to your app in the `app/shopify.server.ts` file.
> Note:
> If you are using Amazon EventBridge, set `arn` to the ARN that you retrieved when you associated your event bus during setup.
### Developing with GraphQL mutations directly
For apps that are not using the Remix template, to create a new webhook subscription, you'll use the webhook subscription mutations found in our [GraphQL Admin API reference](/docs/api/admin-graphql/latest/queries/webhookSubscription).
1. You might want to create a subscription to the `ORDERS_CREATE` topic using the GraphQL Admin API. Specify the topic name using GraphQL's enum screaming case syntax, as well as the subscription endpoint you want to use to receive webhooks.
> Info:
> Webhooks are divided by topic. Refer to the [Webhooks references](/docs/api/webhooks) for the complete list of supported webhook topics.
1. Add this information and the following code to your app, wherever you process your after-authentication hooks. This would be the equivalent to the `app/shopify.server.ts` file in the Remix template, because this is where the `afterAuth` code lives.
1. You might want to test out your code or [example GraphQL queries](/docs/api/admin-graphql/latest/queries/webhookSubscriptions#section-examples) before adding it to your app. In this case, you can use the [`GraphiQL`](/docs/api/usage/api-exploration/admin-graphiql-explorer) interface by pressing `g` in the console where your app is running. You must include values for the variables in order to execute the mutations.
**Request**: `POST /admin/api/2025-01/graphql.json`
> Note:
> If you are using Amazon EventBridge, then set `arn` to the ARN that you retrieved when you associated your event bus during setup.
## Step 2: Test your subscription is working
You can use Shopify CLI's [`webhook trigger`](/docs/api/shopify-cli/app/app-webhook-trigger) command to test webhook delivery. When using this command, note the difference in the URI that you should input for the `--address` flag:
For Google Pub/Sub, the address is:
- `{project-id}`: The ID of your Google Cloud Platform project
- `{topic-id}`: The ID of the topic that you set up in Google Cloud Pub/Sub
For Amazon EventBridge, the address is:
- This is your ARN. You can find details in your Amazon EventBridge console: **Partner Event Sources** > **Select your event source** > **Partner event source ARN**.
> Caution:
> When you're using cloud-based event buses like Google Cloud Pub/Sub or Amazon EventBridge for delivery of your webhooks:
>
> * You receive a JSON payload for topics, but there will be additional fields included beyond the sample payloads displayed in the [Webhooks reference](/docs/api/webhooks).
> * You don't need to perform HMAC verification.
>