# Adhoc query search

`POST /lokta-lms/api/v1/search/advance`

AdHocQuery search has more search options, it is a POST request, it uses request body to send search parameters


Mandatory fields: entities

Optional fields: loanStatus, loanProducts, offices, loanDateOption, loanFromDate, loanToDate,
includeOutStandingAmountPercentage, outStandingAmountPercentageCondition,
minOutStandingAmountPercentage and maxOutStandingAmountPercentage OR outStandingAmountPercentage,
includeOutstandingAmount, outstandingAmountCondition,
minOutstandingAmount and maxOutstandingAmount OR outstandingAmount

## Request body (application/json)
- `dateFormat` (string)
- `includeOutStandingAmountPercentage` (boolean)
- `includeOutstandingAmount` (boolean)
- `loanDateOption` (string)
- `loanFromDate` (string)
- `loanToDate` (string)
- `locale` (string)
- `maxOutstandingAmount` (integer)
- `minOutstandingAmount` (integer)
- `outStandingAmountPercentage` (integer)
- `outStandingAmountPercentageCondition` (string)
- `outstandingAmountCondition` (string)

## Responses
- `default`: default response

## Response fields
- `count` (integer)
- `loanOutStanding` (number)
- `loanProductName` (string)
- `loanProducts` (array of LoanProductData)
- `officeName` (string)
- `offices` (array of OfficeData)
- `percentage` (number)

## Example request (cURL)
```bash
curl -X POST \
  'https://default.lokta.tech/lokta-lms/api/v1/search/advance' \
  -u '{username}:{password}' \
  -H 'Tenant-Identifier: default' \
  -H 'Content-Type: application/json' \
  -d '{
  "dateFormat": "dd MMMM yyyy",
  "includeOutStandingAmountPercentage": true,
  "includeOutstandingAmount": true,
  "loanDateOption": "approvalDate",
  "loanFromDate": "2013-01-01",
  "loanToDate": "2014-01-27",
  "locale": "en",
  "maxOutstandingAmount": 10000,
  "minOutstandingAmount": 100,
  "outStandingAmountPercentage": 80
}'
```

## Example response
```json
[
  {
    "count": 1,
    "loanOutStanding": 0,
    "loanProductName": "string",
    "loanProducts": []
  }
]
```

Interactive: https://developer.lokta.ai/reference#operation/advancedSearch
