> For the complete documentation index, see [llms.txt](https://docs.udara360.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.udara360.io/udara360-docs-1/savings/frequentsavings/search-frequent-savings.md).

# Search Frequent Savings

The "Search Frequent Savings" endpoint allows customers to search and filter frequent savings accounts using a range of optional query parameters.

<mark style="color:green;">`GET`</mark> `/api/Savingsaccount/v1/FrequentSavings/Search`

To search for frequent savings accounts, you can pass any combination of query parameters, such as `AccountNumber`, `CustomerID`, `AccountStatus`, and others, to narrow down the results.

**Headers**

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

**Query Params**

| Name                 | Data Type | Description                                                                    |
| -------------------- | --------- | ------------------------------------------------------------------------------ |
| `AccountNumber`      | string    | Filters results to a specific savings account number.                          |
| `CustomerID`         | string    | Filters results to a specific customer's frequent savings accounts.            |
| `AccountName`        | string    | Filters results by the name on the account.                                    |
| `ProductCode`        | string    | Filters results by the Fixed Deposit Product Code associated with the account. |
| `AccountOfficerCode` | string    | Filters results by the account officer assigned to the account.                |
| `AccountStatus`      | string    | Filters results by account status, e.g. Active.                                |
| `HasDisbursed`       | boolean   | Filters results by whether the account has been disbursed.                     |
| `StartDate`          | date      | The start of the date range to filter results by.                              |
| `EndDate`            | date      | The end of the date range to filter results by.                                |
| `PageNumber`         | integer   | The page number to retrieve, for paginated results.                            |
| `PageSize`           | integer   | The number of records to return per page.                                      |
| `SortColumn`         | string    | The field to sort results by, e.g. DateCreated.                                |
| `Direction`          | string    | The sort direction, e.g. asc or desc.                                          |

**Body table**

| Field                | Data Type | Description                                                                              |
| -------------------- | --------- | ---------------------------------------------------------------------------------------- |
| `status`             | boolean   | Whether the search request was successful.                                               |
| `message`            | string    | Response message from the operation.                                                     |
| `.id`                |           | Unique identifier of the frequent savings account.                                       |
| `pocketName`         | string    | Details of the savings, e.g. Rent, School Fees                                           |
| `liquidationAccount` | string    | The Customer Account that will be debited for the Savings.                               |
| `accountName`        | string    | The name on the frequent savings account.                                                |
| `amount`             | Integer   | The Principal Amount of the frequent savings account.                                    |
| `frequency`          | integer   | How often the deduction towards the savings occurs (Daily = 1, Weekly = 2, Monthly = 3). |
| `commencementDate`   | Integer   | The start date of the frequent savings.                                                  |
| `maturityDate`       | Integer   | The maturity date of the frequent savings.                                               |
| `productCode`        | string    | The Fixed Deposit Product Code associated with the account.                              |
| `productName`        | string    | The name of the Fixed Deposit product associated with the account.                       |
| `interestRate`       | Integer   | The applicable interest rate for the savings.                                            |
| `status`             | string    | The current status of the frequent savings account.                                      |
| `preferredTime`      | Integer   | The preferred time for the deduction to occur (ranges from 0 to 23).                     |
| `recordCount`        | integer   | The total number of matching records found.                                              |

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/Savingsaccount/v1/FrequentSavings/Search?AccountStatus=Active&PageNumber=1&PageSize=23' \
--header 'Authorization: bearer {token}' \
--header 'request-reference: {unique_reference}' \
--header 'Content-Type: application/json' \
--data ''
```

</details>

<details>

<summary>Response: <code>200</code></summary>

```json
{
  "status": true,
  "message": "string",
  "data": {
    "data": [
      {
        "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
        "pocketName": "string",
        "liquidationAccount": "string",
        "accountName": "string",
        "amount": 0,
        "frequency": 1,
        "commencementDate": "2025-02-10T10:40:32.899Z",
        "maturityDate": "2025-02-10T10:40:32.899Z",
        "productCode": "string",
        "productName": "string",
        "interestRate": 0,
        "status": "string",
        "preferredTime": 0
      }
    ],
    "recordCount": 0
  }
}
```

</details>
