# ZAR Payout (new encryption)

### Summary

These APIs are used to initiate a ZAR payout

{% hint style="info" %}
Before you begin!

* Find your keys on the Klasha Dashboard → Settings → Generate API Keys ([here](https://dashboard.klasha.com/settings/keys))

<img src="/files/LFFicElNA6dWGpxBEdo1" alt="" data-size="original">
{% endhint %}

## Integration steps

{% content-ref url="/pages/p15ikIRu4qZuG2xRX2op" %}
[Authentication](/overview/authentication.md)
{% endcontent-ref %}

#### [Encryption algorithm here](/accepting-payments/payments-api.md#encryption-algorithm)

### **Get Bank Lists**

## Make a GET call to the Bank List API&#x20;

<mark style="color:blue;">`GET`</mark> `{{env_url}}/wallet/merchant/bank/transfer/request/banks/ZAR`

#### Headers

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

```json
{
    "message": "success",
    "error": null,
    "data": [
        {
            "id": 420.0,
            "code": "FNB",
            "name": "First National Bank"
        },
        {
            "id": 421.0,
            "code": "NedBank",
            "name": "Nedbank Limited"
        },
        {
            "id": 1798.0,
            "code": "ABSA",
            "name": "ABSA"
        }
    ]
}
```

{% endtab %}
{% endtabs %}

### **Resolve Bank Account** `(Not Available)`

## Make a POST call to the resolve account API&#x20;

<mark style="color:green;">`POST`</mark> `{{env_url}}/wallet/merchant/bank/transfer/request/resolve/account`

#### Headers

| Key           | Value                |
| ------------- | -------------------- |
| Context-Type  | application/json     |
| Authorization | Bearer \<token here> |
|               |                      |

#### Request Body

| Name                                             | Type   | Description                                                                                                            |
| ------------------------------------------------ | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| bankCode<mark style="color:red;">\*</mark>       |        | 430000                                                                                                                 |
| countryCode<mark style="color:red;">\*</mark>    |        | ZA                                                                                                                     |
| accountNumber<mark style="color:red;">\*</mark>  |        | 0690000032                                                                                                             |
| accountType<mark style="color:red;">\*</mark>    |        | personal                                                                                                               |
| documentType<mark style="color:red;">\*</mark>   | String | Customer’s mode of identity. This could be one of: \[`identityNumber`, `passportNumber`, `businessRegistrationNumber`] |
| businessId<mark style="color:red;">\*</mark>     | String | 133                                                                                                                    |
| documentNumber<mark style="color:red;">\*</mark> | String | 8801235111088                                                                                                          |

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

```json
{
    "status": true,
    "message": "Personal Account Verification attempted",
    "data": {
        "verified": true,
        "verificationMessage": "Account is verified successfully"
    }
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
This error occurs when the account number cannot be verified
{"error":"Bad request"}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
This error occurs when the right "countryCode" is not passed in
{
    "message": "Operation not allowed.",
    "error": "Operation not allowed",
    "data": null
}
```

{% endtab %}
{% endtabs %}

### **Merchant Payout request**

## Make a POST call to the Merchant payout request API

<mark style="color:green;">`POST`</mark> `{{env_url}}/wallet/merchant/{businessId}/bank/transfer/v2/request`

You would need to pass, as a header the <mark style="color:red;">x-auth-token</mark>. This can be obtained from your merchant **dashboard → Settings → Generate API keys → Merchant public key**.

#### Headers

| Key           | Value                    |
| ------------- | ------------------------ |
| Content-Type  | application/json         |
| x-auth-token  | Your merchant public key |
| Authorization | Bearer \<token here>     |

**Request body (encrypted):**

```json
{ 
  "message": "encrypted-request-body"
}
```

**Request body (plain)**

#### Request Body

<table><thead><tr><th width="264">Name</th><th width="160">Type</th><th>Description</th></tr></thead><tbody><tr><td>country<mark style="color:red;">*</mark></td><td></td><td>SA</td></tr><tr><td>bankCode<mark style="color:red;">*</mark></td><td></td><td>430000</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td></td><td>100</td></tr><tr><td>accountName<mark style="color:red;">*</mark></td><td></td><td>Sydney Mark</td></tr><tr><td>requestId<mark style="color:red;">*</mark></td><td>String</td><td>kbtr-3857-011-133-166993253334816</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>String</td><td>Payout</td></tr><tr><td>currency<mark style="color:red;">*</mark></td><td>String</td><td>ZAR</td></tr><tr><td>bankName<mark style="color:red;">*</mark></td><td>String</td><td>Ubank Ltd</td></tr><tr><td>accountNumber<mark style="color:red;">*</mark></td><td>String</td><td>0690000032</td></tr><tr><td>mobileNumber<mark style="color:red;">*</mark></td><td>String</td><td>Recipient mobile number</td></tr><tr><td>recipientAddress<mark style="color:red;">*</mark></td><td>String</td><td>Recipient address</td></tr><tr><td>recipientEmail<mark style="color:red;">*</mark></td><td>String</td><td>Recipient email</td></tr></tbody></table>

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

```json
{
    "id": 3,
    "amount": 1000,
    "payoutStatus": "PENDING",
    "requestId": "kbtr-3857-011-133-166993253334816",
    "narration": "certification",
    "country": "SA",
    "fee": 25,
    "bankCode": "430000",
    "bankName": "Ubank Ltd",
    "accountNumber": "0690000032",
    "accountName": "Pastor Bright"
}
```

{% endtab %}

{% tab title="400: Bad Request " %}

```javascript
{
    "message": "A human readable error message",
    "error": "Bad Request",
    "data": null
}
```

{% endtab %}
{% endtabs %}

### **Query payout status**

Make a [call](/transfers/payout.md#polling-transfer-statuses) to fetch status of initiated payouts.


---

# 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://developers.klasha.com/transfers/payout/zar-payout-new-encryption.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.
