<strong>Webhooks</strong> are automated messages sent from one app to another when a specific event happens. Instead of constantly checking for updates (polling), the app notifies you immediately when something changes.
The Doorbell Analogy
Instead of checking your door every 5 minutes (polling), you wait for the doorbell to ring (webhook). The delivery service notifies you exactly when your package arrives.
Your House (Your App)
Waiting for delivery
Doorbell (Webhook)
Notifies you
Delivery (Event)
Package arrives
Payment Completed
HTTP POST Request
Receives Notification
Register webhook URL
Tell the service where to send notifications
Event happens
User makes payment, creates account, etc.
Service sends HTTP POST
Immediately sends data to your webhook URL
Your server receives
Process the event data
Respond with 200 OK
Confirm you received the webhook
Wrong
"Webhooks and APIs are the same"
Correct
<strong>APIs are pull (you request), webhooks are push (they notify)</strong>. APIs require you to ask for data; webhooks automatically send data when events occur.
Stripe payment webhooks:
User completes payment on your site
Stripe immediately sends webhook to your server
Your server receives payment confirmation
You can update order status, send email, etc. in real-time