> For the complete documentation index, see [llms.txt](https://docs.pezesha.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pezesha.com/borrower-loan-repayment-schedule.md).

# Loan Repayment Schedule

The repayment schedule can be Daily, Weekly or Monthly depending on the partners agreement with Pezesha. A repayment schedule can have the following statuses

* **Active on Schedule** - the schedule is active and payment is on schedule
* **Paid** - the schedule has already been paid
* **Overdue** - the schedule is overdue i.e payment is late

{% hint style="info" %}
in the loan schedule response, 'month' is used as a placeholder i.e it can represent day, week or month depending on the the partners loan schedule agreement with pezesha
{% endhint %}

## Get Cakes

<mark style="color:blue;">`GET`</mark> `{{BASE_URL}}/mfi/v1/borrowers/repayment-shedules`

Get user loan repayment schedule

#### Query Parameters

| Name                                           | Type   | Description                                             |
| ---------------------------------------------- | ------ | ------------------------------------------------------- |
| channel<mark style="color:red;">\*</mark>      | string | Client Name given by Pezesha                            |
| merchant\_id<mark style="color:red;">\*</mark> | string | Merchant id for whom to see the loan repayment schedule |

#### Headers

| Name                                             | Type   | Description                                                 |
| ------------------------------------------------ | ------ | ----------------------------------------------------------- |
| Authentication<mark style="color:red;">\*</mark> | string | Authentication token generated from Authentication endpoint |

{% tabs %}
{% tab title="200 Cake successfully retrieved." %}

```
{
    "status": 200,
    "response_code": 0,
    "error": false,
    "message": "Loans Repayment Schedule",
    "data": [
        {
            "loan_id": 10101,
            "repayment_date": "2020-07-03",
            "month": 1,
            "principal_amount": 500,
            "interest_amount": 0,
            "penalty_amount": 0,
            "penalty_paid": 0,
            "total_due": 500,
            "total_outstanding": 1000,
            "balance": 500,
            "status": "Active on Schedule"
        },
        {
            "loan_id": 10101,
            "repayment_date": "2020-07-03",
            "month": 2,
            "principal_amount": 500,
            "interest_amount": 0,
            "penalty_amount": 0,
            "penalty_paid": 0,
            "total_due": 500,
            "total_outstanding": 500,
            "balance": 500,
            "status": "Active on Schedule"
        },
        {
            "loan_id": 10101,
            "repayment_date": "2020-07-04",
            "month": 3,
            "principal_amount": 500,
            "interest_amount": 0,
            "penalty_amount": 0,
            "penalty_paid": 0,
            "total_due": 500,
            "total_outstanding": 0,
            "balance": 500,
            "status": "Active on Schedule"
        }
        
    ]
}
```

{% endtab %}

{% tab title="404 Could not find a cake matching this query." %}

```
{
    "status": 404,
    "response_code": 0,
    "error": true,
    "message": "Unable to find active loan tied to merchant"
}
```

{% endtab %}
{% endtabs %}
