Webhooks created via API are not triggering

Hi all,

I’m building a custom app for a store and I need to get notifications when there’s a new order. I have done this before, but for some reason when I create a webhook via the API, I don’t receive the notifications.

What I’ve done in a test store:

  • Create an app in settings → Apps & sales channels-> Develop Apps → Create an App.
  • Configured the permissions write_resource_feedbacks, read_resource_feedbacks, read_returns, read_orders
  • Created an API access token.
  • Using the GraphQL API, called the mutation webhookSubscriptionCreate with these variables (I’m using webhook.site for testing):
{
      "topic": "ORDERS_CREATE",
      "webhookSubscription": {
        "callbackUrl": "https://webhook.site/xxxxxxxxxxxxxxx",
        "format": "JSON"
      }
    }
  • Go to the test store and place a purchase using the bogus gateway.

I’m expect to see the webhook call, but it never arrives.
If I manually create the webhook in Settings → Notifications → Webhooks, I do receive the webhooks.

I’m wondering if I’m doing something wrong or if the API tokens created by custom apps have slightly different behaviour that tokens generated in other ways.

Bumping this as it was waiting for moderator approval for a week.

One more bump to see if this gets answered. My client keeps messing up with the webhooks the application needs and it would be amazing to be able to manage these programmatically to avoid user errors.

Do these two steps and first share your findings. Such issues needs a step buy step debugging to resolve.

  1. Verify Webhook Registration
  • Check Mutation Response: Ensure the webhookSubscriptionCreate mutation was successful. The response should include the webhook’s id, topic, and callbackUrl. Example response:

json

CollapseWrap

Copy

{ "data": { "webhookSubscriptionCreate": { "webhookSubscription": { "id": "gid://shopify/WebhookSubscription/123456789", "topic": "ORDERS_CREATE", "endpoint": { "__typename": "WebhookHttpEndpoint", "callbackUrl": "https://webhook.site/xxxxxxxxxxxxxxx" } }, "userErrors": [] } } }

  1. Query Existing Webhooks**: Use the GraphQL API to list all webhook subscriptions to confirm your webhook is registered:

graphql

CollapseWrap

Copy

query { webhookSubscriptions(first: 10) { edges { node { id topic endpoint { __typename ... on WebhookHttpEndpoint { callbackUrl } } } } } }

Run this query to verify that your webhook with the correct topic (ORDERS_CREATE) and callbackUrl appears in the list.

  1. Confirm Access Scopes
  • The ORDERS_CREATE webhook requires the read_orders or read_marketplace_orders scope, as it involves protected customer data

Share whats your finding when you do the above for next steps to be taken to resolve.