Mobile Payouts
This allows you to send money directly to customers’ mobile wallets supported countries. With a single, unified endpoint you can:
Payouts (Remittances): Disburse funds from your merchant account directly into customers’ mobile wallets.
Endpoint
POST https://api.mypayd.app/api/v3/withdrawal
Authorization
Every request must include authentication headers:
AUTHORIZATION: Basic Auth
Username <username>
Password <password>
Request Body
The request body should include the necessary parameters for the transaction. Here's the request body.
{
"username": "larntechconsultants",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "momo",
"account_number": "0712345678",
"amount": 10,
"phone_number": "254712345678",
"channel_id": "c2b2eeda-d4ca-49fd-ba21-0781ffa7714b",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"channel": "mobile",
"provider_name": "Mobile Wallet (M-PESA)",
"provider_code": "MPESA"
}
Note: provider_code can also be used as the channel code (from bulk API)
Below are code examples in different programming languages demonstrating how to receive payments from different mobile payments worldwide.
- Curl
- Nodejs
- Python
- Go
- PHP
curl --location 'https://api.mypayd.app/api/v3/withdrawal'
--header 'Content-Type: application/json'
--data-raw '{
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "John Doe",
"account_number": "0712345678",
"amount": 10,
"phone_number": "254712345678",
"channel_id": "c2b2eeda-d4ca-49fd-ba21-0781ffa7714b",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"channel": "mobile",
"provider_name": "Mobile Wallet (M-PESA)",
"provider_code": "MPESA"
}'
var axios = require('axios');
var url = 'https://api.mypayd.app/api/v3/withdrawal';
var payload = {
"username": "larntechconsultants",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "momo",
"account_number": "0712345678",
"amount": 10,
"phone_number": "254712345678",
"channel_id": "c2b2eeda-d4ca-49fd-ba21-0781ffa7714b",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"channel": "mobile",
"provider_name": "Mobile Wallet (M-PESA)",
"provider_code": "MPESA"
};
var config = {
method: 'post',
url: url,
headers: { 'Content-Type': 'application/json' },
data: payload
};
axios(config)
.then(function (response) {
console.log(response.data);
})
.catch(function (error) {
console.log(error.response ? error.response.data : error.message);
});
import requests
url = "https://api.mypayd.app/api/v3/withdrawal"
payload = {
"username": "paydconsultant",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "John Doe",
"account_number": "0712345678",
"amount": 10,
"phone_number": "254712345678",
"channel_id": "c2b2eeda-d4ca-49fd-ba21-0781ffa7714b",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"channel": "mobile",
"provider_name": "Mobile Wallet (M-PESA)",
"provider_code": "MPESA"
}
response = requests.post(url, json=payload)
print(response.text)
package main
import (
"fmt"
"strings"
"net/http"
"io/ioutil"
)
func main() {
url := "https://api.mypayd.app/api/v3/withdrawal"
method := "POST"
payload := strings.NewReader(`{
"username": "larntechconsultants",
"network_code": "7ea6df5c-6bba-46b2-a7e6-f511959e7edb",
"account_name": "momo",
"account_number": "0712345678",
"amount": 10,
"phone_number": "254712345678",
"channel_id": "c2b2eeda-d4ca-49fd-ba21-0781ffa7714b",
"narration": "Payment for goods",
"currency": "KES",
"callback_url": "https://payd-test.free.beeceptor.com",
"transaction_channel": "mobile",
"channel": "mobile",
"provider_name": "Mobile Wallet (M-PESA)",
"provider_code": "MPESA"
}`)
client := &http.Client{}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/json")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := ioutil.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
<?php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://api.mypayd.app/api/v3/payments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode(array(
"username" => "techconsultants",
"account_name" => "bank",
"amount" => 210,
"phone_number" => "+278123456789",
"channel_id" => "1cd9ece9-461a-4157-9140-35c9c2e69c3d",
"redirect_url" => "https://payd-test.free.beeceptor.com",
"narration" => "Payment for goods",
"currency" => "ZAR",
"callback_url" => "https://payd-test.free.beeceptor.com",
"transaction_channel" => "bank"
)),
CURLOPT_HTTPHEADER => array("Content-Type: application/json"),
));
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
?>
Example response
{
"success": true,
"correlator_id": "PIC051914308eW",
"message": "Transaction request sent successfully",
"status": "SUCCESS",
"channel": "",
"amount": 0
}
Conclusions
Mobile Payouts provide a fast, secure, and reliable way to send funds directly to customers’ mobile wallets across supported countries. By using the unified payout endpoint, businesses can streamline disbursements, reduce manual errors, and enhance customer experience.