> For the complete documentation index, see [llms.txt](https://moneywave.gitbook.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://moneywave.gitbook.io/doc/send-money-to-people/examples/single-kes-payout.md).

# Single KES Payout

## Disburse into Kenya in KES

To send money to a single bank account, you need a single API. This process requires an active balance where the funds are debited then sent.

{% hint style="info" %}
Setup an **Active Balance** for your payouts [here](/doc/funding-for-payout.md)
{% endhint %}

## Disburse KES - Single

<mark style="color:green;">`POST`</mark> `https://staging.moneywaveapp.com/v1/disburse`

Destination and transfer details are passed for processing

#### Headers

| Name          | Type   | Description         |
| ------------- | ------ | ------------------- |
| Authorization | string | Authorization Token |

#### Request Body

| Name                                                           | Type   | Description                                              |
| -------------------------------------------------------------- | ------ | -------------------------------------------------------- |
| lock<mark style="color:red;">\*</mark>                         | String | Password required to access active wallet                |
| senderName<mark style="color:red;">\*</mark>                   | String | Sender/Business Name to appear in the bank statement     |
| accountNumber<mark style="color:red;">\*</mark>                | String | Beneficiary account number.                              |
| bankcode<mark style="color:red;">\*</mark>                     | String | Destination Bank                                         |
| currency<mark style="color:red;">\*</mark>                     | String | Currency of amount to send i.e USD                       |
| amount<mark style="color:red;">\*</mark>                       | String | Amount to send                                           |
| ref<mark style="color:red;">\*</mark>                          | String | Unique transaction tracking reference                    |
| narration<mark style="color:red;">\*</mark>                    | String | Description to appear in bank Statement                  |
| x\_recipient\_name<mark style="color:red;">\*</mark>           | String | Beneficiary Name                                         |
| x\_recipient\_address                                          | String | Beneficiary address                                      |
| walletUref                                                     | String | Specify the source balance                               |
| x\_sender\_id\_type<mark style="color:red;">\*</mark>          | String | Sender ID type                                           |
| x\_sender\_id\_number<mark style="color:red;">\*</mark>        | String | Sender ID type number                                    |
| x\_sender\_nationality<mark style="color:red;">\*</mark>       | String | Sender Nationality                                       |
| x\_sender\_source\_of\_funds<mark style="color:red;">\*</mark> | String | Sender source of funds - Bank account, Card payment, etc |
| x\_sender\_dob<mark style="color:red;">\*</mark>               | String | Sender Date of Birth                                     |
| x\_senderOccupation<mark style="color:red;">\*</mark>          | String | Sender Occupation                                        |

{% tabs %}
{% tab title="200 " %}

```
{
  "status": "success",
  "data": {
    "data": {
      "responsecode": "00",
      "responsemessage": "Approved Or Completed Successfully",
      "uniquereference": "TMW000000318"
    },
    "status": "success"
  } 
}
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Sample Code" %}

```
Select a Language above ...
```

{% endtab %}

{% tab title="NODE.JS" %}

```javascript
var unirest = require("unirest");
var base_url = "https://staging.moneywaveapp.com";
var req = unirest("POST", `${base_url}/v1/disburse`);

req.headers({
  "Authorization": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwibmFtZSI6IlRocml2ZSIsImFjY291bnROdW1iZXIiOiIwNjkwMDAwMDAiLCJiYW5rQ29kZSI6IjMwNyIsImlzQWN0aXZlIjp0cnVlLCJlbnZpcm9ubWVudCI6ImxpdmUiLCJjYW5fZ29saXZlIjp0cnVlLCJjb3VudGRvd24iOm51bGwsImNvbXBsaWFuY2UiOjgsImNvZGUiOiJNTDU4MCIsInBvc0lkIjoiMTE0NjMiLCJlYmlsbElkIjoiTVRGVyIsImlwIjpudWxsLCJjcmVhdGVkQXQiOiIyMDE2LTA5LTE2VDEzOjQ5OjIzLjAwMFoiLCJ1cGRhdGVkQXQiOiIyMDE3LTA3LTE5VDE0OjA2OjM2LjAwMFoiLCJkZWxldGVkQXQiOm51bGwsImlhdCI6MTUzMDIxMTc4MiwiZXhwIjoxNTMwMjE4OTgyfQ.gQDK03I9Jc0dO21RxsZjG0k4Px0NzTk4tRnkbV5VciU",
  "Content-Type": "application/json"
});
req.type("json");
req.send({
  "ref": "SD252849857Z",
  "amount": "50",
  "currency": "KES",
  "bankcode": "09",
  "accountNumber": "0600000004",
  "senderName": "ABCompany",
  "lock": "walpassword",
  "narration": "Purchases",
  "x_recipient_name": "OLUWAFEMI DAYO",
  "x_recipient_address": "99, ABC DRIVE",
  "x_recipient_email": "abc@gmail.com",
  "x_recipient_phone": "+235456789",
  "x_sender_name": "John",
  "x_sender_email": "john@gmail.com",
  "x_sender_phone": "+235456789",
  "x_sender_address": "Accra",
  "x_sender_location": "Ghana",
  "x_sender_country": "GH",
  "x_transfer_type": "ACCOUNT",
  "x_sender_id_type": "passport",
  "x_sender_id_number": "1",
  "x_sender_nationality": "GH",
  "x_sender_source_of_funds": "Bank Account",
  "x_sender_dob": "2023/08/02",
  "x_senderOccupation": "Manager",
});

req.end(function (res) {
  if (res.error) console.log(res.code, res.body);
  else console.log(res.body);
});
```

{% endtab %}

{% tab title="PHP" %}

```php
<?php

$curl = curl_init();
$base_url = "https://staging.moneywaveapp.com";
$header = array(
  "Authorization: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6MSwibmFtZSI6IlRocml2ZSIsImFjY291bnROdW1iZXIiOiIwNjkwMDAwMDAiLCJiYW5rQ29kZSI6IjMwNyIsImlzQWN0aXZlIjp0cnVlLCJlbnZpcm9ubWVudCI6ImxpdmUiLCJjYW5fZ29saXZlIjp0cnVlLCJjb3VudGRvd24iOm51bGwsImNvbXBsaWFuY2UiOjgsImNvZGUiOiJNTDU4MCIsInBvc0lkIjoiMTE0NjMiLCJlYmlsbElkIjoiTVRGVyIsImlwIjpudWxsLCJjcmVhdGVkQXQiOiIyMDE2LTA5LTE2VDEzOjQ5OjIzLjAwMFoiLCJ1cGRhdGVkQXQiOiIyMDE3LTA3LTE5VDE0OjA2OjM2LjAwMFoiLCJkZWxldGVkQXQiOm51bGwsImlhdCI6MTUzMDIxMDY4MywiZXhwIjoxNTMwMjE3ODgzfQ.IO4iX_estdWbe2dHey27bj5xsZC0skXHGdFUMTQSJfI",
  "Content-Type: application/json",
);

$body = array(
  "ref": "SD252849857Z",
  "amount": "50",
  "currency": "KES",
  "bankcode": "09",
  "accountNumber": "0600000004",
  "senderName": "ABCompany",
  "lock": "walpassword",
  "narration": "Purchases",
  "x_recipient_name": "OLUWAFEMI DAYO",
  "x_recipient_address": "99, ABC DRIVE",
  "x_recipient_email": "abc@gmail.com",
  "x_recipient_phone": "+235456789",
  "x_sender_name": "John",
  "x_sender_email": "john@gmail.com",
  "x_sender_phone": "+235456789",
  "x_sender_address": "Accra",
  "x_sender_location": "Ghana",
  "x_sender_country": "GH",
  "x_transfer_type": "ACCOUNT",
  "x_sender_id_type": "passport",
  "x_sender_id_number": "1",
  "x_sender_nationality": "GH",
  "x_sender_source_of_funds": "Bank Account",
  "x_sender_dob": "2023/08/02",
  "x_senderOccupation": "Manager",
);

curl_setopt_array($curl, array(
  CURLOPT_URL => $base_url . "/v1/disburse",
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 180,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_POSTFIELDS => json_encode($body),
  CURLOPT_HTTPHEADER => $header,
));

$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);


if ($err) {
  echo "cURL Error #:" . $err;
} else {
  $decodedResponse = json_decode($response, true);

  echo "<pre>"; print_r($decodedResponse);
}
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
The **ref** passed must be unique to prevent double disbursements to the same beneficiary. Preferably the ref used should match a unique customer action, for example a loan ID, settlement ID or charge / payment reference.
{% endhint %}

{% hint style="info" %}
Increase timeout settings in your **http client** to **180 seconds**. This ensures you receive an expected response for payouts with long processing times.
{% endhint %}

## Confirming Success

After a disburse request is received via API, it is submitted for processing. When completed a response is returned. See the example response in the API snippet above.

A disbursement is **successful** only when the disburse API response has the value below.

```
"responsecode" : "00"
```
