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):
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.
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.
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: