All work
Entry 03 of 03
Work
Webhook Event Delivery
Pick up an update when the service that owns it sends an event
Read the walkthrough
- Receive the payment event
- Record the event ID
- Acknowledge delivery
Overview
I build a webhook receiver that checks the incoming message, records the event, and acknowledges delivery. Keeping the event ID lets the receiver recognize a retry without applying the same update twice.
What it covers
- Webhook endpoints
- Event validation
- Duplicate handling
- Delivery acknowledgements
Receive a webhook reliably
- Set up a FastAPI endpoint for one test event and validate the incoming message using the provider's verification method.
- Record the event ID in SQLite together with the update so a repeated delivery cannot apply the update twice.
- Acknowledge delivery after that record is saved, then send the same test event twice and verify that it produces one update.