The external e-commerce site where the sale occurs
Backend & Runtime / Knowledge library
Webhook
Delivers an HTTP callback when an event occurs
Why learn Webhook?
It integrates systems without continuous polling
The problem it solves
It pushes event notifications to registered external endpoints
Where it came from
Webhook is a networking and web concept that delivers an HTTP callback when an event occurs. Its guarantees and tradeoffs depend on the concrete implementation and operating context.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Define Webhook and distinguish it from a neighboring concept.
- Choose a realistic task where Webhook is appropriate.
- Identify a failure mode caused by misusing Webhook.
- Interpret a small design or result involving Webhook.
- Explain one tradeoff or limitation of Webhook.
Documentation and sources
- MDN Web Technology Glossary (developer.mozilla.org)
Connect the ideas
Explore next
Real World Example
Automated Inventory Sync for Artisan Marketplace
A boutique artisan marketplace platform connecting independent craftspeople with global buyers.
The business problem
The marketplace struggles with inventory synchronization; when a craftsperson sells an item on their own personal website, the marketplace platform remains unaware, leading to overselling and customer dissatisfaction.
How this topic solves it
By implementing a webhook architecture, the marketplace platform provides a secure endpoint to the craftspeople's websites. Whenever a sale occurs on a remote site, the remote site pushes an HTTP POST request to the marketplace, triggering an immediate inventory update without requiring the marketplace to poll every individual seller's database.
- The marketplace generates a unique, secret-protected webhook URL for each registered seller.
- The seller configures their e-commerce platform to send a JSON payload to the provided URL upon a successful checkout event.
- The marketplace server validates the request signature to ensure the payload originated from the trusted seller.
- The marketplace parses the payload and updates the internal database record for the specific SKU.
This diagram illustrates the flow of data from a seller's website to the marketplace platform when a purchase occurs.
The event payload containing SKU and quantity
The secure endpoint receiving the webhook
The internal database updated by the API
- Seller Store → triggers event → HTTP POST
- HTTP POST → delivers payload → Marketplace API
- Marketplace API → updates record → Inventory DB
Expected business outcome
The marketplace achieves near real-time inventory accuracy, significantly reducing the frequency of oversold items and improving the reliability of the platform for end-users.
Limitations and checks
Webhooks rely on the sender's ability to successfully reach the receiver's endpoint. If the receiver's server is down or experiences a network timeout, the event notification may be lost. To check for this, developers must implement a retry mechanism with exponential backoff and maintain an event log to identify failed delivery attempts.