Webhooks done right
What makes a webhook implementation actually reliable, and what most APIs get wrong.
Webhooks are the backbone of event-driven payment flows. They are also one of the most misunderstood parts of any payment integration. Here is what separates a reliable webhook implementation from one that will silently lose events.
Always verify the signature
Every webhook delivery should include a signature a hash of the payload signed with a secret only you and the provider share. If you are not verifying it, anyone can POST to your endpoint and trigger your fulfilment logic.
Verification is one line of code. There is no excuse to skip it.
Respond fast, process async
Your webhook endpoint should do two things: verify the signature, return a 200. That is it.
If you do database writes, send emails, or call third-party APIs inside the handler, you will eventually time out. The provider marks the delivery as failed and retries. Now you are processing the same event twice.
Enqueue the payload and handle it in a background job. Keep the handler thin.
Idempotency is not optional
Providers retry on failure. Your endpoint will receive the same event more than once. If your handler is not idempotent if processing the same event twice causes duplicate charges, duplicate emails, or duplicate records you have a bug.
Store the event ID. Before processing, check if you have already handled it. If yes, return 200 and do nothing.
Handle out-of-order delivery
A payment.completed event can arrive before payment.created. This happens more than you would expect, especially under load. Your handler needs to be defensive about state — do not assume events arrive in the order they were emitted.
What normalised webhooks look like
When you integrate with multiple payment providers, each sends events in a different shape. Chapa's payload looks nothing like Telebirr's. You end up writing a normalisation layer for each one.
A good payments API abstracts this. You register one endpoint, you receive one consistent event shape regardless of which provider processed the payment. Your handler does not need to know which provider fired the event.
That is the model Access uses. One endpoint, one schema, all providers.