IOSOR Learn
Duplicate DLR Credit Double-Count Guard in Billing Commit
Verify duplicate or replayed DLRs cannot inflate delivered counts or double-consume credit at billing commit when comparing partner routes.
Lead Telecom & Routing Architect · Lausanne, CH
A duplicate or replayed DLR must resolve to one idempotent billing event: dedupe on message ID plus final-state hash before credit commit, and confirm the same rule holds across every candidate partner route.
Where double-count actually enters billing
Double credit consumption almost never comes from the first DLR. It enters through the second path: aggregator retries after a 200 timeout, dual-channel callbacks where both the partner and the carrier surface the same event, and manual reconciliation runs that re-import a delivery file. Each path produces a distinct receipt identity, so a naive counter keyed on arrival time will count two deliveries for one message.
Deduplication semantics to compare per partner
Ask each route for its dedupe contract in writing: key field (message ID, partner reference, or corridor-scoped tuple), retention window for seen keys, and behaviour when a duplicate arrives after the billing lock is already closed. Verify whether dedupe happens at edge intake or at commit time, because edge-only dedupe still permits a re-import to reach the ledger.
Webhook replay safety and latency budget
Replay safety means a signed, timestamped request rejected if older than the acceptance window, plus an idempotency key echoed in the partner response. Benchmark duplicate delivery under load: inject the same DLR three times within two seconds and once after the retention boundary. Record whether the billing service returns the original commit result or creates a new entry. Track webhook latency percentiles because slow callbacks invite partner-side retries that multiply duplicates.
Billing-lock logic that must resist replays
A billing lock is only useful if the lock check and credit consumption are one atomic operation. Verify that the commit path reads final state, evaluates the lock, and posts the ledger entry inside a single transaction or guarded workflow. Test a race: fire a duplicate DLR exactly while the first commit is in flight and confirm exactly one ledger row survives.
Reconcile counts and credit against one canonical ledger
Before locking a partner, run a reconciliation drill: send a known batch, replay 10 percent of DLRs with altered timestamps, flip one message to failed after commit, then compare partner-reported delivered count, your webhook log, and the ledger. The three totals must agree or the variance must be fully explained by the correction path. Keep the drill reproducible and repeat it whenever the partner changes callback schema or retry policy.
Start with IOSOR
Run this as a scripted comparison for your channel and corridor: (1) request each candidate partner's written dedupe key, retention window, and post-lock duplicate behaviour; (2) replay a fixed DLR set with altered timestamps into a staging sender and count ledger rows; (3) verify atomic lock-plus-credit commit under a concurrent duplicate; (4) confirm correction reversal leaves no second delivered event; (5) record receipt counts, dedupe decisions, and credit references in one audit file per message.
Related: PAYG hold before first debit · Wallet stop-lines before production.
IOSOR takeaway
Double credit consumption almost never comes from the first DLR. Keep the drill reproducible and repeat it whenever the partner changes callback schema or retry policy (/tools/brief · DLR / webhook).
Was this guide helpful?
Related guides
- Partner Failover Cutover Verification Before Billing Lock-In
Verify DLR receipts, webhook latency, sender/template gates, and cost-per-delivered before locking billing to a new failover route. Compare partners via /tools/brief.
- Partner Failover Route Cost Parity Audit for Message Lifecycle
Audit failover routes for cost-per-delivered parity and DLR integrity before committing volume; compare verified partner routes via /tools/brief.
- Building a Partner Failover Matrix for Message Final-State Confirmation
Design a failover matrix that prevents double-billing and missed disputes by ranking backup routes on DLR receipt quality, webhook latency, and dispute evidence.












