{
  "nota": "Mensajes de ejemplo con la forma de las API reales (subconjunto de campos, valores ficticios). Antes de programar contra una API, comprobar los campos en su documentación oficial.",
  "orden_comun": {
    "id_orden_cliente": "R00005",
    "instrumento": "ORSC",
    "cantidad": 434,
    "ejecuciones": 3
  },
  "alpaca": {
    "descripcion": "Alpaca Trading API v2: la orden (GET /v2/orders/{id}) y los mensajes del stream `trade_updates` (eventos new, partial_fill, fill)",
    "orden_final": {
      "id": "6f1c2a9e-4b7d-4c1a-9e55-000000039595",
      "client_order_id": "R00005",
      "created_at": "2025-10-14T13:35:00.805771Z",
      "updated_at": "2025-10-14T13:35:04.441387Z",
      "submitted_at": "2025-10-14T13:35:00.835677Z",
      "filled_at": "2025-10-14T13:35:04.441387Z",
      "expired_at": null,
      "canceled_at": null,
      "failed_at": null,
      "replaced_at": null,
      "replaced_by": null,
      "replaces": null,
      "asset_id": "b0b6dd9d-8b9b-48a9-ba46-b9d54906e415",
      "symbol": "ORSC",
      "asset_class": "us_equity",
      "notional": null,
      "qty": "434",
      "filled_qty": "434",
      "filled_avg_price": "234.8353",
      "order_class": "",
      "order_type": "market",
      "type": "market",
      "side": "buy",
      "position_intent": "buy_to_open",
      "time_in_force": "day",
      "limit_price": null,
      "stop_price": null,
      "status": "filled",
      "extended_hours": false,
      "legs": null,
      "trail_percent": null,
      "trail_price": null,
      "hwm": null
    },
    "trade_updates": [
      {
        "stream": "trade_updates",
        "data": {
          "event": "new",
          "timestamp": "2025-10-14T13:35:00.835677Z",
          "order": {
            "id": "6f1c2a9e-4b7d-4c1a-9e55-000000039595",
            "client_order_id": "R00005",
            "created_at": "2025-10-14T13:35:00.805771Z",
            "updated_at": "2025-10-14T13:35:00.835677Z",
            "submitted_at": "2025-10-14T13:35:00.835677Z",
            "filled_at": null,
            "expired_at": null,
            "canceled_at": null,
            "failed_at": null,
            "replaced_at": null,
            "replaced_by": null,
            "replaces": null,
            "asset_id": "b0b6dd9d-8b9b-48a9-ba46-b9d54906e415",
            "symbol": "ORSC",
            "asset_class": "us_equity",
            "notional": null,
            "qty": "434",
            "filled_qty": "0",
            "filled_avg_price": null,
            "order_class": "",
            "order_type": "market",
            "type": "market",
            "side": "buy",
            "position_intent": "buy_to_open",
            "time_in_force": "day",
            "limit_price": null,
            "stop_price": null,
            "status": "new",
            "extended_hours": false,
            "legs": null,
            "trail_percent": null,
            "trail_price": null,
            "hwm": null
          }
        }
      },
      {
        "stream": "trade_updates",
        "data": {
          "event": "partial_fill",
          "execution_id": "E710000035.01",
          "timestamp": "2025-10-14T13:35:01.024940Z",
          "price": "234.64",
          "qty": "27",
          "position_qty": "27",
          "order": {
            "id": "6f1c2a9e-4b7d-4c1a-9e55-000000039595",
            "client_order_id": "R00005",
            "created_at": "2025-10-14T13:35:00.805771Z",
            "updated_at": "2025-10-14T13:35:01.024940Z",
            "submitted_at": "2025-10-14T13:35:00.835677Z",
            "filled_at": null,
            "expired_at": null,
            "canceled_at": null,
            "failed_at": null,
            "replaced_at": null,
            "replaced_by": null,
            "replaces": null,
            "asset_id": "b0b6dd9d-8b9b-48a9-ba46-b9d54906e415",
            "symbol": "ORSC",
            "asset_class": "us_equity",
            "notional": null,
            "qty": "434",
            "filled_qty": "27",
            "filled_avg_price": "234.6400",
            "order_class": "",
            "order_type": "market",
            "type": "market",
            "side": "buy",
            "position_intent": "buy_to_open",
            "time_in_force": "day",
            "limit_price": null,
            "stop_price": null,
            "status": "partially_filled",
            "extended_hours": false,
            "legs": null,
            "trail_percent": null,
            "trail_price": null,
            "hwm": null
          }
        }
      },
      {
        "stream": "trade_updates",
        "data": {
          "event": "partial_fill",
          "execution_id": "E710000035.02",
          "timestamp": "2025-10-14T13:35:02.522061Z",
          "price": "234.85",
          "qty": "389",
          "position_qty": "416",
          "order": {
            "id": "6f1c2a9e-4b7d-4c1a-9e55-000000039595",
            "client_order_id": "R00005",
            "created_at": "2025-10-14T13:35:00.805771Z",
            "updated_at": "2025-10-14T13:35:02.522061Z",
            "submitted_at": "2025-10-14T13:35:00.835677Z",
            "filled_at": null,
            "expired_at": null,
            "canceled_at": null,
            "failed_at": null,
            "replaced_at": null,
            "replaced_by": null,
            "replaces": null,
            "asset_id": "b0b6dd9d-8b9b-48a9-ba46-b9d54906e415",
            "symbol": "ORSC",
            "asset_class": "us_equity",
            "notional": null,
            "qty": "434",
            "filled_qty": "416",
            "filled_avg_price": "234.8364",
            "order_class": "",
            "order_type": "market",
            "type": "market",
            "side": "buy",
            "position_intent": "buy_to_open",
            "time_in_force": "day",
            "limit_price": null,
            "stop_price": null,
            "status": "partially_filled",
            "extended_hours": false,
            "legs": null,
            "trail_percent": null,
            "trail_price": null,
            "hwm": null
          }
        }
      },
      {
        "stream": "trade_updates",
        "data": {
          "event": "fill",
          "execution_id": "E710000035.03",
          "timestamp": "2025-10-14T13:35:04.441387Z",
          "price": "234.81",
          "qty": "18",
          "position_qty": "434",
          "order": {
            "id": "6f1c2a9e-4b7d-4c1a-9e55-000000039595",
            "client_order_id": "R00005",
            "created_at": "2025-10-14T13:35:00.805771Z",
            "updated_at": "2025-10-14T13:35:04.441387Z",
            "submitted_at": "2025-10-14T13:35:00.835677Z",
            "filled_at": "2025-10-14T13:35:04.441387Z",
            "expired_at": null,
            "canceled_at": null,
            "failed_at": null,
            "replaced_at": null,
            "replaced_by": null,
            "replaces": null,
            "asset_id": "b0b6dd9d-8b9b-48a9-ba46-b9d54906e415",
            "symbol": "ORSC",
            "asset_class": "us_equity",
            "notional": null,
            "qty": "434",
            "filled_qty": "434",
            "filled_avg_price": "234.8353",
            "order_class": "",
            "order_type": "market",
            "type": "market",
            "side": "buy",
            "position_intent": "buy_to_open",
            "time_in_force": "day",
            "limit_price": null,
            "stop_price": null,
            "status": "filled",
            "extended_hours": false,
            "legs": null,
            "trail_percent": null,
            "trail_price": null,
            "hwm": null
          }
        }
      }
    ]
  },
  "interactive_brokers": {
    "descripcion": "Interactive Brokers con ib_async: Trade.orderStatus tras cada evento, Fill.execution y Fill.commissionReport (campos principales; `time` en UTC)",
    "orderStatus": [
      {
        "orderId": 5,
        "status": "Submitted",
        "filled": 0.0,
        "remaining": 434.0,
        "avgFillPrice": 0.0,
        "permId": 1800000005,
        "parentId": 0,
        "lastFillPrice": 0.0,
        "clientId": 7,
        "whyHeld": "",
        "mktCapPrice": 0.0
      },
      {
        "orderId": 5,
        "status": "Submitted",
        "filled": 27.0,
        "remaining": 407.0,
        "avgFillPrice": 234.64,
        "permId": 1800000005,
        "parentId": 0,
        "lastFillPrice": 234.64,
        "clientId": 7,
        "whyHeld": "",
        "mktCapPrice": 0.0
      },
      {
        "orderId": 5,
        "status": "Submitted",
        "filled": 416.0,
        "remaining": 18.0,
        "avgFillPrice": 234.8364,
        "permId": 1800000005,
        "parentId": 0,
        "lastFillPrice": 234.85,
        "clientId": 7,
        "whyHeld": "",
        "mktCapPrice": 0.0
      },
      {
        "orderId": 5,
        "status": "Filled",
        "filled": 434.0,
        "remaining": 0.0,
        "avgFillPrice": 234.8353,
        "permId": 1800000005,
        "parentId": 0,
        "lastFillPrice": 234.81,
        "clientId": 7,
        "whyHeld": "",
        "mktCapPrice": 0.0
      }
    ],
    "fills": [
      {
        "execution": {
          "execId": "0000e0d5.710000035.01",
          "time": "2025-10-14T13:35:01.024940Z",
          "acctNumber": "U-0418272",
          "exchange": "ARCA",
          "side": "BOT",
          "shares": 27.0,
          "price": 234.64,
          "permId": 1800000005,
          "clientId": 7,
          "orderId": 5,
          "liquidation": 0,
          "cumQty": 27.0,
          "avgPrice": 234.64,
          "orderRef": "R00005",
          "lastLiquidity": 2
        },
        "commissionReport": {
          "execId": "0000e0d5.710000035.01",
          "commission": 0.35,
          "currency": "USD",
          "realizedPNL": 0.0
        }
      },
      {
        "execution": {
          "execId": "0000e0d5.710000035.02",
          "time": "2025-10-14T13:35:02.522061Z",
          "acctNumber": "U-0418272",
          "exchange": "ARCA",
          "side": "BOT",
          "shares": 389.0,
          "price": 234.85,
          "permId": 1800000005,
          "clientId": 7,
          "orderId": 5,
          "liquidation": 0,
          "cumQty": 416.0,
          "avgPrice": 234.8364,
          "orderRef": "R00005",
          "lastLiquidity": 2
        },
        "commissionReport": {
          "execId": "0000e0d5.710000035.02",
          "commission": 1.36,
          "currency": "USD",
          "realizedPNL": 0.0
        }
      },
      {
        "execution": {
          "execId": "0000e0d5.710000035.03",
          "time": "2025-10-14T13:35:04.441387Z",
          "acctNumber": "U-0418272",
          "exchange": "ARCA",
          "side": "BOT",
          "shares": 18.0,
          "price": 234.81,
          "permId": 1800000005,
          "clientId": 7,
          "orderId": 5,
          "liquidation": 0,
          "cumQty": 434.0,
          "avgPrice": 234.8353,
          "orderRef": "R00005",
          "lastLiquidity": 2
        },
        "commissionReport": {
          "execId": "0000e0d5.710000035.03",
          "commission": 0.35,
          "currency": "USD",
          "realizedPNL": 0.0
        }
      }
    ]
  },
  "tradier": {
    "descripcion": "Tradier Brokerage API: GET /v1/accounts/{account_id}/orders/{id} al terminar",
    "order": {
      "id": 228005,
      "type": "market",
      "symbol": "ORSC",
      "side": "buy",
      "quantity": 434.0,
      "status": "filled",
      "duration": "day",
      "avg_fill_price": 234.8353,
      "exec_quantity": 434.0,
      "last_fill_price": 234.81,
      "last_fill_quantity": 18.0,
      "remaining_quantity": 0.0,
      "create_date": "2025-10-14T13:35:00.805Z",
      "transaction_date": "2025-10-14T13:35:04.441Z",
      "class": "equity"
    }
  },
  "oanda_v20": {
    "descripcion": "OANDA v20: transacción ORDER_FILL de una orden a mercado de 10 000 EUR_USD (precios como texto; cuenta ficticia)",
    "transaction": {
      "id": "6410",
      "accountID": "101-004-0418272-001",
      "userID": 418272,
      "batchID": "6409",
      "requestID": "79155718231417365",
      "time": "2025-10-14T13:35:00.985771Z",
      "type": "ORDER_FILL",
      "orderID": "6409",
      "instrument": "EUR_USD",
      "units": "10000",
      "requestedUnits": "10000",
      "price": "1.16451",
      "pl": "0.0000",
      "quotePL": "0",
      "financing": "0.0000",
      "baseFinancing": "0",
      "commission": "0.0000",
      "accountBalance": "100000.0000",
      "gainQuoteHomeConversionFactor": "1",
      "lossQuoteHomeConversionFactor": "1",
      "guaranteedExecutionFee": "0.0000",
      "quoteGuaranteedExecutionFee": "0",
      "halfSpreadCost": "0.4000",
      "fullVWAP": "1.16451",
      "reason": "MARKET_ORDER",
      "fullPrice": {
        "type": "PRICE",
        "bids": [
          {
            "price": "1.16443",
            "liquidity": "1000000"
          }
        ],
        "asks": [
          {
            "price": "1.16451",
            "liquidity": "1000000"
          }
        ],
        "closeoutBid": "1.16440",
        "closeoutAsk": "1.16454"
      },
      "tradeOpened": {
        "tradeID": "6410",
        "units": "10000",
        "price": "1.16451",
        "guaranteedExecutionFee": "0.0000",
        "quoteGuaranteedExecutionFee": "0",
        "halfSpreadCost": "0.4000",
        "initialMarginRequired": "349.3500"
      }
    }
  },
  "ccxt_orden": {
    "descripcion": "ccxt: estructura unificada de orden (fetch_order) en un exchange de cripto",
    "orden": {
      "id": "5194720461",
      "clientOrderId": "R4-cripto-0001",
      "datetime": "2025-10-14T13:38:00.805Z",
      "timestamp": 1760449080805,
      "lastTradeTimestamp": 1760449081445,
      "lastUpdateTimestamp": 1760449081445,
      "status": "closed",
      "symbol": "XSN/USDT",
      "type": "limit",
      "timeInForce": "GTC",
      "postOnly": false,
      "reduceOnly": null,
      "side": "buy",
      "price": 61.25,
      "triggerPrice": null,
      "stopLossPrice": null,
      "takeProfitPrice": null,
      "average": 61.246,
      "amount": 2.0,
      "filled": 2.0,
      "remaining": 0.0,
      "cost": 122.492,
      "trades": [],
      "fee": {
        "currency": "XSN",
        "cost": 0.002
      },
      "fees": [
        {
          "currency": "XSN",
          "cost": 0.002
        }
      ],
      "info": {}
    }
  },
  "binance_execution_report": {
    "descripcion": "Binance spot, user data stream: eventos executionReport de la misma orden (NEW, TRADE parcial, TRADE final)",
    "eventos": [
      {
        "e": "executionReport",
        "E": 1760449080809,
        "s": "XSNUSDT",
        "c": "R4-cripto-0001",
        "S": "BUY",
        "o": "LIMIT",
        "f": "GTC",
        "q": "2.00000000",
        "p": "61.25000000",
        "P": "0.00000000",
        "F": "0.00000000",
        "g": -1,
        "C": "",
        "x": "NEW",
        "X": "NEW",
        "r": "NONE",
        "i": 5194720461,
        "l": "0.00000000",
        "z": "0.00000000",
        "L": "0.00000000",
        "n": "0.00000000",
        "N": null,
        "T": 1760449080808,
        "t": -1,
        "I": 11234567,
        "w": true,
        "m": false,
        "M": true,
        "O": 1760449080805,
        "Z": "0.00000000",
        "Y": "0.00000000",
        "Q": "0.00000000",
        "W": 1760449080805,
        "V": "EXPIRE_MAKER"
      },
      {
        "e": "executionReport",
        "E": 1760449081216,
        "s": "XSNUSDT",
        "c": "R4-cripto-0001",
        "S": "BUY",
        "o": "LIMIT",
        "f": "GTC",
        "q": "2.00000000",
        "p": "61.25000000",
        "P": "0.00000000",
        "F": "0.00000000",
        "g": -1,
        "C": "",
        "x": "TRADE",
        "X": "PARTIALLY_FILLED",
        "r": "NONE",
        "i": 5194720461,
        "l": "1.20000000",
        "z": "1.20000000",
        "L": "61.25000000",
        "n": "0.00120000",
        "N": "XSN",
        "T": 1760449081215,
        "t": 880214,
        "I": 11234568,
        "w": false,
        "m": true,
        "M": true,
        "O": 1760449080805,
        "Z": "73.50000000",
        "Y": "73.50000000",
        "Q": "0.00000000",
        "W": 1760449080805,
        "V": "EXPIRE_MAKER"
      },
      {
        "e": "executionReport",
        "E": 1760449081446,
        "s": "XSNUSDT",
        "c": "R4-cripto-0001",
        "S": "BUY",
        "o": "LIMIT",
        "f": "GTC",
        "q": "2.00000000",
        "p": "61.25000000",
        "P": "0.00000000",
        "F": "0.00000000",
        "g": -1,
        "C": "",
        "x": "TRADE",
        "X": "FILLED",
        "r": "NONE",
        "i": 5194720461,
        "l": "0.80000000",
        "z": "2.00000000",
        "L": "61.24000000",
        "n": "0.00080000",
        "N": "XSN",
        "T": 1760449081445,
        "t": 880215,
        "I": 11234569,
        "w": false,
        "m": false,
        "M": true,
        "O": 1760449080805,
        "Z": "122.49200000",
        "Y": "48.99200000",
        "Q": "0.00000000",
        "W": 1760449080805,
        "V": "EXPIRE_MAKER"
      }
    ]
  },
  "metatrader5": {
    "descripcion": "MetaTrader 5 (paquete MetaTrader5): OrderSendResult._asdict() de una compra a mercado de 0,10 lotes de EURUSD (retcode 10009 = TRADE_RETCODE_DONE)",
    "resultado": {
      "retcode": 10009,
      "deal": 401182733,
      "order": 418272001,
      "volume": 0.1,
      "price": 1.16452,
      "bid": 1.16444,
      "ask": 1.16452,
      "comment": "Request executed",
      "request_id": 3712,
      "retcode_external": 0,
      "request": {
        "action": 1,
        "magic": 418272,
        "order": 0,
        "symbol": "EURUSD",
        "volume": 0.1,
        "price": 1.16452,
        "stoplimit": 0.0,
        "sl": 0.0,
        "tp": 0.0,
        "deviation": 10,
        "type": 0,
        "type_filling": 1,
        "type_time": 0,
        "expiration": 0,
        "comment": "rebalanceo",
        "position": 0,
        "position_by": 0
      }
    }
  }
}
