> 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/repay-loan.md).

# Repay Loan

To repay a loan, send a `POST` request to the endpoint:

<mark style="color:yellow;">`POST`</mark> `/api/loanaccount/v1/repayloan`

The request body requires the `loanAccountNumber`, `instrumentNumber`, and `amount`, along with the relevant GL accounts; collectionsGL is always required, and feeIncomeGL becomes required if there's a fee on the GL.

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 make repayments towards an existing loan, and supports optional early termination of the loan as part of the same request.

**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>instrumentNumber</code></td><td>string (50)</td><td>true</td><td>A unique instrument number for this repayment.</td></tr><tr><td><code>amount</code></td><td>number</td><td>true</td><td>The amount to be paid into the linked account for loan deductions.<br><br><em><mark style="color:red;">Amount should be sent in the base unit of the currency. For example, 500 naira should be sent as 50,000</mark></em> <em><mark style="color:red;">kobo.</mark></em></td></tr><tr><td><code>collectionsGL</code></td><td>string (10)</td><td>true</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></td></tr><tr><td><code>feeIncomeGL</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 an Income GL. For Production, the GL should be requested from the Bank. This property only becomes required if there is a fee on the GL.</mark></em></td></tr><tr><td><code>earlyTermination</code></td><td>boolean</td><td>false</td><td>Set to true if the loan should be terminated as part of this repayment.<br><br><em><mark style="color:red;">False by default. For this to succeed, the Amount must be able to pay off all outstanding debts, upcoming principal, and fees.</mark></em></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/repayloan' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data '{
  "loanAccountNumber": "1000003305000074660",
  "instrumentNumber": "",
  "amount": 80000,
  "collectionsGL": "10204005",
  "feeIncomeGL": "40101022",
  "earlyTermination": false
}'
```

</details>

<details>

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

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

</details>
