---
title: "Get Expenses"
method: GET
path: "/insights/v2/expenses"
tags: ["Expenses"]
---

# Get Expenses

`GET /insights/v2/expenses`

## Request

- Base URL: `https://sandbox.leantech.me`
- URL: `https://sandbox.leantech.me/insights/v2/expenses`
- Auth: HTTP bearer

Provides insights on the expenses (outflows) from a bank account.

## Query parameters

- `entity_id` string, uuid, required
- `async` boolean
- `start_date` string, date
- `expense_type` 'CARD' | 'ALL'

## Response `200`

OK

- object
  - `status` 'OK' | 'PENDING' | 'FAILED' | 'CONSENT_EXPIRED' | 'RECONNECT_REQUIRED' | 'PROCESSING_STARTED', required: The status of the request
  - `results_id` string, uuid, required: The unique identifier for the request
  - `message` string, required: A message describing the status of the request
  - `meta` object, nullable: Meta information about the request
  - `timestamp` string, date-time, required: The datetime of when the request was made
  - `status_detail` StatusDetail, nullable
    - `granular_status_code` string, nullable: Granular status code
    - `status_additional_info` string, nullable: Additional information about the status
  - `insights` Expenses
    - `currency` string, required: The 3 Letter ISO code denominating the currency that the salary is provided in. This will be local currency (AED in _UAE).
    - `total` ExpensesTotal, required
      - `count` integer: Number of expenses transactions within the time period.
      - `amount` number, required: Total expenses since start_date.
      - `first_date_time` string, date-time: UTC datetime of first expense transaction since start_date.
      - `last_date_time` string, date-time: UTC datetime of last expense transaction.
      - `average_monthly_count` number: Average number of expenses transactions per month since start_date.
      - `average_monthly_amount` number: Average expenses amount per month since start_date.
      - `minimum_monthly_amount` ExpensesMonthlyAmount
        - `month` integer: Number of month within the year (e.g.: January is represented as 1 and December is represented as 12)
        - `year` integer: Year
        - `amount` number, required: Total expenses for the month
      - `maximum_monthly_amount` ExpensesMonthlyAmount
        - `month` integer: Number of month within the year (e.g.: January is represented as 1 and December is represented as 12)
        - `year` integer: Year
        - `amount` number, required: Total expenses for the month
      - `breakdown` Breakdown[], required: Breakdown of expenses by category.
        - `by` string, required: Criteria by which we are breaking down the expenses.
        - `breakdowns` BreakdownElement[], required: List of breakdown elements.
          - union
            - object
              - …
            - object
              - …
    - `monthly_totals` MonthlyTotalExpenses[], required: Total expenses for all months from start_date until today.
      - `month` integer: Number of month within the year (e.g.: January is represented as 1 and December is represented as 12)
      - `year` integer: Year.
      - `amount` number, required: Total expenses for the month.
      - `count` integer: Number of expense transactions in the month.
      - `is_month_complete` boolean: Determines if Lean retrieved the data for all days for the month. This will always be `true`, except for the first and last month retrieved.
      - `breakdown` Breakdown[], required: Breakdown of expenses by category.
        - `by` string, required: Criteria by which we are breaking down the expenses.
        - `breakdowns` BreakdownElement[], required: List of breakdown elements.
          - union
            - object
              - …
            - object
              - …
    - `transactions` ExpensesTransaction[], required: List of expense transactions (internal use only, not serialized in API response)
      - `account_id` string, uuid, required: The account ID for the transaction
      - `transaction_id` string, required: The unique transaction identifier
      - `transaction_information` string, nullable: Additional information about the transaction
      - `booking_date_time` string, date-time, required: The date and time when the transaction was booked
      - `amount` number, required: The transaction amount
      - `category` string, required: The expense category
  - `type` 'income' | 'employment' | 'cashflow' | 'credits-obligations' | 'non-credits-obligations' | 'expenses' | 'cash-balances' | 'freelancer-cashflow' | 'cashflow-patterns' | 'credit-assessments' | 'account-controls' | 'credit-obligations' | 'spending': type of insight

## Other responses

- `202`: Accepted (Asynchronous request)
- `400`: Bad Request
- `404`: Entity not found
- `500`: Internal Server Error

---

[API](https://skmtc.dev/leantech/apis/insights-api-account-controls.md) - [All operations](https://skmtc.dev/leantech/apis/insights-api-account-controls/llms.txt) - [OpenAPI document](https://skmtc.dev/leantech/apis/insights-api-account-controls/revisions/6a904c24f1e4?raw)
