Pay out
Send money from your balance to a customer's wallet.
Send money from your FlexPay balance to a customer's M-Pesa or Mixx by Yas wallet.
Before you pay out
- Use a key with the
payouts.writeandpayments.writescopes. - Send at least 5,000 TZS.
- Keep enough balance for the amount plus the fee.
Create a payout
Create a payment with kind DISBURSEMENT:
curl -X POST "https://malipo.flex.co.tz/api/v1/payments" \
-H "Authorization: Bearer <token>" \
-H "Idempotency-Key: 8d2f4a1c-6b3e-4f7a-9c0d-1e2f3a4b5c6d" \
-H "Content-Type: application/json" \
-d '{
"kind": "DISBURSEMENT",
"provider": "MPESA",
"amount": 10000,
"currency": "TZS",
"customerPhoneNumber": "255700000001",
"merchantReference": "payout-1042"
}'Then act on the outcome as for a collection.
Your balance
The amount plus the fee leaves your available balance as soon as the payout is sent, and the payout's net is minus
(amount plus fee).
- On
payment.succeeded, the money is gone. - On
payment.failed, you have it back. - If your balance is too low, the payout fails with
failureCodeINSUFFICIENT_BALANCEand nothing leaves it.
Errors
| Code | Why |
|---|---|
403 | The key lacks payouts.write, or payouts are not available to you (contact support). |
422 | The provider cannot pay out. |
A payout cannot be reversed. If one went to the wrong person, contact support with its id.