Webhooks & Idempotency

Delivering reliable asynchronous callbacks and preventing duplicate payments or orders on network retries

Difficulty: Intermediate · Read time: 7 min · Access: Step-1 Preview + Knoera Pro

How It Works

Webhooks invert polling: instead of a client repeatedly asking "is it done yet?", the provider sends an HTTP `POST` callback to the subscriber’s URL when an event occurs. Because networks drop acknowledgments (`ACKs`) and trigger retries, both outbound webhooks and payment APIs require Idempotency—guaranteeing that retrying the exact same request 3 times produces the exact same state change and response as executing it once.

Why It Matters

Without idempotency keys, a customer tapping "Pay $50" on flaky subway Wi-Fi (Wireless Fidelity) can be charged twice or receive duplicate orders when their mobile app safely retries a timed-out HTTP request.

Interactive Architecture Scenarios

  • Duplicate Retry Protection with Idempotency Key
  • Failure Mode: Slow Sync Webhook & Missing HMAC

Related Lessons in APIs & Real-Time Communication