A payment webhook is a small HTTP request with an outsized job: it tells your system that money moved. When it fails, nothing crashes. The customer sees a success page, the gateway has the money, and the order sits in a pending state until somebody notices. That quiet failure mode is why webhook reliability is hard to budget and easy to postpone.
This guide breaks the cost into lines you can scope, gives you a calculator that uses your own figures, and lists the questions that separate a serious integration quote from an optimistic one.
What reliability actually means
A webhook integration is reliable when six things hold at the same time:
- Delivery survives failure. The gateway retries when your endpoint times out or returns an error.
- Duplicate events are harmless. The same event may arrive twice, so the handler must be idempotent.
- Ordering is not assumed. A refund notice can arrive before the original payment notice.
- Authenticity is checked. Signatures and timestamps are verified before any state change.
- Missed events can be recovered. A replay or fetch-by-id path exists for gaps.
- Settlement is reconciled. The provider's settlement file, your order table and your ledger agree.
Miss any one of these and the integration works most of the time, which is the worst kind of working.
The seven cost lines
- Integration audit. Map every payment flow, every event type and every system that reacts to it. Most quotes skip this and discover the second flow halfway through.
- Endpoint build. An idempotent handler, an inbox table for raw events, a queue for processing and a clear failure path.
- Reconciliation job. A scheduled comparison of gateway settlement, orders and ledger, with an exception queue that a human can work.
- Observability. Delivery logs, error alerts, a dashboard of pending and unmatched payments, and a named person who receives the alert.
- Testing. Sandbox tests, failure injection, duplicate delivery, out-of-order events and a simulated provider outage.
- Run cost. Queue throughput, event storage, monitoring and the retry traffic itself.
- Internal operations time. Daily exception review, customer follow-up and month-end reconciliation.
Lines one to five are project cost. Lines six and seven are the recurring cost, and they are where most budgets are wrong.
A calculator you can fill in
Use your own measurements. The placeholder numbers below exist only to show the method, not to describe the market.
- Delayed cash exposure = monthly transactions × failure rate × average order value.
- Manual recovery cost = failed transactions × minutes per case ÷ 60 × loaded hourly cost.
- Reconciliation labour = hours per week spent matching payments × loaded hourly cost × 4.3.
- Annual run cost = monthly infrastructure and monitoring cost × 12.
As an illustration: 4,000 monthly transactions, a 0.5 percent failure rate and an average order value of BDT 2,500 gives 20 affected orders and BDT 50,000 of delayed cash in a month. That is arithmetic, not a benchmark. Replace all three inputs with your gateway reports before you use the number in a business case.
The more useful output is the ratio. If manual recovery and reconciliation labour cost more each year than the engineering work that removes them, the business case is easy. If they do not, fix the monitoring first and postpone the rebuild.
What to ask a payment provider
- How long is the retry window, and on what backoff schedule?
- Is there an idempotency key, and is it stable across retries?
- How are signatures generated, and what is the timestamp tolerance?
- Can we list delivery attempts and replay a specific event from the dashboard or API?
- Are events ordered, or must we sort by event timestamp?
- Does the sandbox reproduce failure and delay behaviour, or only the happy path?
- What settlement or report file is produced, at what cut-off time, and in what format?
- Is there a status endpoint we can poll as a fallback?
If a provider cannot answer the replay and settlement questions, treat the integration as manually reconciled and price the labour accordingly.
A 90-day plan
- Week 1-2: audit flows and events, and pull three months of settlement data to measure the real failure rate.
- Week 3-5: build the idempotent endpoint, inbox table and queue. Add signature verification.
- Week 6-7: add reconciliation, an exception queue and alerting with an owner.
- Week 8-9: run failure tests: duplicate events, out-of-order events, a 30-minute provider outage, a database restart.
- Week 10-12: shadow-run the reconciliation against the old manual process, then switch over and keep the manual check as a weekly sample.
Metrics
- Webhook delivery success rate, by event type.
- Duplicate rate and duplicate-related support tickets.
- Unmatched payments at the end of each day.
- Time from payment to order confirmation.
- Reconciliation breaks per 1,000 transactions.
- Mean time to detect a failed event.
The Bangladesh context
Most local checkouts combine a card or mobile financial service gateway with cash on delivery, and often more than one provider. Each provider has its own retry behaviour, settlement cut-off and reference format. That makes the reconciliation job the hardest part of the build, not the endpoint. Build a canonical payment record with one internal identifier, map each provider's references into it, and keep the raw payload. When a customer sends a screenshot at 11pm, the support team can answer from one screen instead of three dashboards.
Where this fits in our work
If you need the integration rebuilt or reconciled properly, start with Commerce Systems; the pricing page explains how we scope fixed-fee and retainer work. For the finance side, read how daily payment reconciliation changes as you grow.
Sources
- RFC 9110, HTTP Semantics, accessed 17 November 2026.
- Stripe, Webhooks documentation, accessed 17 November 2026.
- Bangladesh Bank, Mobile Financial Services data, accessed 17 November 2026.
- PCI Security Standards Council, accessed 17 November 2026.
Responses (0)
No comments yet. Add the first one below.
Leave a response
Your email address will not be published. Required fields are marked *.