Send Money
Create a merchant mobile wallet
POST https://sandbox.kopokopo.com/api/v2/merchant_wallets
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"first_name": "first_name",
"last_name": "last_name",
"nickname": "nickname",
"phone_number": "254999999999",
"network": "Safaricom"
}
settlement_account_request = {
type: "merchant_wallet",
first_name: "first_name",
last_name: "last_name",
nickname: "nickname",
phone_number: "254999999999",
network: "Safaricom"
}
# Using K2Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
settlement = K2Settlement.new('your_access_token')
settlement.add_settlement_account(settlement_account_request)
settlement.location_url # => "https://sandbox.kopokopo.com/api/v2/merchant_wallets/d76265cd-0951-e511-80da-0aa34a9b2388"
request_body ={
"access_token": ACCESS_TOKEN,
"first_name": 'py_sdk_first_name',
"last_name": 'py_sdk_last_name',
"phone_number": '+254911222538',
"network": 'Safaricom'
}
# Using Kopo Kopo Connect - https://github.com/kopokopo/kopokopo-connect-python (Recommended)
transfer_service = k2connect.Transfer
transfer_location = pay_service.add_mobile_wallet_settlement_account(request_body)
transfer_location # => 'https://sandbox.kopokopo.com/api/v2/merchant_wallets/d76265cd-0951-e511-80da-0aa34a9b2388'
var requestBody = {
network: 'Safaricom',
phoneNumber: '+254999999999',
firstName: 'first_name',
lastName: 'last_name',
accessToken: 'myRand0mAcc3ssT0k3n'
}
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const TransferService = K2.TransferService
TransferService
.createMerchantWallet(requestBody)
.then( response => {
console.log(response) // => 'https://sandbox.kopokopo.com/api/v2/merchant_wallets/d76265cd-0951-e511-80da-0aa34a9b2388'
})
.catch( error => {
console.log(error)
})
<?
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-php (Recommended)
$transfer = $K2->SettlementTransferService();
$response = $transfer->createMerchantWallet([
'network' => 'Safaricom',
'phoneNumber' => '+254999999999',
'firstName' => 'Jane',
'lastName' => 'Doe',
'accessToken' => 'myRand0mAcc3ssT0k3n'
]);
if($response['status'] == 'success')
{
echo "The resource location is:" . json_encode($response['location']);
}
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
HTTP Request
POST https://sandbox.kopokopo.com/api/v2/merchant_wallets
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Request Parameters (JSON)
| Parameter | Required | Type | Description |
|---|---|---|---|
| network | Yes | String | The mobile network to which the phone number belongs |
| first_name | Yes | String | First name |
| last_name | Yes | String | Last name |
| nickname | No | String | Nickname for mobile wallet |
| phone_number | Yes | String | Phone number |
HTTP Response
Successful Response
You must login to the KopoKopo INC application to obtain the reference of the merchant_wallet you have just created
Upon successful creation of the merchant wallet, HTTP Status Code 201 with the URL of the merchant wallet in the Location Header of the HTTP Response.
HTTP/1.1 201 Created
Location: https://sandbox.kopokopo.com/api/v2/merchant_wallets/d76265cd-0951-e511-80da-0aa34a9b2388
Error Response
This will have a HTTP Status code indicating the error and it might have a json that contains the error code and an error message specifying the error that occured. Please note that the error response might not be present depending on the type of error that occured.
If the error json response is present, it will look as follows:
HTTP/1.1 400 Bad Request
{ "error_code": 400, "error_message": "First name can't be blank" }
Create a merchant bank account
POST https://sandbox.kopokopo.com/api/v2/merchant_bank_accounts
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: "< product >/< product-version > < comment >"
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"account_name": "John Doe",
"bank_branch_ref": "c7f300c0-f1ef-4151-9bbe-005005aa3747",
"account_number": "123456789",
"nickname": "JD",
"settlement_method": "EFT"
}
eft_bank_settlement_account = {
type: 'merchant_bank_account',
nickname: 'JD',
account_name: 'John Doe',
account_number: '123456789',
bank_branch_ref: 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
settlement_method: "EFT"
}
rts_bank_settlement_account = {
type: 'merchant_bank_account',
nickname: 'JD',
account_name: 'John Doe',
account_number: '123456789',
bank_branch_ref: 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
settlement_method: "RTS"
}
# Using K2Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
settlement = K2Settlement.new('your_access_token')
# To Add an EFT bank settlement account
settlement.add_settlement_account(eft_bank_settlement_account)
# To Add an RTS bank settlement account
settlement.add_settlement_account(rts_bank_settlement_account)
settlement.location_url # => "https://sandbox.kopokopo.com/api/v2/merchant_bank_accounts/d76265cd-0951-e511-80da-0aa34a9b2388"
request_body ={
'access_token': ACCESS_TOKEN,
'account_name': 'John Doe',
'bank_branch_ref': 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
'account_number': '123456789',
"settlement_method": "EFT"
}
# Using Kopo Kopo Connect - https://github.com/kopokopo/kopokopo-connect-python (Recommended)
transfer_service = k2connect.Transfer
transfer_location = pay_service.add_bank_settlement_account(request_body)
transfer_location # => 'https://sandbox.kopokopo.com/api/v2/merchant_bank_accounts/d76265cd-0951-e511-80da-0aa34a9b2388'
var requestBody = {
'accountName': 'John Doe',
'bankBranchRef': 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
'accountNumber': '123456789',
'settlementMethod': 'EFT',
'accessToken': 'myRand0mAcc3ssT0k3n'
}
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const TransferService = K2.TransferService
TransferService
.createMerchantBankAccount(requestBody)
.then( response => {
console.log(response) // => 'https://sandbox.kopokopo.com/api/v2/merchant_bank_accounts/d76265cd-0951-e511-80da-0aa34a9b2388'
})
.catch( error => {
console.log(error)
})
<?
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-php (Recommended)
$transfer = $K2->SettlementTransferService();
$response = $transfer->createMerchantBankAccount([
'accountName' => 'John Doe',
'bankBranchRef' => 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
'accountNumber' => '123456789',
'settlementMethod' => 'EFT',
'accessToken' => 'myRand0mAcc3ssT0k3n'
]);
if($response['status'] == 'success')
{
echo "The resource location is:" . json_encode($response['location']);
}
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
HTTP Request
POST https://sandbox.kopokopo.com/api/v2/merchant_bank_accounts
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Request Parameters (JSON)
| Parameter | Required | Type | Description |
|---|---|---|---|
| account_name | Yes | String | The name as indicated on the bank account name |
| nickname | No | String | Nickname for bank account |
| bank_branch_ref | Yes | String | An identifier identifying the destination bank branch. Details on how to get a bank_branch_ref are here |
| account_number | Yes | String | The bank account number. Details on bank account number validation rules are here |
| settlement_method | Yes | String | EFT or RTS |
HTTP Response
Successful Response
You must login to the KopoKopo INC application to obtain the reference of the merchant_bank_account you have just created
Upon successful creation of the merchant bank account, HTTP Status Code 201 with the URL of the merchant bank account in the Location Header of the HTTP Response.
HTTP/1.1 201 Created
Location: https://sandbox.kopokopo.com/api/v2/merchant_bank_accounts/d76265cd-0951-e511-80da-0aa34a9b2388
Error Response
This will have a HTTP Status code indicating the error and it might have a json that contains the error code and an error message specifying the error that occured. Please note that the error response might not be present depending on the type of error that occured.
If the error json response is present, it will look as follows:
HTTP/1.1 400 Bad Request
{ "error_code": 400, "error_message": "Bank branch ref is not valid" }
Create an external recipient
POST https://sandbox.kopokopo.com/api/v2/external_recipients
Content-Type: application/json
Accept: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Create Send Money external mobile wallet recipient
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"type": "mobile_wallet",
"external_recipient" : {
"first_name": "John",
"last_name": "Doe",
"nickname": "JD",
"email": "johndoe@nomail.net",
"phone_number": "+254999999999",
"network": "Safaricom"
}
}
your_input = {
type: 'mobile_wallet',
first_name: 'John',
last_name: 'Doe',
email: 'johndoe@nomail.net',
phone_number: '+254999999999',
network: 'Safaricom'
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-ruby(Recommended)
k2_external_recipient = K2ConnectRuby::K2Entity::ExternalRecipient.new(access_token)
k2_external_recipient.add_external_recipient(your_input)
k2_external_recipient.recipients_location_url # => "https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747"
your_input = {
"type": "mobile_wallet",
"first_name": "John",
"last_name": "Doe",
"phone_number": "+254999999999",
"email": "johndoe@nomail.net",
"nickname": "JD",
"network": "Safaricom"
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-python (Recommended)
send_money_service = k2connect.SendMoney(access_token)
k2_external_recipient_location = send_money_service.add_external_recipient(your_input)
k2_external_recipient_location # => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const ExternalRecipientService = K2.ExternalRecipientService
var requestBody = {
type: 'mobile_wallet',
firstName: 'John',
lastName: 'Doe',
network: 'Safaricom',
email: 'johndoe@nomail.net',
phoneNumber: '+254999999999',
accessToken: 'myRand0mAcc3ssT0k3n'
}
ExternalRecipientService
.addExternalRecipient(requestBody)
.then(function(res) {
console.log(response)// => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
})
.catch( error => {
console.log(error)
})
<?
// Using KopoKopoConnect - https://github.com/kopokopo/k2-connect-php (Recommended
$externalRecipientService = $K2->ExternalRecipientService();
$response = $externalRecipientService->addExternalRecipient([
'type' => 'mobile_wallet',
'firstName'=> 'John',
'lastName'=> 'Doe',
'phoneNumber'=> '+254999999999',
'network'=> 'Safaricom',
'access_token' => 'myRand0mAcc3ssT0k3n'
]);
if($response['status'] == 'success')
{
echo "The resource location is:" . json_encode($response['location']); // => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
}
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Create Send Money external bank account recipient
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"type": "bank_account",
"external_recipient" : {
"account_name": "John Doe",
"bank_branch_ref": "c7f300c0-f1ef-4151-9bbe-005005aa3747",
"account_number": "123456789",
"nick_name": "JD",
"settlement_method": "RTS"
}
}
your_input = {
type: 'bank_account',
account_name: 'John Doe',
account_number: '123456789',
bank_branch_ref: 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
settlement_method: 'RTS'
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-ruby(Recommended)
k2_external_recipient = K2ConnectRuby::K2Entity::ExternalRecipient.new(access_token)
k2_external_recipient.add_external_recipient(your_input)
k2_external_recipient.recipients_location_url # => "https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747"
request_body = {
'type': 'bank_account',
'account_name': 'John Doe',
'account_number': '123456789',
'bank_branch_ref': 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
'settlement_method': 'RTS',
'nickname': 'JD',
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-python (Recommended)
send_money_service = k2connect.SendMoney(access_token)
k2_external_recipient_location = send_money_service.add_external_recipient(request_body)
k2_external_recipient_location # => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const ExternalRecipientService = K2.ExternalRecipientService
var requestBody = {
type: 'bank_account',
accountName: 'John Doe',
bankBranchRef: 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
accountNumber: '123456789',
settlementMethod: 'RTS',
accessToken: 'myRand0mAcc3ssT0k3n'
}
ExternalRecipientService
.addExternalRecipient(requestBody)
.then(function(res) {
console.log(response)// => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
})
.catch( error => {
console.log(error)
})
<?
// Using KopoKopoConnect - https://github.com/kopokopo/k2-connect-php (Recommended
$externalRecipientService = $K2->ExternalRecipientService();
$response = $externalRecipientService->addExternalRecipient([
'type' => 'bank_account',
'bankBranchRef' => 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
'accountName' => 'John Doe',
'accountNumber' => '123456789',
'settlementMethod' => 'RTS',
'accessToken' => 'myRand0mAcc3ssT0k3n'
]);
if($response['status'] == 'success')
{
echo "The resource location is:" . json_encode($response['location']); // => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
}
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Create Send Money external till recipient
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"type": "till",
"external_recipient" : {
"till_name": "John Doe",
"till_number": "000000",
"nickname": "JD"
}
}
your_input = {
type: 'till',
till_name: 'John Doe',
till_number: '123456789',
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-ruby(Recommended)
k2_external_recipient = K2ConnectRuby::K2Entity::ExternalRecipient.new(access_token)
k2_external_recipient.add_external_recipient(your_input)
k2_external_recipient.recipients_location_url # => "https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747"
request_body = {
'access_token': ACCESS_TOKEN,
'recipient_type': 'till',
'till_name': 'John Doe',
'till_number': '123456789',
'nickname': 'JD',
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-python (Recommended)
send_money_service = k2connect.SendMoney(access_token)
k2_external_recipient_location = send_money_service.add_external_recipient(request_body)
k2_external_recipient_location # => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const ExternalRecipientService = K2.ExternalRecipientService
var requestBody = {
type: 'till',
tillName: 'John Doe',
tillNumber: '000000',
accessToken: 'myRand0mAcc3ssT0k3n'
}
ExternalRecipientService
.addExternalRecipient(requestBody)
.then(function(res) {
console.log(response)// => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
})
.catch( error => {
console.log(error)
})
<?
// Using KopoKopoConnect - https://github.com/kopokopo/k2-connect-php (Recommended
$externalRecipientService = $K2->ExternalRecipientService();
$response = $externalRecipientService->addExternalRecipient([
'type' => 'till',
'tillName' => 'John Doe',
'tillNumber' => '000000',
'accessToken' => 'myRand0mAcc3ssT0k3n'
]);
if($response['status'] == 'success')
{
echo "The resource location is:" . json_encode($response['location']);
}
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Create Send Money paybill recipient
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"type": "paybill",
"external_recipient" : {
"paybill_name": "KPLC Paybill",
"paybill_number": "890087",
"paybill_account_number": "test_account",
"nickname": "KPLC"
}
}
your_input = {
type: 'paybill',
paybill_name: "KPLC Paybill",
paybill_number: "890087",
paybill_account_number: "test_account",
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-ruby(Recommended)
k2_external_recipient = K2ConnectRuby::K2Entity::ExternalRecipient.new(access_token)
k2_external_recipient.add_external_recipient(your_input)
k2_external_recipient.recipients_location_url # => "https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747"
request_body = {
'access_token': ACCESS_TOKEN,
'recipient_type': 'paybill',
'paybill_name': 'KPLC Paybill',
'paybill_number': '890087',
'paybill_account_number': 'test_account',
'nickname': 'KPLC',
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-python (Recommended)
send_money_service = k2connect.SendMoney(access_token)
k2_external_recipient_location = send_money_service.add_external_recipient(request_body)
k2_external_recipient_location # => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const ExternalRecipientService = K2.ExternalRecipientService
var requestBody = {
type: 'paybill',
paybillName: 'KPLC Paybill',
paybillNumber: '890087',
paybillAccountNumber: 'test_account',
nickname: 'KPLC',
accessToken: 'myRand0mAcc3ssT0k3n'
}
ExternalRecipientService
.addExternalRecipient(requestBody)
.then(function(res) {
console.log(response)// => 'https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747'
})
.catch( error => {
console.log(error)
})
<?
// Using KopoKopoConnect - https://github.com/kopokopo/k2-connect-php (Recommended
$externalRecipientService = $K2->ExternalRecipientService();
$response = $externalRecipientService->addExternalRecipient([
'type' => 'paybill',
'paybillName' => 'KPLC Paybill',
'paybillNumber' => '890087',
'paybillAccountNumber' => 'test_account',
'accessToken' => 'myRand0mAcc3ssT0k3n'
]);
if($response['status'] == 'success')
{
echo "The resource location is:" . json_encode($response['location']);
}
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
<!-- END OF SEND MONEY RECIPIENTS --> Add external entities that will be the destination of your payments.
HTTP Request
POST https://sandbox.kopokopo.com/api/v2/external_recipients
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Request Parameters (JSON)
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | The type of the recipient eg. mobile_wallet, bank_account, till or paybill |
| external_recipient | Yes | JSON | A JSON object containing details of the recipient (see below) |
Send Money Recipient (Mobile Wallet) JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| first_name | Yes | String | First name of the recipient |
| last_name | Yes | String | Last name of recipient |
| nickname | No | String | Nickname for mobile wallet |
| No | String | Email of recipient | |
| phone_number | Yes | String | Phone number |
| network | Yes | String | The mobile network to which the phone number belongs |
Send Money Recipient (Bank Account) JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| account_name | Yes | String | The name as indicated on the bank account name |
| bank_branch_ref | Yes | String | An identifier identifying the destination bank branch. Details on how to get a bank_branch_ref are here |
| account_number | Yes | String | The bank account number (validation rules here) |
| nickname | No | String | Nickname for bank account |
| settlement_method | Yes | String | RTS |
Send Money Recipient (External Till) JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| till_name | Yes | String | The name as indicated on the till |
| till_number | Yes | String | The till number |
| nickname | No | String | Nickname for external till |
Send Money Recipient (Paybill) JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| paybill_name | Yes | String | The name referring to the paybill |
| paybill_number | Yes | String | The paybill business number |
| paybill_account_number | Yes | String | The paybill account number |
| nickname | No | String | Nickname for paybill account |
HTTP Response
Successful Response
You must login to the KopoKopo INC application to obtain the reference of the recipient you have just created
A HTTP response code of 201 is returned upon successful creation of the Send Money recipient. The URL of the recipient resource is also returned in the HTTP Location Header
HTTP/1.1 201 Created
Location: https://sandbox.kopokopo.com/api/v2/external_recipients/c7f300c0-f1ef-4151-9bbe-005005aa3747
Error Response
This will have a HTTP Status code indicating the error and it might have a json that contains the error code and an error message specifying the error that occured. Please note that the error response might not be present depending on the type of error that occured.
If the error json response is present, it will look as follows:
HTTP/1.1 400 Bad Request
{ "error_code": 400, "error_message": "Invalid recipient type" }
Send Money to my accounts
POST https://sandbox.kopokopo.com/api/v2/send_money
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"currency": "KES",
"metadata": {
"customerId": "8675309",
"notes": "Salary payment for September 2025"
},
"_links": {
"callback_url": "https://your-call-bak.yourapplication.com/send_money_result"
}
}
transfer_request = {
callback_url: 'https://webhook.site/437a5819-1a9d-4e96-b403-a6f898e5bed3',
}
# Using K2Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
k2_transfer = K2Transfer.new('your_access_token')
k2_transfer.transfer_funds(transfer_request)
k2_transfer.location_url # => "https://sandbox.kopokopo.com/api/v2/transfers/d76265cd-0951-e511-80da-0aa34a9b2388"
request_body = {
"access_token": ACCESS_TOKEN,
"callback_url": 'https://webhook.site/52fd1913-778e-4ee1-bdc4-74517abb758d'
}
# Using K2 Connect - https://github.com/kopokopo/k2-connect-python (Recommended)
k2connect.initialize(environ.get('CLIENT_ID'), environ.get('CLIENT_SECRET'), 'sandbox.kopokopo.com')
transfer_service = k2connect.Transfers
transfer_location_url = transfer_service.settle_funds(request_body)
transfer_location_url # => 'https://sandbox.kopokopo.com/api/v2/transfers/d76265cd-0951-e511-80da-0aa34a9b2388'
var transferOpts = {
accessToken: 'myRand0mAcc3ssT0k3n',
callbackUrl: 'https://your-call-bak.yourapplication.com/transfer_result'
}
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const TransferService = K2.TransferService
TransferService
.settleFunds(transferOpts)
.then(response => {
console.log(response) // => 'https://sandbox.kopokopo.com/api/v2/settlement_transfers/d76265cd-0951-e511-80da-0aa34a9b2388'
})
.catch(error => {
console.log(error)
})
<?
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-php (Recommended)
$sendMoneyService = $k2->SendMoneyService();
$sendMoneyRequest = [
"currency" => "KES",
"metadata" => [
"notes" => "Salary payment for September 2025"
],
"callbackUrl" => "https://your-call-bak.yourapplication.com/send_money_result",
"accessToken" => "myRand0mAcc3ssT0k3n"
];
// For Kopo Kopo API applications, an accessToken can be used for this endpoint. (https://api-docs.kopokopo.com/#application-authorization)
$response = $sendMoneyService->sendMoney($sendMoneyRequest);
print_r($response); // Array([status] => success, [location] => https://sandbox.kopokopo.com/api/v2/send_money/d76265cd-0951-e511-80da-0aa34a9b2388)
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Create a blind transfer without specifying the amount NOR the destination. Your available funds will be sent to your preferred settlement location(s) that are linked to your company and tills.
HTTP Request
POST https://sandbox.kopokopo.com/api/v2/send_money
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Request Parameters (JSON)
| Parameter | Required | Type | Description |
|---|---|---|---|
| currency | No | String | Currency of funds to transfer |
| metadata | No | JSON | A JSON object with a maximum of 5 key-value pairs containing additional contextual information about the transfer. The values must be primitive data types |
| _links | Yes | JSON | A JSON containing a call back URL where the results of the Settlement Transfer will be posted. MUST be a secure HTTPS (TLS) endpoint |
HTTP Response
Successful Response
Upon successful initiation of the transfer, HTTP Status Code 201 with the URL of the transfer in the Location Header of the HTTP Response.
HTTP/1.1 201 Created
Location: https://sandbox.kopokopo.com/api/v2/send_money/d76265cd-0951-e511-80da-0aa34a9b2388
Error Response
This will have a HTTP Status code indicating the error and it might have a json that contains the error code and an error message specifying the error that occured. Please note that the error response might not be present depending on the type of error that occured.
If the error json response is present, it will look as follows:
HTTP/1.1 400 Bad Request
{ "error_code": 400, "error_message": "Callback url can't be blank" }
Send Money to my account
POST https://sandbox.kopokopo.com/api/v2/send_money
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"destinations": [
{
"type": "merchant_bank_account",
"reference": "e479b8de-d05d-46f1-89ea-27948293f5df",
"amount": 100,
"description": null
}
],
"source_identifier": "4321",
"currency": "KES",
"metadata": {
"customerId": "8675309",
"notes": "Salary payment for September 2025"
},
"_links": {
"callback_url": "https://your-call-bak.yourapplication.com/send_money_result"
}
}
transfer_request = {
destination_reference: '38f7c997-527c-452f-adc4-49ffab98982e',
destination_type: 'merchant_bank_account',
currency: 'currency',
value: 'value',
callback_url: 'callback_url',
}
# Using K2Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
k2_transfer = K2Transfer.new('your_access_token')
k2_transfer.transfer_funds(transfer_request)
k2_transfer.location_url # => "https://sandbox.kopokopo.com/api/v2/transfers/d76265cd-0951-e511-80da-0aa34a9b2388"
request_body = {
"access_token": ACCESS_TOKEN,
"destination_type": 'merchant_bank_account',
"destination_reference": '6ad03242-2c6e-4050-8e46-987cb74f5326',
"callback_url": 'https://webhook.site/52fd1913-778e-4ee1-bdc4-74517abb758d',
"value": '10',
}
# Using K2 Connect - https://github.com/kopokopo/k2-connect-python (Recommended)
k2connect.initialize(environ.get('CLIENT_ID'), environ.get('CLIENT_SECRET'), 'sandbox.kopokopo.com')
transfer_service = k2connect.Transfers
transfer_location_url = transfer_service.settle_funds(request_body)
transfer_location_url # => 'https://sandbox.kopokopo.com/api/v2/transfers/d76265cd-0951-e511-80da-0aa34a9b2388'
var transferOpts = {
amount : 2250.00,
currency: 'KES',
destinationType: 'merchant_bank_account',
destinationReference: '38f7c997-527c-452f-adc4-49ffab98982e',
accessToken: 'myRand0mAcc3ssT0k3n',
callbackUrl: 'https://your-call-bak.yourapplication.com/transfer_result'
}
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const TransferService = K2.TransferService
TransferService
.settleFunds(transferOpts)
.then(response => {
console.log(response) // => 'https://sandbox.kopokopo.com/api/v2/settlement_transfers/d76265cd-0951-e511-80da-0aa34a9b2388'
})
.catch(error => {
console.log(error)
})
<?
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-php (Recommended)
$sendMoneyService = $k2->SendMoneyService();
$sendMoneyRequest = [
"destinations" => [
[
"type" => "merchant_wallet", // or merchant_bank_account
"reference" => "af033d43-75f7-4123-b5c3-252377d96739",
"amount" => 250
]
],
"currency" => "KES",
"sourceIdentifier": "4321",
"metadata" => [
"notes" => "Salary payment for September 2025"
],
"callbackUrl" => "https://your-call-bak.yourapplication.com/send_money_result",
"accessToken" => "myRand0mAcc3ssT0k3n"
];
// For Kopo Kopo API applications, an accessToken can be used for this endpoint. (https://api-docs.kopokopo.com/#application-authorization)
$response = $sendMoneyService->sendMoney($sendMoneyRequest);
print_r($response); // Array([status] => success, [location] => https://sandbox.kopokopo.com/api/v2/send_money/cb95aa2d-cd7f-4c9f-9d16-a2eb1a7fef42)
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Create a transfer from your Kopo Kopo account by specifying the destination of the funds.
HTTP Request
POST https://sandbox.kopokopo.com/api/v2/send_money
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Request Parameters (JSON)
| Parameter | Required | Type | Description |
|---|---|---|---|
| destinations | Yes | JSON | A JSON object containing destinations details |
| source_identifier | No | String | Till number or null for available balance |
| currency | No | String | Currency of funds to transfer |
| metadata | No | JSON | A JSON object with a maximum of 5 key-value pairs containing additional contextual information about the transfer. The values must be primitive data types |
| _links | Yes | JSON | A JSON containing a call back URL where the results of the Settlement Transfer will be posted. MUST be a secure HTTPS (TLS) endpoint |
Destination JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | Type of destination. Either merchant_wallet or merchant_bank_account |
| amount | Yes | Integer | Amount to transfer |
| reference | Yes | String | Identifier of the destination account of the funds. Details on how to locate an account's destination reference are here |
| description | No | String | Description of the transfer |
HTTP Response
Successful Response
Upon successful initiation of the transfer, HTTP Status Code 201 with the URL of the transfer in the Location Header of the HTTP Response.
HTTP/1.1 201 Created
Location: https://sandbox.kopokopo.com/api/v2/send_money/d76265cd-0951-e511-80da-0aa34a9b2388
Error Response
This will have HTTP Status code indicating the error, and it might have a json that contains the error code and an error message specifying the error that occurred. Please note that the error response might not be present depending on the type of error that occured.
If the error json response is present, it will look as follows:
HTTP/1.1 400 Bad Request
{ "error_code": 400, "error_message": "Destination reference is invalid" }
Send Money to external recipients
POST https://sandbox.kopokopo.com/api/v2/send_money
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"destinations": [
{
"type": "mobile_wallet",
"nickname": "Jane Doe",
"phone_number": "254900000000",
"network": "Safaricom",
"amount": 1000,
"description": "Reason for payment",
"favourite": true
},
{
"type": "mobile_wallet",
"nickname": "John Doe",
"phone_number": "254900111111",
"network": "Safaricom",
"amount": 1000,
"description": "Reason for payment",
"favourite": true
}
],
"source_identifier": "4321",
"currency": "KES",
"metadata": {
"customerId": "8675309",
"notes": "Salary payment for September 2025"
},
"_links": {
"callback_url": "https://your-call-bak.yourapplication.com/send_money_result"
}
}
your_input = {
destination_type: "bank_account",
destination_reference: "c7f300c0-f1ef-4151-9bbe-005005aa3747",
currency: "KES",
value: 20000,
description: "Salary payment for May 2018",
category: "salaries",
tags: ["tag 1", "tag 2"],
metadata: {
customer_id: "8675309",
notes: "Salary payment for May 2018"
},
callback_url: "https://your-call-bak.yourapplication.com/payment_result"
}
# Using K2Connect - https://github.com/kopokpo/k2-connect-ruby (Recommended)
k2_pay = K2Pay.new('your_access_token')
k2_pay.create_payment(your_input)
k2_pay.payments_location_url # => "https://sandbox.kopokopo.com/api/v2/payments/d76265cd-0951-e511-80da-0aa34a9b2388"
payment_request = {
"access_token": ACCESS_TOKEN,
"destination_reference": '3344-effefnkka-132',
"destination_type": 'mobile_wallet',
"callback_url": 'https://webhook.site/52fd1913-778e-4ee1-bdc4-74517abb758d',
"amount": '10',
"currency": 'KES'
"description": "Salary payment for May 2018",
"category": 'salaries',
"tags": ["tag 1", "tag 2"]
}
# Using k2-connect - https://github.com/kopokopo/k2-connect-python (Recommended)
pay_service = k2connect.Pay
create_pay_location = pay_service.send_pay(payment_request)
create_pay_location # => 'https://sandbox.kopokopo.com/api/v2/payments/d76265cd-0951-e511-80da-0aa34a9b2388'
var paymentRequest = {
destinationType: 'bank_account',
destinationReference: 'c7f300c0-f1ef-4151-9bbe-005005aa3747',
amount: '20000',
currency: 'KES',
description: 'Salary payment for May 2018',
category: "salaries",
tags: ["tag 1", "tag 2"],
metadata: {
customer_id: '8675309',
notes: 'Salary payment for May 2018'
},
callbackUrl: 'https://your-call-bak.yourapplication.com/payment_result'
}
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const PayService = K2.PayService
PayService
.sendPay(paymentRequest)
.then(function(res) {
console.log(response)
// => 'https://sandbox.kopokopo.com/api/v2/payments/d76265cd-0951-e511-80da-0aa34a9b2388'
})
.catch( error => {
console.log(error)
})
<?
// Using KopoKopoConnect - https://github.com/kopokopo/k2-connect-php (Recommended
$sendMoneyService = $K2->SendMoneyService();
$sendMoneyRequest = [
"destinations" => [
[
"type" => "mobile_wallet",
"amount" => 1000,
"network" => "Safaricom",
"nickname" => "External Wallet 1",
"favourite" => true,
"description" => "Sending money to external mobile wallet 1",
"phoneNumber" => "25490000000"
],
[
"type" => "mobile_wallet",
"amount" => 1000,
"network" => "Safaricom",
"nickname" => "External Wallet 2",
"favourite" => false,
"description" => "Sending money to external mobile wallet 2",
"phoneNumber" => "254900111222"
]
],
"currency" => "KES",
"sourceIdentifier" => "4321",
"metadata" => [
"notes" => "Salary payment for September 2025"
],
"callbackUrl" => "https://your-call-bak.yourapplication.com/send_money_result",
"accessToken" => "myRand0mAcc3ssT0k3n"
];
$response = $sendMoneyService->sendMoney($sendMoneyRequest);
print_r($response); // Array([status] => success, [location] => https://sandbox.kopokopo.com/api/v2/send_money/1854d8ad-3c3c-4842-a965-5d8ea7a3cad7)
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Create an outgoing payment to a third party. The final result of the payment will be posted asynchronously to your systems via the call back URL provided in the request.
Note: Send Money to multiple destinations is only supported for mobile_wallet and bank_account destination types.
All destinations included in a single request must be of the same type (i.e., you cannot mix different destination types within one request).
HTTP Request
POST https://sandbox.kopokopo.com/api/v2/send_money
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Request Parameters (JSON)
| Parameter | Required | Type | Description |
|---|---|---|---|
| destinations | Yes | JSON | A JSON object containing destinations details |
| source_identifier | No | String | Till number or null for available balance |
| currency | No | String | Currency of funds to transfer |
| metadata | No | JSON | A JSON object with a maximum of 5 key-value pairs containing additional contextual information about the transfer. The values must be primitive data types |
| _links | Yes | JSON | A JSON containing a call back URL where the results of the Settlement Transfer will be posted. MUST be a secure HTTPS (TLS) endpoint |
External Mobile Wallet Destination JSON (Could be multiple)
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | Type of destination. Must be mobile_wallet |
| phone_number | Yes | String | Phone number |
| network | Yes | String | The mobile network to which the phone number belongs |
| amount | Yes | Integer | Amount to transfer |
| nickname | No | String | Nickname for the external mobile wallet |
| description | Yes | String | Description of the transfer |
| favourite | No | Boolean | Mark destination as favorite or not |
External Bank Account Destination JSON (Could be multiple)
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | Type of destination. Must be bank_account |
| bank_branch_ref | Yes | String | An identifier identifying the destination bank branch. Details on how to get a bank_branch_ref are here |
| account_name | Yes | String | Bank account name |
| account_number | Yes | String | Bank account number. Details on bank account number validation rules are here |
| nickname | No | String | Nickname for the external bank account |
| amount | Yes | Integer | Amount to transfer |
| description | Yes | String | Description of the transfer |
| favourite | No | Boolean | Mark destination as favorite or not |
External Till Destination JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | Type of destination. Must be till |
| till_number | Yes | String | Till number |
| nickname | No | String | Nickname for the external till |
| amount | Yes | Integer | Amount to transfer |
| description | Yes | String | Description of the transfer |
| favourite | No | Boolean | Mark destination as favorite or not |
External Paybill Destination JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| type | Yes | String | Type of destination. Must be paybill |
| paybill_number | Yes | String | Paybill number |
| paybill_account_number | Yes | String | Paybill account number |
| nickname | No | String | Nickname for the paybill account |
| amount | Yes | Integer | Amount to transfer |
| description | Yes | String | Description of the transfer |
| favourite | No | Boolean | Mark destination as favorite or not |
HTTP Response
Successful Response
A HTTP response code of 201 is returned upon successful creation of the Payment request. The URL of the Payment
resource is also returned in the HTTP Location Header
HTTP/1.1 201 Created
Location: https://sandbox.kopokopo.com/api/v2/send_money/c7f300c0-f1ef-4151-9bbe-005005aa3747
Error Response
This will have a HTTP Status code indicating the error and it might have a json that contains the error code and an error message specifying the error that occured. Please note that the error response might not be present depending on the type of error that occured.
If the error json response is present, it will look as follows:
HTTP/1.1 400 Bad Request
{ "error_code": 400, "error_message": "Destination type can't be blank" }
Process Send Money result
POST https://your-callback-url.com/send_money_result
Content-Type: application/json
X-KopoKopo-Signature: 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"data": {
"id": "716481bc-635c-4d35-92c9-65bb0797196a",
"type": "send_money",
"attributes": {
"status": "Processed",
"created_at": "2025-09-23T20:05:46.522+03:00",
"source_identifier": "4321",
"destinations": [
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test",
"favourite": true,
"description": "Testing",
"phone_number": "254900000000"
},
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test2",
"favourite": true,
"description": "Testing",
"phone_number": "254900111111"
}
],
"currency": "KES",
"transfer_batches": [
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900111111",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:22:59.913+03:00",
"destination_reference": "a3bd6298-8a5a-4a93-b880-7948a621fdfb",
"transaction_reference": "QCL160124A7"
}
]
},
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900000000",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:26:49.173+03:00",
"destination_reference": "5f58ce16-0320-4da8-ad38-0f2cf7f520f2",
"transaction_reference": "QDZ273694C8"
}
]
}
],
"errors": null,
"metadata": {
"notes": "Salary payment for September 2025",
"customerId": "8675309"
},
"_links": {
"callback_url": "https://webhook.site/f0b07170-4397-4e81-b552-a6bc0fc20ed9",
"self": "https://api.kopokopo.com/api/v2/send_money/716481bc-635c-4d35-92c9-65bb0797196a"
}
}
}
}
send_money_client = K2Client.new(ENV["API_KEY"])
send_money_client.parse_request(request)
send_money_object = K2ProcessResult.process(send_money_client.hash_body, API_KEY, send_money_client.k2_signature)
# Processed send money result in json format
{
"data": {
"id": "716481bc-635c-4d35-92c9-65bb0797196a",
"type": "send_money",
"attributes": {
"status": "Processed",
"created_at": "2025-09-23T20:05:46.522+03:00",
"source_identifier": "4321",
"destinations": [
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test",
"favourite": true,
"description": "Testing",
"phone_number": "254900000000"
},
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test2",
"favourite": true,
"description": "Testing",
"phone_number": "254900111111"
}
],
"currency": "KES",
"transfer_batches": [
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900111111",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:22:59.913+03:00",
"destination_reference": "a3bd6298-8a5a-4a93-b880-7948a621fdfb",
"transaction_reference": "QCL160124A7"
}
]
},
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900000000",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:26:49.173+03:00",
"destination_reference": "5f58ce16-0320-4da8-ad38-0f2cf7f520f2",
"transaction_reference": "QDZ273694C8"
}
]
}
],
"errors": null,
"metadata": {
"notes": "Salary payment for September 2025",
"customerId": "8675309"
},
"_links": {
"callback_url": "https://webhook.site/f0b07170-4397-4e81-b552-a6bc0fc20ed9",
"self": "https://api.kopokopo.com/api/v2/send_money/716481bc-635c-4d35-92c9-65bb0797196a"
}
}
}
}
k2connect.initialize(CLIENT_ID, CLIENT_SECRET, BASE_URL)
result_handler = k2connect.ResultHandler
processed_payload = result_handler.process(request)
decomposed_result = payload_decomposer.decompose(processed_payload)
# Processed send money result in json format
{
"data": {
"id": "716481bc-635c-4d35-92c9-65bb0797196a",
"type": "send_money",
"attributes": {
"status": "Processed",
"created_at": "2025-09-23T20:05:46.522+03:00",
"source_identifier": "4321",
"destinations": [
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test",
"favourite": true,
"description": "Testing",
"phone_number": "254900000000"
},
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test2",
"favourite": true,
"description": "Testing",
"phone_number": "254900111111"
}
],
"currency": "KES",
"transfer_batches": [
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900111111",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:22:59.913+03:00",
"destination_reference": "a3bd6298-8a5a-4a93-b880-7948a621fdfb",
"transaction_reference": "QCL160124A7"
}
]
},
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900000000",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:26:49.173+03:00",
"destination_reference": "5f58ce16-0320-4da8-ad38-0f2cf7f520f2",
"transaction_reference": "QDZ273694C8"
}
]
}
],
"errors": null,
"metadata": {
"notes": "Salary payment for September 2025",
"customerId": "8675309"
},
"_links": {
"callback_url": "https://webhook.site/f0b07170-4397-4e81-b552-a6bc0fc20ed9",
"self": "https://api.kopokopo.com/api/v2/send_money/716481bc-635c-4d35-92c9-65bb0797196a"
}
}
}
}
{
"data": {
"id": "716481bc-635c-4d35-92c9-65bb0797196a",
"type": "send_money",
"attributes": {
"status": "Processed",
"created_at": "2025-09-23T20:05:46.522+03:00",
"source_identifier": "4321",
"destinations": [
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test",
"favourite": true,
"description": "Testing",
"phone_number": "254900000000"
},
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test2",
"favourite": true,
"description": "Testing",
"phone_number": "254900111111"
}
],
"currency": "KES",
"transfer_batches": [
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900111111",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:22:59.913+03:00",
"destination_reference": "a3bd6298-8a5a-4a93-b880-7948a621fdfb",
"transaction_reference": "QCL160124A7"
}
]
},
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900000000",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:26:49.173+03:00",
"destination_reference": "5f58ce16-0320-4da8-ad38-0f2cf7f520f2",
"transaction_reference": "QDZ273694C8"
}
]
}
],
"errors": null,
"metadata": {
"notes": "Salary payment for September 2025",
"customerId": "8675309"
},
"_links": {
"callback_url": "https://webhook.site/f0b07170-4397-4e81-b552-a6bc0fc20ed9",
"self": "https://api.kopokopo.com/api/v2/send_money/716481bc-635c-4d35-92c9-65bb0797196a"
}
}
}
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"data" => [
"id" => "716481bc-635c-4d35-92c9-65bb0797196a",
"type" => "send_money",
"attributes" => [
"status" => "Processed",
"created_at" => "2025-09-23T20:05:46.522+03:00",
"source_identifier" => "4321",
"destinations" => [
[
"type" => "mobile_wallet",
"amount" => 1000,
"network" => "Safaricom",
"nickname" => "Test",
"favourite" => true,
"description" => "Testing",
"phone_number" => "254900000000"
],
[
"type" => "mobile_wallet",
"amount" => 1000,
"network" => "Safaricom",
"nickname" => "Test2",
"favourite" => true,
"description" => "Testing",
"phone_number" => "254900111111"
]
],
"currency" => "KES",
"transfer_batches" => [
[
"status" => "Transferred",
"amount" => "1000.0",
"disbursements" => [
[
"amount" => "1000.0",
"errors" => null,
"status" => "Transferred",
"nickname" => "Test",
"favourite" => true,
"phone_number" => "254900111111",
"destination_type" => "mobile_wallet",
"origination_time" => "2025-09-23T20:22:59.913+03:00",
"destination_reference" => "a3bd6298-8a5a-4a93-b880-7948a621fdfb",
"transaction_reference" => "QCL160124A7"
]
]
],
[
"status" => "Transferred",
"amount" => "1000.0",
"disbursements" => [
[
"amount" => "1000.0",
"errors" => null,
"status" => "Transferred",
"nickname" => "Test",
"favourite" => true,
"phone_number" => "254900000000",
"destination_type" => "mobile_wallet",
"origination_time" => "2025-09-23T20:26:49.173+03:00",
"destination_reference" => "5f58ce16-0320-4da8-ad38-0f2cf7f520f2",
"transaction_reference" => "QDZ273694C8"
]
]
]
],
"errors" => null,
"metadata" => [
"notes" => "Salary payment for September 2025",
"customerId" => "8675309"
],
"_links" => [
"callback_url" => "https://webhook.site/f0b07170-4397-4e81-b552-a6bc0fc20ed9",
"self" => "https://api.kopokopo.com/api/v2/send_money/716481bc-635c-4d35-92c9-65bb0797196a"
]
]
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
After a Send Money request is initiated, a Send Money result will be posted asynchronously to the callback URL specified in the Send Money request. This callback is secured by signing the payload of the request (HMAC) and passing the signature in the X-KopoKopo-Signature HTTP header.
Send Money Result Parameters (JSON)
A HTTP response with the following JSON payload is returned.
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | String | The ID of the transfer |
| type | Yes | String | Request type, i.e., send_money |
| attributes | Yes | JSON | A JSON object containing the attributes of the Send Money request |
Attributes JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| status | Yes | String | Current status of the Send Money request |
| created_at | Yes | String | Timestamp when the Send Money request was created |
| currency | Yes | String | Currency of funds to transfer |
| source_identifier | Yes | String | Till number or null if Send Money request was from available balance |
| destinations | Yes | JSON | A JSON object containing destinations details or null for Send Money requests to my accounts |
| transfer_batches | Yes | JSON | A JSON object containing transfer batches information |
| errors | Yes | JSON | A JSON object containing errors for failed Send Money request |
| metadata | Yes | JSON | A JSON object with a maximum of 5 key-value pairs containing additional contextual information about the transfer. The values must be primitive data types |
| _links | Yes | JSON | A JSON object containing the URL pointing to the Send Money request and the callback url |
Transfer Batches JSON (Could be multiple)
| Parameter | Type | Description |
|---|---|---|
| status | String | The status of the transfer batch |
| amount | String | The total amount of the transfer batch |
| disbursements | JSON | These are the disbursements in that particular transfer batch |
Disbursements JSON (Could be multiple)
| Parameter | Type | Description |
|---|---|---|
| status | String | The status of the disbursement |
| amount | String | The amount of the disbursement |
| errors | JSON | A JSON object containing errors for failed disbursement |
| origination_time | String | Timestamp of when the transaction took place |
| destination_type | String | Type of destination, .i.e, merchant_bank_account, merchant_wallet, mobile_wallet, bank_account, till or paybill |
| destination_reference | String | Identifier of the destination account of the funds |
| transaction_reference | String | The reference from the transaction, i.e, mpesa reference. It is null for eft transactions |
Query Send Money request status
GET https://sandbox.kopokopo.com/api/v2/send_money/1b7c1ec2-8c3f-49b8-9b73-3a94fc60c6ab
Accept: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
Content-Type: application/json
User-Agent: < product >/< product-version > < comment >
- Ruby
- Python
- JavaScript
- PHP
- Dart
transfer_url = 'https://sandbox.kopokopo.com/api/v2/settlement_transfers/d76265cd-0951-e511-80da-0aa34a9b2388'
# Using K2 Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
k2_transfer = K2Transfer.new('your_access_token')
k2_transfer.query_resource_url(transfer_url) or k2_transfer.query_resource_url(k2_transfer.location_url)
# Query most recent request
k2_transfer.query_status
transfer_url = 'https://sandbox.kopokopo.com/api/v2/settlement_transfers/d76265cd-0951-e511-80da-0aa34a9b2388'
# Using K2 Connect - https://github.com/kopokopo/k2-connect-python (Recommended)
k2connect.initialize(environ.get('CLIENT_ID'), environ.get('CLIENT_SECRET'), 'sandbox.kopokopo.com')
transfer_service = k2connect.Transfers
transfer_service.transfer_transaction_status(access_token, transfer_url)
var transferUrl = 'https://sandbox.kopokopo.com/api/v2/settlement_transfers/d76265cd-0951-e511-80da-0aa34a9b2388'
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const TransferService = K2.TransferService
TransferService
.getStatus({accessToken: 'myRand0mAcc3ssT0k3n', location: transferUrl})
.then(response => {
console.log(response)
})
.catch(error => {
console.log(error)
})
<?
// Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-php (Recommended)
$transfer = $K2->SettlementTransferService();
$options = [
'location' => 'https://sandbox.kopokopo.com/api/v2/settlement_transfers/d76265cd-0951-e511-80da-0aa34a9b2388',
'accessToken' => 'myRand0mAcc3ssT0k3n',
];
$response = $transfer->getStatus($options);
echo $response;
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
The request above results in the following JSON payload
- JSON
- Ruby
- Python
- JavaScript
- PHP
- Dart
{
"data": {
"id": "716481bc-635c-4d35-92c9-65bb0797196a",
"type": "send_money",
"attributes": {
"status": "Processed",
"created_at": "2025-09-23T20:05:46.522+03:00",
"source_identifier": "4321",
"destinations": [
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test",
"favourite": true,
"description": "Testing",
"phone_number": "254900000000"
},
{
"type": "mobile_wallet",
"amount": 1000,
"network": "Safaricom",
"nickname": "Test",
"favourite": true,
"description": "Testing",
"phone_number": "254900111111"
}
],
"currency": "KES",
"transfer_batches": [
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900111111",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:22:59.913+03:00",
"destination_reference": "a3bd6298-8a5a-4a93-b880-7948a621fdfb",
"transaction_reference": "QCL160124A7"
}
]
},
{
"status": "Transferred",
"amount": "1000.0",
"disbursements": [
{
"amount": "1000.0",
"errors": null,
"status": "Transferred",
"nickname": "Test",
"favourite": true,
"phone_number": "254900000000",
"destination_type": "mobile_wallet",
"origination_time": "2025-09-23T20:26:49.173+03:00",
"destination_reference": "5f58ce16-0320-4da8-ad38-0f2cf7f520f2",
"transaction_reference": "QDZ273694C8"
}
]
}
],
"errors": null,
"metadata": {
"notes": "Salary payment for September 2025",
"customerId": "8675309"
},
"_links": {
"callback_url": "https://webhook.site/f0b07170-4397-4e81-b552-a6bc0fc20ed9",
"self": "https://api.kopokopo.com/api/v2/send_money/716481bc-635c-4d35-92c9-65bb0797196a"
}
}
}
}
{
"data": {
"id": "01aece24-e596-4f5c-9ace-9eb1a0939dda",
"type": "settlement_transfer",
"attributes": {
"status": "Processed",
"created_at": "2021-01-27T10:57:09.838+03:00",
"amount": {
"currency": "KES",
"value": null
},
"transfer_batches": [
{
"status": "Transferred",
"disbursements": [
{
"amount": "19900.0",
"status": "Transferred",
"destination_type": "Mobile Wallet",
"origination_time": "2021-01-06T12:42:36.000+03:00",
"destination_reference": "17067bf7-648e-424c-af0f-8c541a1b4ec3",
"transaction_reference": "LDLJANAPH26"
}
]
},
{
"status": "Transferred",
"disbursements": [
{
"amount": "24452.0",
"status": "Transferred",
"destination_type": "Bank Account",
"origination_time": "2021-01-27T10:57:58.623+03:00",
"destination_reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"transaction_reference": null
},
{
"amount": "25000.0",
"status": "Transferred",
"destination_type": "Bank Account",
"origination_time": "2021-01-27T10:57:58.627+03:00",
"destination_reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"transaction_reference": null
}
]
}
],
"_links": {
"callback_url": "https://webhook.site/3856ff77-93eb-4130-80cd-e62dc0db5c1a",
"self": "https://sandbox.kopokopo.com/api/v2/settlement_transfers/01aece24-e596-4f5c-9ace-9eb1a0939dda"
}
}
}
}
{
"data": {
"id": "01aece24-e596-4f5c-9ace-9eb1a0939dda",
"type": "settlement_transfer",
"attributes": {
"status": "Processed",
"created_at": "2021-01-27T10:57:09.838+03:00",
"amount": {
"currency": "KES",
"value": null
},
"transfer_batches": [
{
"status": "Transferred",
"disbursements": [
{
"amount": "19900.0",
"status": "Transferred",
"destination_type": "Mobile Wallet",
"origination_time": "2021-01-06T12:42:36.000+03:00",
"destination_reference": "17067bf7-648e-424c-af0f-8c541a1b4ec3",
"transaction_reference": "LDLJANAPH26"
}
]
},
{
"status": "Transferred",
"disbursements": [
{
"amount": "24452.0",
"status": "Transferred",
"destination_type": "Bank Account",
"origination_time": "2021-01-27T10:57:58.623+03:00",
"destination_reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"transaction_reference": null
},
{
"amount": "25000.0",
"status": "Transferred",
"destination_type": "Bank Account",
"origination_time": "2021-01-27T10:57:58.627+03:00",
"destination_reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"transaction_reference": null
}
]
}
],
"_links": {
"callback_url": "https://webhook.site/3856ff77-93eb-4130-80cd-e62dc0db5c1a",
"self": "https://sandbox.kopokopo.com/api/v2/settlement_transfers/01aece24-e596-4f5c-9ace-9eb1a0939dda"
}
}
}
}
{
"data": {
"id": "01aece24-e596-4f5c-9ace-9eb1a0939dda",
"type": "settlement_transfer",
"attributes": {
"status": "Processed",
"created_at": "2021-01-27T10:57:09.838+03:00",
"amount": {
"currency": "KES",
"value": null
},
"transfer_batches": [
{
"status": "Transferred",
"disbursements": [
{
"amount": "19900.0",
"status": "Transferred",
"destination_type": "Mobile Wallet",
"origination_time": "2021-01-06T12:42:36.000+03:00",
"destination_reference": "17067bf7-648e-424c-af0f-8c541a1b4ec3",
"transaction_reference": "LDLJANAPH26"
}
]
},
{
"status": "Transferred",
"disbursements": [
{
"amount": "24452.0",
"status": "Transferred",
"destination_type": "Bank Account",
"origination_time": "2021-01-27T10:57:58.623+03:00",
"destination_reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"transaction_reference": null
},
{
"amount": "25000.0",
"status": "Transferred",
"destination_type": "Bank Account",
"origination_time": "2021-01-27T10:57:58.627+03:00",
"destination_reference": "34a273d1-fedc-4610-8ab6-a1ba4828f317",
"transaction_reference": null
}
]
}
],
"_links": {
"callback_url": "https://webhook.site/3856ff77-93eb-4130-80cd-e62dc0db5c1a",
"self": "https://sandbox.kopokopo.com/api/v2/settlement_transfers/01aece24-e596-4f5c-9ace-9eb1a0939dda"
}
}
}
} }
}
}
<?
// The payload from the k2-connect-php SDK will look like this.
[
"status" => "success",
"data" => [
"id" => "f8c02eb2-c35e-42f6-8835-18074f3ca6a7",
"type" => "send_money",
"createdAt" => "2025-10-10T04:45:36.977+03:00",
"status" => "Processed",
"sourceIdentifier" => "4321",
"destinations" => [
[
"type" => "merchant_wallet",
"amount" => 1000,
"reference" => "af033d43-75f7-4123-b5c3-252377d96739"
]
],
"currency" => "KES",
"transferBatches" => [
[
"status" => "Transferred",
"amount" => "1000.0",
"disbursements" => [
[
"amount" => "1000.0",
"errors" => null,
"status" => "Transferred",
"destinationType" => "merchant_wallet",
"originationTime" => "2025-10-10T04:52:08.654+03:00",
"destinationReference" => "af033d43-75f7-4123-b5c3-252377d96739",
"transactionReference" => "OCT52342025"
]
]
]
],
"errors" => null,
"metadata" => null,
"linkSelf" => "https://sandbox.kopokopo.com/api/v2/send_money/f8c02eb2-c35e-42f6-8835-18074f3ca6a7",
"callbackUrl" => "https://your-call-bak.yourapplication.com/send_money_result"
]
]
// This feature is not currently available in the Flutter SDK.
// Please use one of the other SDKs (PHP, Ruby, Python, NodeJs) or the REST API.
Check the status of a prior initiated Send Money request.
HTTP Request
GET https://sandbox.kopokopo.com/api/v2/send_money/1b7c1ec2-8c3f-49b8-9b73-3a94fc60c6ab
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
User-Agent: < product >/< product-version > < comment >
Query Parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| ID | Yes | String | The reference / ID of the Send Money request to retrieve |
HTTP Response
A HTTP response with the following JSON payload is returned.
| Parameter | Required | Type | Description |
|---|---|---|---|
| id | Yes | String | The ID of the transfer |
| type | Yes | String | Request type. send_money |
| attributes | Yes | JSON | A JSON object containing the attributes of the Send Money request |
Attributes JSON
| Parameter | Required | Type | Description |
|---|---|---|---|
| status | Yes | String | Current status of the Send Money request |
| created_at | Yes | String | Timestamp when the Send Money request was created |
| currency | Yes | String | Currency of funds to transfer |
| source_identifier | Yes | String | Till number or null if Send Money request was from available balance |
| destinations | Yes | JSON | A JSON object containing destinations details or null for Send Money requests to my accounts |
| transfer_batches | Yes | JSON | A JSON object containing transfer batches information |
| errors | Yes | JSON | A JSON object containing errors for failed Send Money request |
| metadata | Yes | JSON | A JSON object with a maximum of 5 key-value pairs containing additional contextual information about the transfer. The values must be primitive data types |
| _links | Yes | JSON | A JSON object containing the URL pointing to the Send Money request and the callback url |
Transfer Batches JSON (Could be multiple)
| Parameter | Type | Description |
|---|---|---|
| status | String | The status of the transfer batch |
| amount | String | The total amount of the transfer batch |
| disbursements | JSON | These are the disbursements in that particular transfer batch |
Disbursements JSON (Could be multiple)
| Parameter | Type | Description |
|---|---|---|
| status | String | The status of the disbursement |
| amount | String | The amount of the disbursement |
| errors | JSON | A JSON object containing errors for failed disbursement |
| origination_time | String | Timestamp of when the transaction took place |
| destination_type | String | Type of destination, .i.e, merchant_bank_account, merchant_wallet, mobile_wallet, bank_account, till or paybill |
| destination_reference | String | Identifier of the destination account of the funds |
| transaction_reference | String | The reference from the transaction, i.e, mpesa reference. It is null for eft transactions |