Mobile money payouts
POST /api/withdraw
Send mobile money from the wallet to a customer.
This debits the wallet and starts a real payout. The playground does not send it.
Authentication
HTTP Basic, as described in Authentication. No extra scope is checked.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Basic base64(api_user_id:api_key). |
Content-Type | Yes | application/json |
Accept | No | application/json |
Body
| Field | Required | Rules | Description |
|---|---|---|---|
externalReferencestring |
Yes | required|string|max:255|unique | Your payout reference. |
msisdnstring |
Yes | Ugandan mobile number | Same phone format as collection. |
amountnumber |
Yes | required|numeric|min:500 | Amount in UGX. |
currencystring |
Yes | required|in:UGX | Must be UGX. |
reasonstring |
No | nullable|string|min:2|max:150 | Shown on the transaction. |
namestring |
No | nullable|string | Recipient name. |
success_callbackstring |
No | nullable|url|max:255 | Unsigned success notification URL. |
failure_callbackstring |
No | nullable|url|max:255 | Unsigned failure notification URL. |
Behavior
- Minimum amount is UGX 500.
- The fee comes from the organization disbursement policy.
- HTTP 202 means the payout was accepted, not that the recipient has been paid. Confirm with Check status.
Idempotency. externalReference must be unique. A failed payout still keeps that reference.
Rate limit. No rate limit is configured on the API.
Example request
{
"externalReference": "payout-1001",
"msisdn": "256772123456",
"amount": 5000,
"currency": "UGX",
"reason": "Supplier payment"
}
Success ยท HTTP 202
{
"response": "OK",
"data": {
"transactionStatus": "PENDING",
"ssentezoWalletReference": "generated-uuid",
"financialTransactionId": ""
}
}
Errors
| Status | When |
|---|---|
| 401 NO_AUTHORIZATION_HEADER | The Authorization header is missing. |
| 403 INVALID_AUTHORIZATION_HEADER | The header must start with "Basic ". |
| 403 MISSING_USER_OR_KEY | The decoded value must be api_user_id:api_key. |
| 403 INVALID_USER_OR_KEY | The API user or key was not recognized. |
| 403 ORGANIZATION_SUSPENDED | The organization user is suspended. |
| 400 | Validation failed or the disbursement service returned an error. |
| 500 | Unexpected disbursement error. |
Code
curl
curl --request POST \
--url "$SSENTEZO_BASE_URL/api/withdraw" \
--header "Authorization: Basic $SSENTEZO_BASIC_TOKEN" \
--header "Accept: application/json" \
--header "Content-Type: application/json" \
--data '{
"externalReference": "payout-1001",
"msisdn": "256772123456",
"amount": 5000,
"currency": "UGX",
"reason": "Supplier payment"
}'
php
$client = new Ssentezo\Wallet\SsentezoClient(
getenv('SSENTEZO_API_USER'),
getenv('SSENTEZO_API_KEY'),
getenv('SSENTEZO_BASE_URL')
);
$result = $client->request('POST', '/api/withdraw', json_decode(<<<'JSON'
{
"externalReference": "payout-1001",
"msisdn": "256772123456",
"amount": 5000,
"currency": "UGX",
"reason": "Supplier payment"
}
JSON, true));
javascript
const token = Buffer.from(process.env.SSENTEZO_API_USER + ':' + process.env.SSENTEZO_API_KEY).toString('base64');
const response = await fetch(process.env.SSENTEZO_BASE_URL + '/api/withdraw', {
method: 'POST',
headers: {
Authorization: 'Basic ' + token,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"externalReference": "payout-1001",
"msisdn": "256772123456",
"amount": 5000,
"currency": "UGX",
"reason": "Supplier payment"
}),
});
const payload = await response.json();
python
import base64, json, os, urllib.request
token = base64.b64encode(f"{os.environ['SSENTEZO_API_USER']}:{os.environ['SSENTEZO_API_KEY']}".encode()).decode()
request = urllib.request.Request(
os.environ['SSENTEZO_BASE_URL'] + '/api/withdraw',
data=json.dumps({
"externalReference": "payout-1001",
"msisdn": "256772123456",
"amount": 5000,
"currency": "UGX",
"reason": "Supplier payment"
}).encode(),
headers={'Authorization': f'Basic {token}', 'Accept': 'application/json', 'Content-Type': 'application/json'},
method='POST',
)
with urllib.request.urlopen(request, timeout=20) as response:
payload = json.load(response)
java
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create(System.getenv("SSENTEZO_BASE_URL") + "/api/withdraw"))
.timeout(Duration.ofSeconds(20))
.header("Authorization", "Basic " + Base64.getEncoder().encodeToString((System.getenv("SSENTEZO_API_USER") + ":" + System.getenv("SSENTEZO_API_KEY")).getBytes(StandardCharsets.UTF_8)))
.header("Accept", "application/json")
.header("Content-Type", "application/json")
.POST(HttpRequest.BodyPublishers.ofString("{\"externalReference\":\"payout-1001\",\"msisdn\":\"256772123456\",\"amount\":5000,\"currency\":\"UGX\",\"reason\":\"Supplier payment\"}"))
.build();
Set SSENTEZO_API_USER, SSENTEZO_API_KEY, and SSENTEZO_BASE_URL. SSENTEZO_BASIC_TOKEN is the base64 of user:key.
Ssentezo Developers