Create a payment
/api/v1/paymentsCollects money from a customer's mobile money wallet, or pays money out to one (a payout). Send the customer's phone in payment_method_data: the network is read from the number's first digits and comes back in payment_method_details. The payment starts as CREATED and moves on as the network answers. Follow it with webhooks or by retrieving it.
A payout (kind DISBURSEMENT) needs the payouts.write scope and is paid from your balance. If your available balance cannot cover it and its fee, the payout is created and then FAILED with the failureCode INSUFFICIENT_BALANCE.
Send a unique Idempotency-Key. Repeating the request with the same key and body returns the original payment instead of creating a second one.
Authorization
bearerAuth An access token from POST /api/v1/oauth/token, sent as Authorization: Bearer <token>.
In: header
Header Parameters
A unique key you choose for this request: 1 to 255 visible ASCII characters, no spaces. A UUID works well. Never put personal data, such as a phone number or an email address, in it. Send the same key again to retry safely.
The API version to use for this request, a date such as 2026-11-06. Without it the request uses your default version for the mode of your key. An unknown version answers 400 api_version_invalid.
Value in
- "2026-11-06"
Request Body
application/json
A payment to create.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://api-malipo.flex.co.tz/api/v1/payments" \ -H "Authorization: Bearer <token>" \ -H "Idempotency-Key: 5f1c1e0a-3b7e-4c8e-9d1a-2f6b8a4c7e11" \ -H "FlexMalipo-Version: 2026-11-06" \ -H "Content-Type: application/json" \ -d '{ "kind": "COLLECTION", "amount": 10000, "currency": "TZS", "payment_method_data": { "type": "mobile_money", "mobile_money": { "phone": "255700000001" } }, "merchantReference": "order-1042", "description": "Order 1042 from Duka Online" }'{ "id": "0b6f3c1e-8f2a-4a51-9a57-6d1f0c2b7e93", "status": "SUCCEEDED", "kind": "COLLECTION", "payment_method_details": { "type": "mobile_money", "mobile_money": { "network": "mpesa", "phone": "25574*****11", "verified_name": "ASHA J JUMA" } }, "amount": 10000, "fee": 150, "net": 9850, "currency": "TZS", "merchantReference": "order-1042", "description": "Order 1042 from Duka Online", "livemode": false, "transactionCode": "SGR7K2LQ1P", "createdAt": "2026-09-28T09:15:30Z", "updatedAt": "2026-09-28T09:15:42Z", "metadata": { "channel": "mobile-app" }}