# List Deals

> Returns deal history for the authenticated user

Source: /trader/api/history/deal-history

## `GET /accounts/{account_id}/history/deals`

**List Deals**

Returns deal history for the authenticated user

Tags: `History`

#### Path parameters

- `account_id` (string) (required) — Account ID to fetch deal history for

#### Query parameters

- `from` (string) — From date created to fetch deal history for
- `to` (string) (required) — To date created to fetch deal history for


### Responses

#### `200` — Successfully retrieved account history

**Content-Type:** `application/json`

- `deals` (array) (required)
  - items:
    - `id` (string) (required)
    - `user_id` (string) (required) — The account that the deal is associated with
    - `symbol_name` (string) (required)
    - `comment` (string) (required)
    - `client_deal_id` (string) (required) — The helio user who created the deal, if via API
    - `account_id` (string) (required)
    - `order_id` (string) (required)
    - `position_id` (string) (required)
    - `created_at` (string) (required)
    - `updated_at` (string)
    - `symbol_id` (string) (required)
    - `volume` (number) (required)
    - `amount` (number) (required) — Amount in account currency
    - `amount_raw` (number) (required)
    - `exchange_rate` (number) (required)
    - `close_price` (number) (required) — Last price with the markup applied Avg+Markup
    - `close_price_raw` (number) (required)
    - `open_price` (number) (required) — Last price with the markup applied Avg+Markup
    - `open_price_raw` (number) (required) — last price
    - `commission` (number) (required) — Commission in account currency
    - `commission_raw` (number) (required) — Commission in symbol currency
    - `action` (string) (required)
      - enum: `DEAL_ACTION_UNSPECIFIED`, `DEAL_ACTION_BUY`, `DEAL_ACTION_SELL`, `DEAL_ACTION_CREDIT`, `DEAL_ACTION_CORRECTION`, `DEAL_ACTION_COMMISSION`, `DEAL_ACTION_DIVIDEND`, `DEAL_ACTION_TAX`, `DEAL_ACTION_BONUS`, `DEAL_ACTION_OTHER`, `DEAL_ACTION_SWAP`, `DEAL_ACTION_INTEREST`, `DEAL_ACTION_BALANCE`, `DEAL_ACTION_REBATE`, `DEAL_ACTION_FEE`, `DEAL_ACTION_FUNDING`
    - `direction` (string) (required)
      - enum: `DEAL_DIRECTION_UNSPECIFIED`, `DEAL_DIRECTION_IN`, `DEAL_DIRECTION_OUT`

#### `400` — Bad request (missing or invalid account_id)

**Content-Type:** `application/json`

- `error` (object) (required)
  - `type` (string) (required) — Error type code
  - `message` (string) (required) — Human-readable error message
  - `field` (string) — Field name if error is field-specific

#### `401` — Unauthorized (invalid or missing JWT token)

**Content-Type:** `application/json`



#### `403` — Forbidden (account access denied)

**Content-Type:** `application/json`



#### `404` — Account not found

**Content-Type:** `application/json`



#### `500` — Internal server error

**Content-Type:** `application/json`



