Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I created a webhook via the Notifications in Shopify Admin, then after a couple of days it is getting removed even tho i follow the step to verify it. Here's my code.
Hey @I_KNOW_NOTHING
Code is looking good - your logs indicate a 200 is returned.
Is the endpoint always online/available? If the webhook can't be delivered 19 times (over 48 hours) it will be removed. More info.
Are you able to create the webhook using an app instead of in admin? This will give you access to webhook delivery metrics to troubleshoot delivery failures and get information on performance.
Scott | Developer Advocate @ Shopify
Hey @SBD_ ,
Yea, the endpoint is always online/available as i was using a cpanel webhost rather than a heroku.
Are you able to create the webhook using an app instead of in admin? - Regarding this one, do you have a simpler version of this instead of using the "npm init @shopify/app@latest" as this seems like overkill just for my simple webhook function.
For sure. You can create a custom app in the Shop's admin to get an API key and then hit the webhooks endpoint directly.
Scott | Developer Advocate @ Shopify
Hey @SBD_
I tried what you recommend and create a private app but still following the verification code i sent above. I encountered this issue.
I change the CLIENT_SECRET with the value of the custom apps API Secret Key
But it isn't getting verified at all (unlike the initial webhooks I had)
I actually tried using the value of Admin API access token as well as API key (all of them returned not verified)
Hey @I_KNOW_NOTHING
You're correct in using the API secret key. Confirming the app has subscribed to these webhooks notifications (instead of via admin)?
Scott | Developer Advocate @ Shopify
Hi @SBD_
Sorry if I took too long to reply but yes i am subscribed via the Notifications tab.
Hey @I_KNOW_NOTHING
To use the webhook delivery metrics, you'll need to subscribe to the webhooks through the API (REST / GraphQL) and verify them with your app's key.
Subscriptions created through the admin need to be verified using the key in the admin and wont show on the delivery metrics.
Scott | Developer Advocate @ Shopify