# 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 %}


---

# 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://docs.pezesha.com/loan-application.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.
