Language

Step 3: Send Money to my account

Send Money to a specific transfer account; the transfer account can be a Merchant Bank Account or a Merchant Mobile Wallet.

POST https://sandbox.kopokopo.com/api/v2/send_money
Accept: application/json
Content-Type: application/json
Authorization: Bearer 0Sn0W6kzNicvoWhDbQcVSKLRUpGjIdlPSEYyrHqrDDoRnQwE7Q
{
  "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://dummy_callback_url/send_money_result"
  }
}
transfer_request = {
  destination_reference: '38f7c997-527c-452f-adc4-49ffab98982e',
  destination_type: 'merchant_bank_account',
  currency: 'currency',
  value: 'value',
  metadata: {
    customerId: '8675309',
    notes: 'Payment for September 2025'
  },
  callback_url: 'callback_url',
}

# Using K2Connect - https://github.com/kopokopo/k2-connect-ruby (Recommended)
send_money = K2ConnectRuby::K2Entity::SendMoney.new('your_access_token')
send_money.create_payment(transfer_request)
send_money.payments_location_url # => "https://sandbox.kopokopo.com/api/v2/send_money/d76265cd-0951-e511-80da-0aa34a9b2388"
var destinations = [{
  type: 'merchant_bank_account',
  reference: 'e479b8de-d05d-46f1-89ea-27948293f5df',
  amount: 100,
  description: null
}]

var sendMoneyOpts = {
  sourceIdentifier: '43291',
  currency: 'KES',
  destinations: destinations,
  metadata: {
    customerId: '8675309',
    notes: 'Payment for September 2025'
  },
  callbackUrl: 'https://dummy_callback_url/send_money_result',
  accessToken: 'myRand0mAcc3ssT0k3n'
}

//  Using Kopo Kopo Connect - https://github.com/kopokopo/k2-connect-node (Recommended)
const SendMoneyService = K2.SendMoneyService

SendMoneyService.sendMoney(sendMoneyOpts)
  .then((response) => {
    console.log(response) // => 'https://sandbox.kopokopo.com/api/v2/send_money/d76265cd-0951-e511-80da-0aa34a9b2388
  })
  .catch((error) => {
    console.error(error);
  });
send_money_request = {
  "type": "merchant_bank_account",
  "reference": "e479b8de-d05d-46f1-89ea-27948293f5df",
  "amount": 100,
  "metadata": {
    "customerId": "8675309",
    "notes": "Payment for September 2025"
  }
}

# Using K2 Connect - https://github.com/kopokopo/k2-connect-python (Recommended)
k2connect.initialize(environ.get('CLIENT_ID'), environ.get('CLIENT_SECRET'), 'http://127.0.0.1:3000/')
send_money_service = k2connect.SendMoney(access_token=access_token)
send_money_location_url = send_money_service.create_payment(
  send_money_request)  # => 'https://sandbox.kopokopo.com/api/v2/send_money/d76265cd-0951-e511-80da-0aa34a9b2388'
<?
//  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://dummy_callback_url/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)
// Not Supported
// 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.