Backend engineering case study

What changed when we acknowledged payment webhooks sooner

At Jatis Mobile, moving order processing to background workers made payment confirmations more reliable during busy WhatsApp sales campaigns.

Lucky Akbar · Jatis Mobile, 2022–2024

Where the wait came from

Scarlett Whitening ran sales campaigns through WhatsApp. During traffic spikes, customers who had already paid at the gateway could wait for confirmation in chat. I traced the delay to the payment webhook.

The handler updated the order and did follow-up work before it responded. Under load, that work could run past the gateway’s timeout. The gateway retried delivery during the same spike, adding more requests while the service was processing orders.

What we moved out of the request

  1. The webhook handler validates the signature and payload.
  2. It queues the payment event and responds with 200 OK.
  3. Background workers update the order, sync internal systems, and send the WhatsApp confirmation.

With the order work handled by workers, the gateway could receive a response as soon as the payment event was queued.

What we observed after rollout

Acknowledgment time fell from about 5 seconds to under 1 second. In the observed rollout, the webhook error rate went from 70% to 0%, and customers received their WhatsApp confirmations sooner during campaigns.