Cannot get pubsub webhook to work

I’ve tried to register to webhooks using Google Pubsub (mostly following this article: Subscribe to a webhook topic ) and it seems there’s something missing in my setup that is not documented. Apparently, others had issues as well (see this: Help with Shopify's GCP Pub/Sub Webhook Example ) but they don’t publish what they did differently to get things to work!

In my case, I have a python server that creates webhooks with the rest API (calling …/webhooks.json). The webhooks calls seem to work (getting 201), and querying for webhooks, I do get the created webhooks back. The pubsub also seems to work, as I’m able to listen to it, and send fake pubsubs to myself and receive them. I’ve double checked the URI and it is pubsub://<project_id>:<pubsub_topic_id> which is the standard URI for a Google pubsub to the best of my knowledge?

In the Dev Dashboard under monitoring, I do see that webhooks calls are failing, with 403, but there’s no error message as to why. It could be permissions to send to that pubsub, but I’ve added [email removed] as a principal with the role of “Pub/Sub Editor” to the pubsub topic itself. This is what the documentation mentioned. My guess is that there’s more to it in terms of permissions, but without any error message I cannot debug this further.

Would appreciate any help!

@Clique256

The 201 just means Shopify accepted the webhook. It doesn’t mean it can actually send anything yet. The real clue is that 403 you’re seeing in the dashboard. That means Shopify is trying to publish to Pub/Sub and Google is blocking it.

The biggest thing: Shopify doesn’t need Pub/Sub Editor. It needs Pub/Sub Publisher specifically. Even though Editor sounds higher, Google separates publishing from editing. Give the Shopify service account the Pub/Sub Publisher role on the topic itself, not just the project.

Indeed, the issue was that I added this permission on the subscription and not the topic. Now it works. Thank you!