Guides
Mobile money push

Mobile money push

Send a payment prompt straight to your customer's phone. They approve it with their mobile-money PIN, and the money lands in your Swahilies balance — usually within a few seconds.

One endpoint covers every Tanzanian network: M-Pesa, Mixx by Yas (Tigo Pesa), Airtel Money, HaloPesa and the rest. You don't need to know which network the number is on. Payments run through our Selcom connection.

Scope required: psp:collections-operator · Currency: TZS only

Send the push

POST /api/psp/collections/push with the phone number and amount. You get back status: "pending".

Customer approves

A prompt appears on their phone. They check the amount and enter their PIN.

We confirm and tell you

As soon as the network confirms, the payment is credited to your balance and we send a signed collection.paid webhook. If they decline or let it expire, you get collection.failed.

Send a push

curl -X POST https://engine.swahilies.net/api/psp/collections/push \
  -H "Authorization: Bearer swh_live_<prefix>_<secret>" \
  -H "Content-Type: application/json" \
  -d '{
    "merchant_txn_ref": "order_1042",
    "msisdn": "0783 262 616",
    "amount_minor": 1000,
    "narrative": "Order 1042"
  }'
FieldTypeRequiredNotes
merchant_txn_refstringyesYour unique reference for this payment, e.g. your order ID. Makes the request idempotent.
msisdnstringyesThe payer's Tanzanian mobile number, in any common format: 0783262616, 255783262616, +255 783 262 616.
amount_minorintegeryesWhole shillings — TZS has no minor unit, so 1000 = 1,000 TZS. Between 100 and 10,000,000.
currencystringnoTZS (the default and the only accepted value).
channelstringnomobile_money (default): a USSD prompt on any network. selcom_pesa: an in-app request to the payer's Selcom Pesa wallet.
narrativestringnoUp to 100 characters describing the payment.

Response 201 Created

{
  "merchant_txn_ref": "order_1042",
  "reference": "PSH-9f3c2a1b7e",
  "status": "pending",
  "channel": "mobile_money",
  "msisdn": "255783262616",
  "amount_minor": 1000,
  "currency": "TZS",
  "provider_ref": null,
  "created_at": "2026-11-25T13:28:49+00:00",
  "updated_at": "2026-11-25T13:28:49+00:00"
}

msisdn comes back in international format. reference is Swahilies' own ID for the payment; quote it when you contact support.

⚠️

pending means the prompt was sent, not that the customer has paid. Release goods or credit an account only on collection.paid (or a status lookup that says paid).

If the network refuses the request outright (for example an invalid or barred number), you get 200 OK with status: "failed" and a failure_reason, and a collection.failed webhook follows.

Statuses

statusMeaning
pendingThe prompt was sent; waiting for the customer.
paidThe network confirmed the payment and the amount is in your balance. Final.
failedDeclined, cancelled, expired or refused. No money moved. Final.

A prompt the customer ignores expires after 15 minutes. It is then cancelled with the network and becomes failed, normally within half an hour of the push.

Check a payment's status

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

Returns the same object as above. If a payment has been pending for more than a minute, this call checks with the network before answering, so it is a reliable fallback if a webhook is late. Don't poll faster than every 10 seconds.

You can only see your own payments; any other reference returns 404.

Retries and idempotency

merchant_txn_ref is the key. If a request times out, send it again with the same body — you get the existing payment back (200 OK), and the customer is never prompted twice. Reusing a merchant_txn_ref with a different phone number, amount or channel is refused with 409 Conflict. To charge again (say, the customer declined and wants to retry), use a new merchant_txn_ref.

Webhooks

When a payment settles, Swahilies POSTs a signed event to your webhook endpoint, with the same headers and signature as every other event.

{
  "event": "collection.paid",
  "id": "PSH-9f3c2a1b7e:paid",
  "created_at": "2026-11-25T13:29:33+00:00",
  "data": {
    "merchant_txn_ref": "order_1042",
    "reference": "PSH-9f3c2a1b7e",
    "rail": "selcom",
    "status": "paid",
    "amount_minor": 1000,
    "currency": "TZS",
    "msisdn": "255783262616",
    "provider_ref": "1991112808"
  }
}
EventWhen
collection.paidThe network confirmed the payment. Credit the order.
collection.failedDeclined, expired or refused. Release the order or offer a retry.

rail is selcom for mobile_money and selcompesa for selcom_pesa. Delivery is at-least-once: key your handler off id, and apply each payment only once. Always verify the signature.

Errors

HTTPWhen
400A field is invalid: not a Tanzanian mobile number, amount outside 100–10,000,000, a currency other than TZS, an unknown channel. The body names the field.
401Missing or invalid API key.
403The key lacks psp:collections-operator, or the request names another merchant.
404Status lookup for a reference that isn't yours or doesn't exist.
409merchant_txn_ref already used for a different payment.

Testing

There is no sandbox for mobile-money push: every push is a real payment. Test with a small amount (for example 1,000 TZS) on your own phone, approve the prompt, and check that your webhook handler receives collection.paid and that the status lookup says paid. Then try declining a prompt to see collection.failed.