> ## Documentation Index
> Fetch the complete documentation index at: https://docs.whitebit.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cancel conditional order

> Cancel an active conditional order on a collateral trading market via the WhiteBIT V4 API.

* [Query unexecuted conditional orders](/api-reference/collateral-trading/query-unexecuted-conditional-orders) — List active conditional orders before cancellation
* [Query unexecuted OCO orders](/api-reference/collateral-trading/query-unexecuted-oco-orders) — List active OCO orders
* [Create collateral OCO order](/api-reference/collateral-trading/create-collateral-oco-order) — Create a new OCO order
* [Open positions](/api-reference/collateral-trading/open-positions) — View current open positions


## OpenAPI

````yaml /openapi/private/http-trade-v4.yaml POST /api/v4/order/conditional-cancel
openapi: 3.0.3
info:
  title: Private HTTP API V4 - Collateral Trading
  description: |
    WhiteBIT Private HTTP API V4 for collateral/margin trading operations.

    Base URL: https://whitebit.com

    All endpoints return time in Unix-time format.
    All endpoints return either a JSON object or array.
    For receiving responses from API calls please use http method POST.

    Authentication required for all endpoints.
  version: 4.0.0
  license:
    name: WhiteBIT Terms of Service
    url: https://whitebit.com/terms
servers:
  - url: https://whitebit.com
    description: WhiteBIT Global Server
  - url: https://whitebit.eu
    description: WhiteBIT EU Server
security:
  - ApiKeyAuth: []
    PayloadAuth: []
    SignatureAuth: []
tags:
  - name: Collateral Trading
    description: Endpoints for collateral/margin trading operations
  - name: Spot Trading
    description: Endpoints for spot trading operations
  - name: Market Fee
    description: Endpoints for querying trading fees
paths:
  /api/v4/order/conditional-cancel:
    post:
      tags:
        - Collateral Trading
      summary: Cancel conditional order
      description: >
        The endpoint cancels an active conditional order
        ([OCO](/glossary#one-cancels-the-other-oco) or
        [OTO](/glossary#one-triggers-the-other-oto)) on the specified market.
        Both legs of the conditional order are cancelled. Use the [query
        unexecuted conditional
        orders](/api-reference/collateral-trading/query-unexecuted-conditional-orders)
        endpoint to obtain the conditional order `id` before cancellation.


        <Warning>

        Rate limit: 10000 requests/10 sec.

        </Warning>


        <Accordion title="Error Codes">
          - `30` - default validation error code
          - `31` - market validation failed
          - `2` - conditional order not found. Returned whether the `id` does not exist, or the order was already filled or already cancelled — these cases are not distinguished
        </Accordion>


        <Accordion title="Errors">

        ```json

        {
          "code": 2,
          "message": "Inner validation failed",
          "errors": {
            "id": ["Unexecuted order was not found."]
          }
        }

        ```

        </Accordion>
      operationId: cancelConditionalOrder
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - market
                - id
                - request
                - nonce
              properties:
                market:
                  type: string
                  description: 'Market of the conditional order to cancel. Example: BTC_USDT'
                  example: BTC_USDT
                id:
                  type: integer
                  description: >-
                    Conditional order identifier. Obtain from the [query
                    unexecuted conditional
                    orders](/api-reference/collateral-trading/query-unexecuted-conditional-orders)
                    endpoint.
                  example: 117703764514
                request:
                  type: string
                  example: '{{request}}'
                nonce:
                  type: integer
                  example: 1594297865000
            example:
              market: BTC_USDT
              id: 117703764514
              request: '{{request}}'
              nonce: 1594297865000
      responses:
        '200':
          description: Order cancelled
        '400':
          description: Inner validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '503':
          description: Service temporarily unavailable
      security:
        - ApiKeyAuth: []
          PayloadAuth: []
          SignatureAuth: []
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        code:
          type: integer
          description: Error code
          example: 30
        message:
          type: string
          description: Error message
          example: Validation failed
        errors:
          type: object
          additionalProperties:
            type: array
            items:
              type: string
          description: Detailed error information
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-TXC-APIKEY
      description: The public WhiteBIT API key.
    PayloadAuth:
      type: apiKey
      in: header
      name: X-TXC-PAYLOAD
      description: Base64-encoded JSON request body.
    SignatureAuth:
      type: apiKey
      in: header
      name: X-TXC-SIGNATURE
      description: >-
        HMAC-SHA512 signature of the payload, hex-encoded. Computed as
        hex(HMAC-SHA512(payload, api_secret)).

````