← Back to all posts
Community question

What is your best practice for handling duplicate payment webhooks in travel booking?

By Alex Chen·Oct 20, 2026
When handling ticketing payments (especially agent wallet top-ups or credit card gateways), we occasionally receive duplicate webhook events within milliseconds due to network retries. Currently we use database transaction locks with an idempotency key (gateway reference + order id). Are there better distributed lock strategies or Redis-based token buckets you've had success with in high-load production environments?

1 approved reply

We use Redis Redlock with a 30-second TTL keyed on the webhook transaction ID, followed by a unique constraint on the database Payment record. The second webhook simply returns 200 OK without double-charging or duplicate ticket issuance.

By Tharindu Ruwanpathirana · Oct 20, 2026