# Money debited. Order failed.

> The payment worked. The webhook did not.

- **Format:** short video, 10 steps, ~56 seconds
- **Topic:** Payment succeeded but the order was not created: why a slow payment webhook loses orders, and how saving the event first, placing the order from an Azure Service Bus queue and reconciling with the gateway every five minutes means every captured payment becomes an order.
- **Author:** Suthahar Jegatheesan (MSDEVBUILD)
- **Category:** Azure · Azure
- **Published:** 2026-10-05
- **Tags:** systemdesign, payments, webhooks, azure, azurefunctions, azureservicebus, softwarearchitecture, backenddeveloper, dotnet, interviewprep, msdevbuild
- **Canonical URL:** https://blog.msdevbuild.com/shorts/azure-payment-webhook-order-not-created/

---
## What you'll learn

- Why a slow payment webhook loses orders after the money is taken
- Why a webhook should save the event and answer 200 before doing any work
- How a reconciliation timer finds payments whose webhook never arrived

## Understand it one step at a time

### 1. The customer pays

Sunday lunch. ₹414 by UPI. The gateway captures the payment.

### 2. The webhook does everything

The gateway calls your webhook. It updates the order, calls the restaurant, sends a push: 14 seconds.

### 3. A restart kills it

An instance restarts mid-transaction. The order is never saved. The app was killed in the background.

### 4. Ten minutes, then failed

An expiry job marks every order still pending after 10 minutes as PaymentFailed.

### 5. The retry is ignored

At 30 minutes the gateway retries. The order is not pending, so the handler returns 200 and does nothing.

### 6. Save first, answer fast

The webhook only verifies the signature, saves the event, queues it and returns 200.

### 7. The queue places the order

A Service Bus queue hands the event to a processor. It places the order only if it is still pending.

### 8. Twice? Nothing happens

A retried webhook hits the saved event and an order that is no longer pending. Zero rows change.

### 9. No webhook? Ask the gateway

Every 5 minutes a timer asks the gateway about every order still pending. Captured? Place it.

### 10. Save the event, ask the gateway

Save first, place from a queue, reconcile every five minutes. Only the gateway can say a payment failed.

---

## The takeaway

**Save the event. Ask the gateway.**

Webhook: verify, save, queue, 200. Queue: place the order once. Timer: reconcile every five minutes.
