Topics covering webhook creation & management, event handling, Pub/Sub, and Eventbridge, in Shopify apps.
Hello everyone,
I have a little problem with webhooks. I have a webhook for Inventory Level Update. I did it with the idea that I wanted to sync 2 stores with the same products between them. When the quantity of a product changes, I receive a webhook to modify the quantity of the same product in the other store and vice versa. But from what I noticed, the problem is that when a larger order is placed, for example if there are over 100 items in order I don't get all the webhooks. Some are called later, I noticed some who called 7 minutes late, but also who called half an hour late. The problem is that some do not work at all. Or from what I've noticed, if a second order is placed on the same product in a short time I still don't get a webhook sometimes.
I use ruby on rails, and when I received the webhook I set a job to perform later, and I send the answer 200 OK. I also solved the problem with "429: Too Many Requests" in job by putting some sleepers. I put even more logs, I don't get any errors.
If anyone knows what it could be...
Thanks!
Hi,
Usually when you receive delayed webhooks it's because the first attempt at delivery failed due to either the destination host being unreachable or taking too long to respond with 200 OK.
Given that you're noticing this more with very large orders, perhaps it's an issue with not being able to receive a larger payload within the acceptable response time.
Can you provide the webhook subscription ID that you are having trouble with and we can try and look into any errors?
Thanks,
To learn more visit the Shopify Help Center or the Community Blog.
Post it here or send it somewhere?
I had the problem with take too long to respond with 200 and I solved it 2 days ago, doing jobs, I give the answer almost instantly. But now for debugging when I get the webhook I create a log, and it doesn't even seem to come to me.
You can send it directly to me.
Cheers
To learn more visit the Shopify Help Center or the Community Blog.
mike, exactly what you mean by webhook subscription ID? The webhook id, or what exactly?
Someone who has had this problem before?
Hi,
I was referring to the webhook subscription ID you can retrieve from calling the API. For example, if you refer to the docs here https://shopify.dev/docs/admin-api/rest/reference/events/webhook you will see that you can make a request to get a list of webhook subscriptions. You can either use the REST API or the GraphQL API to retrieve that information. With that along with the date that the webhook should have been sent on, I can trace the activity for that specific subscription.
Cheers
To learn more visit the Shopify Help Center or the Community Blog.