I work as an internal developer for a company with a shopify store front and have written a custom application to sync our shopify orders with our internal order management system. The entire thing is based around the "Order Creation" webhook calling on an endpoint to kick off the process. It's working reasonably well.
Recently we've noticed an influx of duplicate orders into our system. The system still relies on human interaction for final approval, so thankfully none of our customers have been charged or actually received double orders. However, the problem appears to be caused by the webhook for "Order Creation" being called twice on some orders. There appears to be no firm commonality I can find between the orders that cause the webhook to fire twice and the orders that do not.
Anyone else have an issue with the order creation webhook?
Just to confirm - is your custom app sending back a 200 status code when it successfully receives an Order created event? In our webhook best practices guide, we do advise to set up your app to ignore duplicate calls by using idempotent operations - this means even if you receive the same webhook event a second time it should have no additional effect. You can detect duplicate webhook events by looking for identical X-Shopify-Webhook-Id headers, or by comparing the payload directly to the previous state.