Skip to navigation

Search Expense service

View as Markdown

Search Expense Service

This endpoint allows users to search for expenses based on a query parameter. The query parameter q is used to specify the type of expense being searched for.

Request

  • Method: GET

  • URL: {{host}}/apis/external/search/searchExpenseService?q=Food

Query Parameters

ParameterTypeDescription
qstringThe search term for the expense.

Response

The response will return a JSON object containing an array of items that match the search criteria. Each item in the array represents an expense and includes the following fields:

  • id: A unique identifier for the expense.

  • name: The name of the expense.

Example Response

{
"items": [
{
"id": 1,
"name": "Lunch at Restaurant"
},
{
"id": 2,
"name": "Groceries"
}
]
}

This example response shows two expense items related to the search term “Food”. Each item includes an id and a name representing the expense.

This endpoint allows users to search for expense items based on a query parameter. It is particularly useful for retrieving specific expense categories or items.

Request

  • Method: GET

  • URL: {{host}}/apis/external/search/searchExpenseService

  • Query Parameters:

    • q (string): The search term to filter expense items. For example, using q=Food will return expense items related to food.

Response

The response will return a JSON object containing an array of items that match the search criteria.

  • Response Structure:

    • items (array): An array of expense items.

      • Each item in the array contains:

        • id (integer): A unique identifier for the expense item.

        • name (string): The name of the expense item.

Notes

  • Ensure that the query parameter q is properly encoded to handle special characters.

  • The response may contain multiple items or none, depending on the search term provided.

Headers

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

Query parameters

qstringOptional

Searches expense services using the q parameter with a case-insensitive partial match on the service name. Returns an empty response if q is blank or not provided.

Response headers

request-idstringOptional

Response

OK
itemslist of objects