What is a webhook?
A webhook sends an event notification from one system to another, usually through an HTTP request to a configured endpoint. Instead of repeatedly asking whether something changed, the receiving system is notified when the provider emits an event. The notification’s delivery and ordering guarantees depend on the provider and must be checked in its documentation.
Reception and verification
The public webhook address requires a message authenticity check, for example a signature calculated according to the provider's rules. A secret URL fragment alone is not always sufficient security. Verify proper request bytes, time, and allowed event context. Don't trust a price or status just because a field has the correct name. Keep secrets out of public code and avoid writing full customer details in logs.
Duplicates and ordering
The source may resend an event after missing an acknowledgment, even if the recipient has already processed it. Use an event ID and idempotent handling to avoid creating multiple invoices or repeat shipments. Messages may arrive out of order, so an older notification should not undo a newer one. For a critical operation, read the current state of the source rather than treating every incoming message as the final truth.
Quick confirmation and queue
Save the verified event in a permanent location and do heavy lifting outside of the short receiving request. Confirmation of acceptance should not mean that all further steps have been completed. The queue needs failure handling, limited retries, and space for messages that require manual analysis. If you acknowledge receipt before storing permanently, a process failure may result in the event being lost without another attempt by the provider.
Testing the entire path
Check for valid signature, invalid signature, duplicate, delay, unknown type and missing fields. The payment test should confirm the appropriate order status, not just the HTTP response. Determine what will happen when the recipient is unavailable and how to recreate missing operations. The test environment should not send real documents or messages to clients. The synthetic result must be clearly distinguished from the verified production service.
Status monitoring and reconciliation
Measure collections, processing times and backlogs. The alert should indicate the process and the secure identifier, without revealing secrets. Periodic comparison with the source API helps detect missed changes. While a webhook improves response, it does not itself ensure that a business action is executed exactly once. Reliability comes from verification, persistent storage, deduplication, and the ability to perform controlled recovery when part of the integration fails.
Example of payment re-notification
The operator sends a success event, the application saves it, but the confirmation does not come back. The operator repeats the message. The recipient should recognize the ID and not send the goods or invoice a second time. If an older status arrives later, it cannot undo the newer one without analysis. At a critical point, retrieve the current state from an authorized source and apply the agreed transition rules.
Verify signature against documentation, with proper request body and protection against unwanted reproduction. Send confirmation after permanent acceptance and transfer the hard work to a controlled queue. Record cases requiring manual intervention and the ability to safely retry. A public endpoint should not assume any status just because the sender knows the name of the transaction_id field.