monnify BUILD
SESSIONS
SESSION 02
SPEAKER
Auwal MS
Lead, Developer Relations & Integration Support

Network flaps, worker timeouts, 502 proxies, or database locks trigger automatic gateway retries.
Idempotency is 100% the receiver’s responsibility. The gateway guarantees delivery, not deduplication. ✓ Golden Rule: Receiving the exact same payload 10 times must produce identical business state.
The Flawed Check-Then-Act Flow
// DEADLY: App-layer check is NOT atomic
const tx = await db.find({ ref });
if (!tx) {
// Millisecond gap: concurrent retry passes
await wallet.credit(amount); // 2x CREDIT!
await db.save({ ref, status: 'PAID' });
}
Parallel Request Collisions Two containers evaluate condition simultaneously before either writes.