WebSocket›Trade WebSocket

WSS

Send on an established WebSocket connection to place a new order.

Places a new order (market, limit, TWAP, steady_pace, or stop). When status is accepted, the response contains only id and clientOrderId. Subscribe to the orders channel for fills and status changes.

Order fields and validation match the REST Place Order endpoint (NewOrderRequest). See our Trade Guide for order-type fields, funding types, and validation error codes.

Requires access token scope: trade_trade on the token used to open the connection.

WebSocket-specific rules:

  • clientOrderId is required in order (optional on REST).
  • Idempotency: retrying with the same clientOrderId returns accepted with the original order. The REST Place Order endpoint returns 409 for a duplicate clientOrderId instead.
  • If a place_order_response is lost (e.g. connection drop), retry with the same clientOrderId and a new reqId.
  • source is ignored if sent — the server sets api_websocket.

Connection

WSS wss://app.bitgo-test.com/api/prime/trading/v1/ws

Channel place_order

Authorization The access token used to open the connection must have the trade_trade scope to send place_order messages. If the token is missing or invalid the upgrade is refused with HTTP 403 and no socket is opened; a token without trade_trade gets a WebSocket place_order_response with status: rejected and error code common:permissionDenied.

Messages sent

Place order

Place order request.

object

  • type string enum required
    Must be place_order.
    place_order
  • reqId string
    Optional client correlation ID, echoed in the response when valid. Omitted from the response when not supplied or when reqId itself fails validation. Use a fresh reqId on each retry; keep clientOrderId unchanged when retrying a lost acknowledgement.

    up to 36 characters

  • accountId string required
    The ID of the account
  • order object required

    Order parameters. Same field definitions and order-type rules as REST NewOrderRequest (market, limit, TWAP, steady_pace, stop). See Place Order for order-type-specific required fields and validation.

    WebSocket-only:

    • clientOrderId is required on every variant (optional on REST).
    • source is ignored — the server sets api_websocket.

    ONE OF

    • clientOrderId string required
      Client-supplied identifier for a single logical order. Must be unique among concurrent open orders in your account. Reuse the same clientOrderId when retrying a place_order after a lost or ambiguous acknowledgement — the server treats a duplicate placement with the same clientOrderId as an idempotent retry (unlike REST, which returns 409). Do not reuse a clientOrderId for a different order.

      up to 256 characters

    • product string required
      Product name e.g. BTC-USD
    • type string required
      Must be set to "market" to place a market order
    • 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
    • side string enum required
      buysell
    • quantity string decimal required
      The quantity of the quantityCurrency to buy or sell.
    • quantityCurrency string required

      The quantity currency for the order. Can be in base or quote currency for both buy and sell orders.

      • Buy orders in quote currency specify a total spend amount (e.g., "buy $10,000 of BTC").
      • Buy orders in base currency specify an exact quantity to purchase (e.g., "buy 1 BTC"). When no limitPrice is provided, a protective marketable limit is computed automatically.
      • Sell orders in base currency specify an exact quantity to sell (e.g., "sell 0.5 BTC").
      • Sell orders in quote currency specify a target proceeds amount (e.g., "sell $500 of BTC"). When no limitPrice is provided, a protective marketable limit is computed automatically. e.g. If product is BTC-USD, the base currency will be BTC and the quote currency will be USD.
    • timeInForce string enum
      Time in force policy for market orders. Only IOC and FOK are supported. If not specified, defaults to IOC.
      IOCFOK

Messages received

Place order response

The server responds with a place_order_response for each place_order message.

ONE OF

  • type string enum required
    place_order_response
  • reqId string
    Echoed when the client supplied a valid reqId.
  • status string enum required
    accepted
  • order object required
    Slim acknowledgement returned on accepted place_order_response. Contains only identity fields.
    order object
    • id string uuid required
      Assigned order ID.
    • clientOrderId string
      Client-supplied order ID from the request.