APIs and integrations

3 min read ·

Webhooks: Your Partner Sent an Event. Should You Trust It?

A payment provider says the charge succeeded. Why receiving a webhook is not enough to complete the order safely.

A payment provider sends a successful-payment notification. The company can update the order, issue a receipt and trigger fulfilment. But what happens if the notification arrives twice? If someone forges a similar HTTP request? If the receiving service is temporarily down?

A webhook reports a change without forcing the recipient to poll an API constantly. The idea is simple. The implementation gets serious once money and customer promises depend on it.

Where it beats polling

With polling, an application repeatedly asks whether anything has changed. Many requests return nothing. With webhooks, the sender calls an agreed endpoint when an event happens. This can reduce unnecessary traffic and shorten the time to react.

But a webhook should not always be the only way to discover authoritative state. Reconciliation through the partner's API is valuable when notifications are delayed or missed, especially for payments, shipping or contract status.

Verify the sender before believing the message

An HTTP POST to the right URL proves very little. Providers may support signed payloads, shared secrets or other authentication mechanisms. Follow the actual provider contract, check message freshness where supported and do not treat an endpoint URL appearing in logs as a security boundary.

A genuine webhook may also describe an intermediate state rather than a final outcome. Payment authorisation, capture, refund and cancellation can be separate events. Interpret them according to the partner's semantics.

Acknowledge quickly and process reliably

A handler that tries to update several systems and send an email inside the webhook request is more likely to time out. A safer design often verifies the message, persists it durably and processes the downstream work separately.

Expect redelivery, possible ordering issues and provider-specific response requirements. Event IDs help with duplicate messages, while business operation IDs help avoid repeating the underlying effect when the partner sends a new event about the same operation.

Who notices a missing callback?

Monitoring should follow the business result, not only successful HTTP responses. If payment was captured but the order still has the wrong status, reconciliation should detect the discrepancy and recover from an authoritative source.

For rare changes that are easy to read through a normal API call, operating webhook delivery and recovery may be unnecessary. Where delay and event volume matter, it can be well worth the effort.

A webhook shortens the path from fact to reaction. It does not remove authenticity checks, duplicate handling or ownership of the order's final state.