Mobile Payout
curl --request POST \
--url https://pesahub.co/api/v1/payouts/mobile \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount": 123,
"currency": "<string>",
"phone_number": "<string>",
"metadata": {}
}
'import requests
url = "https://pesahub.co/api/v1/payouts/mobile"
payload = {
"amount": 123,
"currency": "<string>",
"phone_number": "<string>",
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 123, currency: '<string>', phone_number: '<string>', metadata: {}})
};
fetch('https://pesahub.co/api/v1/payouts/mobile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pesahub.co/api/v1/payouts/mobile",
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([
'amount' => 123,
'currency' => '<string>',
'phone_number' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pesahub.co/api/v1/payouts/mobile"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pesahub.co/api/v1/payouts/mobile")
.header("Authorization", "<authorization>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pesahub.co/api/v1/payouts/mobile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"balance": {
"current": 123,
"reserved": 123
},
"transaction_id": "<string>",
"status": "<string>",
"amount": {
"value": 123,
"currency": "<string>",
"fee": 123
},
"metadata": {
"order_id": "<string>",
"note": "<string>"
}
}Payout
Mobile Payout
Send money directly to a mobile money wallet
POST
/
api
/
v1
/
payouts
/
mobile
Mobile Payout
curl --request POST \
--url https://pesahub.co/api/v1/payouts/mobile \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"amount": 123,
"currency": "<string>",
"phone_number": "<string>",
"metadata": {}
}
'import requests
url = "https://pesahub.co/api/v1/payouts/mobile"
payload = {
"amount": 123,
"currency": "<string>",
"phone_number": "<string>",
"metadata": {}
}
headers = {
"Authorization": "<authorization>",
"Idempotency-Key": "<idempotency-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'Idempotency-Key': '<idempotency-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({amount: 123, currency: '<string>', phone_number: '<string>', metadata: {}})
};
fetch('https://pesahub.co/api/v1/payouts/mobile', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://pesahub.co/api/v1/payouts/mobile",
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([
'amount' => 123,
'currency' => '<string>',
'phone_number' => '<string>',
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"Idempotency-Key: <idempotency-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://pesahub.co/api/v1/payouts/mobile"
payload := strings.NewReader("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"metadata\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("Idempotency-Key", "<idempotency-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://pesahub.co/api/v1/payouts/mobile")
.header("Authorization", "<authorization>")
.header("Idempotency-Key", "<idempotency-key>")
.header("Content-Type", "application/json")
.body("{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://pesahub.co/api/v1/payouts/mobile")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["Idempotency-Key"] = '<idempotency-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"amount\": 123,\n \"currency\": \"<string>\",\n \"phone_number\": \"<string>\",\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "<string>",
"balance": {
"current": 123,
"reserved": 123
},
"transaction_id": "<string>",
"status": "<string>",
"amount": {
"value": 123,
"currency": "<string>",
"fee": 123
},
"metadata": {
"order_id": "<string>",
"note": "<string>"
}
}Overview
The Mobile Payout API lets you send funds directly to a recipient’s mobile money wallet. Use the preview endpoint first to see fee breakdowns, then call initiate to execute the transfer.Mobile payout is currently restricted to 300,000 TZS in a single transaction
Request Headers
string
required
Bearer token for authentication. Format:
Bearer <token>string
default:"application/json"
Expected response format. Use
application/json.string
default:"application/json"
Format of the request body. Use
application/json.string
required
A unique key to ensure idempotent requests.
Preview Mobile Payout
Calculate fees and preview the payout before committing.POST /api/v1/payouts/mobile/preview
Request Body
integer
required
Amount to send in the specified currency
string
required
Currency code (e.g.,
TZS)string
required
Recipient’s phone number (e.g.,
07XXXXXXXX)object
Arbitrary key-value pairs for your reference. Maximum of 3 items, each less than 100 characters.
Example Request
curl -X POST https://pesahub.co/api/v1/payouts/mobile/preview \
-H "Authorization: Bearer {{api_key}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"amount": 1500,
"currency": "TZS",
"phone_number": "07XXXXXXXX",
"metadata": {
"order_id": "order_001",
"note": "Payment for services"
}
}'
Initiate Mobile Payout
Execute the mobile money transfer to the recipient.POST /v1/payouts/mobile
Request Body
Same fields as the preview endpoint.integer
required
Amount to send in the specified currency
string
required
Currency code (e.g.,
TZS)string
required
Recipient’s phone number
object
Arbitrary key-value pairs for your reference. Maximum of 3 items, each less than 100 characters.
Response
boolean
Indicates whether the payout was successful.
string
Human-readable status message.
object
string
Unique identifier for the transaction.
string
Current status of the payout. Example:
initiated.object
object
Always run a preview before initiating a payout to confirm fees and ensure the recipient details are correct.