# ZMW Payout (new encryption)

### Summary

These APIs are used to initiate a ZMW 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="https://257545343-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FNw4nU37LIEg41plxXG5u%2Fuploads%2FvBXI8QATrncq17zlRm1P%2Fdashboad-klasha-settings.png?alt=media&#x26;token=1ebaf2b3-7e99-4490-9ede-a660c8d0035c" alt="" data-size="original">
{% endhint %}

### Integration steps

{% content-ref url="../../overview/authentication" %}
[authentication](https://developers.klasha.com/overview/authentication)
{% endcontent-ref %}

### [Encryption algorithm here](https://developers.klasha.com/accepting-payments/payments-api#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/ZMW`

#### Headers

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

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

```json
{
    "message": "success",
    "error": null,
    "data": [
        {
            "code": "002",
            "name": "Absa Bank"
        },
        {
            "code": "003",
            "name": "Access Bank"
        },
        {
            "code": "005",
            "name": "Atlas Mara"
        },
        {
            "code": "006",
            "name": "Bank of China"
        },
        {
            "code": "007",
            "name": "Citibank"
        },
        {
            "code": "008",
            "name": "Ecobank"
        },
        {
            "code": "010",
            "name": "Indo Zambia Bank"
        },
        {
            "code": "011",
            "name": "Investrust Bank"
        },
        {
            "code": "012",
            "name": "First Alliance Bank"
        },
        {
            "code": "013",
            "name": "First Capital"
        },
        {
            "code": "014",
            "name": "FNB"
        },
        {
            "code": "016",
            "name": "Stanbic Bank"
        },
        {
            "code": "017",
            "name": "Standard Chartered Bank"
        },
        {
            "code": "022",
            "name": "United Bank for Africa"
        },
        {
            "code": "023",
            "name": "Zanaco"
        },
        {
            "code": "025",
            "name": "ZICB"
        }
    ]
}
```

{% 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 (json)

<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>ZM</td></tr><tr><td>bankCode<mark style="color:red;">*</mark></td><td></td><td>007</td></tr><tr><td>amount<mark style="color:red;">*</mark></td><td></td><td>10</td></tr><tr><td>accountName<mark style="color:red;">*</mark></td><td></td><td>John Doe</td></tr><tr><td>requestId<mark style="color:red;">*</mark></td><td>String</td><td>kbtr-3857-011-133-166993253</td></tr><tr><td>description<mark style="color:red;">*</mark></td><td>String</td><td>Hair design</td></tr><tr><td>currency<mark style="color:red;">*</mark></td><td>String</td><td>ZMW</td></tr><tr><td>bankName<mark style="color:red;">*</mark></td><td>String</td><td>Citibank</td></tr><tr><td>accountNumber<mark style="color:red;">*</mark></td><td>String</td><td>0719593074</td></tr></tbody></table>

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

```json
{
    "message": "success",
    "error": null,
    "data": {
        "id": 589,
        "amount": 10.00,
        "payoutStatus": "PENDING",
        "requestId": "kbtr-3857-011-133-166993253",
        "narration": "Hair dressing",
        "country": "ZM",
        "fee": 26.00,
        "bankCode": "007",
        "bankName": "Citibank",
        "accountNumber": "0719593074",
        "accountName": "John Doe"
    }
}
```

{% 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](https://developers.klasha.com/transfers/payout/..#polling-transfer-statuses) to fetch status of initiated payouts.
