Aquarius
WEB

Why Dubai Apps Double-Charge Customers (2026): Webhook Retries, Idempotency Keys and the Outbox Pattern

Telr retries webhooks 3 times in 15 seconds and SQS Standard delivers twice by design. Why Dubai apps double-charge, and what idempotency keys and an outbox cost in AED.

PUBLISHED
18 NOV 2026
READ TIME
12 MIN
AUTHOR
AQUARIUS · DUBAI
UNIT
REV 2026.09
Why Dubai Apps Double-Charge Customers (2026): Webhook Retries, Idempotency Keys and the Outbox Pattern

Short answer: Dubai apps double-charge customers because payment webhooks and message queues are at-least-once systems, and most local builds are written as if they were exactly-once. Telr retries a failed notification three times at five-second intervals, Amazon SQS Standard can deliver the same message more than once by design, and a shopper who taps “Pay” twice on a weak mobile connection generates two perfectly valid requests. The fix is three cheap patterns — idempotency keys, a transactional outbox and a deduplication store — not a bigger server.

This is the failure mode behind most “our payments are fine but accounting is a nightmare” conversations we have in Dubai. It shows up as duplicate orders, duplicate Aani transfers, double-posted invoices in the ERP, and a support queue arguing with customers about charges the system genuinely made twice. It is an architecture problem with a known, boring solution, and it costs far less to design in than to refund out. Updated November 2026.

Why 2026 is the year this starts hurting (the awareness case)

The UAE’s payment rails got fast, and fast rails punish sloppy retry logic. Three numbers set the stakes:

  • Aani reached 14.65 million enrolled users, around 875,000 merchants and 78 licensed financial institutions by October 2026, according to Al Etihad Payments. In its April 2026 update AEP reported a sixfold year-on-year rise in transfers, roughly 25,000 transfers a day by mobile number alone, and an average completion time of no more than three seconds. The CBUAE has put Aani transaction growth at +183% year on year.
  • UAE e-commerce is tracking about USD 12.30 billion in 2026 (Mordor Intelligence), on the way to roughly AED 67.2 billion by 2030 at a 9.9% CAGR. Dubai’s EZDubai data puts online shopping at 50% of consumer spend in 2024, up from 42% in 2022.
  • About 78.67% of UAE online orders now come from mobile. Mobile means lossy networks, app backgrounding and double taps — precisely the conditions that produce duplicate submissions.

A three-second settlement rail with no reversal flow and a 78% mobile mix is a system where the duplicate reaches the customer’s bank statement before your engineer reaches the log file.

The five ways a Dubai integration bills twice

  • Webhook retries. Telr’s documented behaviour is explicit: your endpoint must answer HTTP 200, and “3 attempts in total will be made with 5 second delay between each attempt.” If your handler takes six seconds to charge and then returns 200, Telr has already sent attempt two. PayTabs does not publish a retry schedule at all, which means you must assume repeats rather than plan around a documented count.
  • At-least-once queues. SQS Standard guarantees delivery at least once, not exactly once. Any consumer that charges, emails or posts a journal entry without a guard will eventually do it twice.
  • Dual writes. The classic bug: commit the order row, then publish the event. If the publish fails you have a paid order no downstream system knows about. If the commit fails after publish, you have an event for an order that does not exist. Retrying the whole block creates the duplicate.
  • Client double-submit. No request-level key, no server-side lock, two taps, two charges.
  • Reconciliation jobs. A nightly cron that re-reads the PSP and “fixes” missing records will happily re-create records that already exist under a different reference.

Pattern one: idempotency keys, done the way the PSPs do it

An idempotency key is a client-generated unique string sent with a mutating request, so that replays return the original result instead of performing the action again. Stripe’s implementation is the reference worth copying, and the details matter:

  • Keys are strings of up to 255 characters and are pruned after at least 24 hours — so your own retention window should be at least as long as your longest retry chain.
  • A replayed key returns the first response, including a 500. A cached failure is still a cached response; your retry logic must treat that as terminal, not as a reason to mint a new key.
  • Request parameters are compared against the original. Same key with different parameters is an error, not a silent overwrite.
  • Keys apply to POST only. GET and DELETE are idempotent by definition and ignore the header.

In practice: generate the key at the point of user intent (checkout button, not the retry wrapper), store it against the order, and send the same key for every attempt at that one logical payment. We cover the UAE-specific rail details in our guide to Aani and Jaywan payment integration.

Pattern two: the transactional outbox

The outbox pattern removes the dual-write problem entirely. Instead of writing to your database and then publishing to a queue, you write the business row and an outbox row in the same local transaction. A separate relay process reads unsent outbox rows and publishes them, marking each one sent.

Either both writes commit or neither does, so you can never have a paid order without its event. The relay can crash and restart freely — it will re-publish, which is why the consumer side still needs a dedup guard. That trade is deliberate: you convert an impossible-to-detect inconsistency into a duplicate you can detect cheaply.

For multi-brand or multi-branch platforms the outbox table needs the same tenant isolation as everything else — see multi-tenant SaaS architecture in Dubai for how we partition that.

Pattern three: deduplication windows and what SQS FIFO actually gives you

Teams reach for SQS FIFO expecting exactly-once processing. Two constraints usually get missed:

  • The deduplication interval is five minutes. A message resent at minute six is a new message. Telr’s 15-second retry chain fits comfortably; a nightly reconciliation job does not.
  • Content-based deduplication hashes the message body only — not message attributes. Two messages with identical bodies and different attributes dedupe to one; two messages with the same logical meaning and a timestamp in the body do not dedupe at all.

