Guides
Collections

Collections

Collect payments from your customers' mobile-money wallets.

For new integrations use Mobile money push: one endpoint for every Tanzanian network, a status lookup, and signed webhooks. This page documents the original per-provider endpoint.

Supported providers on this endpoint include Airtel Money and Tigo Pesa / Mixx.

Scope required: psp:collections-operator

Create a collection

curl -X POST https://engine.swahilies.net/api/psp/collections \
  -H "Authorization: Bearer swh_live_<prefix>_<secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_txn_ref": "order_1042",
    "merchant_ref": "daraja",
    "provider": "airtel",
    "msisdn": "255712345678",
    "amount_minor": 50000,
    "currency": "TZS"
  }'
FieldTypeNotes
merchant_txn_refstringYour unique reference. Idempotent.
providerstringairtel or tigo.
msisdnstringPayer's phone in international format (2557…).
amount_minorintegerTZS has no minor unit: 50000 = 50,000 TZS.
currencystringISO code, e.g. TZS.

Response

{
  "id": "col_01M5...",
  "merchant_txn_ref": "order_1042",
  "status": "pending",
  "amount_minor": 50000,
  "currency": "TZS",
  "provider": "airtel"
}

The flow

Initiate

You POST the collection. The customer is prompted on their phone to approve a push payment (or completes a USSD step, depending on the provider).

Customer approves

They authorise the debit on their handset.

Webhook confirms

Swahilies sends a signed collection.paid or collection.failed webhook. Credit the order only on collection.paid.

⚠️

The pending you get back is not a completed payment. Wait for the webhook, and reconcile by merchant_txn_ref.