{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/bloomberg-buyside-enterprise-solutions/json-schema/bloomberg-buyside-enterprise-solutions-create-order-request-schema.json",
  "title": "CreateOrderRequest",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/bloomberg-buyside-enterprise-solutions-orders-api-openapi.yml#/components/schemas/CreateOrderRequest",
  "type": "object",
  "required": [
    "security",
    "side",
    "orderType",
    "quantity"
  ],
  "properties": {
    "security": {
      "type": "string",
      "description": "Bloomberg security identifier"
    },
    "side": {
      "type": "string",
      "enum": [
        "BUY",
        "SELL",
        "SHORT_SELL",
        "BUY_TO_COVER"
      ]
    },
    "orderType": {
      "type": "string",
      "enum": [
        "MARKET",
        "LIMIT",
        "STOP",
        "STOP_LIMIT",
        "PEGGED",
        "VWAP",
        "TWAP"
      ]
    },
    "quantity": {
      "type": "number",
      "description": "Order quantity",
      "minimum": 0
    },
    "limitPrice": {
      "type": "number",
      "description": "Limit price (required for LIMIT and STOP_LIMIT orders)"
    },
    "stopPrice": {
      "type": "number",
      "description": "Stop price (required for STOP and STOP_LIMIT orders)"
    },
    "timeInForce": {
      "type": "string",
      "enum": [
        "DAY",
        "GTC",
        "IOC",
        "FOK",
        "GTD"
      ],
      "default": "DAY"
    },
    "expirationDate": {
      "type": "string",
      "format": "date",
      "description": "Expiration date (required for GTD orders)"
    },
    "portfolioId": {
      "type": "string",
      "description": "Target portfolio for allocation"
    },
    "brokerId": {
      "type": "string",
      "description": "Broker to route the order to"
    },
    "algorithm": {
      "type": "string",
      "description": "Algorithm name for algorithmic execution"
    },
    "algorithmParams": {
      "type": "object",
      "additionalProperties": true,
      "description": "Algorithm-specific parameters"
    },
    "notes": {
      "type": "string",
      "description": "Order notes or instructions"
    }
  }
}