Withdrawals
Initiates a USDC → KES withdrawal, paying out to the user's M-Pesa.
The payout goes to the phone number stored on the account.
Option A: Get a quote first (recommended)
Step 1 — Get a rate quote
GET /accounts/{account_id}/withdrawal-quote?amount_usdc=38
{
"rate_id": "def456-...",
"amount_usdc": 38.0,
"fiat_amount_kes": 4970.0,
"fee_usdc": 0.38,
"fee_kes": 50.0,
"exchange_rate": 130.79,
"spread_bps": 20,
"expires_in_seconds": 600
}
Step 2 — Confirm the withdrawal
POST /accounts/{account_id}/withdrawals
Idempotency-Key header required.
Response:
Regini sends the KES payout to the user's M-Pesa. Once confirmed, a withdrawal.completed webhook fires.
Option B: Auto-confirm at live rate
One withdrawal at a time
Only one withdrawal can be in-flight per account at a time. A second request while one is pending returns CONCURRENT_WITHDRAWAL.