WebSocketTrade WebSocket

GET

Establish a WebSocket connection to get real-time updates for trade orders. Subscribe to live status updates for your trade orders, including individual fills for an order. Send messages when statuses update.

Header Params

  • Authorization string required
    Bearer token for authorization

Body Params

object

Subscribe or unsubscribe to order events for a specific account.

Multiple subscriptions are supported on a single connection — send separate subscribe messages for each accountId. Each subscribe/unsubscribe triggers a subscription_response message confirming the outcome.

Behavior changes (previously silent, now explicit):

  • Subscribing to an already-subscribed accountId returns status already_subscribed instead of being silently ignored.
  • Unsubscribing from an accountId that is not currently subscribed returns an error message instead of being silently ignored.
  • type string enum required
    The event type ("subscribe" or "unsubscribe")
    subscribeunsubscribe
  • channel string enum required
    The subscription channel ("orders" for trade orders)
    orders
  • accountId string required
    The ID of the account

Responses

101

Switching Protocols. Once connected, the server may send:

  • WsTradeOrdersResponse — order events and subscription confirmations
  • WsSubscriptionResponse — confirmation after every subscribe/unsubscribe request

Response Body

ONE OF

  • channel string
    The channel you are subscribed to.
  • time string date-time
  • creationDate string date-time
  • completionDate string date-time
  • settleDate string date-time
  • scheduledDate string date-time
    Date to schedule the order. If not provided, the order will be placed immediately.
  • lastFillDate string date-time
  • accountId string
    The ID of the account
  • clientOrderId string
    Custom order ID provided by the client. This must be a unique ID for each individual order and cannot be the same across multiple requests. Can be used to ensure idempotency of order requests.

    up to 256 characters

  • orderId string
    The ID of the order.
  • product string
    Product name.
  • fundingType string enum

    The funding type of the order.

    • Funded orders will be placed using the Go account balance.
    • Margin orders will be placed using the margin account balances. See our Trade Guide for more details on each funding type.

    Defaults to funded

    marginfunded
  • status string enum
    pending_openopencompletedpending_cancelcancelederrorscheduled
  • execType string

    The type of update, using FIX 4.4 ExecType (tag 150) values. Use this field to distinguish order status updates from fill events.

    • F (Trade) — a fill occurred; check tradeId, fillQuantity, fillPrice for fill details
    • 0 (New) — order accepted by the exchange
    • A (Pending New) — order submitted, awaiting acceptance
    • 6 (Pending Cancel) — cancel request sent
    • 4 (Canceled) — order canceled
    • 8 (Rejected) — order rejected or internal failure
    • I (Order Status) — terminal status summary (e.g. completed)
  • type string enum
    The type of order to be placed. See our Trade Guide for more details on each order type.
    markettwaplimitsteady_pacestop
  • side string enum
    buysell
  • quantity string decimal
    The specified quantity.
  • quantityCurrency string
    The specified quantity currency.
  • cumulativeQuantity string decimal
    The total base quantity filled for the order.
  • cumulativeQuoteQuantity string decimal
    The total quote quantity filled for the order.
  • leavesQuantity string decimal

    For orders created with base currency, this field is set to the remaining unfilled base quantity.

    • Only one of leavesQuantity or leavesQuoteQuantity will be set.
    • This field is set to null for orders created with quote currency.
  • leavesQuoteQuantity string decimal

    For orders created with quote currency, this field is set to the remaining unfilled quote quantity.

    • Only one of leavesQuantity or leavesQuoteQuantity will be set.
    • This field is set to null for orders created with base currency.
  • averagePrice string decimal
    The average price for the order's fills.
  • tradeId string
    The ID of the trade.
  • fillQuantity string decimal
    The quantity of the fill for the trade.
  • fillPrice string decimal
    The price of the fill for the trade.
  • source string

    The originating channel for the order.

    • api_fix — order placed via FIX 4.4 session
    • api_rest — order placed via REST API
  • triggerPrice string decimal nullable
    Stop/trigger price for stop and stop-limit orders. Null for other order types.
  • limitPrice string decimal nullable
    Limit price for limit, TWAP-with-limit, and SteadyPace-with-limit orders. Null when not set.
  • timeInForce string nullable
    Time-in-force (1 GTC, 3 IOC, 4 FOK, 6 GTD). Null when not set.
  • duration integer nullable
    Order duration in seconds for TWAP and SteadyPace orders. Null for other order types.
  • twapInterval integer nullable
    TWAP slice interval in minutes when isTimeSliced is true. Null for non-TWAP orders and when not time-sliced.
  • isTimeSliced boolean nullable
    TWAP time-slicing flag. Null for non-TWAP orders. When true, use twapInterval; when false, boundsControl may be set instead.
  • boundsControl string nullable
    TWAP bounds control (narrow, standard, wide) for non-time-sliced TWAP orders. Null for time-sliced TWAP and non-TWAP orders.
  • interval integer nullable
    SteadyPace interval length. Null for non-SteadyPace orders.
  • intervalUnit string nullable
    SteadyPace interval unit (second, minute, hour). Null for non-SteadyPace orders.
  • subOrderSize string decimal nullable
    SteadyPace sub-order size. Null for non-SteadyPace orders.
  • variance string decimal nullable
    Optional SteadyPace sub-order size variance (0–1). Null for non-SteadyPace orders.
403
Forbidden - Insufficient permissions

Response Body

object

  • error string required
  • errorName string required
  • reqId string required