Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
I have a product/update
Shopify webhook. When the webhook event comes, I see the JSON payload but I don't get any clue about who updated the product. I need the username or email or whatever to identify the user who triggered the webhook. Is that even possible ? If yes, how ?
Hey Hari,
You can accomplish this by adding the parameter that identify the user to the Webhook Address. For example, it can look like this:
https://myapp.com/webhooks/ProductUpdate?userId=[USER_ID]
Also, remember to authenticate the Webhook 🙂
What is a webhook address ? Did you mean the url which is used to create the webhook ? Also, I shouldn't append that USER_ID to the url, I expect to come to me through the webhook event automatically.
Hi Hari,
It isn't possible to know who triggered a product update webhook notification.
You can accomplish this by adding the parameter that identify the user to the Webhook Address.
Ummm... no. Since Shopify is making the POST, how would you do that?
Please see https://help.shopify.com/en/api/reference/events/webhook for more info.
Gavin.
Thanks for letting me know about that. Is there anyway we can request this to shopify. Because that is a highily essential and obvious requirement.
Sorry, I think I misunderstood the question. I thought you were asking about the app user, not the shop user.
As Gavin wrote, it’s not possible to identify who triggered a webhook.
Just to add to my first post, it’s also possible to get the shop url from “X-Shopify-Shop-Domain” header, which is sent with every webhook.