# Create Loan Account

Send a POST request to the endpoint mentioned above to create a new loan account. The request should include the required payloads in the request body, such as `customerID`, `linkedNumber`, `lendingModel`, and other necessary information.

<mark style="color:green;">`POST`</mark> `/api/loanaccount/v1/add`\
\
A successful request will return the loan `accountNumber`, `id` and a success message in the response, allowing for reference to the newly created loan account.\
\
This process allows for creating customer loan accounts and simplifies the management of loan-related information.

**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="201">Name</th><th width="173">Data Type (length)</th><th width="101" data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td><code>customerID</code></td><td>string <a data-footnote-ref href="#user-content-fn-1"><em>(8)</em></a></td><td>true</td><td>The unique identifier of the customer applying for the loan<br><br><em><mark style="color:orange;">The</mark><mark style="color:orange;"> </mark><mark style="color:orange;"><code>CustomerID</code></mark><mark style="color:orange;"> </mark><mark style="color:orange;">must be the same as the</mark><mark style="color:orange;"> </mark><mark style="color:orange;"><code>CustomerID</code></mark><mark style="color:orange;"> </mark><mark style="color:orange;">linked to the beneficiary</mark></em></td></tr><tr><td><code>linkedNumber</code></td><td>string <a data-footnote-ref href="#user-content-fn-1"><em>(10)</em></a></td><td>true</td><td>The number linked to the loan account (NUBAN) for disbursement</td></tr><tr><td><code>productCode</code></td><td>string <a data-footnote-ref href="#user-content-fn-1"><em>(3)</em></a></td><td>true</td><td>The code of the loan product being applied for<br><br><em><mark style="color:orange;">The loan products should be created on the Udara360 portal and they must be</mark><mark style="color:orange;"> </mark><mark style="color:orange;"><strong>active</strong></mark><mark style="color:orange;">.</mark></em></td></tr><tr><td><code>lendingModel</code></td><td>integer</td><td>true</td><td>The model used for lending <br><br>The enumerations are: <br><br><code>1</code> = CreditUnion<br><code>2</code> = Individual<br><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>integer</td><td>true</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>loanAmount</code></td><td>integer</td><td>true</td><td>The amount of the loan being applied for<br><br><em><mark style="color:orange;">The amount should be supplied in the base currency amount. For example,</mark><mark style="color:orange;"> </mark><mark style="color:orange;"><code>1000.55</code></mark><mark style="color:orange;"> </mark><mark style="color:orange;">should be sent as</mark><mark style="color:orange;"> </mark><mark style="color:orange;"><code>100055</code></mark><mark style="color:orange;">.</mark></em></td></tr><tr><td><code>startDate</code></td><td>dateTime</td><td>true</td><td>The start date of the loan</td></tr><tr><td><code>tenure</code></td><td>integer</td><td>true</td><td>The tenure of the loan in months</td></tr><tr><td><code>guarantorID1</code></td><td>string</td><td>true</td><td>The ID of the first guarantor</td></tr><tr><td><code>guarantorID2</code></td><td>string</td><td>true</td><td>The ID of the second guarantor</td></tr><tr><td><code>penaltyGracePeriod</code></td><td>integer</td><td>false</td><td>The grace period before a penalty is applied in days</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>integer</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 valuation 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 provided</td></tr><tr><td><code>principalRepaymentType</code></td><td>integer</td><td>true</td><td>The type of principal repayment<br><br>The enumerations are:<br><code>1</code>  = EndOfContract<br><code>2</code> = Prorated <br><code>3</code> = Upfront</td></tr><tr><td><code>principalFrequency</code></td><td>integer</td><td>false</td><td><p>The frequency of principal repayment<br><br><code>1</code> = Daily <br><code>2</code> = Weekly<br><code>3</code> = Fortnight<br><code>4</code> = Monthly</p><p><code>5</code> = Quarterly</p><p><code>6</code> = HalfYearly</p><p><code>7</code> = Annually</p><p><code>8</code> = EndOfContract</p><p><code>9</code> = Upfront</p></td></tr><tr><td><code>principalToBeRepaidEvery</code></td><td>integer</td><td>false</td><td>How frequently the principal should be repaid if it's not at the <code>EndOfContract</code> or <code>Upfront</code> </td></tr><tr><td><code>principalInstallment</code></td><td>integer</td><td>false</td><td>The amount of each principal instalment, this parameter can also be used to compute the tenure</td></tr><tr><td><code>useProductInterestRate</code></td><td>boolean</td><td>false</td><td>Indicates whether the product's interest rate should be used, set true for <code>yes</code> and false for <code>no</code></td></tr><tr><td><code>defaultingInterestRate</code></td><td>integer</td><td>false</td><td>The interest rate that is applied when the loan defaults</td></tr><tr><td><code>interestRepaymentType</code></td><td>integer</td><td>false</td><td>The type of interest repayment<br><br>The enumerations are:<br><code>1</code>  = EndOfContract<br><code>2</code> = Prorated <br><code>3</code> = Upfront</td></tr><tr><td><code>interestFrequency</code></td><td>integer</td><td>false</td><td><p>The frequency of interest repayment<br><br>The enumerations are:<br><code>1</code> = Daily</p><p><code>2</code> = Weekly</p><p><code>3</code> = Fortnight</p><p><code>4</code> = Monthly</p><p><code>5</code> = Quarterly</p><p><code>6</code> = HalfYearly</p><p><code>7</code> = Annually</p><p><code>8</code> = EndOfContract</p><p><code>9</code> = Upfront</p></td></tr><tr><td><code>interestToBeRepaidEvery</code></td><td>integer</td><td>false</td><td>How often the interest is to be repaid</td></tr><tr><td><code>interestInstallment</code></td><td>integer</td><td>false</td><td>The total number of instalments</td></tr><tr><td><code>interestAccrualMode</code></td><td>integer</td><td>false</td><td><p>The mode by which interest accrues<br><br>The enumerations are:<br><code>1</code> = Fixed </p><p><code>2</code> = ReducingBalance </p><p><code>3</code> = ReducingBalanceButEqual</p></td></tr><tr><td><code>interestFreePrincipalAmount</code></td><td>integer</td><td>false</td><td>The amount of the principal that is interest-free</td></tr><tr><td><code>securityDeposit</code></td><td>integer</td><td>false</td><td>The amount of the security deposit taken<br><br><em><mark style="color:orange;">The system will place a lien on the account and automatically release it when the loan expires or is closed.</mark></em></td></tr><tr><td><code>holdFundSecurityDeposit</code></td><td>boolean</td><td>false</td><td>Indicates whether the fund security deposit is held, set true for <code>yes</code> and false for <code>no</code></td></tr><tr><td><code>applyLoanFees</code></td><td>boolean</td><td>false</td><td>Indicates whether loan fees should be applied, set true for <code>yes</code> and false for <code>no</code></td></tr><tr><td><code>loanFees</code></td><td>array</td><td>false</td><td>An array of objects representing the fees associated with the loan</td></tr><tr><td><code>loanFees.loanFeeCode</code></td><td>string</td><td>false</td><td>The loan fee code</td></tr><tr><td><code>loanFees.name</code></td><td>string</td><td>false</td><td>The loan code name</td></tr><tr><td><code>allowMoratorium</code></td><td>integer</td><td>false</td><td><p>Indicates whether a moratorium is allowed <br><br>The enumrations are <em>(nullable)</em>:<br><code>1</code> = False</p><p><code>2</code> = PrincipalOnly</p><p><code>3</code> = InterestOnly</p><p><code>4</code> = PrincipalAndInterest</p></td></tr><tr><td><code>moratoriumDuration</code></td><td>integer</td><td>false</td><td>The duration of the moratorium<br><br><code>1</code> = IncreaseTotalLoanDuration<br><code>2</code> = DonNotIncreaseTotalLoanDuration</td></tr><tr><td><code>moratoriumFrequency</code></td><td>integer</td><td>false</td><td><p>The frequency of the moratorium<br><br>The enumerations are: <br><code>1</code> = Daily</p><p><code>2</code> = Weekly</p><p><code>3</code> = Monthly</p><p><code>4</code> = Annually</p></td></tr><tr><td><code>moratoriumEffect</code></td><td>integer</td><td>false</td><td><p>The effect of the moratorium<br></p><p>The enumerations are:<br><code>1</code> = IncreaseTotalLoanDuration</p><p><code>2</code> = DonNotIncreaseTotalLoanDuration</p></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 '{{baseurl}}/api/loanaccount/v1/add' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data '{
  "customerID": "string",
  "linkedNumber": "string",
  "productCode": "305",
  "lendingModel": 1,
  "economicSector": 42400,
  "guarantorID1": "",
  "guarantorID2": "",
  "penaltyGracePeriod": 0,
  "loanAmount": 100000,
  "hasCollateralPledge": true,
  "collateralType": 2,
  "collateralValuation": 100000,
  "collateralDescription": "Toyota Camry 2008",
  "startDate": "2021-06-28",
  "tenure": 60,
  "principalRepaymentType": 2,
  "principalFrequency": 4,
  "principalToBeRepaidEvery": 1,
  "principalInstallment": 2,
  "useProductInterestRate": true,
  "defaultingInterestRate": 0,
  "interestRepaymentType": 2,
  "interestFrequency": 4,
  "interestToBeRepaidEvery": 1,
  "interestInstallment": 2,
  "interestAccrualMode": 1,
  "interestFreePrincipalAmount": 0,
  "securityDeposit": 0,
  "holdFundSecurityDeposit": false,
  "applyLoanFees": false,
  "loanFees": [
    {
      "loanFeeCode": "",
      "name": ""
    }
  ],
  "allowMoratorium": null,
  "moratoriumDuration": 0,
  "moratoriumFrequency": null,
  "moratoriumEffect": null,
  "enableRepaymentTracker": false,
  "repaymentTrackerInDays": 0
}'
```

</details>

<details>

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

```json
{
  "status": true,
  "message": "string",
  "data": {
    "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "accountNumber": "1000003305000021282"
  }
}
```

</details>

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