Developer Portal

PortfolioGET

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

View as Markdown
GET
/accounts/{account_id}/portfolio

Authorization

AuthorizationRequiredBearer <token>

JWT token obtained from the login endpoint

In: header

Path Parameters

account_idRequiredstring

Account ID to fetch portfolio for

curl -X GET "http://localhost:8081/api/v1/accounts/acc_123456/portfolio" \
  -H "Authorization: Bearer <token>"

Successfully retrieved portfolio

{
  "account_id": "acc_123456",
  "currency": "USD",
  "balance": 10000,
  "unrealized_pnl": 150.5,
  "used_margin": 2500,
  "in_margin_call": false,
  "in_stop_out": false,
  "status": "TRADE_STATUS_FULL",
  "positions": [
    {
      "id": "pos_123456",
      "symbol_id": "EURUSD",
      "account_id": "acc_123456",
      "order_id": "ord_123456",
      "symbol_name": "EURUSD",
      "open_price": 1.085,
      "close_price": 1.086,
      "side": "TRADE_SIDE_BUY",
      "status": "POSITION_STATUS_OPEN",
      "is_closing": false,
      "commission": 2.5,
      "swap": -0.15,
      "profit": 100,
      "units": 100000,
      "qty": 1,
      "qty_closed": 0,
      "comment": "Manual trade",
      "created_at": "2025-01-01T12:00:00Z",
      "updated_at": "2025-01-01T12:30:00Z",
      "funding_accrued": -1.25
    }
  ],
  "orders": [
    {
      "id": "ord_123456",
      "account_id": "acc_123456",
      "symbol_id": "EURUSD",
      "symbol_name": "EURUSD",
      "position_id": "pos_123456",
      "client_order_id": "client_123",
      "parent_order_id": "ord_parent_123",
      "cancels_order_id": "ord_cancel_123",
      "created_at": "2025-01-01T12:00:00Z",
      "updated_at": "2025-01-01T12:30:00Z",
      "expiration_date": "2025-01-02T12:00:00Z",
      "qty_original": 1,
      "qty_filled": 0.5,
      "qty_remaining": 0.5,
      "limit_price": 1.085,
      "stop_price": 1.084,
      "fill_price": 1.0851,
      "side": "TRADE_SIDE_BUY",
      "type": "ORDER_TYPE_LIMIT",
      "status": "ORDER_STATUS_WORKING",
      "time_in_force": "TIF_GTC",
      "comment": "Manual order"
    }
  ]
}