Overview
The Bank Payout API allows you to transfer funds directly to a recipient’s bank account. Use the preview endpoint to see fee breakdowns, initiate to execute the transfer, and list to retrieve past bank payouts.
Preview Bank Payout
Calculate fees and validate recipient details before committing.
POST /v1/payouts/bank/preview
Authentication
Authorization: Bearer {{api_key}}
| Header | Value |
|---|
Accept | application/json |
Content-Type | application/json |
Request Body
| Field | Type | Required | Description |
|---|
amount | integer | required | Amount to send in the specified currency |
currency | string | required | Currency code (e.g., TZS) |
account_number | string | required | Recipient’s bank account number |
bic | string | required | Bank Identifier Code (BIC/SWIFT) of the destination bank |
beneficiary.full_name | object.string | required | Recipient’s full name as registered with the bank |
beneficiary.phone_number | object.string | optional | Recipient’s phone number |
metadata | object | optional | Arbitrary key-value pairs for your reference, max of 3 items with length of less than 100 characters each |
Example Request
curl -X POST https://pesahub.test/api/v1/payouts/bank/preview \
-H "Authorization: Bearer {{api_key}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"amount": 10000,
"currency": "TZS",
"beneficiary": {
"phone_number": "07XXXXXXXX",
"full_name": "DEMO RECIPIENT"
},
"account_number": "XXXXXXXXXXXX",
"bic": "NLCBTZTX",
"metadata": {
"order_id": "order_001",
"notes": "Payment for services"
}
}'
const response = await fetch('https://pesahub.test/api/v1/payouts/bank/preview', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 10000,
currency: 'TZS',
beneficiary: {
phone_number: '07XXXXXXXX',
full_name: 'DEMO RECIPIENT',
},
account_number: 'XXXXXXXXXXXX',
bic: 'NLCBTZTX',
metadata: {
order_id: 'order_001',
notes: 'Payment for services',
},
}),
});
Initiate Bank Payout
Execute the bank transfer.
Request Body
Same fields as the preview endpoint.
Example Request
curl -X POST https://pesahub.test/api/v1/payouts/bank \
-H "Authorization: Bearer {{api_key}}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"amount": 5000,
"currency": "TZS",
"beneficiary": {
"phone_number": "07XXXXXXXX",
"full_name": "DEMO RECIPIENT"
},
"account_number": "XXXXXXXXXXXX",
"bic": "NLCBTZTX",
"metadata": {
"order_id": "order_001",
"notes": "Payment for services"
}
}'
const response = await fetch('https://pesahub.test/api/v1/payouts/bank', {
method: 'POST',
headers: {
'Authorization': `Bearer ${API_KEY}`,
'Accept': 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
amount: 5000,
currency: 'TZS',
beneficiary: {
phone_number: '07XXXXXXXX',
full_name: 'DEMO RECIPIENT',
},
account_number: 'XXXXXXXXXXXX',
bic: 'NLCBTZTX',
metadata: {
order_id: 'order_001',
notes: 'Payment for services',
},
}),
});
List Bank Payouts
Retrieve a list of all bank payouts.
GET /v1/payouts/bank/list
Example Request
curl -X GET https://pesahub.test/api/v1/payouts/bank/list \
-H "Authorization: Bearer {{api_key}}" \
-H "Accept: application/json"
Always run a preview before initiating a bank payout to validate the BIC and account number are correct.