A webhook endpoint receives events over HTTP when another system has something to report. That makes it useful for payment notifications, order updates, and integrations—but it also puts an internet-facing handler on the critical path of your application.
A reliable receiver has two separate jobs: establish that the message was authenticated, and process the event without losing it or applying it twice. A valid signature alone does not solve retries, replay, ordering, or storage failures.
Start with the sender's contract
Before writing a handler, find out:
Which request method, headers, body, and encoding does the sender use?
Exactly which bytes are signed, and is a timestamp included in the signed material?
How are keys, signature versions, and key rotation handled?
Which response codes count as success, and when will the sender retry?
Are event identifiers stable across retries, and is ordering guaranteed?
Do not infer one provider's behavior from another.…