# Portfolio

> Returns account balances, metrics, positions, and orders for the authenticated user

Source: /trader/api/trading/get-portfolio

## `GET /accounts/{account_id}/portfolio`

**Portfolio**

Returns account balances, metrics, positions, and orders for the authenticated user

Tags: `Trading`

#### Path parameters

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


### Responses

#### `200` — Successfully retrieved portfolio

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

- `account_id` (string) (required) — Account identifier
- `currency` (string) (required) — Account base currency
- `balance` (number) (required) — Account balance
- `unrealized_pnl` (number) (required) — Unrealized profit/loss from open positions
- `used_margin` (number) (required) — Margin currently used by open positions
- `in_margin_call` (boolean) (required) — Whether account is in margin call
- `in_stop_out` (boolean) (required) — Whether account is in stop out
- `status` (string) (required)
  - enum: `TRADE_STATUS_UNSPECIFIED`, `TRADE_STATUS_FULL`, `TRADE_STATUS_CLOSE_ONLY`, `TRADE_STATUS_DISABLED`, `TRADE_STATUS_LONG_ONLY`
- `positions` (array) (required) — List of open positions
  - items:
    - `id` (string) (required) — Position identifier
    - `symbol_id` (string) (required) — Trading symbol identifier
    - `account_id` (string) (required) — Account identifier
    - `order_id` (string) — Opening order identifier
    - `symbol_name` (string) (required) — Symbol display name
    - `open_price` (number) (required) — Position opening price
    - `close_price` (number) (required) — Position closing price (if closed)
    - `side` (string) (required) — Trade side (buy/sell)
      - enum: `TRADE_SIDE_UNSPECIFIED`, `TRADE_SIDE_BUY`, `TRADE_SIDE_SELL`
    - `status` (string) (required)
      - enum: `POSITION_STATUS_UNSPECIFIED`, `POSITION_STATUS_OPEN`, `POSITION_STATUS_CLOSED`, `POSITION_STATUS_CANCELLED`
    - `is_closing` (boolean) — Whether this order closes a position. e.g. stop loss or take profit
    - `commission` (number) (required) — Commission charged for the position
    - `swap` (number) (required) — Swap charges
    - `profit` (number) (required) — Current profit/loss
    - `units` (number) (required) — Position size in units
    - `qty` (number) (required) — Position quantity in lots
    - `qty_closed` (number) — Quantity already closed
    - `comment` (string) — Position comment
    - `created_at` (string) — Position creation timestamp
    - `updated_at` (string) — Position last update timestamp
    - `funding_accrued` (number) — Cumulative funding charges accrued on this position (account currency)
- `orders` (array) (required) — List of active orders
  - items:
    - `id` (string) (required) — Order identifier
    - `account_id` (string) (required) — Account identifier
    - `symbol_id` (string) (required) — Trading symbol identifier
    - `symbol_name` (string) (required) — Symbol display name
    - `position_id` (string) — Related position identifier
    - `client_order_id` (string) — Client-provided order identifier
    - `parent_order_id` (string) — Parent order identifier for bracket orders
    - `cancels_order_id` (string) — Order that this order cancels
    - `created_at` (string) — Order creation timestamp
    - `updated_at` (string) — Order last update timestamp
    - `expiration_date` (string) — Order expiration timestamp
    - `qty_original` (number) (required) — Original order quantity
    - `qty_filled` (number) (required) — Filled quantity
    - `qty_remaining` (number) — Remaining quantity
    - `limit_price` (number) — Limit price for limit orders
    - `stop_price` (number) — Stop price for stop orders
    - `fill_price` (number) — The average fill price (VWAP) for filled/partially filled orders
    - `side` (any) (required)
    - `type` (string) (required)
      - enum: `ORDER_TYPE_UNSPECIFIED`, `ORDER_TYPE_MARKET`, `ORDER_TYPE_LIMIT`, `ORDER_TYPE_STOP`, `ORDER_TYPE_STOP_LIMIT`, `ORDER_TYPE_TRAILING_STOP`
    - `status` (string) (required)
      - enum: `ORDER_STATUS_UNSPECIFIED`, `ORDER_STATUS_INACTIVE`, `ORDER_STATUS_WORKING`, `ORDER_STATUS_FILLED`, `ORDER_STATUS_CANCELED`, `ORDER_STATUS_REJECTED`, `ORDER_STATUS_EXPIRED`, `ORDER_STATUS_PARTIALLY_FILLED`
    - `time_in_force` (string)
      - enum: `TIF_UNSPECIFIED`, `TIF_GTC`, `TIF_DAY`, `TIF_IOC`, `TIF_FOK`, `TIF_GTD`
    - `comment` (string) — Order comment

#### `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`



