# Update Loan Account

To update an existing loan account, send a PUT request to the endpoint mentioned below. The request should include the loan `id` in the request body, as well as any other required information.\
\ <mark style="color:orange;">`PUT`</mark> `/api/loanaccount/v1/update`\
\
A successful request will return a success message in the response, indicating that the loan account has been updated.\
\
This process enables modifying existing loan account information, ensuring that loan-related data remains current and relevant.

**Headers**

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

**Body**

<table><thead><tr><th width="223">Name</th><th width="173">Data Type (length)</th><th width="102" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>id</code></td><td>string </td><td>true</td><td>The unique identifier for the loan account (Guid)</td></tr><tr><td><code>linkedNumber</code></td><td>string</td><td>false</td><td>The number linked to the loan account (NUBAN) for disbursement</td></tr><tr><td><code>lendingModel</code></td><td>string</td><td>false</td><td>The model used for lending <br><br>The enumerations are: <br><br><code>1</code> = CreditUnion<br><code>2</code> = Individual<br><code>3</code> = Individuals<br><code>4</code> = NeighbourhoodAndSmallGroupRevolvingFunds<br><code>5</code> = Other<br><code>6</code> = SolidarityGroups<br><code>7</code> = Staff,<br><code>8</code> = VillageBanking<br><code>9</code> = WholesaleLending</td></tr><tr><td><code>economicSector</code></td><td>string</td><td>false</td><td>The code representing the economic sector<br><br>The enumerations are:<br><code>40100</code> = Agriculture, Forestry, and Fishing <br><code>40200</code> = Mining and Quarrying <code>40300</code> = Manufacturing <br><code>40500</code> = Real Estate Activities <code>40700</code> = General Commerce <code>40800</code> = Transportation and Storage <br><code>40900</code> = Finance and Insurance <code>41000</code> = General <br><code>41200</code> = Governments <br><code>41300</code> = Water Supply, Sewage, Waste Management, and Remediation Activities <br><code>41400</code> = Construction <br><code>41500</code> = Information and Communication <br><code>41600</code> = Professional, Scientific, and Technical Activities <br><code>41700</code> = Administrative and Support Service Activities<br><code>41800</code> = Education <br><code>41900</code> = Human Health and Social Work Activities <br><code>42000</code> = Arts, Entertainment, and Recreation <br><code>42100</code> = Activities of Extra-Territorial Organizations and Bodies <code>42200</code> = Power and Energy <code>42300</code> = Capital Market <br><code>42400</code> = Oil and Gas</td></tr><tr><td><code>guarantorID1</code></td><td>string</td><td>false</td><td>The ID of the first guarantor</td></tr><tr><td><code>guarantorID2</code></td><td>string</td><td>false</td><td>The ID of the second guarantor</td></tr><tr><td><code>hasCollateralPledge</code></td><td>boolean</td><td>false</td><td>Indicates if there is a collateral pledge, set <code>true</code> for yes an <code>false</code> for no</td></tr><tr><td><code>collateralType</code></td><td>string</td><td>false</td><td>The type of collateral provided<br><br>The enumerations are:<br><br><code>1</code> = RealEstateLandAndBuilding <br><code>2</code> = Automobile<br><code>3</code> = PlantAndEquipment<br><code>4</code> = NaturalReserves<br><code>5</code> = MarketableSecurities<br><code>6</code> = AccountsReceivablesAndInventory<br><code>7</code> = Cash<br><code>8</code> = PersonalGuarantees<br><code>9</code> = PostDatedCheques<br><code>10</code> = Dormicilliation<br><code>11</code> = HouseholdItems</td></tr><tr><td><code>collateralValuation</code></td><td>integer</td><td>false</td><td>The value of the collateral</td></tr><tr><td><code>collateralDescription</code></td><td>string <a data-footnote-ref href="#user-content-fn-1"><em>(1000)</em></a></td><td>false</td><td>A description of the collateral</td></tr><tr><td><code>enableRepaymentTracker</code></td><td>boolean</td><td>false</td><td>Indicates whether the repayment tracker is enabled set true for <code>yes</code> and false for <code>no</code></td></tr><tr><td><code>repaymentTrackerInDays</code></td><td>integer</td><td>false</td><td>The number of days for the repayment tracker</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 --request PUT '{{baseurl}}/api/loanaccount/v1/update' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data '{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "linkedNumber": "string",
  "lendingModel": "string",
  "economicSector": "string",
  "guarantorID1": "string",
  "guarantorID2": "string",
  "hasCollateralPledge": true,
  "collateralType": "string",
  "collateralValuation": 0,
  "collateralDescription": "string",
  "enableRepaymentTracker": true,
  "repaymentTrackerInDays": 0
}'
```

</details>

<details>

<summary>Respose: <code>200</code></summary>

```json
{
  "status": true,
  "message": "string"
}
```

</details>

[^1]: This is the maximum number of characters allowed.
