+254 748 866 805
Back to Insights
Product & Tech

The Tech Behind Automated Morning M-PESA Dispatches

Aug 10, 20264 min readOndiegi Engineering Team

High-Availability Cron Schedulers & Daraja B2C

Delivering thousands of precision payouts every morning at exactly 8:00 AM EAT requires a resilient, fault-tolerant architecture built on top of Safaricom's Daraja B2C (Business-to-Customer) API ecosystem.

Our core dispatch pipeline utilizes isolated queue workers running on distributed cron schedules. Payout tasks are enqueued prior to the target dispatch window, pre-calculated for ledger accuracy, and submitted with strict idempotency keys.

Atomic Database Transactions & Zero-Discrepancy Ledgers

In financial applications, partial state updates are unacceptable. Chulri executes all balance deductions and payout statuses using PostgreSQL isolated transactions.

When a B2C request is initialized, the user's vault balance is state-locked. The system tracks Safaricom ConversationIDs and OriginatorConversationIDs in real-time.

Webhook Callbacks and Retry Fallbacks

Network timeouts or temporary M-PESA maintenance windows are handled gracefully by our queue engine. If a B2C transaction times out, the system marks the dispatch as PENDING_RETRY rather than failing it.

Once Safaricom confirms callback status or system health restores, automatic retries fire with exponential backoff, ensuring users receive their daily drip without manual support intervention.

Automated M-PESA Vaults

Ready to automate your M-PESA liquidity?

Lock impulse capital and schedule your first morning daily drip vault in less than 2 minutes.