WebSocketTrade WebSocket

GET

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.

Header Params

  • Authorization string required
    Bearer token for authorization

Body Params

object

Client message to place an order on an established WebSocket connection. The order object uses the same shape as REST NewOrderRequest.
  • 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

Responses

101
Switching Protocols. The server responds with WsPlaceOrderResponse for each place_order message.

Response Body

Server response to a place_order message. Accepted responses contain a slim order acknowledgement (id and clientOrderId only). Full order state is delivered on the orders subscription channel.

place_order_response and subsequent orders channel updates may arrive out of order on the same connection.

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.
403
Forbidden - Insufficient permissions

Response Body

object

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