{"openapi":"3.0.3","info":{"title":"BitGo WebSocket API","version":"1.0.0"},"servers":[{"url":"/","description":"Default server"}],"tags":[{"name":"Trade WebSocket","x-displayName":"Trade WebSocket","description":"Real-time WebSocket feeds for order books, order status updates,\nand order placement/cancellation.\n"}],"paths":{"/api/prime/trading/v1/ws (level2)":{"get":{"summary":"Level2 Order Book","description":"Establish a WebSocket connection to get real-time updates for order books. Subscribe to a live feed of all outstanding buy and sell orders on the market for specific coins and tokens. Send messages when specific market conditions occur.","operationId":"trade.websocket.level2","x-internal":false,"tags":["Trade WebSocket"],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Bearer token for authorization"}],"requestBody":{"description":"Event subscription details for Order Books","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsOrderBooksRequest"}}}},"responses":{"101":{"description":"Switching Protocols. Once connected, the server may send:\n- `WsOrderBooksResponse` — level2 order book snapshot/updates\n- `WsSubscriptionResponse` — confirmation after every subscribe/unsubscribe request\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/WsOrderBooksResponse"},{"$ref":"#/components/schemas/WsSubscriptionResponse"}]},"examples":{"level2SnapshotPriceAndSize":{"summary":"Level2 snapshot — [price, size] per level","description":"Order book snapshot when `includeCumulative` is false or omitted on the subscription.","value":{"channel":"level2","type":"snapshot","product":"TBTC-TUSD*","time":"2020-01-01T09:35:26.465Z","bids":[["7001.10","1.5084"]],"asks":[["7002.55","2.7524"]]}},"level2SnapshotWithCumulative":{"summary":"Level2 snapshot — [price, size, cumulativeSize] per level","description":"Order book snapshot when `includeCumulative` is true on the subscription.","value":{"channel":"level2","type":"snapshot","product":"TBTC-TUSD*","time":"2020-01-01T09:35:26.465Z","bids":[["7001.10","1.5084","1.5084"],["7000.50","0.8000","2.3084"]],"asks":[["7002.55","2.7524","2.7524"],["7003.00","1.2000","3.9524"]]}}}}}},"403":{"$ref":"#/components/responses/ForbiddenError3"}}}},"/api/prime/trading/v1/ws (orders)":{"get":{"summary":"Orders","description":"Establish a WebSocket connection for order updates and order write operations.\n\nOpening the connection requires an access token with the `trade_view` scope. Placing or\ncanceling orders requires `trade_trade` on that same token.\n\n**Subscribe** to live status updates for your orders, including individual fills.\n\nYou can also send **`place_order`** and **`cancel_order`** messages on an established\nWebSocket connection (see those operations). Subscribe to the `orders` channel to receive\nfull lifecycle updates after placement or cancellation.\n\n**Correlation:** Supply a unique `reqId` on each `place_order` or `cancel_order` to match\nthe corresponding `*_response`. Use `reqId` only for response correlation — not for\nidempotency or order lookup (`clientOrderId` / `orderId` serve those roles).\n\n**Message ordering:** `place_order_response`, `cancel_order_response`, and `orders`\nchannel updates may arrive out of order on the same connection.\n","operationId":"trade.websocket.orders","x-internal":false,"tags":["Trade WebSocket"],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Bearer token for authorization"}],"requestBody":{"description":"Event subscription details for Orders","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsTradeOrdersRequest"}}}},"responses":{"101":{"description":"Switching Protocols. Once connected, the server may send:\n- `WsSystemMessage` — connection handshake (`status: connected`)\n- `WsTradeOrdersResponse` — order events\n- `WsSubscriptionResponse` — confirmation after every subscribe/unsubscribe request\n- `WsPlaceOrderResponse` — acknowledgement or rejection for a `place_order` request\n- `WsCancelOrderResponse` — acknowledgement or rejection for a `cancel_order` request\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/WsSystemMessage"},{"$ref":"#/components/schemas/WsTradeOrdersResponse"},{"$ref":"#/components/schemas/WsSubscriptionResponse"},{"$ref":"#/components/schemas/WsPlaceOrderResponse"},{"$ref":"#/components/schemas/WsCancelOrderResponse"}]}}}},"403":{"$ref":"#/components/responses/ForbiddenError3"}}}},"/api/prime/trading/v1/ws (place_order)":{"get":{"summary":"Place Order","description":"Send on an **established** WebSocket connection to place a new order.\n\nPlaces a new order (market, limit, TWAP, steady_pace, or stop). When `status` is\n`accepted`, the response contains only `id` and `clientOrderId`. Subscribe to the\n`orders` channel for fills and status changes.\n\nOrder fields and validation match the REST [Place Order](https://developers.bitgo.com/reference/tradeordersadd) endpoint (`NewOrderRequest`).\nSee our [Trade Guide](/docs/trade-overview) for order-type fields, funding types, and validation error codes.\n\n**Requires access token scope:** `trade_trade` on the token used to open the connection.\n\n**WebSocket-specific rules:**\n- `clientOrderId` is **required** in `order` (optional on REST).\n- **Idempotency:** retrying with the same `clientOrderId` returns `accepted` with the original order. The REST Place Order endpoint returns **409** for a duplicate `clientOrderId` instead.\n- If a `place_order_response` is lost (e.g. connection drop), retry with the **same** `clientOrderId` and a **new** `reqId`.\n- `source` is ignored if sent — the server sets `api_websocket`.\n","operationId":"trade.websocket.place_order","x-internal":false,"tags":["Trade WebSocket"],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Bearer token for authorization"}],"requestBody":{"description":"Place order request","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsPlaceOrderRequest"}}}},"responses":{"101":{"description":"Switching Protocols. The server responds with `WsPlaceOrderResponse` for each `place_order` message.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsPlaceOrderResponse"},"examples":{"accepted":{"summary":"Order accepted","value":{"type":"place_order_response","reqId":"c2a8e4f0-9b1d-4e7a-8c3f-1e2d3f4a5b6c","status":"accepted","order":{"id":"8a1f2e3d-4c5b-6a7e-8f9d-0a1b2c3d4e5f","clientOrderId":"my-order-uuid-2026-06-16-001"}}},"rejectedMissingClientOrderId":{"summary":"Missing clientOrderId","value":{"type":"place_order_response","reqId":"c2a8e4f0-9b1d-4e7a-8c3f-1e2d3f4a5b6c","status":"rejected","error":{"code":"common:invalidArgument","field":"clientOrderId","message":"clientOrderId is required"}}},"rejectedPermissionDenied":{"summary":"Missing trade_trade scope","value":{"type":"place_order_response","reqId":"c2a8e4f0-9b1d-4e7a-8c3f-1e2d3f4a5b6c","status":"rejected","error":{"code":"common:permissionDenied","message":"user does not have required permissions"}}}}}}},"403":{"$ref":"#/components/responses/ForbiddenError3"}}}},"/api/prime/trading/v1/ws (cancel_order)":{"get":{"summary":"Cancel Order","description":"Send on an **established** WebSocket connection to cancel a previously placed order.\n\nSubmits a cancel request for the given `orderId`. A successful response confirms the\ncancel **request** was accepted, not that the order is already canceled — confirm final\nstatus on the `orders` subscription channel or via [Get Order](https://developers.bitgo.com/reference/tradeordersorder).\n\nSee the REST [Cancel Order](https://developers.bitgo.com/reference/tradeordersordercancel) endpoint for validation\nerror codes.\n\n**Requires access token scope:** `trade_trade` on the token used to open the connection.\n\n**Idempotency:** canceling an order already in `pending_cancel` is accepted again.\n","operationId":"trade.websocket.cancel_order","x-internal":false,"tags":["Trade WebSocket"],"parameters":[{"in":"header","name":"Authorization","required":true,"schema":{"type":"string"},"description":"Bearer token for authorization"}],"requestBody":{"description":"Cancel order request","required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsCancelOrderRequest"}}}},"responses":{"101":{"description":"Switching Protocols. The server responds with `WsCancelOrderResponse` for each `cancel_order` message.\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsCancelOrderResponse"},"examples":{"accepted":{"summary":"Cancel request accepted","value":{"type":"cancel_order_response","reqId":"c2a8e4f0-9b1d-4e7a-8c3f-1e2d3f4a5b6c","status":"accepted","orderId":"8a1f2e3d-4c5b-6a7e-8f9d-0a1b2c3d4e5f"}},"rejectedNotCancelable":{"summary":"Order already completed","value":{"type":"cancel_order_response","reqId":"d3b9f1a2-7e4c-4b1a-9f3e-2a1b3c4d5e6f","status":"rejected","error":{"code":"trade:orderNotCancelable","message":"order is already completed"}}},"rejectedMissingOrderId":{"summary":"Missing orderId","value":{"type":"cancel_order_response","reqId":"c2a8e4f0-9b1d-4e7a-8c3f-1e2d3f4a5b6c","status":"rejected","error":{"code":"common:invalidArgument","field":"id","message":"required"}}}}}}},"403":{"$ref":"#/components/responses/ForbiddenError3"}}}}},"components":{"callbacks":{},"headers":{},"links":{},"requestBodies":{},"responses":{"BadRequest":{"description":"Bad Request","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GeneralError"},{"$ref":"#/components/schemas/ValidationError"}]},"example":{"code":"BadRequest","message":"Bad Request","status":400}}}},"BadRequestError":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"}}}},"BadRequestError1":{"description":"Bad Request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"},"example":{"error":"Bad Request","errorName":"BadRequest","reqId":"some-id"}}}},"Conflict":{"description":"Conflict - The request conflicts with the current state of the resource","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneralError"},"example":{"code":"Conflict","message":"A pending change already exists for this policy rule","status":409}}}},"ConflictError":{"description":"Conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"},"example":{"error":"Conflicting clientID","errorName":"Conflict","reqId":"some-id"}}}},"Forbidden":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneralError"},"example":{"code":"AccessDenied","message":"License not added for enterprise","status":403}}}},"ForbiddenError":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"}}}},"ForbiddenError1":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error1"},"examples":{"forbidden":{"summary":"Insufficient permissions","value":{"error":"Forbidden, reqId=unk-nqo97l23l2ofpvgkbb8z","errorName":"backend:common:forbidden","reqId":"unk-nqo97l23l2ofpvgkbb8z"}}}}}},"ForbiddenError2":{"description":"Forbidden","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"},"example":{"error":"Staking license not added for enterprise","errorName":"AccessDenied","reqId":"some-id"}}}},"ForbiddenError3":{"description":"Forbidden - Insufficient permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WsError"}}}},"InternalServerError":{"description":"Server Error - Transient error please try again","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"}}}},"InternalServerError1":{"description":"Server Error - Transient error please try again","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"},"example":{"error":"Database is down","errorName":"Internal_Server_Error","reqId":"some-id"}}}},"MalformedJSONError":{"description":"Unprocessable Entity - JSON payload is improperly formatted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error1"},"examples":{"malformedJSON":{"summary":"JSON payload is improperly formatted","value":{"error":"backend:common:malformedJSON","errorName":"backend:common:malformedJSON","reqId":"unk-nqo97l23l2ofpvgkbb8z"}}}}}},"NotFound":{"description":"The specified resource was not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneralError"},"example":{"code":"NotFound","message":"Touchpoint not found","status":404}}}},"NotFoundError":{"description":"Not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"}}}},"NotFoundError1":{"description":"Not Found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"},"example":{"error":"Wallet not found","errorName":"NotFound","reqId":"some-id"}}}},"RateLimitError":{"description":"Too Many Requests - Rate limit exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error1"},"examples":{"rateLimitExceeded":{"summary":"Too many API requests","value":{"error":"backend:common:rateLimitExceeded","errorName":"backend:common:rateLimitExceeded","reqId":"unk-nqo97l23l2ofpvgkbb8z"}}}}}},"ServerError":{"description":"Server Error - Transient error please try again","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneralError"},"example":{"code":"Internal_Server_Error","message":"Database is down","status":500}}}},"Unauthorized":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneralError"},"example":{"code":"Unauthorized","message":"Unauthorized","status":401}}}},"UnauthorizedError":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"}}}},"UnauthorizedError1":{"description":"Unauthorized - Invalid or missing authentication","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error1"},"examples":{"unauthorized":{"summary":"Unauthorized access","value":{"error":"Unauthorized","errorName":"Error","reqId":"unk-nqo97l23l2ofpvgkbb8z"}}}}}},"UnauthorizedError2":{"description":"Unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StakingError"},"example":{"error":"Unauthorized","errorName":"Unauthorized","reqId":"some-id"}}}},"internalServerError1":{"description":"Internal Server Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error1"},"examples":{"internalServerError":{"summary":"Generic server error - Reach out to support for more information","value":{"error":"backend:common:internalServerError","errorName":"backend:common:internalServerError","reqId":"unk-nqo97l23l2ofpvgkbb8z"}}}}}}},"schemas":{"Error1":{"required":["error","errorName","reqId"],"type":"object","properties":{"error":{"type":"string"},"errorName":{"type":"string"},"reqId":{"type":"string"},"context":{"$ref":"#/components/schemas/ErrorContext"}},"example":{"error":"invalid permission","errorName":"backend:common:forbidden","reqId":"unk-nqo97l23l2ofpvgkbb8z"}},"ErrorContext":{"type":"object","description":"Optional structured metadata for REST validation failures.\nThe schema is fixed for client contract stability.\n","required":["errorName"],"properties":{"errorName":{"type":"string","description":"Same value as the top-level errorName."},"field":{"type":"string","description":"Request field associated with the validation failure."},"message":{"type":"string","description":"Human-readable field-level validation message."}}},"GeneralError":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"status":{"type":"integer"}}},"StakingError":{"title":"Staking Error","type":"object","properties":{"error":{"type":"string"},"errorName":{"type":"string"},"reqId":{"type":"string"},"context":{"type":"object"}}},"ValidationError":{"allOf":[{"$ref":"#/components/schemas/GeneralError"},{"type":"object","properties":{"failedValidations":{"type":"object"}}}]},"WsAccountId":{"type":"string","description":"The ID of the account"},"WsCancelOrderAcceptedResponse":{"title":"Cancel Order Accepted","description":"The cancel request was accepted for processing. `orderId` echoes the ID from the\n`cancel_order` request. Confirm final cancellation on the `orders` channel or via [Get Order](https://developers.bitgo.com/reference/tradeordersorder).\n","type":"object","required":["type","status","orderId"],"properties":{"type":{"type":"string","enum":["cancel_order_response"]},"reqId":{"type":"string","description":"Echoed when the client supplied a valid `reqId`."},"status":{"type":"string","enum":["accepted"]},"orderId":{"type":"string","format":"uuid","description":"Echoes the `orderId` from the `cancel_order` request."}}},"WsCancelOrderRejectedResponse":{"title":"Cancel Order Rejected","description":"The cancel request was rejected. `error` describes the validation or business failure.","type":"object","required":["type","status","error"],"properties":{"type":{"type":"string","enum":["cancel_order_response"]},"reqId":{"type":"string","description":"Echoed when the client supplied a valid `reqId`."},"status":{"type":"string","enum":["rejected"]},"error":{"$ref":"#/components/schemas/WsOrderWriteError"}}},"WsCancelOrderRequest":{"title":"Cancel Order","description":"Client message to cancel an order on an established WebSocket connection.","required":["type","accountId","orderId"],"type":"object","properties":{"type":{"type":"string","description":"Must be `cancel_order`.","enum":["cancel_order"]},"reqId":{"type":"string","maxLength":36,"description":"Optional client correlation ID, echoed in the response when valid.\nOmitted from the response when not supplied or when `reqId` itself fails validation.\nUse a fresh `reqId` on each send (including retries). Do **not** use `reqId` for\nidempotency — use `orderId` only to identify the order being canceled.\n"},"accountId":{"$ref":"#/components/schemas/WsAccountId"},"orderId":{"type":"string","format":"uuid","description":"The order ID to cancel (UUID). Validation errors use field `id` in the error payload\n(not `orderId`), even though the request field is `orderId`.\n"}},"example":{"type":"cancel_order","reqId":"c2a8e4f0-9b1d-4e7a-8c3f-1e2d3f4a5b6c","accountId":"f230fdebfa084ffebc7e00515f54603f","orderId":"8a1f2e3d-4c5b-6a7e-8f9d-0a1b2c3d4e5f"}},"WsCancelOrderResponse":{"title":"Cancel Order Response","description":"Server response to a `cancel_order` message. Accepted responses confirm the cancel\n**request** was accepted; rejected responses contain a structured `error`.\nConfirm final cancellation on the `orders` channel or via [Get Order](https://developers.bitgo.com/reference/tradeordersorder).\n","oneOf":[{"$ref":"#/components/schemas/WsCancelOrderAcceptedResponse"},{"$ref":"#/components/schemas/WsCancelOrderRejectedResponse"}]},"WsClientOrderId":{"type":"string","description":"Client-supplied identifier for a single logical order. Must be unique among concurrent\nopen orders in your account. **Reuse** the same `clientOrderId` when retrying a\n`place_order` after a lost or ambiguous acknowledgement — the server treats a duplicate\nplacement with the same `clientOrderId` as an idempotent retry (unlike REST, which\nreturns 409). Do not reuse a `clientOrderId` for a different order.\n","maxLength":256},"WsError":{"type":"object","required":["error","errorName","reqId"],"properties":{"error":{"type":"string"},"errorName":{"type":"string"},"reqId":{"type":"string"}}},"WsFillUpdated":{"title":"Fill Updated","allOf":[{"$ref":"#/components/schemas/WsTradeBaseOrder"}],"example":{"channel":"orders","time":"2025-12-08T16:41:03.30491Z","creationDate":"2025-12-08T16:41:02.802558Z","scheduledDate":null,"lastFillDate":"2025-12-08T16:41:03.419104Z","completionDate":null,"settleDate":null,"accountId":"6598421ec862bac27d0d4f7d827fe202","orderId":"4f9aacc5-d8aa-4fe4-bb6d-109eee0b7270","clientOrderId":"my-order-1","product":"BTC-USD","fundingType":"funded","status":"open","execType":"F","type":"market","side":"buy","quantity":"0.0068","quantityCurrency":"BTC","cumulativeQuantity":"0.00342566","cumulativeQuoteQuantity":"310","leavesQuantity":"0.0068","leavesQuoteQuantity":null,"averagePrice":"90493.51","tradeId":"5606d256-818f-4e55-9cf8-4b237ddd0c85","fillQuantity":"0.00342566","fillPrice":"90493.51"}},"WsFundingType":{"type":"string","enum":["margin","funded"],"description":"The funding type of the order.\n- Funded orders will be placed using the Go account balance.\n- Margin orders will be placed using the margin account balances.\nSee our [Trade Guide](/docs/trade-overview) for more details on each funding type.\n","default":"funded"},"WsLimitPrice":{"type":"string","format":"decimal","description":"The limit price. It always refers to the quote currency.\n- It's maximum precision is determined by the product's `quoteDisplayPrecision` field, which can be fetched from the list products endpoint.\n","example":"10005.00"},"WsNewLimitOrderRequest":{"title":"Limit","required":["clientOrderId","product","quantity","quantityCurrency","side","type","limitPrice"],"type":"object","properties":{"clientOrderId":{"$ref":"#/components/schemas/WsClientOrderId"},"product":{"type":"string","description":"Product name e.g. BTC-USD"},"type":{"type":"string","description":"Must be set to \"limit\" to place a limit order"},"fundingType":{"$ref":"#/components/schemas/WsFundingType"},"side":{"$ref":"#/components/schemas/WsSide"},"quantity":{"type":"string","format":"decimal"},"quantityCurrency":{"type":"string","description":"The quantity currency. Can be in base or quote currency for both buy and sell orders.\n- Buy orders in base currency specify an exact quantity to purchase.\n- Buy orders in quote currency specify a total spend amount.\n- Sell orders in base currency specify an exact quantity to sell.\n- Sell orders in quote currency specify a target proceeds amount.\ne.g. If product is `BTC-USD`, the base currency will be `BTC` and the quote currency will be `USD`.\n"},"limitPrice":{"$ref":"#/components/schemas/WsLimitPrice"},"duration":{"type":"integer","description":"Duration of the limit order in minutes. When set, the order uses GTD (Good Till Date) time in force\nand expires after the specified duration. Cannot be combined with timeInForce=GTC.\nFor orders that are good till cancelled, omit duration and use timeInForce=GTC.\n"},"timeInForce":{"type":"string","enum":["GTC","IOC","FOK","GTD"],"description":"Time in force policy for limit orders. Supported values: GTC, IOC, FOK, GTD.\nIf not specified, defaults to GTC.\nWhen `duration` is provided, the order automatically uses GTD regardless of this field.\nGTD requires `duration` to be set. GTC cannot be combined with `duration`.\n"}},"example":{"clientOrderId":"myorder1","type":"limit","product":"BTC-USD","side":"buy","quantity":"1","quantityCurrency":"BTC","limitPrice":"10005","duration":60}},"WsNewMarketOrderRequest":{"title":"Market","required":["clientOrderId","product","quantity","quantityCurrency","side","type"],"type":"object","properties":{"clientOrderId":{"$ref":"#/components/schemas/WsClientOrderId"},"product":{"type":"string","description":"Product name e.g. BTC-USD"},"type":{"type":"string","description":"Must be set to \"market\" to place a market order"},"fundingType":{"$ref":"#/components/schemas/WsFundingType"},"side":{"$ref":"#/components/schemas/WsSide"},"quantity":{"type":"string","format":"decimal","description":"The quantity of the `quantityCurrency` to buy or sell."},"quantityCurrency":{"type":"string","description":"The quantity currency for the order. Can be in base or quote currency for both buy and sell orders.\n- Buy orders in quote currency specify a total spend amount (e.g., \"buy $10,000 of BTC\").\n- 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.\n- Sell orders in base currency specify an exact quantity to sell (e.g., \"sell 0.5 BTC\").\n- 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.\ne.g. If product is `BTC-USD`, the base currency will be `BTC` and the quote currency will be `USD`.\n"},"timeInForce":{"type":"string","enum":["IOC","FOK"],"description":"Time in force policy for market orders. Only IOC and FOK are supported.\nIf not specified, defaults to IOC.\n"}},"example":{"clientOrderId":"myorder1","type":"market","product":"BTC-USD","side":"buy","quantity":"10000","quantityCurrency":"USD"}},"WsNewSteadyPaceOrderRequest":{"title":"Steady Pace","required":["clientOrderId","product","quantity","quantityCurrency","side","type"],"type":"object","properties":{"clientOrderId":{"$ref":"#/components/schemas/WsClientOrderId"},"product":{"type":"string","description":"Product name e.g. BTC-USD"},"type":{"type":"string","description":"Must be set to \"steady_pace\" to place a Steady Pace order"},"fundingType":{"$ref":"#/components/schemas/WsFundingType"},"side":{"$ref":"#/components/schemas/WsSide"},"quantity":{"type":"string","format":"decimal"},"quantityCurrency":{"type":"string","description":"The quantity currency. Can be in base or quote currency for both buy and sell orders.\n- Buy orders in base currency specify an exact quantity to purchase. When no `limitPrice` is provided, a protective marketable limit is computed automatically.\n- Buy orders in quote currency specify a total spend amount.\n- Sell orders in base currency specify an exact quantity to sell.\n- Sell orders in quote currency specify a target proceeds amount. When no `limitPrice` is provided, a protective marketable limit is computed automatically.\ne.g. If product is `BTC-USD`, the base currency will be `BTC` and the quote currency will be `USD`.\n"},"limitPrice":{"$ref":"#/components/schemas/WsLimitPrice"},"scheduledDate":{"$ref":"#/components/schemas/WsScheduledDate"},"parameters":{"allOf":[{"$ref":"#/components/schemas/WsSteadyPaceOrderParameters"}]}},"example":{"clientOrderId":"myorder1","type":"steady_pace","product":"BTC-USD","side":"buy","quantity":"100000","quantityCurrency":"USD","parameters":{"interval":5,"intervalUnit":"minute","subOrderSize":"20000","variance":0.02}}},"WsNewStopOrderRequest":{"title":"Stop","required":["clientOrderId","product","quantity","quantityCurrency","side","type","triggerPrice"],"type":"object","properties":{"clientOrderId":{"$ref":"#/components/schemas/WsClientOrderId"},"product":{"type":"string","description":"Product name e.g. BTC-USD"},"type":{"type":"string","description":"Must be set to \"stop\" to place a stop order"},"fundingType":{"$ref":"#/components/schemas/WsFundingType"},"side":{"$ref":"#/components/schemas/WsSide"},"quantity":{"type":"string","format":"decimal","description":"The quantity of the `quantityCurrency` to buy or sell."},"quantityCurrency":{"type":"string","description":"The quantity currency. Can be in base or quote currency for both buy and sell orders.\n- Buy orders in base currency specify an exact quantity to purchase.\n- Buy orders in quote currency specify a total spend amount.\n- Sell orders in base currency specify an exact quantity to sell.\n- Sell orders in quote currency specify a target proceeds amount.\ne.g. If product is `BTC-USD`, the base currency will be `BTC` and the quote currency will be `USD`.\n"},"triggerPrice":{"$ref":"#/components/schemas/WsTriggerPrice"},"limitPrice":{"$ref":"#/components/schemas/WsLimitPrice"},"timeInForce":{"type":"string","enum":["GTC"],"description":"Time in force policy for stop orders. Only GTC (Good Till Cancelled) is supported.\nIf not specified, defaults to GTC.\n"}},"example":{"clientOrderId":"mystoporder1","type":"stop","product":"BTC-USD","side":"sell","quantity":"0.5","quantityCurrency":"BTC","triggerPrice":"48000","limitPrice":"47500"}},"WsNewTWAPOrderRequest":{"title":"TWAP","required":["clientOrderId","product","quantity","quantityCurrency","side","type","duration"],"type":"object","properties":{"clientOrderId":{"$ref":"#/components/schemas/WsClientOrderId"},"product":{"type":"string","description":"Product name e.g. BTC-USD"},"type":{"type":"string","description":"Must be set to \"twap\" to place a TWAP order"},"fundingType":{"$ref":"#/components/schemas/WsFundingType"},"side":{"$ref":"#/components/schemas/WsSide"},"quantity":{"type":"string","format":"decimal"},"quantityCurrency":{"type":"string","description":"The quantity currency. Can be in base or quote currency for both buy and sell orders.\n- Buy orders in base currency specify an exact quantity to purchase. When no `limitPrice` is provided, a protective marketable limit is computed automatically.\n- Buy orders in quote currency specify a total spend amount.\n- Sell orders in base currency specify an exact quantity to sell.\n- Sell orders in quote currency specify a target proceeds amount. When no `limitPrice` is provided, a protective marketable limit is computed automatically.\ne.g. If product is `BTC-USD`, the base currency will be `BTC` and the quote currency will be `USD`.\n"},"limitPrice":{"$ref":"#/components/schemas/WsLimitPrice"},"duration":{"type":"integer","description":"Duration of the TWAP order in minutes. Must be greater than 0."},"interval":{"type":"integer","description":"Interval of the time-sliced TWAP order in minutes. Only required if `isTimeSliced` is `true`."},"scheduledDate":{"$ref":"#/components/schemas/WsScheduledDate"},"parameters":{"allOf":[{"$ref":"#/components/schemas/WsTWAPOrderParameters"}]}},"example":{"clientOrderId":"myorder1","type":"twap","product":"BTC-USD","side":"buy","quantity":"100000","quantityCurrency":"USD","duration":60,"interval":5,"parameters":{"isTimeSliced":false,"boundsControl":"wide"}}},"WsOrderBooksRequest":{"title":"Order Books","required":["type","channel","accountId","productId"],"type":"object","properties":{"type":{"type":"string","description":"The event type (e.g. \"subscribe\" or \"unsubscribe\")"},"channel":{"type":"string","description":"The subscription channel (e.g. \"level2\" for order books)"},"accountId":{"$ref":"#/components/schemas/WsAccountId"},"productId":{"type":"string","description":"The ID of product. (e.g. \"TBTC-TUSD*\")"},"includeCumulative":{"type":"boolean","description":"Include cumulative size in each price level. When `true`, each level is `[price, size, cumulativeSize]` instead of `[price, size]`.\n`cumulativeSize` is the running total of `size` from the top of that side through the level.\n","default":false}},"example":{"type":"subscribe","channel":"level2","accountId":"f230fdebfa084ffebc7e00515f54603f","productId":"TBTC-TUSD*"}},"WsOrderBooksResponse":{"title":"Order Books Response","type":"object","properties":{"channel":{"type":"string","description":"The channel name (e.g. \"level2\")."},"type":{"type":"string","description":"The type of the response (e.g. \"snapshot\")."},"product":{"type":"string","description":"The product name (e.g. \"TBTC-TUSD*\")."},"time":{"type":"string","format":"date-time","description":"The timestamp of the snapshot."},"bids":{"type":"array","description":"An array of bid levels `[price, size]` or `[price, size, cumulativeSize]` when `includeCumulative` is true.\n`cumulativeSize` is the running total of `size` from the top of that side through the level.\n","items":{"type":"array","items":{"type":"string"}}},"asks":{"type":"array","description":"An array of ask levels `[price, size]` or `[price, size, cumulativeSize]` when `includeCumulative` is true.\n`cumulativeSize` is the running total of `size` from the top of that side through the level.\n","items":{"type":"array","items":{"type":"string"}}}},"example":{"channel":"level2","type":"snapshot","product":"TBTC-TUSD*","time":"2020-01-01T09:35:26.465Z","bids":[["7001.10","1.5084"]],"asks":[["7002.55","2.7524"]]}},"WsOrderCanceled":{"title":"Order Canceled","allOf":[{"$ref":"#/components/schemas/WsTradeBaseOrder"}],"example":{"channel":"orders","time":"2025-12-05T00:03:29.878861Z","creationDate":"2025-12-05T00:03:28.501965Z","scheduledDate":null,"lastFillDate":null,"completionDate":null,"settleDate":null,"accountId":"6598421ec862bac27d0d4f7d827fe202","orderId":"8857abd9-a88b-4059-a66c-9e45bfb58699","clientOrderId":"my-order-1","product":"BTC-USD","fundingType":"funded","status":"canceled","execType":"4","type":"market","side":"buy","quantity":"0.0068","quantityCurrency":"BTC","cumulativeQuantity":"0","cumulativeQuoteQuantity":"0","leavesQuantity":"0.0068","leavesQuoteQuantity":null,"averagePrice":"0","tradeId":"","fillQuantity":"","fillPrice":""}},"WsOrderCompleted":{"title":"Order Completed","allOf":[{"$ref":"#/components/schemas/WsTradeBaseOrder"}],"example":{"channel":"orders","time":"2025-12-05T00:03:29.878861Z","creationDate":"2025-12-05T00:03:28.501965Z","scheduledDate":null,"lastFillDate":"2025-12-05T00:03:29.091521Z","completionDate":"2025-12-05T00:03:29.878861Z","settleDate":null,"accountId":"6598421ec862bac27d0d4f7d827fe202","orderId":"8857abd9-a88b-4059-a66c-9e45bfb58699","clientOrderId":"my-order-1","product":"BTC-USD","fundingType":"funded","status":"completed","execType":"I","type":"market","side":"buy","quantity":"0.0068","quantityCurrency":"BTC","cumulativeQuantity":"0.0068","cumulativeQuoteQuantity":"615.38","leavesQuantity":"0","leavesQuoteQuantity":null,"averagePrice":"90497.05","tradeId":"","fillQuantity":"","fillPrice":""}},"WsOrderCreated":{"title":"Order Created","allOf":[{"$ref":"#/components/schemas/WsTradeBaseOrder"},{"type":"object"}],"example":{"channel":"orders","time":"2025-12-08T16:41:02.802558Z","creationDate":"2025-12-05T21:31:37.907912Z","scheduledDate":null,"lastFillDate":null,"completionDate":null,"settleDate":null,"accountId":"f230fdebfa084ffebc7e00515f54603f","orderId":"14db12f5-4d3d-4fd8-8ced-062aa81bb4bc","clientOrderId":"my-order-1","product":"BTC-USD","fundingType":"funded","status":"pending_open","execType":"A","type":"market","side":"buy","quantity":"0.0068","quantityCurrency":"BTC","cumulativeQuantity":"0.00110034","cumulativeQuoteQuantity":"0","leavesQuantity":"0.0068","leavesQuoteQuantity":null,"averagePrice":"0","tradeId":"","fillQuantity":"","fillPrice":""}},"WsOrderError":{"title":"Order Error","allOf":[{"$ref":"#/components/schemas/WsTradeBaseOrder"}],"example":{"channel":"orders","time":"2019-04-25T01:02:03.045678Z","accountId":"f230fdebfa084ffebc7e00515f54603f","orderId":"14db12f5-4d3d-4fd8-8ced-062aa81bb4bc","product":"BTC-USD","fundingType":"funded","status":"error","execType":"8","type":"market","side":"buy","quantity":"0.0068","quantityCurrency":"BTC","cumulativeQuantity":"0.00359973","cumulativeQuoteQuantity":"325.53","leavesQuantity":"0.00320027","leavesQuoteQuantity":null,"averagePrice":"90431.78","tradeId":"","fillQuantity":"","fillPrice":""}},"WsOrderStatus":{"type":"string","enum":["pending_open","open","completed","pending_cancel","canceled","error","scheduled"]},"WsOrderType":{"type":"string","enum":["market","twap","limit","steady_pace","stop","rfq"],"description":"The type of order to be placed. See our [Trade Guide](/docs/trade-overview) for more details on each order type."},"WsOrderWriteError":{"title":"Order Write Error","description":"Structured error when `status` is `rejected`. Error codes mirror REST domain codes\n(e.g. `trade:invalidQuantity`) without the REST `backend:` prefix.\n","type":"object","required":["code","message"],"properties":{"code":{"type":"string","description":"Error code. Common values:\n- `common:invalidArgument` — validation failure (see `field`)\n- `common:permissionDenied` — missing `trade_trade` scope\n- `trade:orderNotCancelable` — cancel on completed/canceled order\n- `internal:internalError` — internal failure (generic message)\n- `internal:timeout` — request timed out or connection canceled\n","example":"common:invalidArgument"},"field":{"type":"string","nullable":true,"description":"Request field associated with the error when applicable.\nCancel validation uses `id` for `orderId` wire field errors.\n"},"message":{"type":"string","description":"Human-readable error detail."}}},"WsPlaceOrderAcceptedResponse":{"title":"Place Order Accepted","description":"The place request was accepted for processing. `order` contains only `id` and\n`clientOrderId`. Confirm final order state on the `orders` channel or via [Get Order](https://developers.bitgo.com/reference/tradeordersorder).\n","type":"object","required":["type","status","order"],"properties":{"type":{"type":"string","enum":["place_order_response"]},"reqId":{"type":"string","description":"Echoed when the client supplied a valid `reqId`."},"status":{"type":"string","enum":["accepted"]},"order":{"$ref":"#/components/schemas/WsPlacedOrder"}}},"WsPlaceOrderBody":{"title":"Place Order Body","description":"Order parameters. Same field definitions and order-type rules as REST `NewOrderRequest`\n(market, limit, TWAP, steady_pace, stop). See [Place Order](https://developers.bitgo.com/reference/tradeordersadd)\nfor order-type-specific required fields and validation.\n\n**WebSocket-only:**\n- `clientOrderId` is **required** on every variant (optional on REST).\n- `source` is ignored — the server sets `api_websocket`.\n","oneOf":[{"$ref":"#/components/schemas/WsNewMarketOrderRequest"},{"$ref":"#/components/schemas/WsNewLimitOrderRequest"},{"$ref":"#/components/schemas/WsNewTWAPOrderRequest"},{"$ref":"#/components/schemas/WsNewSteadyPaceOrderRequest"},{"$ref":"#/components/schemas/WsNewStopOrderRequest"}]},"WsPlaceOrderRejectedResponse":{"title":"Place Order Rejected","description":"The place request was rejected. `error` describes the validation or business failure.","type":"object","required":["type","status","error"],"properties":{"type":{"type":"string","enum":["place_order_response"]},"reqId":{"type":"string","description":"Echoed when the client supplied a valid `reqId`."},"status":{"type":"string","enum":["rejected"]},"error":{"$ref":"#/components/schemas/WsOrderWriteError"}}},"WsPlaceOrderRequest":{"title":"Place Order","description":"Client message to place an order on an established WebSocket connection.\nThe `order` object uses the same shape as REST `NewOrderRequest`.\n","required":["type","accountId","order"],"type":"object","properties":{"type":{"type":"string","description":"Must be `place_order`.","enum":["place_order"]},"reqId":{"type":"string","maxLength":36,"description":"Optional client correlation ID, echoed in the response when valid.\nOmitted from the response when not supplied or when `reqId` itself fails validation.\nUse a fresh `reqId` on each retry; keep `clientOrderId` unchanged when retrying a lost acknowledgement.\n"},"accountId":{"$ref":"#/components/schemas/WsAccountId"},"order":{"$ref":"#/components/schemas/WsPlaceOrderBody"}},"example":{"type":"place_order","reqId":"c2a8e4f0-9b1d-4e7a-8c3f-1e2d3f4a5b6c","accountId":"f230fdebfa084ffebc7e00515f54603f","order":{"clientOrderId":"my-order-uuid-2026-06-16-001","type":"limit","product":"BTC-USD","side":"buy","quantity":"0.5","quantityCurrency":"BTC","limitPrice":"100000","timeInForce":"GTC"}}},"WsPlaceOrderResponse":{"title":"Place Order Response","description":"Server response to a `place_order` message. Accepted responses contain a slim `order`\nacknowledgement (`id` and `clientOrderId` only). Full order state is delivered on the\norders subscription channel.\n\n`place_order_response` and subsequent `orders` channel updates may arrive out of order\non the same connection.\n","oneOf":[{"$ref":"#/components/schemas/WsPlaceOrderAcceptedResponse"},{"$ref":"#/components/schemas/WsPlaceOrderRejectedResponse"}]},"WsPlacedOrder":{"title":"Placed Order Acknowledgement","description":"Slim acknowledgement returned on accepted `place_order_response`. Contains only identity fields.","type":"object","required":["id"],"properties":{"id":{"type":"string","format":"uuid","description":"Assigned order ID."},"clientOrderId":{"type":"string","description":"Client-supplied order ID from the request."}}},"WsScheduledDate":{"type":"string","format":"date-time","description":"Date to schedule the order. If not provided, the order will be placed immediately."},"WsSide":{"type":"string","enum":["buy","sell"]},"WsSteadyPaceOrderParameters":{"type":"object","required":["interval","intervalUnit","subOrderSize"],"properties":{"interval":{"type":"integer","description":"The interval for the SteadyPace order, specified in conjunction with the interval unit."},"intervalUnit":{"type":"string","description":"The unit of time for the interval. Defaults to \"minute\".","enum":["second","minute","hour"]},"subOrderSize":{"type":"string","format":"decimal","description":"The size of each sub-order in the SteadyPace order."},"variance":{"type":"string","format":"decimal","description":"Optional degree of randomization for sub-order sizes. Accepts a decimal value rounded to two decimal places between 0 and 1, representing the variation in the size of each sub-order.\nFor example, a value of 0.20 indicates a 20% variance in sub-order sizes.\n"}}},"WsSubscriptionResponse":{"title":"Subscription Response","description":"Sent by the server after every subscribe or unsubscribe request to confirm the outcome.\nClients should handle this message type to detect whether a subscription was accepted,\nalready active, or released.\n","type":"object","required":["type","channel","status"],"properties":{"type":{"type":"string","description":"Always \"subscription_response\".","enum":["subscription_response"]},"channel":{"type":"string","description":"The channel the subscription applies to (\"orders\" or \"level2\").","enum":["orders","level2"]},"status":{"type":"string","description":"Outcome of the subscribe/unsubscribe request:\n- `subscribed` — subscription was accepted and is now active.\n- `already_subscribed` — (orders channel only) a subscription for this accountId was already active; no duplicate was created. For the level2 channel, duplicate subscribe requests return an error instead, because `includeCumulative` is fixed for the lifetime of a subscription and cannot be changed without unsubscribing first.\n- `unsubscribed` — subscription was successfully removed.\n","enum":["subscribed","already_subscribed","unsubscribed"]},"accountId":{"$ref":"#/components/schemas/WsAccountId"},"productId":{"type":"string","description":"The product ID, present for level2 subscriptions.","example":"TBTC-TUSD*"},"session_id":{"type":"string","description":"The session ID for this WebSocket connection."}},"example":{"type":"subscription_response","channel":"orders","status":"subscribed","accountId":"f230fdebfa084ffebc7e00515f54603f"}},"WsSystemMessage":{"title":"System Message","description":"Sent immediately after the WebSocket connection is established.","type":"object","required":["type","status"],"properties":{"type":{"type":"string","enum":["system"]},"status":{"type":"string","description":"Connection status.","enum":["connected"]},"session_id":{"type":"string","description":"Session ID for this WebSocket connection."}},"example":{"type":"system","status":"connected","session_id":"3f2504e0-4f89-11d3-9a0c-0305e82c3301"}},"WsTWAPOrderParameters":{"type":"object","properties":{"isTimeSliced":{"type":"boolean","description":"The isTimeSliced field when provided determines the order's time slicing behavior:\n- If isTimeSliced is set to true, the order will be executed using a time-sliced strategy.\n- If isTimeSliced is set to false, the order will be executed using a regular TWAP strategy without time slicing.\n- If isTimeSliced is not specified, the default behavior uses a regular TWAP strategy without time slicing.\n"},"boundsControl":{"type":"string","description":"The boundsControl field when provided determines how strictly the TWAP order adheres to its target fill progression.\nThis parameter only applies to regular TWAP orders. It is not supported for TimeSliced orders and will be ignored if provided.\n- narrow - within 3% or 3 minutes\n- standard - within 5% or 5 minutes\n- wide - within 7.5% or 7.5 minutes\n- If boundsControl is not specified, the default behavior is `standard`.\n","enum":["narrow","standard","wide"]}}},"WsTradeBaseOrder":{"type":"object","properties":{"channel":{"type":"string","description":"The channel you are subscribed to.","example":"orders"},"time":{"type":"string","format":"date-time"},"creationDate":{"type":"string","format":"date-time"},"completionDate":{"type":"string","format":"date-time"},"settleDate":{"type":"string","format":"date-time"},"scheduledDate":{"$ref":"#/components/schemas/WsScheduledDate"},"lastFillDate":{"type":"string","format":"date-time"},"accountId":{"$ref":"#/components/schemas/WsAccountId"},"clientOrderId":{"$ref":"#/components/schemas/WsClientOrderId"},"orderId":{"type":"string","description":"The ID of the order.","example":"14db12f5-4d3d-4fd8-8ced-062aa81bb4bc"},"product":{"type":"string","description":"Product name.","example":"BTC-USD"},"fundingType":{"$ref":"#/components/schemas/WsFundingType"},"status":{"$ref":"#/components/schemas/WsOrderStatus"},"execType":{"type":"string","description":"The type of update, using FIX 4.4 ExecType (tag 150) values.\nUse this field to distinguish order status updates from fill events.\n\n- `F` (Trade) — a fill occurred; check `tradeId`, `fillQuantity`, `fillPrice` for fill details\n- `0` (New) — order accepted by the exchange\n- `A` (Pending New) — order submitted, awaiting acceptance\n- `6` (Pending Cancel) — cancel request sent\n- `4` (Canceled) — order canceled\n- `8` (Rejected) — order rejected or internal failure\n- `I` (Order Status) — terminal status summary (e.g. completed)\n","example":"F"},"type":{"$ref":"#/components/schemas/WsOrderType"},"side":{"$ref":"#/components/schemas/WsSide"},"quantity":{"type":"string","format":"decimal","description":"The specified quantity.","example":25.07},"quantityCurrency":{"type":"string","description":"The specified quantity currency.","example":"USD"},"cumulativeQuantity":{"type":"string","format":"decimal","description":"The total base quantity filled for the order.","example":0.0123},"cumulativeQuoteQuantity":{"type":"string","format":"decimal","description":"The total quote quantity filled for the order.","example":49.99},"leavesQuantity":{"type":"string","format":"decimal","description":"For orders created with base currency, this field is set to the remaining unfilled base quantity.\n\n- Only one of leavesQuantity or leavesQuoteQuantity will be set.\n- This field is set to null for orders created with quote currency.\n","example":0.0068},"leavesQuoteQuantity":{"type":"string","format":"decimal","description":"For orders created with quote currency, this field is set to the remaining unfilled quote quantity.\n\n- Only one of leavesQuantity or leavesQuoteQuantity will be set.\n- This field is set to null for orders created with base currency.\n","example":23.12},"averagePrice":{"type":"string","format":"decimal","description":"The average price for the order's fills."},"tradeId":{"type":"string","description":"The ID of the trade.","example":"14db12f5-4d3d-4fd8-8ced-062aa81bb4bc"},"fillQuantity":{"type":"string","format":"decimal","description":"The quantity of the fill for the trade.","example":0.5},"fillPrice":{"type":"string","format":"decimal","description":"The price of the fill for the trade.","example":7090.1},"source":{"type":"string","description":"The originating channel for the order.\n- `api_fix` — order placed via FIX 4.4 session\n- `api_rest` — order placed via REST API\n- `api_websocket` — order placed via WebSocket API\n","example":"api_websocket"},"triggerPrice":{"type":"string","format":"decimal","nullable":true,"description":"Stop/trigger price for stop and stop-limit orders. Null for other order types.","example":"80000.00"},"limitPrice":{"type":"string","format":"decimal","nullable":true,"description":"Limit price for limit, TWAP-with-limit, and SteadyPace-with-limit orders. Null when not set.","example":"85000.00"},"timeInForce":{"type":"string","nullable":true,"description":"Time-in-force (`1` GTC, `3` IOC, `4` FOK, `6` GTD). Null when not set.\n","example":"1"},"duration":{"type":"integer","nullable":true,"description":"Order duration in seconds for TWAP and SteadyPace orders. Null for other order types.","example":300},"twapInterval":{"type":"integer","nullable":true,"description":"TWAP slice interval in minutes when `isTimeSliced` is true.\nNull for non-TWAP orders and when not time-sliced.\n","example":5},"isTimeSliced":{"type":"boolean","nullable":true,"description":"TWAP time-slicing flag. Null for non-TWAP orders.\nWhen true, use `twapInterval`; when false, `boundsControl` may be set instead.\n","example":true},"boundsControl":{"type":"string","nullable":true,"description":"TWAP bounds control (`narrow`, `standard`, `wide`) for non-time-sliced TWAP orders.\nNull for time-sliced TWAP and non-TWAP orders.\n","example":"standard"},"interval":{"type":"integer","nullable":true,"description":"SteadyPace interval length. Null for non-SteadyPace orders.","example":60},"intervalUnit":{"type":"string","nullable":true,"description":"SteadyPace interval unit (`second`, `minute`, `hour`). Null for non-SteadyPace orders.\n","example":"second"},"subOrderSize":{"type":"string","format":"decimal","nullable":true,"description":"SteadyPace sub-order size. Null for non-SteadyPace orders.","example":"2"},"variance":{"type":"string","format":"decimal","nullable":true,"description":"Optional SteadyPace sub-order size variance (0–1). Null for non-SteadyPace orders.\n","example":"0.1"}}},"WsTradeOrdersRequest":{"title":"Orders","description":"Subscribe or unsubscribe to order events for a specific account.\n\nMultiple subscriptions are supported on a single connection — send separate subscribe\nmessages for each accountId. Each subscribe/unsubscribe triggers a `subscription_response`\nmessage confirming the outcome.\n\n**Behavior changes (previously silent, now explicit):**\n- Subscribing to an already-subscribed accountId returns status `already_subscribed` instead of being silently ignored.\n- Unsubscribing from an accountId that is not currently subscribed returns an error message instead of being silently ignored.\n","required":["type","channel","accountId"],"type":"object","properties":{"type":{"type":"string","description":"The event type (\"subscribe\" or \"unsubscribe\")","enum":["subscribe","unsubscribe"]},"channel":{"type":"string","description":"The subscription channel for order events (\"orders\")","enum":["orders"]},"accountId":{"$ref":"#/components/schemas/WsAccountId"}},"example":{"type":"subscribe","channel":"orders","accountId":"f230fdebfa084ffebc7e00515f54603f"}},"WsTradeOrdersResponse":{"title":"Orders Response","oneOf":[{"$ref":"#/components/schemas/WsOrderCreated"},{"$ref":"#/components/schemas/WsFillUpdated"},{"$ref":"#/components/schemas/WsOrderCompleted"},{"$ref":"#/components/schemas/WsOrderCanceled"},{"$ref":"#/components/schemas/WsOrderError"}]},"WsTriggerPrice":{"type":"string","format":"decimal","description":"The trigger price for stop orders. When the market reaches this price, the stop order is activated.\n- For buy stop-limit orders, `triggerPrice` must be less than or equal to `limitPrice`.\n- For sell stop-limit orders, `triggerPrice` must be greater than or equal to `limitPrice`.\n- It always refers to the quote currency.\n","example":"50000.00"}},"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"Access Token","description":"BitGo access token"}}},"x-governance":{"version":"1.0"},"x-tagGroups":[{"name":"API reference","tags":["Trade WebSocket"]}]}