> ## 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.

# Query unexecuted (active) OCO orders

> List active OCO orders not yet fully executed on collateral markets via the V4 API.

* [Query unexecuted conditional orders](/api-reference/collateral-trading/query-unexecuted-conditional-orders) — List active conditional orders
* [Create collateral OCO order](/api-reference/collateral-trading/create-collateral-oco-order) — Create a new OCO order
* [Cancel conditional order](/api-reference/collateral-trading/cancel-conditional-order) — Cancel an active conditional order
* [Collateral limit order](/api-reference/collateral-trading/collateral-limit-order) — Place a collateral limit order


## OpenAPI

````yaml /openapi/private/http-trade-v4.yaml POST /api/v4/oco-orders
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/oco-orders:
    post:
      tags:
        - Collateral Trading
      summary: Query unexecuted(active) OCO orders
      description: >
        The endpoint returns active (unexecuted)
        [OCO](/glossary#one-cancels-the-other-oco) orders for the authenticated
        account. Each OCO order contains a `stop_loss` and `take_profit` leg.
        When one leg executes, the system cancels the other automatically. Use
        the optional `market` parameter to filter results.


        <Warning>

        Rate limit: 12000 requests/10 sec.

        </Warning>


        <Note>

        This endpoint supports pagination. Use `limit` (default: 50) and
        `offset` (default: 0) to page through results. The response does not
        include a `total` field — detect the last page when fewer than `limit`
        OCO orders are returned. An empty array means you have paged past the
        end; receiving exactly `limit` orders does not guarantee that another
        page exists.

        </Note>


        <Accordion title="Error Codes">
          - `30` - default validation error code (invalid pagination — `limit` outside 1–100 or negative `offset`)
          - `31` - market validation failed (the `market` filter is unknown or not available for collateral trading)
        </Accordion>
      operationId: getOcoOrders
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                market:
                  type: string
                  description: |
                    Filter by specific market. Example: BTC_USDT

                    If not specified, returns OCO orders for all markets.
                  example: BTC_USDT
                offset:
                  type: integer
                  description: Number of records to skip for pagination.
                  default: 0
                  example: 0
                limit:
                  type: integer
                  description: Maximum number of records to return per page.
                  default: 50
                  example: 100
                request:
                  type: string
                  example: '{{request}}'
                nonce:
                  type: integer
                  example: 1594297865000
            example:
              market: BTC_USDT
              offset: 0
              limit: 100
      responses:
        '200':
          description: Successful response - returns array of active OCO orders
          content:
            application/json:
              schema:
                type: array
                description: Array of active OCO orders
                items:
                  type: object
                  properties:
                    id:
                      type: integer
                      description: OCO order identifier
                      example: 117703764513
                    stop_loss:
                      type: object
                      description: Stop loss order details
                      properties:
                        orderId:
                          type: integer
                          example: 117703764514
                        clientOrderId:
                          type: string
                          example: ''
                        market:
                          type: string
                          example: BTC_USDT
                        side:
                          type: string
                          enum:
                            - buy
                            - sell
                          example: buy
                        type:
                          type: string
                          example: stop limit
                        timestamp:
                          type: number
                          example: 1594605801.49815
                        dealMoney:
                          type: string
                          example: '0'
                        dealStock:
                          type: string
                          example: '0'
                        amount:
                          type: string
                          example: '2.241379'
                        takerFee:
                          type: string
                          example: '0.001'
                        makerFee:
                          type: string
                          example: '0.001'
                        left:
                          type: string
                          example: '2.241379'
                        dealFee:
                          type: string
                          example: '0'
                        post_only:
                          type: boolean
                          example: false
                        mtime:
                          type: number
                          example: 1662478154.941582
                        price:
                          type: string
                          example: '19928.79'
                        activation_price:
                          type: string
                          example: '29928.79'
                        activation_condition:
                          type: string
                          description: >
                            Trigger condition derived from `side`
                            (response-only, cannot be overridden): `buy` →
                            `gte`, `sell` → `lte`.
                          enum:
                            - gte
                            - lte
                          example: gte
                        activated:
                          type: integer
                          example: 0
                        status:
                          type: string
                          example: FILLED
                        stp:
                          type: string
                          example: 'no'
                    take_profit:
                      type: object
                      description: Take profit order details
                      properties:
                        orderId:
                          type: integer
                          example: 117703764515
                        clientOrderId:
                          type: string
                          example: ''
                        market:
                          type: string
                          example: BTC_USDT
                        side:
                          type: string
                          enum:
                            - buy
                            - sell
                          example: buy
                        type:
                          type: string
                          example: limit
                        timestamp:
                          type: number
                          example: 1662478154.941582
                        dealMoney:
                          type: string
                          example: '0'
                        dealStock:
                          type: string
                          example: '0'
                        amount:
                          type: string
                          example: '0.635709'
                        takerFee:
                          type: string
                          example: '0.001'
                        makerFee:
                          type: string
                          example: '0.001'
                        left:
                          type: string
                          example: '0.635709'
                        dealFee:
                          type: string
                          example: '0'
                        post_only:
                          type: boolean
                          example: false
                        mtime:
                          type: number
                          example: 1662478154.941582
                        price:
                          type: string
                          example: '9928.79'
                        status:
                          type: string
                          example: FILLED
                        stp:
                          type: string
                          example: 'no'
              example:
                - id: 117703764513
                  stop_loss:
                    orderId: 117703764514
                    clientOrderId: ''
                    market: BTC_USDT
                    side: buy
                    type: stop limit
                    timestamp: 1594605801.49815
                    dealMoney: '0'
                    dealStock: '0'
                    amount: '2.241379'
                    takerFee: '0.001'
                    makerFee: '0.001'
                    left: '2.241379'
                    dealFee: '0'
                    post_only: false
                    mtime: 1662478154.941582
                    price: '19928.79'
                    activation_price: '29928.79'
                    activation_condition: gte
                    activated: 0
                    status: FILLED
                    stp: 'no'
                  take_profit:
                    orderId: 117703764515
                    clientOrderId: ''
                    market: BTC_USDT
                    side: buy
                    type: limit
                    timestamp: 1662478154.941582
                    dealMoney: '0'
                    dealStock: '0'
                    amount: '0.635709'
                    takerFee: '0.001'
                    makerFee: '0.001'
                    left: '0.635709'
                    dealFee: '0'
                    post_only: false
                    mtime: 1662478154.941582
                    price: '9928.79'
                    status: FILLED
                    stp: 'no'
        '400':
          description: Inner validation failed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Request 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)).

````