So the durable answer is a dedup table you own: a unique index on the business key (tran_ref, cart_id, the PSP event id), checked inside the same transaction that performs the side effect. The queue’s window is a performance optimisation. The unique index is the correctness guarantee.

What reliability costs in AWS me-central-1

Prices below are from the AWS public price list for the UAE region (me-central-1), converted at the pegged rate of AED 3.6725 to the dollar.

Service (me-central-1)UnitUSDAED
SQS — first 1M requests / monthper monthFreeFree
SQS Standard (tier 1)per 1M requests0.441.62
SQS FIFO (tier 1)per 1M requests0.552.02
SQS fair queueper 1M requests0.110.40
MSK kafka.m7g.largeper broker-hour0.25060.92
MSK Express kafka.m7g.largeper broker-hour0.50131.84
MSK broker storageper GB-month0.1210.44

Run the arithmetic and the architecture decision makes itself. A three-broker kafka.m7g.large cluster with 100 GB per broker costs about USD 585 a month, roughly AED 2,149, before data transfer. The same reliability guarantees for a mid-size Dubai retailer pushing 10 million queue requests a month cost USD 3.96, about AED 15, on SQS Standard — roughly 148 times cheaper.

Kafka earns its keep when you need event replay, stream processing or multiple independent consumer groups reading the same log. Most UAE e-commerce and marketplace workloads do not. The duplicate-charge bug is not solved by the more expensive broker; it is solved by the unique index you were going to add anyway.

What it costs to fix — and what it costs to ignore

Retrofitting idempotency into a live Dubai platform is a scoped piece of work, not a rebuild. Typical ranges we quote:

  • AED 18,000–30,000 — idempotency keys plus a dedup table on an existing checkout and webhook handler, with a replay test suite.
  • AED 35,000–60,000 — the above plus a transactional outbox, a relay worker and queue wiring across two or three downstream systems (ERP, WMS, notifications).
  • AED 60,000–120,000 — event-driven rebuild of an order pipeline with saga-style compensation for multi-step flows such as split payments or partial refunds.

Against that, the cost of leaving it: UAE chargeback and dispute fees generally run AED 50–150 per case (Paymob lists AED 75; some acquirers reach AED 100–300). Stripe charges AED 60 for a dispute received, AED 60 to counter it and AED 60 to appeal — AED 180 on a single contested duplicate, on top of card processing at 2.9% + AED 1.00 domestically.

The regulatory clock is the part finance teams underestimate. Under the CBUAE Consumer Protection Standards a licensed institution must acknowledge a complaint within 2 complete business days and issue a final written response within 30 complete business days. Where it identifies its own error, such as a duplicate debit, it must notify affected consumers within 10 complete business days and refund the full amount immediately, without waiting for a claim. Unauthorised payments must be reimbursed within 30 calendar days. For merchants, Federal Law 15/2020 and Cabinet Resolution 66/2023 add a 14-day e-commerce return right and 30 days to recover on a defect.

None of those clocks care whether the duplicate was your bug or the queue’s. If you cannot produce a per-transaction audit trail on demand, you absorb the refund and the fee.

How Aquarius builds it

Our default for UAE payment and order flows: idempotency key minted client-side at user intent, stored server-side with a 72-hour window; every mutating endpoint guarded by a unique index on the business key; webhook handlers that acknowledge in under one second and process asynchronously; a transactional outbox for every cross-system event; and a replay test that fires each PSP webhook three times in five seconds and asserts exactly one charge, one email and one ledger entry. Full costs sit on our pricing page, and payment gateway integration costs in Dubai covers the gateway side.

FAQ

Is SQS FIFO enough to stop duplicate charges?

No. FIFO deduplicates only within a five-minute interval, and content-based deduplication hashes the message body alone, ignoring message attributes. Anything resent later — a reconciliation job, a manual replay, a PSP resend hours after the fact — arrives as a brand-new message. You still need a unique index on the business key.

How long should I keep idempotency keys?

At least as long as your longest retry chain, and longer than your PSP’s. Stripe prunes keys after a minimum of 24 hours; Telr’s own retries finish inside 15 seconds. We default to 72 hours, which covers weekend reconciliation runs in the UAE without unbounded storage growth.

Do I need Kafka for an event-driven platform in Dubai?

Rarely. A three-broker Amazon MSK cluster in me-central-1 runs about AED 2,149 a month; SQS at 10 million requests costs roughly AED 15. Choose Kafka when you genuinely need event replay, stream processing or several independent consumer groups on one log — not to fix duplicates.

What happens if my webhook endpoint is slow?

You get retried mid-processing. Telr makes three attempts five seconds apart and treats any non-200 response as failure, so a handler that charges first and responds after six seconds will be invoked again before it finishes. Acknowledge immediately, queue the work, process it behind an idempotency guard.

Who is liable for a duplicate Aani transfer?

Aani transfers settle in around three seconds and are designed for finality, so recovery is commercial rather than automatic. Under the CBUAE Consumer Protection Standards a licensed institution that identifies its own error must tell affected consumers within 10 complete business days and refund in full without a claim. As a merchant you sit outside that protection, which is why the prevention layer is yours to build.

Shipping a UAE platform that touches money, and not certain it can survive a replayed webhook? Send us the integration — we will run the triple-fire replay test against your staging environment and tell you exactly where it charges twice.

+ END OF FILEAQUARIUS ADVERTISING © 2026 · DUBAI, UAE