Search Expense Category

View as Markdown
### Endpoint: Search Expense Category This endpoint allows users to search for expense categories based on a query parameter. It is particularly useful for retrieving specific categories related to expenses, such as allowances, travel costs, and other financial classifications. #### HTTP Method `GET` #### Request Parameters - **q** (string, required): The search query for the expense category. In this case, it is used to filter categories based on user input. For example, `q=Daily Allowance` will search for categories related to daily allowances. #### Example Request ``` GET {{host}}/apis/external/search/searchExpenseCategory?q=Daily Allowance ``` #### Response Structure The response will return a JSON object containing the following structure: - **categories** (array): An array of category objects matching the search query. - Each category object includes: - **id** (integer): The unique identifier for the category. - **name** (string): The name of the category. #### Example Response ``` json { "categories": [ { "id": 0, "name": "" } ] } ``` This response indicates that the search has been executed, returning an array of categories that match the provided query. If no categories are found, the array may be empty.

Headers

DICE-APP-IDstringOptional
X-CLIENT-IDstringOptional
X-CLIENT-SECRETstringOptional

Query parameters

qstringOptional

Fetches expense categories matching the q parameter using a case-insensitive partial match on the category name. If q is blank, an empty response is returned.

Response headers

request-idstringOptional

Response

OK
categorieslist of objects