Skip to main content

Module models

Module models 

Source
Expand description

Request and response models of the REST API, one struct per JSON shape of the broker.

Field names are in Rust style and map to the broker’s camelCase names through serde. Wherever the broker docs say a value is one of a closed set (side, status, instrument type), these models keep it as text when a new value must not break parsing, and use an enum when the set is stable. Almost every field of a reply is an Option, because the broker fills only what fits the object. Check before you use a field.

All dates and times from the broker are UTC (broker docs). Quantities of orders are in pieces.

Structs§

CancelByIdRequest
POST /api/v1/orders/cancel and /orders/cancel/sync body: the order is named in the body, not in the path (the /orders/{id}/cancel of CancelOrderRequest is the deprecated form).
CancelOrderRequest
Body of the deprecated cancel, BcsHttpClient::cancel_order.
CandleBar
One candle (bar).
CandlesRequest
Parameters of BcsHttpClient::get_candles.
CandlesResponse
Historical candles of one instrument.
CreateOrderRequest
Body of an order placement: BcsHttpClient::create_order and BcsHttpClient::create_order_sync.
DailyScheduleRequest
Parameters of BcsHttpClient::get_daily_schedule.
DailyScheduleResponse
The trading schedule of one instrument for the day.
DepoLimit
A securities position in the limits.
EditOrderRequest
POST /api/v1/orders/edit and /orders/edit/sync body. The edit is a cancel of the original and a new order (docs), so client_order_id is the id of the new one.
FuturesLimit
A limit of the derivatives market (collateral and variation margin).
InstrumentBoard
A board an instrument trades on.
InstrumentDiscount
The margin discount rates of one instrument.
InstrumentInfo
Reference data of one instrument, as the information service returns it.
InstrumentsByIsinsRequest
Body of BcsHttpClient::get_instruments_by_isins.
InstrumentsByTickersRequest
Body of BcsHttpClient::get_instruments_by_tickers.
InstrumentsByTypeRequest
Parameters of BcsHttpClient::get_instruments_by_type.
LastTradeRecord
One trade of the tape. The docs give dateTime, side (1 buy, 2 sell), price, volume (in the currency) and quantity (pieces), and NO instrument: it is the one asked for. ticker and classCode are read if the broker sends them (older samples have them).
LastTradesRequest
POST /api/v1/last-trades body (schema checked 2026-10-19): the instrument, an optional period of the current session and an optional side. The API has no limit.
LimitPosition
A position record with the fields of a portfolio position.
LimitsResponse
The account limits: positions, money and futures limits.
ModifyOrderRequest
Body of the deprecated change, BcsHttpClient::modify_order.
MoneyLimit
A money balance in the limits.
OperationHistoryRequest
POST /api/v1/operations/search body (schema OperationRequest), all filters optional.
OperationHistoryResponse
Response of POST /api/v1/operations/search (schema OperationListResponse). Unlike the other paginated lists, the docs give only records and pageSize (no total).
OperationRecord
One non-trade operation (schema Operation): deposits, withdrawals, dividends, coupons, commissions, taxes, securities in and out.
OperationResponse
A generic acknowledgement of a command: the id of the request and a status text.
OrderBookLevel
One price level of an order book: a price and the quantity at it.
OrderBookRequest
Parameters of BcsHttpClient::get_order_book.
OrderBookResponse
A snapshot of the order book.
OrderExecutionData
One report about an order: its state, quantities and the last fill.
OrderExtras
Optional order parameters of the current docs (POST /api/v1/orders, /orders/edit, and their /sync twins): time in force, stop-loss and take-profit, iceberg, trailing spread and offset. Everything is optional and omitted when None. What a combination means for the broker is in the docs. The connector fills them for its stop orders (conditional orders).
OrderOperationResponse
The acknowledgement of an asynchronous order command (place, cancel, edit).
OrderRecord
One order in the order list (POST .../orders/search).
OrderSearchRequest
Body of BcsHttpClient::search_orders.
OrderSearchResponse
One page of the order list, with the totals.
OrderStateListResponse
Answer of the synchronous methods and of GET /api/v1/orders: the order’s current state. Unlike the deprecated status call, data is a list.
OrderStatusResponse
The state of an order from the deprecated status method, BcsHttpClient::get_order_status.
PaginatedResponse
A page of a list, with the totals the broker reports.
PortfolioPosition
One record of the portfolio: a securities position or a currency balance.
Quantity
An amount with its settlement mode (REST limits).
QuoteInstrument
One instrument of a quotes request (POST /api/v1/quotes, schema QuotesRequest.instruments[]).
QuoteRecord
Current quote of one instrument (schema MarketDataResponse). Every field except the key may be absent: the docs mark none of them required.
QuotesRequest
POST /api/v1/quotes body. The docs allow 1 to 100 instruments.
QuotesResponse
Response of POST /api/v1/quotes (schema QuotesListResponse).
ScheduleEntry
One session of the day in a daily schedule.
TokenRequest
The form the client sends to the token service to trade a refresh token for an access token.
TokenResponse
The answer of the token service (OAuth style).
TradeData
The nested report of an older trade record shape. See TradeRecord.
TradeRecord
One own trade (fill) in the trades list.
TradeSearchRequest
Body of BcsHttpClient::search_trades.
TradingParamsSnapshot
Normalized trading parameters extracted from InstrumentInfo for domain mapping.
TradingStatusRequest
Parameters of BcsHttpClient::get_trading_status.
TradingStatusResponse
The trading session status of a board.

Enums§

OrderType
Type of an order for placement (orderType of the create and edit requests). The wire form is a digit as text.

Type Aliases§

InstrumentDiscountsResponse
The answer of BcsHttpClient::get_instruments_discounts: a list of discounts.
LastTradesResponse
The anonymous trades of the session: a list of LastTradeRecord. See BcsHttpClient::get_last_trades.
PortfolioResponse
The answer of BcsHttpClient::get_portfolio: a list of positions.