# Search Loan Account

To retrieve details of a loan account, send a GET request to the following endpoint:

<mark style="color:blue;">`GET`</mark> `/api/LoanAccount/v1/Search`\
\
The response will contain relevant information associated with the loan account that matches the search criteria, allowing users to access and review details. This API endpoint facilitates the retrieval of loan account data, enabling users to access the necessary information for their specific requirements.<br>

**Headers**

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

**Query Parameter**

<table><thead><tr><th width="196">Name</th><th width="177">Data Type (length)</th><th>Description</th><th data-hidden>Required</th></tr></thead><tbody><tr><td><code>accountNumber</code></td><td>string</td><td>The unique number identifying the account</td><td></td></tr><tr><td><code>customerID</code></td><td>string</td><td>The unique identifier of the customer associated with the loan account</td><td></td></tr><tr><td><code>accountName</code></td><td>string</td><td>The name associated with the account</td><td></td></tr><tr><td><code>productCode</code></td><td>string</td><td>The code of the product associated with the account</td><td></td></tr><tr><td><code>accountOfficerCode</code></td><td>string</td><td>The code of the account officer managing the account</td><td></td></tr><tr><td><code>accountStatus</code></td><td>string</td><td>The current status of the account (e.g., Active, Inactive)</td><td></td></tr><tr><td><code>hasDisbursed</code></td><td>boolean</td><td>Indicates whether funds have been disbursed from the account using <code>true</code> or <code>false</code></td><td></td></tr><tr><td><code>startDate</code></td><td>date</td><td>The start date of the account activity</td><td></td></tr><tr><td><code>endDate</code></td><td>date</td><td>The end date of the account activity</td><td></td></tr><tr><td><code>pageNumber</code></td><td>integer</td><td>The current page number for pagination</td><td></td></tr><tr><td><code>pageSize</code></td><td>integer</td><td>The number of records per page</td><td></td></tr><tr><td><code>sortColumn</code></td><td>string</td><td>The column by which the results are sorted</td><td></td></tr><tr><td><code>direction</code></td><td>string</td><td>The direction of the sort (e.g., ascending or  descending)</td><td></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/Search?AccountNumber=1000002992&CustomerID=001&AccountName=Test&ProductCode=001&AccountOfficerCode=002&AccountStatus=Active&HasDisbursed=Yes&StartDate=2022-01-01&EndDate=2022-03-09&PageNumber=1&PageSize=10&SortColumn=DateCreated&Direction=asc' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data ''
```

</details>

<details>

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

```json
{
  "status": true,
  "message": "string",
  "data": {
    "data": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "accountNumber": "string",
        "name": "string",
        "accountStatus": "string",
        "customerID": "string",
        "linkedNumber": "string",
        "accountOfficerCode": "string",
        "productCode": "string",
        "lendingModel": "string",
        "economicSector": "string",
        "guarantorID1": "string",
        "guarantor1": {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "customerID": "string",
          "name": "string",
          "phoneNumber": "string"
        },
        "guarantorID2": "string",
        "guarantor2": {
          "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
          "customerID": "string",
          "name": "string",
          "phoneNumber": "string"
        },
        "penaltyGracePeriod": 0,
        "loanAmount": 0,
        "dateCreated": "2023-01-29T15:05:30.196Z",
        "dateLastModified": "2023-01-29T15:05:30.196Z",
        "approvedDate": "2023-01-29T15:05:30.196Z",
        "interestCommencementDate": "2023-01-29T15:05:30.196Z",
        "tenure": 0,
        "startDate": "2023-01-29T15:05:30.196Z",
        "maturityDate": "2023-01-29T15:05:30.196Z",
        "installmentAmount": 0,
        "hasCollateralPledge": true,
        "collateralType": "string",
        "collateralValuation": 0,
        "collateralDescription": "string",
        "principalRepaymentType": "string",
        "principalFrequency": "string",
        "principalToBeRepaidEvery": 0,
        "principalInstallment": 0,
        "applicableInterestCode": "string",
        "interestName": "string",
        "useProductInterestRate": true,
        "applicableInterestRate": 0,
        "defaultingInterestRate": 0,
        "interestRepaymentType": "string",
        "interestFrequency": "string",
        "interestToBeRepaidEvery": 0,
        "interestInstallment": 0,
        "interestAccrualMode": "string",
        "interestFreePrincipalAmount": 0,
        "securityDeposit": 0,
        "applyLoanFees": true,
        "productName": "string",
        "accountOfficerName": "string",
        "branchName": "string",
        "ledgerBalance": 0,
        "unpaidPrincipal": 0,
        "outstandingLoanPrincipal": 0,
        "outstandingLoanInterest": 0,
        "outstandingLoanFee": 0,
        "hasDisbursed": true,
        "hasOutstandingLoan": true,
        "dateCreatedFinancial": "2023-01-29T15:05:30.196Z",
        "firstInstallmentDate": "2023-01-29T15:05:30.196Z",
        "closureDate": "2023-01-29T15:05:30.196Z",
        "enableRepaymentTracker": true,
        "repaymentTrackerInDays": 0,
        "loanFees": [
          {
            "loanFeeCode": "string"
          }
        ],
        "paymentSchedules": [
          {
            "loanAccountNumber": "string",
            "linkedNumber": "string",
            "principal": 0,
            "interest": 0,
            "fee": 0,
            "totalRepayment": 0,
            "paymentDate": "string",
            "paymentDate_Date": "2023-01-29T15:05:30.196Z",
            "hasProcessed": true,
            "paymentStatus": "string"
          }
        ]
      }
    ],
    "recordCount": 0
  }
}
```

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.udara360.io/udara360-docs-1/overdrafts-and-loans/loan-api/search-loan-account.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
