{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hitbtc/json-schema/hitbtc-trading-replace-order-request-schema.json",
  "title": "Replace order request",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hitbtc-futures-orders-api-openapi.yml#/components/schemas/trading_ReplaceOrderRequest",
  "oneOf": [
    {
      "$ref": "#/$defs/trading_LimitReplaceOrderRequest"
    },
    {
      "$ref": "#/$defs/trading_MarketReplaceOrderRequest"
    },
    {
      "$ref": "#/$defs/trading_StopLimitReplaceOrderRequest"
    },
    {
      "$ref": "#/$defs/trading_StopMarketReplaceOrderRequest"
    },
    {
      "$ref": "#/$defs/trading_TakeProfitLimitReplaceOrderRequest"
    },
    {
      "$ref": "#/$defs/trading_TakeProfitMarketReplaceOrderRequest"
    }
  ],
  "$defs": {
    "trading_LimitReplaceOrderRequest": {
      "title": "Limit order",
      "allOf": [
        {
          "$ref": "#/$defs/trading_ReplaceOrderRequestBase"
        },
        {
          "$ref": "#/$defs/trading_PriceRequest"
        }
      ]
    },
    "trading_MarketReplaceOrderRequest": {
      "title": "Market order",
      "allOf": [
        {
          "$ref": "#/$defs/trading_ReplaceOrderRequestBase"
        }
      ]
    },
    "trading_NewOrderClientId": {
      "title": "Order client ID",
      "type": "object",
      "properties": {
        "new_client_order_id": {
          "type": "string",
          "minLength": 8,
          "maxLength": 32,
          "pattern": "^[a-zA-Z0-9_\\-]{8,32}$",
          "description": "Client-provided identifier of a new order placed or parked instead of the canceled one.\n\n⚠️ Uniqueness must be guaranteed until the last order with the same `client_order_id` becomes inactive (canceled, expired, or fully executed) and some time after that.\n\nℹ️ If omitted, will be generated by the system.\n"
        }
      }
    },
    "trading_PriceRequest": {
      "title": "Price",
      "type": "object",
      "required": [
        "price"
      ],
      "properties": {
        "price": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "Order price."
        }
      }
    },
    "trading_QuantityRequest": {
      "title": "Quantity",
      "type": "object",
      "required": [
        "quantity"
      ],
      "properties": {
        "quantity": {
          "type": "string",
          "exclusiveMinimum": 0,
          "description": "Order quantity."
        }
      }
    },
    "trading_ReplaceOrderRequestBase": {
      "title": "Replace order request",
      "allOf": [
        {
          "$ref": "#/$defs/trading_StrictValidateRequest"
        },
        {
          "$ref": "#/$defs/trading_NewOrderClientId"
        },
        {
          "$ref": "#/$defs/trading_QuantityRequest"
        }
      ]
    },
    "trading_StopLimitReplaceOrderRequest": {
      "title": "Stop limit order",
      "allOf": [
        {
          "$ref": "#/$defs/trading_ReplaceOrderRequestBase"
        },
        {
          "$ref": "#/$defs/trading_PriceRequest"
        },
        {
          "$ref": "#/$defs/trading_StopPriceRequest"
        }
      ]
    },
    "trading_StopMarketReplaceOrderRequest": {
      "title": "Stop market order",
      "allOf": [
        {
          "$ref": "#/$defs/trading_ReplaceOrderRequestBase"
        },
        {
          "$ref": "#/$defs/trading_StopPriceRequest"
        }
      ]
    },
    "trading_StopPriceRequest": {
      "title": "Stop price",
      "type": "object",
      "properties": {
        "stop_price": {
          "type": "number",
          "exclusiveMinimum": 0,
          "description": "The price level that triggers order activation."
        }
      }
    },
    "trading_StrictValidateRequest": {
      "title": "Strict validate",
      "type": "object",
      "properties": {
        "strict_validate": {
          "type": "boolean",
          "description": "Price and quantity will be checked for incrementation within the symbol tick size and quantity step (see the symbol `tick_size` and `quantity_increment`).",
          "default": false
        }
      }
    },
    "trading_TakeProfitLimitReplaceOrderRequest": {
      "title": "Take-profit limit order",
      "allOf": [
        {
          "$ref": "#/$defs/trading_ReplaceOrderRequestBase"
        },
        {
          "$ref": "#/$defs/trading_PriceRequest"
        },
        {
          "$ref": "#/$defs/trading_StopPriceRequest"
        }
      ]
    },
    "trading_TakeProfitMarketReplaceOrderRequest": {
      "title": "Take-profit market order",
      "allOf": [
        {
          "$ref": "#/$defs/trading_ReplaceOrderRequestBase"
        },
        {
          "$ref": "#/$defs/trading_StopPriceRequest"
        }
      ]
    }
  }
}