Wallets

Wallets store user funds. Each wallet has a unique account number and supports KES currency.

Sandbox Wallets

In sandbox mode, newly created wallets are automatically funded with 0 KES balance. You need to make a deposit to fund your wallet before testing test withdrawals, transfers, and other operations without needing to first deposit funds.

API Reference

Create Wallet

Get Wallet Balance

Get Wallet Transactions

Code Examples

wallets.js
const BASE = 'https://api.wasaapay.com/api/v1/partner';
const headers = { 'X-API-Key': process.env.WASAAPAY_API_KEY };
// Create a wallet
const res = await fetch(`${BASE}/wallets`, {
method: 'POST',
headers: { ...headers, 'Content-Type': 'application/json', 'X-Idempotency-Key': crypto.randomUUID() },
body: JSON.stringify({ externalUserId: 'user_001', currency: 'KES' }),
});
const { data: wallet } = await res.json();
// Get balance
const bal = await fetch(`${BASE}/wallets/${wallet.id}/balance`, { headers });
const { data: balance } = await bal.json();
console.log('Balance:', balance.availableBalance, 'KES');
// Transactions
const txns = await fetch(`${BASE}/wallets/${wallet.id}/transactions?limit=20`, { headers });
const { data: transactions } = await txns.json();