I have an app that uses API to create Webhook for order/paid event. I use Azure function as an end point to receive the webhook. This function adds the message to Service Bus Queue for later processing and returns OK 200.
The problem is, that the same webhook gets called multiple times even if it receives 200 response!
Because of this I get a lot of 429 rate limit exceptions in my Queue processing Azure function.
Why is the same webhook called multiple times when the response is 200?
response is fast enough, average around 200ms.
This is draftOrderId, that was send to webhook end point and got called 3 times,
Azure Function response to webhook:
List of 3 identical request to webhook end point with same draftOrderId. Response is 429 because processing of webhook exceeds rate limit, But data is added to Queue and processed by separate function.
My functions always returns 200
Here you can see trace of calls for webhook. It is clear that function "OrderPaid" is executed with response before processing of Queue Worker starts
The draft order ID that you linked to is a saved draft order, and hasn't been turned into an order and marked as paid yet - so it won't trigger an orders/paid webhook. Orders/paid webhooks will only fire when an order resource is paid for, or a draft order is marked as paid which turns it into an order.
I also noticed that you have 59 orders/paid webhooks registered on this shop with different URLs, which would cause several webhooks to be sent. This means that for every order marked as paid on your shop, there would be 59 webhooks being triggered.
In good news, there don't seem to be any errors on our end and we're successfully receiving 200OK responses, but normally you would only register a single orders/paid webhook and send them all to one URL that processes them. If you were to remove all of your webhook subscriptions from this shop and then add one of them back again, I think you'll notice that this stops happening.