{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/whitebit/main/json-schema/whitebit-oco-order-leg-schema.json",
  "title": "OcoOrderLeg",
  "description": "OCO order leg as returned by `/api/v4/oco-orders` and `/api/v4/order/oco-cancel`. Field names use snake_case (`post_only`, `activation_price`) — unlike the camelCase legs returned by `/api/v4/conditional-orders`.",
  "x-generated": "2026-10-13",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/whitebit-http-trade-v4-openapi.yml#/components/schemas/OcoOrderLeg",
  "type": "object",
  "properties": {
    "orderId": {
      "type": "integer",
      "description": "Order identifier"
    },
    "clientOrderId": {
      "type": "string",
      "description": "Custom order identifier. Empty string if not specified"
    },
    "market": {
      "type": "string",
      "description": "Market name"
    },
    "side": {
      "type": "string",
      "description": "Order side",
      "enum": [
        "buy",
        "sell"
      ]
    },
    "type": {
      "type": "string",
      "description": "Order type"
    },
    "timestamp": {
      "type": "number",
      "description": "Unix timestamp in seconds (UTC) of order creation, with microsecond precision."
    },
    "dealMoney": {
      "type": "string",
      "description": "Executed amount in money"
    },
    "dealStock": {
      "type": "string",
      "description": "Executed amount in stock"
    },
    "amount": {
      "type": "string",
      "description": "Order amount"
    },
    "left": {
      "type": "string",
      "description": "Unexecuted amount in stock"
    },
    "dealFee": {
      "type": "string",
      "description": "Executed fee by deal"
    },
    "post_only": {
      "type": "boolean",
      "description": "Post-only flag"
    },
    "feeAsset": {
      "type": "string",
      "description": "Currency ticker of the asset used to pay the trading fee. Omitted when empty."
    },
    "status": {
      "type": "string",
      "description": "Order status (for example `OPEN` for an active leg, `CANCELED` after cancellation)."
    },
    "stp": {
      "type": "string",
      "description": "Self-trade prevention mode. Possible values: `no`, `cb`, `cn`, `co`. Always returned in abbreviated form, even when the request used a legacy value."
    },
    "positionSide": {
      "type": "string",
      "description": "Position side of the leg. Present on futures markets (`BOTH` in one-way mode, `LONG`/`SHORT` in hedge mode); omitted on margin-spot markets.",
      "enum": [
        "LONG",
        "SHORT",
        "BOTH"
      ]
    },
    "reduceOnly": {
      "type": "boolean",
      "description": "Reduce-only flag. When `true`, the leg can only reduce or close an existing position."
    },
    "mtime": {
      "type": "number",
      "description": "Unix timestamp in seconds (UTC), with microsecond precision, of the last time the matching engine modified the order."
    },
    "price": {
      "type": "string",
      "description": "Order price"
    },
    "activation_price": {
      "type": "string",
      "description": "Activation price. Returned on the stop-loss leg"
    },
    "activation_condition": {
      "type": "string",
      "description": "Trigger condition derived from `side` (response-only, cannot be overridden): `buy` → `gte`, `sell` → `lte`. Returned on the stop-loss leg.\n",
      "enum": [
        "gte",
        "lte"
      ]
    },
    "activated": {
      "type": "integer",
      "description": "Activation status (0 - not activated, 1 - activated). Returned on the stop-loss leg"
    }
  }
}