Virtual accounts
Give each of your customers their own bank account number. Anything they transfer into it, from any bank or mobile wallet that can pay a bank account, is credited to your Swahilies balance and reported to you, tagged with that customer.
Scope required: psp:tembo-merchant (or psp:collections-operator)
Unlike bank transfer collections, there is nothing to declare and nothing to match: the account number itself says who paid. An account is permanent and reusable. It accepts any number of payments, of any amount.
How ownership works
Accounts sit in a three-level chain, the same as cards:
Swahilies → you (the merchant) → your customer
- You can only see and manage the accounts you issued.
- Each account belongs to one of your customers, identified by your own
customer_ref(your user id, account number, etc.). - Optionally, if the customer is also one of your dashboard users, bind them with
owner_suband they can read their own account. Nothing else.
The flow
Issue an account to a customer
curl -X POST https://engine.swahilies.net/api/psp/tembo/virtual-accounts \
-H "Authorization: Bearer swh_live_<prefix>_<secret>" \
-H "Content-Type: application/json" \
-d '{
"customer_ref": "user_8812",
"customer_name": "Asha Mwinyi",
"mobile": "255712345678"
}'{
"merchant_ref": "daraja",
"customer_ref": "user_8812",
"customer_name": "Asha Mwinyi",
"owner_sub": "",
"bank_account_no": "999222004916",
"account_name": "SWAHILIES",
"provider": "TCB",
"currency": "TZS",
"mobile": "255712345678",
"reference": "SWAVA-0E418C304DF1477B",
"expected_amount_minor": null,
"status": "active",
"created_at": "2026-10-29T12:08:41Z",
"updated_at": "2026-10-29T12:08:51Z"
}| Field | Type | Notes |
|---|---|---|
customer_ref | string | Required. Your id for the customer. One account per customer_ref: issuing again returns the existing account (200) instead of opening a new one. |
mobile | string | Required. The customer's number, 9–15 digits, international format, no +. |
customer_name | string | Optional. For your records and the dashboard. |
owner_sub | string | Optional. One of your users who may read this account. Rejected (400) if they aren't your user. |
expected_amount_minor | integer | Optional and informational only. It does not limit what can be paid. |
201 means a new account was opened; 200 means this customer already had one
and you got it back.
Show the customer where to pay
Display bank_account_no with the bank TCB (Tanzania Commercial Bank) and
account_name. The customer pays into it like any bank account, through TIPS
from another bank, or from a mobile wallet's "pay to bank" option.
We credit you and call you back
When a payment lands we confirm it with the bank, credit your balance, and POST
a signed collection.paid webhook to your endpoint:
{
"event": "collection.paid",
"id": "ZKRZZ40FQDFN",
"created_at": "2026-10-29T12:23:42Z",
"data": {
"rail": "tembo_va",
"status": "paid",
"collection_id": "ZKRZZ40FQDFN",
"customer_ref": "user_8812",
"virtual_account": {
"id": "PS5VDHD66VTA",
"bank_account_no": "999222004916",
"account_name": "SWAHILIES"
},
"amount_minor": 1200,
"amount": 1200,
"expected_amount_minor": null,
"currency": "TZS",
"settlement": "AWAITING_SETTLEMENT",
"bank_txn_id": "048-003-1a1879cf505e9b2b",
"narration": "REF:999222004916 DPS:ASHA MWINYI ... TIPS FT 1a1879cf505e9b2b",
"payer": { "name": "ASHA MWINYI", "account_no": "0152411779000", "bank": "CRDB" },
"transaction_date": "2026-10-29",
"ledger_txn_id": "7e8a6a42-cc64-499e-96ec-11d658f22ad0",
"paid_at": "2026-10-29T12:23:42Z"
}
}The money is held for the customer in data.customer_ref until it is spent or
data.expires_at passes (see below). Key your
handler off id (the payment id). Each payment is delivered once per event,
but delivery is at-least-once, so ignore an id you've already processed.
Customer funds: spend within 48 hours
A deposit is your customer's pending funds, not a wallet: it must be used
within 48 hours of arriving (Bank of Tanzania rule). Each deposit has its
own clock, shown as expires_at on the collection.paid webhook and the
balance below.
- Spending uses the oldest deposits first.
- After 24 hours we send
balance.expiringso you can remind the customer. - At 48 hours whatever is left of that deposit stops being spendable, moves
to the customer's return balance, and we send
balance.expired. - We send it back to the account it came from, and send
balance.returned(with the transfer'sexternal_ref) once it has gone. - Money the bank has not yet settled is spendable up to 500,000 TZS per customer; above that, wait for settlement.
curl https://engine.swahilies.net/api/psp/tembo/customers/user_8812/balance \
-H "Authorization: Bearer swh_live_<prefix>_<secret>"{
"merchant_ref": "daraja",
"customer_ref": "user_8812",
"currency": "TZS",
"balance_minor": 151200,
"available_minor": 151200,
"settled_minor": 1200,
"unsettled_minor": 150000,
"return_due_minor": 0,
"next_expiry_at": "2026-10-31T12:23:42Z",
"deposits": [
{ "collection_id": "ZKRZZ40FQDFN", "amount_minor": 1200, "remaining_minor": 1200,
"settled": true, "received_at": "2026-10-29T12:23:42Z", "expires_at": "2026-10-31T12:23:42Z" }
]
}| Field | Meaning |
|---|---|
balance_minor | All of the customer's pending funds. |
available_minor | What can be spent right now (settled + unsettled up to the limit). |
return_due_minor | Expired funds being returned to the customer. |
next_expiry_at | When the oldest deposit expires. |
The 48-hour window is being switched on. Until it is, expires_at is shown but
deposits stay spendable; returns_mode on the balance tells you which applies
(off or manual).
balance.expiring, balance.expired and balance.returned webhooks carry the deposit:
{
"event": "balance.expired",
"id": "ZKRZZ40FQDFN:expired",
"data": {
"customer_ref": "user_8812", "collection_id": "ZKRZZ40FQDFN",
"bank_account_no": "999222004916", "amount_minor": 1200, "remaining_minor": 1200,
"currency": "TZS", "received_at": "2026-10-29T12:23:42Z", "expires_at": "2026-10-31T12:23:42Z"
}
}Fees
Swahilies fees on virtual accounts are currently zero. When a fee applies it is charged to your balance, never to your customer's deposit, so customer funds are always spent or returned in full.
Whatever is paid is credited, even if it differs from
expected_amount_minor. Compare the two yourself if your product needs an exact
amount (for example, to handle a part-payment or an overpayment).
List accounts and payments
# All your accounts (optionally ?customer_ref=user_8812)
curl https://engine.swahilies.net/api/psp/tembo/virtual-accounts \
-H "Authorization: Bearer swh_live_<prefix>_<secret>"
# One account
curl https://engine.swahilies.net/api/psp/tembo/virtual-accounts/999222004916 \
-H "Authorization: Bearer swh_live_<prefix>_<secret>"
# Payments into one account
curl https://engine.swahilies.net/api/psp/tembo/virtual-accounts/999222004916/payments \
-H "Authorization: Bearer swh_live_<prefix>_<secret>"
# Every payment across your accounts (optionally ?customer_ref=user_8812)
curl https://engine.swahilies.net/api/psp/tembo/virtual-account-payments \
-H "Authorization: Bearer swh_live_<prefix>_<secret>"A payment looks like:
{
"collection_id": "ZKRZZ40FQDFN",
"merchant_ref": "daraja",
"customer_ref": "user_8812",
"bank_account_no": "999222004916",
"amount_minor": 1200,
"currency": "TZS",
"status": "posted",
"tembo_status": "PAYMENT_ACCEPTED",
"tembo_status_code": "AWAITING_SETTLEMENT",
"bank_txn_id": "048-003-1a1879cf505e9b2b",
"payer_name": "ASHA MWINYI",
"payer_account_no": "0152411779000",
"payer_bank": "CRDB",
"transaction_date": "2026-10-29",
"ledger_txn_id": "7e8a6a42-cc64-499e-96ec-11d658f22ad0",
"settled_at": null,
"created_at": "2026-10-29T12:23:42Z"
}An account number you don't own returns 404, the same as one that doesn't
exist.
Settlement
A payment is credited to the customer's pending funds as soon as the bank reports it
(tembo_status_code: AWAITING_SETTLEMENT). When the bank completes settlement it
becomes SUCCESS and settled_at is filled in. We check this automatically; no
second webhook is sent.
Configure your callback endpoint
Use the same endpoint as every other product. See Bank transfer collections and verify every delivery's signature as described in Webhooks. If no endpoint is configured, payments are still credited to your balance; the webhook waits until you set one.
Errors
| Status | When |
|---|---|
400 | Invalid field (e.g. mobile not 9–15 digits), owner_sub isn't your user, or the bank refused to open the account (reason says why). |
403 | Your key lacks the scope, or your merchant account is suspended. |
404 | Account not found, or not yours. |
502 | The bank couldn't be reached. Retry the same request. It's safe and never opens a second account for the same customer_ref. |