Guides
Bank transfer collections

Bank transfer collections

Collect bank transfers from your customers. You declare the payment you expect, your customer transfers into the Swahilies collection account, and we match the incoming credit to your order and call you back.

Scope required: psp:tembo-merchant (or psp:collections-operator)

This is a declare-then-reconcile flow: you tell us the payment to expect up front, and we confirm it when the money lands. A unique, automatic reference-based flow is coming — this is what to use today.

The flow

Declare the expected transfer

Tell us the amount and, where you can, the payer's account/phone:

curl -X POST https://engine.swahilies.net/api/psp/collections/tembo \
  -H "Authorization: Bearer swh_live_<prefix>_<secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_txn_ref": "order_1042",
    "amount_minor": 150000,
    "currency": "TZS",
    "from_account": "255712345678",
    "expires_in_minutes": 1440
  }'
{
  "merchant_ref": "daraja",
  "merchant_txn_ref": "order_1042",
  "amount_minor": 150000,
  "currency": "TZS",
  "from_account": "255712345678",
  "status": "awaiting_payment",
  "expires_at": "2026-10-21T09:00:00Z"
}
FieldTypeNotes
merchant_txn_refstringYour unique reference. Idempotent — a repeat returns 409.
amount_minorintegerMinor units — 150000 = 150,000 TZS. Must match the transfer exactly.
currencystringISO code, e.g. TZS.
from_accountstringPayer's account/phone. Optional but strongly recommended — it's how we tell two same-amount orders apart.
expires_in_minutesintegerOptional. After this, the order stops matching.

Customer pays

Your customer transfers the exact amount into the Swahilies collection account.

We match & call you back

When the bank credit arrives we match it to your open order by amount, using the payer account (from the transfer narration) to disambiguate when needed. On a match we mark the order paid and POST a signed collection.paid webhook to your configured endpoint:

{
  "event": "collection.paid",
  "id": "<bank transaction id>",
  "data": {
    "merchant_txn_ref": "order_1042",
    "rail": "tembo",
    "status": "paid",
    "amount_minor": 150000,
    "currency": "TZS",
    "from_account": "255712345678",
    "tembo_transaction_id": "...",
    "paid_at": "2026-10-20T09:12:00Z"
  }
}

Check status

Besides the callback, you can poll:

curl https://engine.swahilies.net/api/psp/collections/tembo/order_1042 \
  -H "Authorization: Bearer swh_live_<prefix>_<secret>"

status is one of awaiting_payment · paid · expired · cancelled.

Cancel

curl -X POST https://engine.swahilies.net/api/psp/collections/tembo/order_1042/cancel \
  -H "Authorization: Bearer swh_live_<prefix>_<secret>"

Only an order still awaiting_payment can be cancelled.

Configure your callback endpoint

Set where we deliver collection.paid (and future events), and get your signing secret — shown once:

curl -X PUT https://engine.swahilies.net/api/psp/callbacks/endpoint \
  -H "Authorization: Bearer swh_live_<prefix>_<secret>" \
  -H "Content-Type: application/json" \
  -d '{ "url": "https://yourapp.com/swahilies/webhook" }'
{ "configured": true, "url": "https://yourapp.com/swahilies/webhook", "secret": "whsec_..." }

Verify the signature on every delivery — see Webhooks.

⚠️

Match the amount exactly, and send from_account whenever you can. If two open orders share an amount and we can't tell the payers apart, we leave the credit unmatched for manual reconciliation rather than risk crediting the wrong order — so distinct amounts (or a known payer) keep things automatic.