Searching for Records
A basic search query for loans from a particular product type, sort by approval date
POST /loans:search
{
"filterCriteria": [
{
"field": "loanName",
"operator": "EQUALS_CASE_SENSITIVE",
"value": "Agriculture Loan"
}
],
"sortingCriteria": {
"field": "approvedDate",
"order": "DESC"
}
}
A search for current accounts which are active and overdrawn from two different branches using compound filters, sort by overdraft balance
POST /deposits:search
{
"filterCriteria": [
{
"field": "accountState",
"operator": "EQUALS_CASE_SENSITIVE",
"value": "ACTIVE"
},
{
"field": "accountType",
"operator": "EQUALS_CASE_SENSITIVE",
"value": "CURRENT_ACCOUNT"
},
{
"field": "balances.overdraftAmount",
"operator": "MORE_THAN",
"value": 0
},
{
"field": "assignedBranchKey",
"operator": "in",
"values": [
"8a193c26722b51b701722d779e7122de",
"8a193c26722b51b701722d779e7122df"
]
}
],
"sortingCriteria": {
"field": "balances.overdraftAmount",
"order": "DESC"
}
}
Search functionality is provided for a number of entities through dedicated endpoints that can be identified by the :search suffix, for example to search for deposit accounts you can use the /deposits:search endpoint. Search endpoints accept a POST request that can include an object containing a filterCriteria array of objects and a sortingCriteria object in the request body.
The filterCriteria array of objects allows you to narrow your search using multiple fields to filter by. Every entity that supports search has a schema that provides the enumerated values available for the filter properties, for example, the schema for a deposit account search is DepositAccountFilterCriteria.
The sortingCriteria object allows you to specify according to which field and in what way you would like to sort the returned results. Every entity that supports search provides a schema with all the available fields you can sort by. For example, the schema for sorting the results of a deposit account search is DepositAccountSortingCriteria.
Apart from native fields that are enumerated in the relevant schemas that you can use in your filter criteria, you can also filter by custom fields. For more information, see Searching by custom fields.
API v2 also provides a couple of additional features that allow you to further customize and manage your search queries.
The pagination query parameters allow you to break up your search into smaller chunks, for more information, see Pagination and Optimising Searches.
Additionally, you can perform cursor-based pagination which can significantly improve performance with large data sets. For more information, see cursor-based search pagination.
The detailsLevel query parameter allows you to specify the level of detail to include in the results. For more information, see Details Level and Optimising Searches.