Can transaction webhook fire before mutation response received?

Hi,

I have a query about the timing of Shopify webhook notifications. If our system calls the GraphQL admin API to create a refund on an order, is it ever possible that we would receive the transaction webhook notification for the refund before we receive a response for our GraphQL mutation?

In more general terms, do we ever need to worry about this race condition for any mutation that can trigger a webhook notification?

Thanks,

Paul

1 Like

Hey @P_Mac, this specific scenario isn’t something we have documented, but I would recommend building in a way that a webhook could possibly be sent before receiving an API response. One scenario where this is likely to happen is if running bulk operations.

Our docs do mention not relying on webhooks being sent in a certain order and instead relying on the timestamp sent in the headers About webhooks