Pay merchants from their TeronaPay balance to any M-Pesa number with one POST. We handle reservations, Daraja credentials, and reconciliation.
POST /v1/payouts with amount, currency, and the destination M-Pesa number. The payout enters the `pending` state and the merchant's payable balance is immediately reserved.
We forward the request to Daraja's B2C v3 API with a generated SecurityCredential. The customer gets the M-Pesa SMS confirming the transfer.
Daraja's async result callback lands in our handler. On success the reservation is released into the platform bank; on failure it's returned to the merchant's available balance.
A payout sweeper runs every 5 minutes (configurable). Stuck-pending payouts after `PAYOUT_SWEEPER_STUCK_AFTER` are marked failed and the reservation released. Documented trade-off: a payout that Daraja secretly succeeded gets reported failed.