Payouts API
Enable your customers to withdraw funds from their CashPay wallet directly to their mobile money or bank accounts. All payouts debit the CashPay user and credit your partner fleet account.
Overview
The Payouts API is the cornerstone of interoperability, allowing value to flow from the CashPay network to external financial systems like bank accounts and mobile money wallets.
Payout Flow (CashPay to Bank/Fintech):
- A CashPay user initiates a withdrawal to an account within your institution (e.g., a Rawbank account).
- Your backend calls the appropriate Payouts API endpoint with the transaction details.
- The CashPay system debits the user's CashPay wallet.
- Simultaneously, your **Partner Fleet Account is credited** with the corresponding amount.
- Your system receives a successful API response with a unique transaction reference. You can then safely credit your customer's bank account.
Working with Multiple Currencies
If the payout currency differs from your fleet account's funding currency, you can use our Exchange Rates API to get the exact conversion rate before initiating the transaction. This helps in calculating the precise amount that will be debited from your account.
Payout to Mobile Money
POST
/api/v1/b2b/payouts/mobile-moneySends funds to a mobile money wallet (M-Pesa, Airtel, etc.).
cURL
curl -X POST 'https://api.cashpay-all.com/api/v1/b2b/payouts/mobile-money' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"recipient": {
"phone": "243800000001",
"name": "John Doe",
"countryCode": "CD"
},
"amount": 50,
"currency": "USD",
"reference": "PAYOUT-001",
"operator": "MPESA"
}'Success Response
JSON
{
"success": true,
"message": "Payout processing initiated.",
"transactionId": "MPESA_TXN_ABC123"
}Payout to Bank Account
POST
/api/v1/b2b/payouts/bank-accountSends funds to a traditional bank account.
cURL
curl -X POST 'https://api.cashpay-all.com/api/v1/b2b/payouts/bank-account' \
-H 'Authorization: Bearer <YOUR_API_KEY>' \
-H 'Content-Type: application/json' \
-d '{
"recipient": {
"accountNumber": "001122334455",
"bankCode": "ECOCCDKI",
"name": "Jane Smith",
"countryCode": "CD"
},
"amount": 500,
"currency": "USD",
"reference": "PAYOUT-002"
}'