Webhooks created via API not sending events

Solved

Webhooks created via API not sending events

Jamie-27
Shopify Partner
2 1 1

In testing, I have successfully been able to create a webhook subscription via the API (have tried both GraphQL via the Shopify GraphiQL App, as well as REST via a test app); mutation below:

 

 

mutation webhookSubscriptionCreate($topic: WebhookSubscriptionTopic!, $webhookSubscription: WebhookSubscriptionInput!) {
  webhookSubscriptionCreate(
    topic: $topic
    webhookSubscription: $webhookSubscription
  ) {
    webhookSubscription {
      id
      topic
      format
      endpoint {
        __typename
        ... on WebhookHttpEndpoint {
          callbackUrl
        }
      }
      metafieldNamespaces
    }
  }
}

 

Variables:

 

{
  "topic": "ORDERS_PAID",
  "webhookSubscription": {
    "callbackUrl": "{my-callback-url}",
    "format": "JSON",
    "metafieldNamespaces": [
      "custom"
    ]
  }
}

 

However, when I do a test order, no event is sent to the callbackUrl. On the otherhand, the webhook I create from the Admin dashboard (i.e., `/settings/notifications/webhooks`) does successfully send events to the same URL. In installing the GraphiQL app and the test app, I gave all permissions to both.

Thank you for any insight as to why I am not receiving events.

Accepted Solution (1)

Jamie-27
Shopify Partner
2 1 1

This is an accepted solution.

Issue was due to an incorrectly structured callback url; my fault. Thanks

View solution in original post

Replies 2 (2)

jpena
Shopify Partner
5 0 0

I have the same problems, we detected this error a week ago, we have a webhook in several stores that connect to a microservice with the topic of products/update, usually when it should be called when an order is made and the level of inventory moves, we have this event like this since we also need the product information, normally we receive the webhook event no later than 1 minute after that order, but it is not sent, out of 44 orders 7 were not sent.
In addition to that, the products/update webhook is also removed from a store, we check and it complies with everything so as not to be removed, the only explanation is that their server has latency and marks it as non-200.

Jamie-27
Shopify Partner
2 1 1

This is an accepted solution.

Issue was due to an incorrectly structured callback url; my fault. Thanks