Bank Payouts
How to send bank payments (PesaLink API) with IntaSend
Please go through the Send Money Pre-requisite to obtain the API Keys, Device ID and everything else you need to proceed.
Once setup we recommend using the SDKs provided by IntaSend to make it easy for you to sign and approve with less efforts. We have done the heavy lifting for you, so do not reinvent the wheel if the SDK of your stack is already available.
Bank Transaction Fields
When sending payment to a bank account, the following fields must be specified in your transaction items:
Field | Description |
---|---|
name | Beneficiary bank account name |
account | Beneficiary bank account |
bank_code | Bank code reference. See our list of bank code below. Used to identify the beneficiary bank. |
amount | Amount you intend to send in KES |
narrative | Purpose of payment |
List of Bank Codes
You must specify a bank code in the transaction item when sending bank payments. To obtain the values of the bank codes that are available, send a GET request to the following resource:
GET https://payment.intasend.com/api/v1/send-money/bank-codes/ke/
Sample response from the above request
[
{
"bank_name": "KCB",
"bank_code": "1"
},
{
"bank_name": "Standard Charted Bank KE",
"bank_code": "2"
},
{
"bank_name": "Barclays Bank",
"bank_code": "3"
},
{
"bank_name": "NCBA",
"bank_code": "7"
},
{
"bank_name": "Prime Bank",
"bank_code": "10"
},
{
"bank_name": "Cooperative Bank",
"bank_code": "11"
},
{
"bank_name": "National Bank",
"bank_code": "12"
},
{
"bank_name": "Citibank",
"bank_code": "16"
},
{
"bank_name": "Habib Bank AG Zurich",
"bank_code": "17"
},
{
"bank_name": "Middle East Bank",
"bank_code": "18"
},
{
"bank_name": "Bank of Africa",
"bank_code": "19"
},
{
"bank_name": "Consolidated Bank",
"bank_code": "23"
},
{
"bank_name": "Credit Bank Ltd",
"bank_code": "25"
},
{
"bank_name": "Stanbic Bank",
"bank_code": "31"
},
{
"bank_name": "ABC Bank",
"bank_code": "35"
},
{
"bank_name": "Spire Bank",
"bank_code": "49"
},
{
"bank_name": "Paramount Universal Bank",
"bank_code": "50"
},
{
"bank_name": "Jamii Bora Bank",
"bank_code": "51"
},
{
"bank_name": "Guaranty Bank",
"bank_code": "53"
},
{
"bank_name": "Victoria Commercial Bank",
"bank_code": "54"
},
{
"bank_name": "Guardian Bank",
"bank_code": "55"
},
{
"bank_name": "I&M Bank",
"bank_code": "57"
},
{
"bank_name": "DTB",
"bank_code": "63"
},
{
"bank_name": "Sidian Bank",
"bank_code": "66"
},
{
"bank_name": "Equity Bank",
"bank_code": "68"
},
{
"bank_name": "Family Bank",
"bank_code": "70"
},
{
"bank_name": "Gulf African Bank",
"bank_code": "72"
},
{
"bank_name": "First Community Bank",
"bank_code": "74"
},
{
"bank_name": "KWFT Bank",
"bank_code": "78"
},
{
"bank_name": "Housing Finance Company Limited (HFCK)",
"bank_code": "61"
},
{
"bank_name": "Mayfair Bank Limited",
"bank_code": "65"
}
]
The bank_code is what we'll need for the next request.
Step 1 - Initiate Bank Transfer
To initiate a bank transfer, you'll need the user name, bank account and the bank code. The bank code help us to identify the beneficiary bank.
Scope and Limits
Note this API currently only send to domestic banks in Kenya. The minimum you can send is KES. 100 and a maximum of KES. 999,999. We use PesaLink for disbursements and the supported currency is the Kenya Shilling (KES) at the moment.
from intasend import APIService
service = APIService(token=token)
transactions = [{'name': 'Joe Doe', 'account': "0129292920202", 'bank_code': '11', 'amount':20000, 'narrative': 'Salary'},
{'name': 'Mary Doe', 'account': "525623632321", 'bank_code': '2', 'amount': 10000, 'narrative': 'Invoice 122'}]
requires_approval = 'YES' # Set to 'NO' if you want the transaction to go through
# without calling the approve method
response = service.transfer.bank(currency='KES', transactions=transactions,,
requires_approval=requires_approval)
print(response)
use IntaSend\IntaSendPHP\Transfer;
$transactions = [
['name' => 'Joe Doe','account'=>'0129292920202','amount'=>'200', 'bank_code'=>'2', 'narrative'=> 'Bill Payment'],
['name' => 'Mary Doe','account'=>'525623632321','amount'=>'150', 'bank_code'=>'11', 'narrative'=> 'Purchase']
];
$requires_approval = 'YES'; // Set to 'NO' if you want the transaction to go through
// without calling the approve method
$transfer = new Transfer();
$transfer->init($credentials);
$response=$transfer->bank("KES", $transactions, $requires_approval=$requires_approval);
const IntaSend = require('intasend-node');
const intasend = new IntaSend(/*...Authenticate*/)
let payouts = intasend.payouts();
var req_approval = "YES" // Set to 'NO' if you want the transaction
// to go through without calling the approve method
payouts
.bank({
currency: 'KES',
requires_approval: req_approval,
transactions: [{
name: 'Joe Doe',
account: '0129292920202',
bank_code: '2',
amount: 200,
narrative: 'Purchase'
}, {
name: 'Mary Doe',
account: '525623632321',
bank_code: '11',
amount: 500,
narrative: 'Purchase'
}]
})
.then((resp) => {
console.log(`Payouts response:`, resp);
})
.catch((err) => {
console.error(`Payouts error:`, err);
});
Step 2: How to Approve a Bank Transaction
If requires_approval
is set to YES
, the response from Step 1 is passed to the approve function to approve the transaction.
approved_response = service.transfer.approve(response)
print(approved_response)
$response = $transfer->approve($response);
print_r($response);
payouts
.approve(resp, false)
.then((resp) => {
console.log(`Payouts approve:`, resp);
})
.catch((err) => {
console.error(`Payouts approve error:`, err);
});
Check the Transaction Status reference for more details on transaction codes and meaning.
Updated 7 months ago