WhiteBIT · AsyncAPI Specification

WhiteBit Cancel Conditional Order Group

Version 1.0.0

Cancel an OCO or OTO group in one call. Pass the group id from the placement response and every leg is withdrawn atomically. The response mirrors the placement response — same shape, same `type` value — with every leg reporting `CANCELED`. Plain stop orders and TPSL legs are not accepted here. Cancel those with `order_cancel`.

View Spec View on GitHub CompanyCryptocurrencyExchangeTradingWebSocketAsyncAPIEventsWebSockets

Channels

/ws
Conditional order group cancellation channel

Messages

✉
orderCancelConditionalRequest
Cancel conditional group
Cancel an OCO or OTO group by group id
✉
orderCancelConditionalResponse
Cancel Conditional Group Response
Group object with every leg CANCELED

Servers

wss
production
WhiteBIT Global Server
wss
eu
WhiteBIT EU Server

AsyncAPI Specification

Raw ↑
asyncapi: 3.0.0
info:
  title: WhiteBit Cancel Conditional Order Group
  version: 1.0.0
  description: |
    Cancel an OCO or OTO group in one call.

    Pass the group id from the placement response and every leg is withdrawn atomically. The
    response mirrors the placement response — same shape, same `type` value — with every leg
    reporting `CANCELED`.

    Plain stop orders and TPSL legs are not accepted here. Cancel those with `order_cancel`.
  x-auth-required: true
  x-rate-limits:
    connections-per-minute: 1000
    requests-per-10-seconds: 12000
  x-error-codes:
    - code: 6
      message: order not found
      description: "The id is unknown, the group already finished, or the id belongs to a plain stop order or a TPSL leg. Cancel those with `order_cancel`."
    - code: 1
      message: invalid argument
      description: "The `order_id` parameter is missing. This method has no `client_order_id` form."
    - code: 19
      message: market is not margin market
      description: "Groups exist on margin and futures markets only."

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: Conditional order group cancellation channel
    messages:
      orderCancelConditionalRequest:
        $ref: '#/components/messages/orderCancelConditionalRequest'
      orderCancelConditionalResponse:
        $ref: '#/components/messages/orderCancelConditionalResponse'

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

  receiveOrderCancelConditionalResponse:
    action: send
    channel:
      $ref: '#/channels/~1ws'
    messages:
      - $ref: '#/channels/~1ws/messages/orderCancelConditionalResponse'

components:
  messages:
    orderCancelConditionalRequest:
      name: OrderCancelConditionalRequest
      title: Cancel conditional group
      summary: Cancel an OCO or OTO group by group id
      payload:
        $ref: '#/components/schemas/OrderCancelConditionalRequest'
      examples:
        - name: orderCancelConditionalOco
          summary: |
            Cancel an OCO group with parameters:
            - params[0]: object with market and the group order_id
          payload:
            id: 500021
            method: order_cancel_conditional
            params:
              - market: BTC_PERP
                order_id: 2423735892717

    orderCancelConditionalResponse:
      name: OrderCancelConditionalResponse
      title: Cancel Conditional Group Response
      summary: Group object with every leg CANCELED
      payload:
        $ref: '#/components/schemas/OrderCancelConditionalResponse'
      examples:
        - name: orderCancelConditionalCanceled
          summary: Both legs canceled in one atomic event, sharing one mtime
          payload:
            id: 500021
            result:
              type: oco
              id: 2423735892717
              stop_loss:
                id: 2423735892718
                type: 9
                activation_price: "63370.99"
                price: "62405.95"
                mtime: 1786452692.7629499
                status: CANCELED
              take_profit:
                id: 2423735892719
                type: 7
                price: "65301.08"
                mtime: 1786452692.7629499
                status: CANCELED
            error: null

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

    OrderCancelConditionalParams:
      type: object
      required:
        - market
        - order_id
      properties:
        market:
          type: string
          description: "Market the group lives on."
          example: BTC_PERP
        order_id:
          type: integer
          description: "Group id — the `id` inside `result` on the OCO or OTO placement response, next to the `type` value. Neither a leg id nor the frame-level `id`, which only echoes the request. No `client_order_id` form exists for this method."
          example: 2423735892717

    OrderCancelConditionalResponse:
      type: object
      required:
        - id
        - result
        - error
      properties:
        id:
          type: integer
          description: Request identifier matching the request
        result:
          type: object
          description: "Group object mirroring the placement response — same `type` value, `\"oco\"` or `\"oto\"` — with every leg reporting `status` `CANCELED`. All legs share one `mtime`, because the cancellation is a single atomic event."
        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-order-cancel-conditional-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.