# Single ZAR Payout

## Disburse into South Africa in ZAR

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 ZAR - 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                           |

{% 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": "ZAR",
	"bankcode": "FNB",
	"accountNumber": "0600000004",
	"senderName": "ABCompany",
	"lock": "walpassword",
	"narration": "Purchases",
	"x_recipient_name": "OLUWAFEMI DAYO",
	"x_recipient_address": "99, ABC DRIVE",
});

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": "ZAR",
  "bankcode": "FNB",
  "accountNumber": "0600000004",
  "senderName": "ABCompany",
  "lock": "walpassword",
  "narration": "Purchases",
  "x_recipient_name": "OLUWAFEMI DAYO",
  "x_recipient_address": "99, ABC DRIVE",
  "x_transfer_type" => "ACCOUNT",
);

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"
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://moneywave.gitbook.io/doc/send-money-to-people/examples/single-zar-payout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
