Hello, I am building an app that requires processing when an order is placed in a store that has my app installed. I read that I can use toml or admin API to configure webhook.
If I configure webhooks through toml, and I later need the app to subscribe to more webhook, can I simply update the toml file and redeploy the app? Or does updating webhook require merchants to reinstall my app?
What other differences are there between these two approaches?
No I believe Shopify manages the subscriptions for you under the hood. Merchants don’t need to accept permissions for the individual webhooks subscriptions to be managed.
You’ll just have to update the subscriptions field in your shopify.app.toml and deploy the changes.
However access token changes will need to be explicitly accepted, those change the permissions of your application.
But, if you choose to manage manually, you have more flexibility per merchant.
For example - If a merchant only uses your app with specific product collections, then you can conditionally enable a product update webhook on their account only.
Thanks for the answer. Does that mean when the app needs more webhooks to be subscribed, the merchants don’t need to reinstall the app? I am currently using GCP pubsub, do I need one pubsub for one store that install my app? Or one pubsub for all stores that use my app is enough?
I created an order on my store with this added to the toml and deployed, but it didn’t seem to publish to the topic in pubsub. I already provided the delivery@shopify-pubsub-webhooks.iam.gserviceaccount.com email with the Pub/Sub Publisher permission. Am I missing any steps?
Does your shop have Shop-specific webhooks already?
Please note that you need to delete Shop-specific webhooks using webhooksubscriptiondelete after migrating into Shop-specific webhooks.