# Loan Application

## Loan Application

<mark style="color:green;">`POST`</mark> `{{BASE_URL}}/mfi/v1/borrowers/loans`

This endpoint allows you to apply for a loan on behalf of your user.&#x20;

#### Headers

| Name           | Type   | Description                                                    |
| -------------- | ------ | -------------------------------------------------------------- |
| Authentication | string | Authentication token to track down who is emptying our stocks. |

#### Request Body

| Name                           | Type   | Description                             |
| ------------------------------ | ------ | --------------------------------------- |
| pezesha\_id                    | string | Pezesha ID returned during registration |
| channel                        | string | Client Name given by Pezesha            |
| amount                         | string | Loan Amount entered by user             |
| duration                       | string | Loan duration from Offers endpoint      |
| interest                       | string | Loan Interest Amount                    |
| rate                           | string | Loan Interest Rate                      |
| fee                            | string | Service Fee from Offers endpoint        |
| payment\_details.type          | string |                                         |
| payment\_details.number        | string |                                         |
| payment\_details.callback\_url | string |                                         |

{% tabs %}
{% tab title="200 Loan application successful." %}

```javascript
{
   "status":200,
   "response_code":0,
   "error":false,
   "message":"Loan approved",
   "data":{
      "loan_id":94202
   }
}
```

{% endtab %}

{% tab title="400 Could not make loan application." %}

```javascript
{
   "status":200,
   "response_code":0,
   "error":false,
   "message":"Your last loan was paid late. You don't qualify for a loan"
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
For Partners managing a **Pezesha wallet**, make sure to persist the **Loan ID** as it is needed during Loan Repayment.
{% endhint %}

{% tabs %}
{% tab title="Request Payload" %}

```javascript
{
 "pezesha_id": 239831,
 "amount": 500,
 "duration": 30,
 "interest": 50,
 "rate": 10,
 "fee": 10,
 "channel": "Partner Name",
 "payment_details": {
   "type": "BUY_GOODS/PAYBILL",
   "number": "898927",
   "callback_url": "https://example.com/callback"
 }
}
```

{% endtab %}
{% endtabs %}
