WhiteBIT · AsyncAPI Specification

WhiteBit Place Margin Stop-Market Order

Version 1.0.0

Place a margin or futures stop-market order over the WebSocket connection. This is the workhorse protective stop: the trigger fires a margin market order. Because `amount` is [stock](/glossary#stock), a stop that closes a position takes the position size directly.

View Spec View on GitHub CompanyCryptocurrencyExchangeTradingWebSocketAsyncAPIEventsWebSockets

Channels

/ws
Margin and futures stop-market order placement channel

Messages

✉
collateralOrderStopMarketPlaceRequest
Place margin stop-market order
Place a margin or futures stop-market order
✉
collateralOrderStopMarketPlaceResponse
Place Margin Stop-Market Order Response
Accepted conditional order (status OPEN, not activated)

Servers

wss
production
WhiteBIT Global Server
wss
eu
WhiteBIT EU Server

AsyncAPI Specification

Raw ↑
asyncapi: 3.0.0
info:
  title: WhiteBit Place Margin Stop-Market Order
  version: 1.0.0
  description: |
    Place a margin or futures stop-market order over the WebSocket connection.

    This is the workhorse protective stop: the trigger fires a margin market order. Because
    `amount` is [stock](/glossary#stock), a stop that closes a position takes the position size
    directly.
  x-auth-required: true
  x-rate-limits:
    connections-per-minute: 1000
    order-placements-per-10-seconds: 10000
  x-error-codes:
    - code: 19
      message: market is not margin market
      description: "The method was called on a spot-only market. Use the spot `order_*` equivalent there."
    - code: 101
      message: activation price should not be equal to the last price
      description: "The activation price equals the current last price. Move the trigger to either side of it."
    - code: 103
      message: max num margin stop market orders
      description: "The per-market ceiling on conditional orders held by one user was reached. Cancel an existing stop before placing another."
    - code: 251
      message: activation price is out of bands
      description: "The activation price falls outside the market price bands."
    - code: 115
      message: order would result in a new position in the opposite direction
      description: "A reduce-only order would flip the position instead of shrinking it."
    - code: 116
      message: margin order with reduce only is rejected
      description: "The order carries `reduce_only` but nothing is open on that side."
    - code: 114
      message: order's position side does not match user's setting
      description: "`position_side` was sent (as non-`BOTH`) without hedge mode enabled, or was omitted or sent as `BOTH` while hedge mode is enabled, or otherwise does not match the account setting."

servers:
  production:
    host: wss.whitebit.com
    protocol: wss
    description: WhiteBIT Global Server
  eu:
    host: api.whitebit.eu
    protocol: wss
    description: WhiteBIT EU Server

channels:
  /ws:
    address: /ws
    description: Margin and futures stop-market order placement channel
    messages:
      collateralOrderStopMarketPlaceRequest:
        $ref: '#/components/messages/collateralOrderStopMarketPlaceRequest'
      collateralOrderStopMarketPlaceResponse:
        $ref: '#/components/messages/collateralOrderStopMarketPlaceResponse'

operations:
  sendCollateralOrderStopMarketPlaceRequest:
    action: receive
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/collateralOrderStopMarketPlaceRequest'

  receiveCollateralOrderStopMarketPlaceResponse:
    action: send
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/collateralOrderStopMarketPlaceResponse'

components:
  messages:
    collateralOrderStopMarketPlaceRequest:
      name: CollateralOrderStopMarketPlaceRequest
      title: Place margin stop-market order
      summary: Place a margin or futures stop-market order
      payload:
        $ref: '#/components/schemas/CollateralOrderStopMarketPlaceRequest'
      examples:
        - name: collateralOrderStopMarketPlaceSell
          summary: |
            Place a sell stop-market order with parameters:
            - params[0]: order object with market, side, amount, and activation_price
          payload:
            id: 500013
            method: collateral_order_stop_market_place
            params:
              - market: BTC_PERP
                side: sell
                amount: "0.001"
                activation_price: "63385.76"
                stp: "no"

    collateralOrderStopMarketPlaceResponse:
      name: CollateralOrderStopMarketPlaceResponse
      title: Place Margin Stop-Market Order Response
      summary: Accepted conditional order (status OPEN, not activated)
      payload:
        $ref: '#/components/schemas/CollateralOrderStopMarketPlaceResponse'
      examples:
        - name: collateralOrderStopMarketPlaceAccepted
          summary: Protective stop waiting below the market
          payload:
            id: 500013
            result:
              id: 2423735886307
              market: BTC_PERP
              type: 10
              side: 1
              post_only: false
              ioc: false
              reduce_only: false
              position_side: BOTH
              ctime: 1786452692.167474
              mtime: 1786452692.167474
              activation_price: "63385.76"
              activation_condition: lte
              activated: 0
              price: "0"
              amount: "0.001"
              left: "0.001"
              deal_stock: "0"
              deal_money: "0"
              deal_fee: "0"
              client_order_id: ""
              stp: "no"
              status: OPEN
            error: null

  schemas:
    CollateralOrderStopMarketPlaceRequest:
      type: object
      required:
        - id
        - method
        - params
      properties:
        id:
          type: integer
          description: Unique request identifier. The response echoes this value.
        method:
          type: string
          const: collateral_order_stop_market_place
          description: "Method name. Fixed value: `collateral_order_stop_market_place`."
        params:
          type: array
          minItems: 1
          maxItems: 1
          items:
            $ref: '#/components/schemas/CollateralOrderStopMarketPlaceParams'
          description: Array containing exactly one order parameter object

    CollateralOrderStopMarketPlaceParams:
      type: object
      required:
        - market
        - side
        - amount
        - activation_price
      properties:
        market:
          type: string
          description: "Margin or futures market name. A spot-only market is rejected with error `19`."
          example: BTC_PERP
        side:
          type: string
          enum: ["buy", "sell"]
          description: "Order side. The response reports the side numerically: `1` for sell, `2` for buy."
        amount:
          type: string
          description: "Order size in stock, at the market stock precision. A stop that closes a position takes the position size directly."
          example: "0.001"
        activation_price:
          type: string
          description: "Trigger price, validated against the market price bands. Outside them the call returns error `251`."
          example: "63385.76"
        reduce_only:
          type: boolean
          description: "Restrict the order to shrinking an existing position. Recommended for protective stops."
        position_side:
          type: string
          enum: ["BOTH", "LONG", "SHORT"]
          description: "Position leg in hedge mode; futures markets only. `BOTH` in one-way mode. Optional at the request layer but functionally required in hedge mode — omitting it, or sending `BOTH`, is rejected with error `114`."
        client_order_id:
          type: string
          description: "Custom client order id, echoed on the response. Must be unique among active orders — a collision returns error `43`."
        stp:
          type: string
          enum: ["no", "co", "cn", "cb"]
          description: "Self-trade prevention mode applied to the order created on activation. Defaults to `no` when omitted."

    CollateralOrderStopMarketPlaceResponse:
      type: object
      required:
        - id
        - result
        - error
      properties:
        id:
          type: integer
          description: Request identifier matching the request
        result:
          type: object
          description: "Accepted conditional order with `price` `\"0\"`. A margin stop-market order reports `type` `10`."
        error:
          type: "null"
          description: Error object (null on success)

Work with this as data

Every AsyncAPI spec here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for asyncapi

4 MCP tools reach this
  • find_asyncapisBrowse and filter every AsyncAPI spec in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This AsyncAPI spec
curl "https://apis.io/api/v1/asyncapis/whitebit-private-collateral-order-stop-market-place-asyncapi"
All asyncapi
curl "https://apis.io/api/v1/asyncapis?limit=25"

Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.