> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/loan-account/early-or-advance-repayment.md).

# Early or Advance Repayment

To make an early or advance repayment on a loan, send a `POST` request to the endpoint:

`POST` `/api/loanaccount/v1/EarlyRepaymentLoan`

The request body requires the `loanAccountNumber`, `paymentOption`, and `instrumentNumber`, along with paymentSchedulesToProcess (only when doing a part repayment) and the relevant GL account.

A successful request will return a status and message confirming the repayment, along with a data object containing the transaction's `statusCode`, `referenceNumber`, `instrumentNumber`, and duration.

This process allows customers to repay a loan ahead of schedule, either in full, closing the loan automatically, or by paying off specific upcoming payment schedules in part.

**Headers**

| Name                                                | Value                |
| --------------------------------------------------- | -------------------- |
| Content-Type<mark style="color:red;">\*</mark>      | `application/json`   |
| Authorization<mark style="color:red;">\*</mark>     | `Bearer`             |
| Request-Reference<mark style="color:red;">\*</mark> | `{unique_reference}` |

**Body**

<table><thead><tr><th>Name</th><th>Data Type (Length)</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>loanAccountNumber</code></td><td>string (50)</td><td>true</td><td>The loan account number.</td></tr><tr><td><code>paymentOption</code></td><td></td><td>true</td><td>The type of early repayment to be made.<br><br><em><mark style="color:red;">FullRepayment means the loan is terminating, the system will automatically close the loan. PartRepayment pays off specific upcoming payment schedules in advance.</mark></em></td></tr><tr><td><code>paymentSchedulesToProcess</code></td><td>array</td><td>true</td><td>The IDs of the schedules the customer is paying for in advance.<br><br><em><mark style="color:red;">The customer cannot pay a payment schedule in part, if the upcoming Principal is 10,000, then 10,000 is expected in the customer's balance for the repayment</mark>.</em></td></tr><tr><td><code>instrumentNumber</code></td><td>string (50)</td><td>false</td><td>A unique instrument number for this repayment.</td></tr><tr><td><code>actualInterestToBePaid</code></td><td>number</td><td>false</td><td>The amount of interest to be charged, if any.<br><br><em><mark style="color:red;">If Interest is to be charged, pass the value here, otherwise pass 0. Amount should be sent in the base unit of the currency; for example, 500 naira should be sent as 50,000 kobo.</mark></em></td></tr><tr><td><code>actualFeesToBePaid</code></td><td>number</td><td>false</td><td>The amount of fees to be charged, if any.<br><br><em><mark style="color:red;">If a Fee is to be charged, pass the value here, otherwise pass 0. Amount should be sent in the base unit of the currency; for example, 500 naira should be sent as 50,000 kobo.</mark></em></td></tr><tr><td><code>incomeGL</code></td><td>string (10)</td><td>false</td><td>A General Ledger Account created on the CBA portal.<br><br><em><mark style="color:red;">This GL will typically be a Bank GL. For Production, the GL should be requested from the Bank.</mark></em><br><br>Required if actualFeesToBePaid > 0</td></tr></tbody></table>

Here is an example request and response with a sample payload sent to the endpoint in Curl format.

<details>

<summary>Sample Request</summary>

```json
curl --location -g '{{baseurl}}/api/loanaccount/v1/EarlyRepaymentLoan' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data '{
  "loanAccountNumber": "1000003305000074660",
  "paymentOption": 1,
  "paymentSchedulesToProcess": [
    "3fa85f64-5717-4562-b3fc-2c963f66afa6"
  ],
  "instrumentNumber": "",
  "actualInterestToBePaid": 0,
  "actualFeesToBePaid": 0,
  "incomeGL": "40101022"
}'
```

</details>

<details>

<summary>Response: <code>200</code></summary>

```json
{
  "status": true,
  "message": "string",
  "data": {
    "statusCode": "string",
    "referenceNumber": "string",
    "instrumentNumber": "string",
    "duration": "string"
  }
}
```

</details>
