{"format":"opendoc-document","version":1,"url":"https://docs.upscale.trade/es/developers/operations/createorder","title":"Crear nueva orden","description":"POST /orders: Coloca una orden y la devuelve tal como la almacenó el motor de trading. Las órdenes de incremento (market, limit, stop market, stop limit) abren o amplían una…","kind":"api-operation","locale":"es","inLanguage":"es","translation":{"sourceLanguage":"en","targetLanguage":"es","status":"complete","translatedUnits":81,"totalUnits":81},"lastModified":"2026-09-28T20:05:09.350Z","revision":"3c2fd254d25c5fe88817d5c939afd24407f25862bdfb7b9dc8ab5105728c7abe","section":{"title":"Developers","url":"https://docs.upscale.trade/es/developers"},"representations":{"html":"https://docs.upscale.trade/es/developers/operations/createorder","markdown":"https://docs.upscale.trade/es/developers/operations/createorder.md","json":"https://docs.upscale.trade/es/developers/operations/createorder.json"},"translations":{"en":"https://docs.upscale.trade/developers/operations/createorder","ru":"https://docs.upscale.trade/ru/developers/operations/createorder","es":"https://docs.upscale.trade/es/developers/operations/createorder"},"operation":{"id":"createOrder","method":"POST","path":"/orders","summary":"Crear nueva orden","description":"Coloca una orden y la devuelve tal como la almacenó el motor de trading. Las órdenes de incremento (`market`, `limit`, `stop_market`, `stop_limit`) abren o amplían una posición;\nlas órdenes de cierre (`stop`, `take`, `trailing_stop`) se vinculan a una posición existente mediante `positionId`.\n\n`amount` se lee en una unidad diferente por cada uno de los dos: en una orden de aumento es un importe de cotización reservado del saldo libre, en una orden de cierre\nes el tamaño del activo base de la posición a cerrar, sin reservar nada. El resto de los campos de tamaño (`expectedAmount`, `sizeMode`,\n`baseSize`, `leverage`) pertenecen solo a las órdenes de aumento.\n\nMás allá del esquema a nivel de campo, la solicitud se verifica para:\n\n- **Forma para el tipo.** Cada rechazo aquí es un `400` cuyo código nombra la combinación de campos en falta:\n  - tamaño — `amount_not_positive`, `base_size_required`, `base_size_negative`, `base_size_not_allowed`;\n  - apalancamiento — `leverage_required`, `leverage_negative`;\n  - precio de activación — `trigger_price_required`, `trigger_price_negative`;\n  - stop-loss / take-profit adjuntos a una orden de incremento — `stop_trigger_price_negative`, `take_trigger_price_negative`,\n    `stop_trigger_price_gt_trigger_price`, `stop_trigger_price_lt_trigger_price`, `take_trigger_price_gt_trigger_price`,\n    `take_trigger_price_lt_trigger_price`;\n  - precio de stop-limit — `stop_limit_price_required`, `stop_limit_price_negative`, `stop_limit_price_gt_trigger_price`,\n    `stop_limit_price_lt_trigger_price`;\n  - stop móvil — `trailing_stop_activation_price_negative`, `trailing_stop_offset_required`, `trailing_stop_offset_conflict`,\n    `trailing_stop_offset_negative`, `trailing_stop_offset_percent_negative`, `trailing_stop_offset_percent_gte_one`;\n  - órdenes de cierre — `position_id_required`.\n- **Apalancamiento** de una orden de incremento. Debe mantenerse dentro de los límites del mercado: no por debajo del mínimo del mercado ni por encima del máximo de la fase,\n  con `invalid_leverage` (`leverage` más `minLeverage` o `maxLeverage` en el cuerpo).\n- **Cuenta.** Debe pertenecer al llamador y estar en un estado de trading; las órdenes de incremento se rechazan además mientras la cuenta está bloqueada por el límite de capital gestionado,\n  y necesitan `amount` disponible como saldo libre.\n- **Mercado.** Debe estar abierto y dentro de la categoría en la que la cuenta puede operar (cripto o RWA). Un mercado de solo cierre no acepta nada más que una orden `take` creada\n  sin un precio de activación.\n- **Posición**, cuando se proporciona `positionId`: debe existir (`position_not_found`), estar abierta, estar en la misma cuenta, pertenecer al mismo\n  mercado y tener la misma dirección que la orden (`position_not_available`).\n- **Precio de activación**, contra el precio de mercado actual y — para `stop` / `take` — contra el precio de liquidación de la posición\n  (`trigger_price_gt_current`, `trigger_price_lt_current`, `trigger_price_gt_liquidation`, `trigger_price_lt_liquidation`).\n  Una orden `market` con un stop-loss / take-profit adjunto se comprueba contra el precio de liquidación que tendría su posición después de la ejecución:\n  `market_price_unavailable` cuando no hay un precio actual contra el que comprobar, `order_validation_invariant` cuando faltan los campos de tamaño necesarios para\n  esa proyección.\n- **Nocional** de una orden de aumento. `(amount − fee) × leverage` debe ajustarse al nocional abierto máximo que el mercado permite en esa dirección\n  (`order_exceeds_max_open_notional`).\n\nUna orden diferida no se ejecuta aquí, por lo que aún puede fallar cuando su disparador se active más tarde: entonces termina con el estado `canceled_by_error` y un\n`errorCode` (`insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth`, `order_exceeds_max_open_notional`,\n`order_zero_size_at_execution`, `slippage_tolerance`, `market_close_only_at_execution`), y se libera su reserva.\n\nEnvía un encabezado `x-idempotency-key` para que la llamada sea segura frente a repeticiones: dentro de la ventana de repetición indicada en ese encabezado, la misma clave en la misma ruta reproduce la respuesta almacenada (marcada con `X-Idempotency-Cached: true` y `X-Idempotency-Timestamp`) en lugar de actuar de nuevo, y una segunda llamada que llegue mientras la primera aún se está ejecutando recibe `409` (`idempotency_key_in_flight`).","tags":["Trading"],"tagLabels":{"Accounts":"Cuentas","Config":"Configuración","Trading":"Trading"},"deprecated":false,"parameters":[{"name":"x-idempotency-key","location":"header","schema":{"type":"string","types":["string"],"example":"9f1c2b7e-5a3d-4f61-9b0e-2c7d4a8e1f35","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"type":"string","required":false,"description":"Clave de idempotencia — cualquier cadena opaca, un uuid v4 funciona bien. Repetir la llamada con la misma clave en esta ruta dentro de 1 hora reproduce la respuesta almacenada en lugar de actuar de nuevo; una reproducción incluye `X-Idempotency-Cached: true` y `X-Idempotency-Timestamp`. Omite el encabezado para optar por no participar.","example":"9f1c2b7e-5a3d-4f61-9b0e-2c7d4a8e1f35"}],"bodies":[{"mediaType":"application/json","required":true,"properties":[{"name":"accountId","type":"string · uuid","required":true,"description":"Trader account the order is placed on. Must belong to the caller.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Trader account the order is placed on. Must belong to the caller.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"marketId","type":"string · uuid","required":true,"description":"Market the order is placed on, as returned by `GET /v2/markets`.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Market the order is placed on, as returned by `GET /v2/markets`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"type","type":"string · enum","required":true,"description":"Order type. Increase (position-opening) types: `market`, `limit`, `stop_market`, `stop_limit`. Close types, attached to an existing position: `stop`, `take`, `trailing_stop`. `liquidation` is raised by the platform itself and `add_margin` / `remove_margin` are legacy — none of the three is accepted here.","example":"market","schema":{"type":"string · enum","types":["string"],"description":"Order type. Increase (position-opening) types: `market`, `limit`, `stop_market`, `stop_limit`. Close types, attached to an existing position: `stop`, `take`, `trailing_stop`. `liquidation` is raised by the platform itself and `add_margin` / `remove_margin` are legacy — none of the three is accepted here.","enum":["market","limit","stop","trailing_stop","take","stop_limit","stop_market"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"direction","type":"string · enum","required":true,"description":"Order direction. For a close order it must match the direction of the position it is attached to.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Order direction. For a close order it must match the direction of the position it is attached to.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"positionId","type":"string · uuid · nullable","required":false,"description":"Position a close order (`stop`, `take`, `trailing_stop`) is attached to. Required for those types, ignored for increase orders.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid · nullable","types":["string"],"description":"Position a close order (`stop`, `take`, `trailing_stop`) is attached to. Required for those types, ignored for increase orders.","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"amount","type":"string · int32","required":true,"description":"What the order is sized by, fp9 raw — the unit depends on the order class. On an increase order (`market`, `limit`, `stop_market`, `stop_limit`) it is a **quote** amount reserved from the free balance (margin, fee, spread and buffer): the account must hold at least this much, and the reserve is released when the order is cancelled. On a close order (`stop`, `take`, `trailing_stop`) it is the **base asset** size of the position to close and nothing is reserved; a size larger than the position holds closes it in full.","example":"100000000000","schema":{"type":"string · int32","types":["string"],"description":"What the order is sized by, fp9 raw — the unit depends on the order class. On an increase order (`market`, `limit`, `stop_market`, `stop_limit`) it is a **quote** amount reserved from the free balance (margin, fee, spread and buffer): the account must hold at least this much, and the reserve is released when the order is cancelled. On a close order (`stop`, `take`, `trailing_stop`) it is the **base asset** size of the position to close and nothing is reserved; a size larger than the position holds closes it in full.","example":"100000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"expectedAmount","type":"string · int32 · nullable","required":false,"description":"Slippage tolerance for increase orders: the position size the caller expects for `amount`, fp9 raw. Execution outside the tolerance fails with `slippage_tolerance`. Omitted or `0` — no tolerance check. Not applicable to close orders.","example":"0","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Slippage tolerance for increase orders: the position size the caller expects for `amount`, fp9 raw. Execution outside the tolerance fails with `slippage_tolerance`. Omitted or `0` — no tolerance check. Not applicable to close orders.","example":"0","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"leverage","type":"string · int32 · nullable","required":false,"description":"Leverage, fp9 raw (`10000000000` = 10x). Required for increase orders and must be within the leverage bounds of the market.","example":"10000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Leverage, fp9 raw (`10000000000` = 10x). Required for increase orders and must be within the leverage bounds of the market.","example":"10000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"triggerPrice","type":"string · int32 · nullable","required":false,"description":"Price at which the order fires, fp9 raw. Required for `limit`, `stop`, `take`, `stop_market` and `stop_limit`, and rejected for `market`. For `stop` / `take`, `0` means the order is created without a trigger and can be set later.","example":"65000000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Price at which the order fires, fp9 raw. Required for `limit`, `stop`, `take`, `stop_market` and `stop_limit`, and rejected for `market`. For `stop` / `take`, `0` means the order is created without a trigger and can be set later.","example":"65000000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopTriggerPrice","type":"string · int32 · nullable","required":false,"description":"Stop-loss attached to an increase order, fp9 raw. Must sit below the entry trigger price for `long` and above it for `short`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Stop-loss attached to an increase order, fp9 raw. Must sit below the entry trigger price for `long` and above it for `short`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"takeTriggerPrice","type":"string · int32 · nullable","required":false,"description":"Take-profit attached to an increase order, fp9 raw. Must sit above the entry trigger price for `long` and below it for `short`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Take-profit attached to an increase order, fp9 raw. Must sit above the entry trigger price for `long` and below it for `short`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopActivationPrice","type":"string · int32 · nullable","required":false,"description":"Price at which a `trailing_stop` starts trailing, fp9 raw. Omitted — the order trails from the moment it is created.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Price at which a `trailing_stop` starts trailing, fp9 raw. Omitted — the order trails from the moment it is created.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffset","type":"string · int32 · nullable","required":false,"description":"Trailing distance as an absolute quote amount, fp9 raw. Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Trailing distance as an absolute quote amount, fp9 raw. Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffsetPercent","type":"string · int32 · nullable","required":false,"description":"Trailing distance as a fraction of price, fp9 raw and strictly below `1000000000` (100%). Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required.","example":"50000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Trailing distance as a fraction of price, fp9 raw and strictly below `1000000000` (100%). Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required.","example":"50000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopLimitPrice","type":"string · int32 · nullable","required":false,"description":"Limit price a `stop_limit` order is placed at once its trigger fires, fp9 raw. Required for that type; must be at or below the trigger price for `long` and at or above it for `short`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Limit price a `stop_limit` order is placed at once its trigger fires, fp9 raw. Required for that type; must be at or below the trigger price for `long` and at or above it for `short`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"sizeMode","type":"string · enum","required":false,"description":"How the size of an increase order is expressed: `quote` (default) sizes it by `amount`, `base` sizes it by `baseSize` while `amount` stays the reserve. Increase orders only — a close order is always sized by `amount` in base asset units.","example":"quote","schema":{"type":"string · enum","types":["string"],"description":"How the size of an increase order is expressed: `quote` (default) sizes it by `amount`, `base` sizes it by `baseSize` while `amount` stays the reserve. Increase orders only — a close order is always sized by `amount` in base asset units.","enum":["quote","base"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"baseSize","type":"string · int32 · nullable","required":false,"description":"Order size in base asset units, fp9 raw. Required when `sizeMode` is `base` and rejected otherwise, and meaningful for increase orders only.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Order size in base asset units, fp9 raw. Required when `sizeMode` is `base` and rejected otherwise, and meaningful for increase orders only.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}}],"schema":{"type":"object","types":["object"],"reference":"#/components/schemas/OrderCreateRequest","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[{"name":"accountId","type":"string · uuid","required":true,"description":"Cuenta de trader en la que se coloca la orden. Debe pertenecer al llamador.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Cuenta de trader en la que se coloca la orden. Debe pertenecer al llamador.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"marketId","type":"string · uuid","required":true,"description":"Mercado en el que se coloca la orden, tal como lo devuelve `GET /v2/markets`.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Mercado en el que se coloca la orden, tal como lo devuelve `GET /v2/markets`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"type","type":"string · enum","required":true,"description":"Tipo de orden. Tipos de aumento (apertura de posición): `market`, `limit`, `stop_market`, `stop_limit`. Tipos de cierre, vinculados a una posición existente: `stop`, `take`, `trailing_stop`. `liquidation` es generado por la propia plataforma y `add_margin` / `remove_margin` son heredados; ninguno de los tres se acepta aquí.","example":"market","schema":{"type":"string · enum","types":["string"],"description":"Tipo de orden. Tipos de aumento (apertura de posición): `market`, `limit`, `stop_market`, `stop_limit`. Tipos de cierre, vinculados a una posición existente: `stop`, `take`, `trailing_stop`. `liquidation` es generado por la propia plataforma y `add_margin` / `remove_margin` son heredados; ninguno de los tres se acepta aquí.","enum":["market","limit","stop","trailing_stop","take","stop_limit","stop_market"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"direction","type":"string · enum","required":true,"description":"Dirección de la orden. Para una orden de cierre, debe coincidir con la dirección de la posición a la que está vinculada.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Dirección de la orden. Para una orden de cierre, debe coincidir con la dirección de la posición a la que está vinculada.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"positionId","type":"string · uuid · nullable","required":false,"description":"Posición a la que está vinculada una orden de cierre (`stop`, `take`, `trailing_stop`). Obligatoria para esos tipos, ignorada para las órdenes de aumento.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid · nullable","types":["string"],"description":"Posición a la que está vinculada una orden de cierre (`stop`, `take`, `trailing_stop`). Obligatoria para esos tipos, ignorada para las órdenes de aumento.","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"amount","type":"string · int32","required":true,"description":"Con qué se dimensiona la orden, fp9 en bruto: la unidad depende de la clase de orden. En una orden de aumento (`market`, `limit`, `stop_market`, `stop_limit`) es un monto **cotización** reservado del saldo libre (margen, comisión, spread y buffer): la cuenta debe tener al menos esta cantidad, y la reserva se libera cuando se cancela la orden. En una orden de cierre (`stop`, `take`, `trailing_stop`) es el tamaño en **activo base** de la posición a cerrar y no se reserva nada; un tamaño mayor que el que mantiene la posición la cierra en su totalidad.","example":"100000000000","schema":{"type":"string · int32","types":["string"],"description":"Con qué se dimensiona la orden, fp9 en bruto: la unidad depende de la clase de orden. En una orden de aumento (`market`, `limit`, `stop_market`, `stop_limit`) es un monto **cotización** reservado del saldo libre (margen, comisión, spread y buffer): la cuenta debe tener al menos esta cantidad, y la reserva se libera cuando se cancela la orden. En una orden de cierre (`stop`, `take`, `trailing_stop`) es el tamaño en **activo base** de la posición a cerrar y no se reserva nada; un tamaño mayor que el que mantiene la posición la cierra en su totalidad.","example":"100000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"expectedAmount","type":"string · int32 · nullable","required":false,"description":"Tolerancia de deslizamiento para órdenes de aumento: el tamaño de posición que el llamador espera para `amount`, fp9 en bruto. La ejecución fuera de la tolerancia falla con `slippage_tolerance`. Omitida o `0`: sin comprobación de tolerancia. No aplicable a las órdenes de cierre.","example":"0","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Tolerancia de deslizamiento para órdenes de aumento: el tamaño de posición que el llamador espera para `amount`, fp9 en bruto. La ejecución fuera de la tolerancia falla con `slippage_tolerance`. Omitida o `0`: sin comprobación de tolerancia. No aplicable a las órdenes de cierre.","example":"0","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"leverage","type":"string · int32 · nullable","required":false,"description":"Apalancamiento, fp9 en bruto (`10000000000` = 10x). Obligatorio para órdenes de incremento y debe estar dentro de los límites de apalancamiento del mercado.","example":"10000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Apalancamiento, fp9 en bruto (`10000000000` = 10x). Obligatorio para órdenes de incremento y debe estar dentro de los límites de apalancamiento del mercado.","example":"10000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"triggerPrice","type":"string · int32 · nullable","required":false,"description":"Precio al que se activa la orden, fp9 en bruto. Obligatorio para `limit`, `stop`, `take`, `stop_market` y `stop_limit`, y rechazado para `market`. Para `stop` / `take`, `0` significa que la orden se crea sin un disparador y se puede establecer más tarde.","example":"65000000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Precio al que se activa la orden, fp9 en bruto. Obligatorio para `limit`, `stop`, `take`, `stop_market` y `stop_limit`, y rechazado para `market`. Para `stop` / `take`, `0` significa que la orden se crea sin un disparador y se puede establecer más tarde.","example":"65000000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopTriggerPrice","type":"string · int32 · nullable","required":false,"description":"Stop-loss asociado a una orden de incremento, fp9 en bruto. Debe situarse por debajo del precio de activación de entrada para `long` y por encima de él para `short`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Stop-loss asociado a una orden de incremento, fp9 en bruto. Debe situarse por debajo del precio de activación de entrada para `long` y por encima de él para `short`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"takeTriggerPrice","type":"string · int32 · nullable","required":false,"description":"Take-profit asociado a una orden de incremento, fp9 en bruto. Debe situarse por encima del precio de activación de entrada para `long` y por debajo de él para `short`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Take-profit asociado a una orden de incremento, fp9 en bruto. Debe situarse por encima del precio de activación de entrada para `long` y por debajo de él para `short`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopActivationPrice","type":"string · int32 · nullable","required":false,"description":"Precio al que un `trailing_stop` comienza el trailing, fp9 en bruto. Omitido — la orden hace trailing desde el momento en que se crea.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Precio al que un `trailing_stop` comienza el trailing, fp9 en bruto. Omitido — la orden hace trailing desde el momento en que se crea.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffset","type":"string · int32 · nullable","required":false,"description":"Distancia de seguimiento como un monto absoluto de cotización, fp9 en bruto. Se requiere exactamente uno de `trailingStopOffset` / `trailingStopOffsetPercent`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Distancia de seguimiento como un monto absoluto de cotización, fp9 en bruto. Se requiere exactamente uno de `trailingStopOffset` / `trailingStopOffsetPercent`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffsetPercent","type":"string · int32 · nullable","required":false,"description":"Distancia de seguimiento como una fracción del precio, fp9 en bruto y estrictamente por debajo de `1000000000` (100%). Se requiere exactamente uno de `trailingStopOffset` / `trailingStopOffsetPercent`.","example":"50000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Distancia de seguimiento como una fracción del precio, fp9 en bruto y estrictamente por debajo de `1000000000` (100%). Se requiere exactamente uno de `trailingStopOffset` / `trailingStopOffsetPercent`.","example":"50000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopLimitPrice","type":"string · int32 · nullable","required":false,"description":"Precio límite al que se coloca una orden `stop_limit` una vez que se activa su disparador, fp9 en bruto. Obligatorio para ese tipo; debe estar en o por debajo del precio de activación para `long` y en o por encima de él para `short`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Precio límite al que se coloca una orden `stop_limit` una vez que se activa su disparador, fp9 en bruto. Obligatorio para ese tipo; debe estar en o por debajo del precio de activación para `long` y en o por encima de él para `short`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"sizeMode","type":"string · enum","required":false,"description":"Cómo se expresa el tamaño de una orden de aumento: `quote` (predeterminado) lo dimensiona por `amount`, `base` lo dimensiona por `baseSize` mientras que `amount` permanece como reserva. Solo órdenes de aumento — una orden de cierre siempre se dimensiona por `amount` en unidades del activo base.","example":"quote","schema":{"type":"string · enum","types":["string"],"description":"Cómo se expresa el tamaño de una orden de aumento: `quote` (predeterminado) lo dimensiona por `amount`, `base` lo dimensiona por `baseSize` mientras que `amount` permanece como reserva. Solo órdenes de aumento — una orden de cierre siempre se dimensiona por `amount` en unidades del activo base.","enum":["quote","base"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"baseSize","type":"string · int32 · nullable","required":false,"description":"Tamaño de la orden en unidades del activo base, fp9 en bruto. Obligatorio cuando `sizeMode` es `base` y rechazado en caso contrario, y significativo solo para órdenes de aumento.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Tamaño de la orden en unidades del activo base, fp9 en bruto. Obligatorio cuando `sizeMode` es `base` y rechazado en caso contrario, y significativo solo para órdenes de aumento.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}}],"variants":[]},"example":"{\n  \"accountId\": \"00000000-0000-4000-8000-000000000000\",\n  \"marketId\": \"00000000-0000-4000-8000-000000000000\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"amount\": \"100000000000\"\n}"}],"responses":[{"status":"401","description":"No autorizado","properties":[],"headers":[]},{"status":"403","description":"La cuenta pertenece a otro usuario (`account_access_denied`), o la solicitud se autentica con una clave de API mientras `api_trading` está deshabilitado en la cuenta (`api_trading_not_enabled`). El trading en la cuenta ha terminado en su estado actual (`challenge_closed`), o la cuenta está bloqueada por el límite de capital gestionado (`funded_limit_trading_locked`). El mercado está en pausa (`market_paused`) o solo acepta órdenes de cierre (`market_close_only`).","properties":[],"headers":[]},{"status":"404","description":"No existe tal cuenta, mercado o posición.","properties":[],"headers":[]},{"status":"409","description":"Otra llamada con la misma `x-idempotency-key` sigue en ejecución (`idempotency_key_in_flight`). Reintenta cuando haya terminado.","properties":[],"headers":[]},{"status":"429","description":"Se superó el límite de velocidad de la clave de API (`api_key_rate_limit_exceeded`). `Retry-After` indica cuándo volver; el cuerpo incluye el bucket (`read` / `write`), la ventana que se activó, su límite y `retryAt`.","properties":[],"headers":[]},{"status":"default","description":"Respuesta","mediaType":"application/json","properties":[{"name":"id","type":"string · uuid","required":true,"description":"Order identifier.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Order identifier.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"txId","type":"string","required":true,"description":"Order identifier. Kept for backward compatibility, always equal to `id`.","example":"string","schema":{"type":"string","types":["string"],"description":"Order identifier. Kept for backward compatibility, always equal to `id`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"trader","type":"string · uuid","required":true,"description":"Trader account the order belongs to.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Trader account the order belongs to.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"market","type":"string · uuid","required":true,"description":"Market the order is placed on.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Market the order is placed on.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"status","type":"string · enum","required":true,"description":"Lifecycle state: `active` while it waits, `executed` once filled, `canceled` when cancelled by the trader or the platform, `canceled_by_update` when replaced by an edit, `canceled_by_position` when the position it was attached to went away, `canceled_by_error` when execution failed — see `errorCode`.","example":"active","schema":{"type":"string · enum","types":["string"],"description":"Lifecycle state: `active` while it waits, `executed` once filled, `canceled` when cancelled by the trader or the platform, `canceled_by_update` when replaced by an edit, `canceled_by_position` when the position it was attached to went away, `canceled_by_error` when execution failed — see `errorCode`.","enum":["active","canceled","canceled_by_update","canceled_by_error","canceled_by_position","executed"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"type","type":"string · enum","required":true,"description":"Order type. `liquidation` marks an order the engine raised itself.","example":"market","schema":{"type":"string · enum","types":["string"],"description":"Order type. `liquidation` marks an order the engine raised itself.","enum":["market","limit","stop","trailing_stop","take","stop_limit","stop_market","liquidation"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"direction","type":"string · enum","required":true,"description":"Order direction.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Order direction.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"triggerPrice","type":"string · int32","required":true,"description":"Price at which the order fires, fp9 raw. `0` when the order carries no trigger.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Price at which the order fires, fp9 raw. `0` when the order carries no trigger.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"requestedTriggerPrice","type":"string · int32 · nullable","required":true,"description":"Trigger price as requested, before the engine pushed it out to the minimum stop distance, fp9 raw. Null when the requested price was kept as is.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Trigger price as requested, before the engine pushed it out to the minimum stop distance, fp9 raw. Null when the requested price was kept as is.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopPrice","type":"string · int32","required":true,"description":"Trigger price of a `stop_market` / `stop_limit` order, fp9 raw; `0` for every other type.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Trigger price of a `stop_market` / `stop_limit` order, fp9 raw; `0` for every other type.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"limitPrice","type":"string · int32","required":true,"description":"Price the order is placed at once triggered, fp9 raw: the stop-limit price, falling back to the trigger price.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Price the order is placed at once triggered, fp9 raw: the stop-limit price, falling back to the trigger price.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopTriggerPrice","type":"string · int32","required":true,"description":"Stop-loss attached to the order, fp9 raw. `0` when none is attached.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Stop-loss attached to the order, fp9 raw. `0` when none is attached.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"takeTriggerPrice","type":"string · int32","required":true,"description":"Take-profit attached to the order, fp9 raw. `0` when none is attached.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Take-profit attached to the order, fp9 raw. `0` when none is attached.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopActivationPrice","type":"string · int32","required":true,"description":"Price at which a trailing stop starts trailing, fp9 raw. `0` when it trails from creation.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Price at which a trailing stop starts trailing, fp9 raw. `0` when it trails from creation.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffset","type":"string · int32","required":true,"description":"Trailing distance as an absolute quote amount, fp9 raw. `0` when the distance is set as a percent.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Trailing distance as an absolute quote amount, fp9 raw. `0` when the distance is set as a percent.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffsetPercent","type":"string · int32","required":true,"description":"Trailing distance as a fraction of price, fp9 raw. `0` when the distance is absolute.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Trailing distance as a fraction of price, fp9 raw. `0` when the distance is absolute.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"leverage","type":"string · int32 · nullable","required":true,"description":"Leverage of the order, fp9 raw. Null on close orders, which inherit the leverage of the position.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Leverage of the order, fp9 raw. Null on close orders, which inherit the leverage of the position.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"index","type":"string","required":true,"description":"Order identifier. Kept for backward compatibility, always equal to `id`.","example":"string","schema":{"type":"string","types":["string"],"description":"Order identifier. Kept for backward compatibility, always equal to `id`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"positionId","type":"string[]","required":true,"description":"Position a close order is attached to. Null for orders that open or grow a position.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Position a close order is attached to. Null for orders that open or grow a position.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"parentOrderId","type":"string[]","required":true,"description":"Order this one was spawned from: a stop or take created out of `stopTriggerPrice` / `takeTriggerPrice`, or the limit order a `stop_limit` turned into. Null when the order was submitted directly.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Order this one was spawned from: a stop or take created out of `stopTriggerPrice` / `takeTriggerPrice`, or the limit order a `stop_limit` turned into. Null when the order was submitted directly.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"expiration","type":"string · date-time · nullable","required":true,"description":"Always null. Kept for backward compatibility — orders do not expire on their own.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time · nullable","types":["string"],"description":"Always null. Kept for backward compatibility — orders do not expire on their own.","example":"2026-05-01T12:30:00.000Z","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"amount","type":"string · int32","required":true,"description":"Size of the order, fp9 raw, in the unit its class uses: on an increase order a quote amount — the reserve while it waits, and what it actually spent once executed; on a close order (`stop`, `take`, `trailing_stop`) the base asset size it closes, as requested at creation.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Size of the order, fp9 raw, in the unit its class uses: on an increase order a quote amount — the reserve while it waits, and what it actually spent once executed; on a close order (`stop`, `take`, `trailing_stop`) the base asset size it closes, as requested at creation.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"indexPrice","type":"string · int32 · nullable","required":true,"description":"Index price the order executed at, fp9 raw. Null while the order has not executed.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Index price the order executed at, fp9 raw. Null while the order has not executed.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"settlementOraclePrice","type":"string · int32","required":true,"description":"Always `1000000000` (1.0). Kept for backward compatibility.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Always `1000000000` (1.0). Kept for backward compatibility.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"createdAt","type":"string · date-time","required":true,"description":"When the order was accepted.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"When the order was accepted.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"error","type":"string[]","required":true,"description":"Always null. Kept for backward compatibility — use `errorCode`.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Always null. Kept for backward compatibility — use `errorCode`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"realizedPnl","type":"string · int32 · nullable","required":true,"description":"Pnl realised by this order, fp9 raw. Set only on an executed close order; null while pending and on orders that open or grow a position.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Pnl realised by this order, fp9 raw. Set only on an executed close order; null while pending and on orders that open or grow a position.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rawRealizedPnl","type":"string · int32 · nullable","required":true,"description":"Realised pnl before the 60-second adjustment, fp9 raw. Differs from `realizedPnl` only when the adjustment fired.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Realised pnl before the 60-second adjustment, fp9 raw. Differs from `realizedPnl` only when the adjustment fired.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"profitAdjustmentApplied","type":"boolean","required":true,"description":"Whether the 60-second adjustment capped the profit of this order — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Whether the 60-second adjustment capped the profit of this order — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"executedAfterPause","type":"boolean","required":true,"description":"Whether the order executed after a market pause. Not set by the current engine — always `false`.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Whether the order executed after a market pause. Not set by the current engine — always `false`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"sizeMode","type":"string · enum","required":true,"description":"How the size was expressed on creation: `quote` sizes the order by `amount`, `base` sizes it by `baseSize`.","example":"quote","schema":{"type":"string · enum","types":["string"],"description":"How the size was expressed on creation: `quote` sizes the order by `amount`, `base` sizes it by `baseSize`.","enum":["quote","base"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"baseSize","type":"string · int32 · nullable","required":true,"description":"Order size in base asset units, fp9 raw. Null for `quote`-sized orders.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Order size in base asset units, fp9 raw. Null for `quote`-sized orders.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"reservedAmount","type":"string · int32 · nullable","required":true,"description":"Quote amount reserved when the order with sizeMode=base was created, fp9 raw. Stays at the original reserve after execution, while `amount` is rewritten to what was spent. Null for `quote`-sized orders, where `amount` is the reserve.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Quote amount reserved when the order with sizeMode=base was created, fp9 raw. Stays at the original reserve after execution, while `amount` is rewritten to what was spent. Null for `quote`-sized orders, where `amount` is the reserve.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"errorCode","type":"string[]","required":true,"description":"Why execution failed, set together with status `canceled_by_error` — for example `insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth` or `slippage_tolerance`. Null otherwise.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Why execution failed, set together with status `canceled_by_error` — for example `insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth` or `slippage_tolerance`. Null otherwise.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"reason","type":"string · enum · nullable","required":true,"description":"Why the platform cancelled the order itself, for example `force_close` or `weekly_session_risk_close`. Null for trader-driven cancellations.","example":"force_close","schema":{"type":"string · enum · nullable","types":["string"],"description":"Why the platform cancelled the order itself, for example `force_close` or `weekly_session_risk_close`. Null for trader-driven cancellations.","enum":["force_close","stop_accounts_fail","stop_accounts_freeze","stop_accounts_promote","stop_accounts_manual","weekly_session_risk_close",null],"nullable":true,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}}],"schema":{"type":"object","types":["object"],"reference":"#/components/schemas/OrderResponse","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[{"name":"id","type":"string · uuid","required":true,"description":"Identificador de la orden.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Identificador de la orden.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"txId","type":"string","required":true,"description":"Identificador de la orden. Se conserva por compatibilidad con versiones anteriores, siempre igual a `id`.","example":"string","schema":{"type":"string","types":["string"],"description":"Identificador de la orden. Se conserva por compatibilidad con versiones anteriores, siempre igual a `id`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"trader","type":"string · uuid","required":true,"description":"Cuenta del trader a la que pertenece la orden.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Cuenta del trader a la que pertenece la orden.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"market","type":"string · uuid","required":true,"description":"Mercado en el que se coloca la orden.","example":"00000000-0000-4000-8000-000000000000","schema":{"type":"string · uuid","types":["string"],"description":"Mercado en el que se coloca la orden.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$"},"properties":[],"variants":[]}},{"name":"status","type":"string · enum","required":true,"description":"Estado del ciclo de vida: `active` mientras espera, `executed` una vez ejecutada, `canceled` cuando es cancelada por el trader o la plataforma, `canceled_by_update` cuando es reemplazada por una edición, `canceled_by_position` cuando la posición a la que estaba vinculada desapareció, `canceled_by_error` cuando falló la ejecución — consulta `errorCode`.","example":"active","schema":{"type":"string · enum","types":["string"],"description":"Estado del ciclo de vida: `active` mientras espera, `executed` una vez ejecutada, `canceled` cuando es cancelada por el trader o la plataforma, `canceled_by_update` cuando es reemplazada por una edición, `canceled_by_position` cuando la posición a la que estaba vinculada desapareció, `canceled_by_error` cuando falló la ejecución — consulta `errorCode`.","enum":["active","canceled","canceled_by_update","canceled_by_error","canceled_by_position","executed"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"type","type":"string · enum","required":true,"description":"Tipo de orden. `liquidation` marca una orden que el propio motor generó.","example":"market","schema":{"type":"string · enum","types":["string"],"description":"Tipo de orden. `liquidation` marca una orden que el propio motor generó.","enum":["market","limit","stop","trailing_stop","take","stop_limit","stop_market","liquidation"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"direction","type":"string · enum","required":true,"description":"Dirección de la orden.","example":"long","schema":{"type":"string · enum","types":["string"],"description":"Dirección de la orden.","enum":["long","short"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"triggerPrice","type":"string · int32","required":true,"description":"Precio al que se dispara la orden, fp9 en bruto. `0` cuando la orden no lleva disparador.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Precio al que se dispara la orden, fp9 en bruto. `0` cuando la orden no lleva disparador.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"requestedTriggerPrice","type":"string · int32 · nullable","required":true,"description":"Precio de activación tal como se solicitó, antes de que el motor lo desplazara hasta la distancia mínima de stop, fp9 en bruto. Nulo cuando el precio solicitado se mantuvo tal cual.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Precio de activación tal como se solicitó, antes de que el motor lo desplazara hasta la distancia mínima de stop, fp9 en bruto. Nulo cuando el precio solicitado se mantuvo tal cual.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopPrice","type":"string · int32","required":true,"description":"Precio de activación de una orden `stop_market` / `stop_limit`, fp9 en bruto; `0` para cualquier otro tipo.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Precio de activación de una orden `stop_market` / `stop_limit`, fp9 en bruto; `0` para cualquier otro tipo.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"limitPrice","type":"string · int32","required":true,"description":"Precio al que se coloca la orden una vez activada, fp9 en bruto: el precio stop-limit, recurriendo al precio de activación como alternativa.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Precio al que se coloca la orden una vez activada, fp9 en bruto: el precio stop-limit, recurriendo al precio de activación como alternativa.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"stopTriggerPrice","type":"string · int32","required":true,"description":"Stop-loss asociado a la orden, fp9 en bruto. `0` cuando no hay ninguno asociado.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Stop-loss asociado a la orden, fp9 en bruto. `0` cuando no hay ninguno asociado.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"takeTriggerPrice","type":"string · int32","required":true,"description":"Take-profit asociado a la orden, fp9 en bruto. `0` cuando no hay ninguno asociado.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Take-profit asociado a la orden, fp9 en bruto. `0` cuando no hay ninguno asociado.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopActivationPrice","type":"string · int32","required":true,"description":"Precio al que un stop móvil comienza a hacer seguimiento, fp9 sin procesar. `0` cuando hace seguimiento desde la creación.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Precio al que un stop móvil comienza a hacer seguimiento, fp9 sin procesar. `0` cuando hace seguimiento desde la creación.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffset","type":"string · int32","required":true,"description":"Distancia de seguimiento como un importe absoluto de cotización, fp9 sin procesar. `0` cuando la distancia se establece como porcentaje.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Distancia de seguimiento como un importe absoluto de cotización, fp9 sin procesar. `0` cuando la distancia se establece como porcentaje.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"trailingStopOffsetPercent","type":"string · int32","required":true,"description":"Distancia de seguimiento como una fracción del precio, fp9 sin procesar. `0` cuando la distancia es absoluta.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Distancia de seguimiento como una fracción del precio, fp9 sin procesar. `0` cuando la distancia es absoluta.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"leverage","type":"string · int32 · nullable","required":true,"description":"Apalancamiento de la orden, fp9 en bruto. Nulo en órdenes de cierre, que heredan el apalancamiento de la posición.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Apalancamiento de la orden, fp9 en bruto. Nulo en órdenes de cierre, que heredan el apalancamiento de la posición.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"index","type":"string","required":true,"description":"Identificador de la orden. Se conserva por compatibilidad con versiones anteriores, siempre igual a `id`.","example":"string","schema":{"type":"string","types":["string"],"description":"Identificador de la orden. Se conserva por compatibilidad con versiones anteriores, siempre igual a `id`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"positionId","type":"string[]","required":true,"description":"Posición a la que está asociada una orden de cierre. Nulo para órdenes que abren o aumentan una posición.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Posición a la que está asociada una orden de cierre. Nulo para órdenes que abren o aumentan una posición.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"parentOrderId","type":"string[]","required":true,"description":"Orden de la que se generó esta: un stop o un take creado a partir de `stopTriggerPrice` / `takeTriggerPrice`, o la orden limit en la que se convirtió un `stop_limit`. Nulo cuando la orden se envió directamente.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Orden de la que se generó esta: un stop o un take creado a partir de `stopTriggerPrice` / `takeTriggerPrice`, o la orden limit en la que se convirtió un `stop_limit`. Nulo cuando la orden se envió directamente.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"expiration","type":"string · date-time · nullable","required":true,"description":"Siempre nulo. Se mantiene por compatibilidad con versiones anteriores: las órdenes no expiran por sí solas.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time · nullable","types":["string"],"description":"Siempre nulo. Se mantiene por compatibilidad con versiones anteriores: las órdenes no expiran por sí solas.","example":"2026-05-01T12:30:00.000Z","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"amount","type":"string · int32","required":true,"description":"Tamaño de la orden, fp9 en bruto, en la unidad que usa su clase: en una orden de incremento, un importe de cotización — la reserva mientras espera, y lo que realmente gastó una vez ejecutada; en una orden de cierre (`stop`, `take`, `trailing_stop`), el tamaño del activo base que cierra, tal como se solicitó al crearla.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Tamaño de la orden, fp9 en bruto, en la unidad que usa su clase: en una orden de incremento, un importe de cotización — la reserva mientras espera, y lo que realmente gastó una vez ejecutada; en una orden de cierre (`stop`, `take`, `trailing_stop`), el tamaño del activo base que cierra, tal como se solicitó al crearla.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"indexPrice","type":"string · int32 · nullable","required":true,"description":"Precio índice al que se ejecutó la orden, fp9 en bruto. Nulo mientras la orden no se haya ejecutado.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Precio índice al que se ejecutó la orden, fp9 en bruto. Nulo mientras la orden no se haya ejecutado.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"settlementOraclePrice","type":"string · int32","required":true,"description":"Siempre `1000000000` (1.0). Se mantiene por compatibilidad con versiones anteriores.","example":"1000000000","schema":{"type":"string · int32","types":["string"],"description":"Siempre `1000000000` (1.0). Se mantiene por compatibilidad con versiones anteriores.","example":"1000000000","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"createdAt","type":"string · date-time","required":true,"description":"Cuándo se aceptó la orden.","example":"2026-05-01T12:30:00.000Z","schema":{"type":"string · date-time","types":["string"],"description":"Cuándo se aceptó la orden.","example":"2026-05-01T12:30:00.000Z","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{"format":"date-time"},"properties":[],"variants":[]}},{"name":"error","type":"string[]","required":true,"description":"Siempre null. Se mantiene por compatibilidad hacia atrás — utilice `errorCode`.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Siempre null. Se mantiene por compatibilidad hacia atrás — utilice `errorCode`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"realizedPnl","type":"string · int32 · nullable","required":true,"description":"Pnl realizado por esta orden, fp9 en bruto. Se establece solo en una orden de cierre ejecutada; null mientras está pendiente y en órdenes que abren o aumentan una posición.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Pnl realizado por esta orden, fp9 en bruto. Se establece solo en una orden de cierre ejecutada; null mientras está pendiente y en órdenes que abren o aumentan una posición.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"rawRealizedPnl","type":"string · int32 · nullable","required":true,"description":"Pnl realizado antes del ajuste de 60 segundos, fp9 en bruto. Difiere de `realizedPnl` solo cuando se activó el ajuste.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Pnl realizado antes del ajuste de 60 segundos, fp9 en bruto. Difiere de `realizedPnl` solo cuando se activó el ajuste.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"profitAdjustmentApplied","type":"boolean","required":true,"description":"Si el ajuste de 60 segundos limitó la ganancia de esta orden — dentro de un minuto de una apertura o un aumento, el pnl de la posición no puede crecer por encima de lo que era en ese momento.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Si el ajuste de 60 segundos limitó la ganancia de esta orden — dentro de un minuto de una apertura o un aumento, el pnl de la posición no puede crecer por encima de lo que era en ese momento.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"executedAfterPause","type":"boolean","required":true,"description":"Indica si la orden se ejecutó después de una pausa del mercado. No lo establece el motor actual — siempre `false`.","example":"true","schema":{"type":"boolean","types":["boolean"],"description":"Indica si la orden se ejecutó después de una pausa del mercado. No lo establece el motor actual — siempre `false`.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"sizeMode","type":"string · enum","required":true,"description":"Cómo se expresó el tamaño al crearse: `quote` dimensiona la orden por `amount`, `base` la dimensiona por `baseSize`.","example":"quote","schema":{"type":"string · enum","types":["string"],"description":"Cómo se expresó el tamaño al crearse: `quote` dimensiona la orden por `amount`, `base` la dimensiona por `baseSize`.","enum":["quote","base"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}},{"name":"baseSize","type":"string · int32 · nullable","required":true,"description":"Tamaño de la orden en unidades del activo base, fp9 en bruto. Nulo para órdenes dimensionadas por `quote`.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Tamaño de la orden en unidades del activo base, fp9 en bruto. Nulo para órdenes dimensionadas por `quote`.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"reservedAmount","type":"string · int32 · nullable","required":true,"description":"Importe de quote reservado cuando se creó la orden con sizeMode=base, fp9 en bruto. Se mantiene en la reserva original después de la ejecución, mientras que `amount` se reescribe a lo que se gastó. Nulo para órdenes dimensionadas por `quote`, donde `amount` es la reserva.","example":"1000000000","schema":{"type":"string · int32 · nullable","types":["string"],"description":"Importe de quote reservado cuando se creó la orden con sizeMode=base, fp9 en bruto. Se mantiene en la reserva original después de la ejecución, mientras que `amount` se reescribe a lo que se gastó. Nulo para órdenes dimensionadas por `quote`, donde `amount` es la reserva.","example":"1000000000","nullable":true,"readOnly":false,"writeOnly":false,"constraints":{"format":"int32","pattern":"^(?:-?[1-9][0-9]*|0)$"},"properties":[],"variants":[]}},{"name":"errorCode","type":"string[]","required":true,"description":"Por qué falló la ejecución, establecido junto con el estado `canceled_by_error` — por ejemplo `insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth` o `slippage_tolerance`. Nulo en caso contrario.","example":"[\n  \"string\"\n]","schema":{"type":"string[]","types":["array"],"description":"Por qué falló la ejecución, establecido junto con el estado `canceled_by_error` — por ejemplo `insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth` o `slippage_tolerance`. Nulo en caso contrario.","nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"items":{"type":"string","types":["string"],"nullable":false,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]},"variants":[]}},{"name":"reason","type":"string · enum · nullable","required":true,"description":"Por qué la plataforma canceló la orden por sí misma, por ejemplo `force_close` o `weekly_session_risk_close`. Nulo para cancelaciones impulsadas por el trader.","example":"force_close","schema":{"type":"string · enum · nullable","types":["string"],"description":"Por qué la plataforma canceló la orden por sí misma, por ejemplo `force_close` o `weekly_session_risk_close`. Nulo para cancelaciones impulsadas por el trader.","enum":["force_close","stop_accounts_fail","stop_accounts_freeze","stop_accounts_promote","stop_accounts_manual","weekly_session_risk_close",null],"nullable":true,"readOnly":false,"writeOnly":false,"constraints":{},"properties":[],"variants":[]}}],"variants":[]},"example":"{\n  \"id\": \"00000000-0000-4000-8000-000000000000\",\n  \"txId\": \"string\",\n  \"trader\": \"00000000-0000-4000-8000-000000000000\",\n  \"market\": \"00000000-0000-4000-8000-000000000000\",\n  \"status\": \"active\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"triggerPrice\": \"1000000000\",\n  \"requestedTriggerPrice\": \"1000000000\",\n  \"stopPrice\": \"1000000000\",\n  \"limitPrice\": \"1000000000\",\n  \"stopTriggerPrice\": \"1000000000\",\n  \"takeTriggerPrice\": \"1000000000\",\n  \"trailingStopActivationPrice\": \"1000000000\",\n  \"trailingStopOffset\": \"1000000000\",\n  \"trailingStopOffsetPercent\": \"1000000000\",\n  \"leverage\": \"1000000000\",\n  \"index\": \"string\",\n  \"positionId\": [\n    \"string\"\n  ],\n  \"parentOrderId\": [\n    \"string\"\n  ],\n  \"expiration\": \"2026-05-01T12:30:00.000Z\",\n  \"amount\": \"1000000000\",\n  \"indexPrice\": \"1000000000\",\n  \"settlementOraclePrice\": \"1000000000\",\n  \"createdAt\": \"2026-05-01T12:30:00.000Z\",\n  \"error\": [\n    \"string\"\n  ],\n  \"realizedPnl\": \"1000000000\",\n  \"rawRealizedPnl\": \"1000000000\",\n  \"profitAdjustmentApplied\": true,\n  \"executedAfterPause\": true,\n  \"sizeMode\": \"quote\",\n  \"baseSize\": \"1000000000\",\n  \"reservedAmount\": \"1000000000\",\n  \"errorCode\": [\n    \"string\"\n  ],\n  \"reason\": \"force_close\"\n}","headers":[]}],"security":[{"name":"bearer","type":"http · bearer","description":"Clave de API personal, con el prefijo `usk_`.","required":true,"scopes":[]}],"codeSamples":[{"label":"cURL","language":"bash","source":"curl --request POST 'https://api.upscale.trade/orders' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '{\n  \"accountId\": \"00000000-0000-4000-8000-000000000000\",\n  \"marketId\": \"00000000-0000-4000-8000-000000000000\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"amount\": \"100000000000\"\n}'"},{"label":"JavaScript","language":"javascript","source":"const response = await fetch(\"https://api.upscale.trade/orders\", {\n  method: \"POST\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\"\n  },\n  body: \"{\\n  \\\"accountId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"marketId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"type\\\": \\\"market\\\",\\n  \\\"direction\\\": \\\"long\\\",\\n  \\\"amount\\\": \\\"100000000000\\\"\\n}\",\n});\nconsole.log(response.status, await response.text());"},{"label":"Python","language":"python","source":"import requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.upscale.trade/orders\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"},\n    data=\"{\\n  \\\"accountId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"marketId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"type\\\": \\\"market\\\",\\n  \\\"direction\\\": \\\"long\\\",\\n  \\\"amount\\\": \\\"100000000000\\\"\\n}\",\n    timeout=30,\n)\nprint(response.status_code, response.text)"}]},"breadcrumbs":[{"title":"Qué es el prop trading","url":"https://docs.upscale.trade/es"},{"title":"Developers","url":"https://docs.upscale.trade/es/developers"},{"title":"Crear nueva orden","url":"https://docs.upscale.trade/es/developers/operations/createorder"}],"headings":[{"depth":2,"id":"authorization","title":"Autorización"},{"depth":2,"id":"parameters","title":"Parámetros"},{"depth":2,"id":"request-body-required","title":"Cuerpo de la solicitud · obligatorio"},{"depth":2,"id":"examples","title":"Ejemplos"},{"depth":2,"id":"responses","title":"Respuestas"}],"markdown":"# Crear nueva orden\n\n`POST /orders`\n\nColoca una orden y la devuelve tal como la almacenó el motor de trading. Las órdenes de incremento (`market`, `limit`, `stop_market`, `stop_limit`) abren o amplían una posición;\nlas órdenes de cierre (`stop`, `take`, `trailing_stop`) se vinculan a una posición existente mediante `positionId`.\n\n`amount` se lee en una unidad diferente por cada uno de los dos: en una orden de aumento es un importe de cotización reservado del saldo libre, en una orden de cierre\nes el tamaño del activo base de la posición a cerrar, sin reservar nada. El resto de los campos de tamaño (`expectedAmount`, `sizeMode`,\n`baseSize`, `leverage`) pertenecen solo a las órdenes de aumento.\n\nMás allá del esquema a nivel de campo, la solicitud se verifica para:\n\n- **Forma para el tipo.** Cada rechazo aquí es un `400` cuyo código nombra la combinación de campos en falta:\n  - tamaño — `amount_not_positive`, `base_size_required`, `base_size_negative`, `base_size_not_allowed`;\n  - apalancamiento — `leverage_required`, `leverage_negative`;\n  - precio de activación — `trigger_price_required`, `trigger_price_negative`;\n  - stop-loss / take-profit adjuntos a una orden de incremento — `stop_trigger_price_negative`, `take_trigger_price_negative`,\n    `stop_trigger_price_gt_trigger_price`, `stop_trigger_price_lt_trigger_price`, `take_trigger_price_gt_trigger_price`,\n    `take_trigger_price_lt_trigger_price`;\n  - precio de stop-limit — `stop_limit_price_required`, `stop_limit_price_negative`, `stop_limit_price_gt_trigger_price`,\n    `stop_limit_price_lt_trigger_price`;\n  - stop móvil — `trailing_stop_activation_price_negative`, `trailing_stop_offset_required`, `trailing_stop_offset_conflict`,\n    `trailing_stop_offset_negative`, `trailing_stop_offset_percent_negative`, `trailing_stop_offset_percent_gte_one`;\n  - órdenes de cierre — `position_id_required`.\n- **Apalancamiento** de una orden de incremento. Debe mantenerse dentro de los límites del mercado: no por debajo del mínimo del mercado ni por encima del máximo de la fase,\n  con `invalid_leverage` (`leverage` más `minLeverage` o `maxLeverage` en el cuerpo).\n- **Cuenta.** Debe pertenecer al llamador y estar en un estado de trading; las órdenes de incremento se rechazan además mientras la cuenta está bloqueada por el límite de capital gestionado,\n  y necesitan `amount` disponible como saldo libre.\n- **Mercado.** Debe estar abierto y dentro de la categoría en la que la cuenta puede operar (cripto o RWA). Un mercado de solo cierre no acepta nada más que una orden `take` creada\n  sin un precio de activación.\n- **Posición**, cuando se proporciona `positionId`: debe existir (`position_not_found`), estar abierta, estar en la misma cuenta, pertenecer al mismo\n  mercado y tener la misma dirección que la orden (`position_not_available`).\n- **Precio de activación**, contra el precio de mercado actual y — para `stop` / `take` — contra el precio de liquidación de la posición\n  (`trigger_price_gt_current`, `trigger_price_lt_current`, `trigger_price_gt_liquidation`, `trigger_price_lt_liquidation`).\n  Una orden `market` con un stop-loss / take-profit adjunto se comprueba contra el precio de liquidación que tendría su posición después de la ejecución:\n  `market_price_unavailable` cuando no hay un precio actual contra el que comprobar, `order_validation_invariant` cuando faltan los campos de tamaño necesarios para\n  esa proyección.\n- **Nocional** de una orden de aumento. `(amount − fee) × leverage` debe ajustarse al nocional abierto máximo que el mercado permite en esa dirección\n  (`order_exceeds_max_open_notional`).\n\nUna orden diferida no se ejecuta aquí, por lo que aún puede fallar cuando su disparador se active más tarde: entonces termina con el estado `canceled_by_error` y un\n`errorCode` (`insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth`, `order_exceeds_max_open_notional`,\n`order_zero_size_at_execution`, `slippage_tolerance`, `market_close_only_at_execution`), y se libera su reserva.\n\nEnvía un encabezado `x-idempotency-key` para que la llamada sea segura frente a repeticiones: dentro de la ventana de repetición indicada en ese encabezado, la misma clave en la misma ruta reproduce la respuesta almacenada (marcada con `X-Idempotency-Cached: true` y `X-Idempotency-Timestamp`) en lugar de actuar de nuevo, y una segunda llamada que llegue mientras la primera aún se está ejecutando recibe `409` (`idempotency_key_in_flight`).\n\n<a id=\"authorization\"></a>\n\n## Autorización\n\nbearer: http · bearer (obligatorio). Clave de API personal, con el prefijo `usk_`.\n\n<a id=\"parameters\"></a>\n\n## Parámetros\n\n- header: x-idempotency-key (string; opcional). Clave de idempotencia — cualquier cadena opaca, un uuid v4 funciona bien. Repetir la llamada con la misma clave en esta ruta dentro de 1 hora reproduce la respuesta almacenada en lugar de actuar de nuevo; una reproducción incluye `X-Idempotency-Cached: true` y `X-Idempotency-Timestamp`. Omite el encabezado para optar por no participar.\n\nTipo: string\n\nEjemplo: \"9f1c2b7e-5a3d-4f61-9b0e-2c7d4a8e1f35\"\n\n<a id=\"request-body-ordercreaterequest\"></a>\n\n## Cuerpo de la solicitud · OrderCreateRequest\n\napplication/json · obligatorio\n\nEsquema: OrderCreateRequest\n\nTipo: object\n\nCampos obligatorios: accountId, marketId, type, direction, amount\n\nTipos de campos obligatorios: accountId (string · uuid; obligatorio), marketId (string · uuid; obligatorio), type (string · enum; obligatorio), direction (string · enum; obligatorio), amount (string · int32; obligatorio)\n\n- accountId (string · uuid; obligatorio)\n\naccountId ejemplo: 00000000-0000-4000-8000-000000000000\n\naccountId.Tipo: string · uuid\n\naccountId.Cuenta de trader en la que se coloca la orden. Debe pertenecer al llamador.\n\naccountId.format: uuid\n\naccountId.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- marketId (string · uuid; obligatorio)\n\nmarketId ejemplo: 00000000-0000-4000-8000-000000000000\n\nmarketId.Tipo: string · uuid\n\nmarketId.Mercado en el que se coloca la orden, tal como lo devuelve `GET /v2/markets`.\n\nmarketId.format: uuid\n\nmarketId.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- type (string · enum; obligatorio)\n\ntype ejemplo: market\n\ntype.Tipo: string · enum\n\ntype.Tipo de orden. Tipos de aumento (apertura de posición): `market`, `limit`, `stop_market`, `stop_limit`. Tipos de cierre, vinculados a una posición existente: `stop`, `take`, `trailing_stop`. `liquidation` es generado por la propia plataforma y `add_margin` / `remove_margin` son heredados; ninguno de los tres se acepta aquí.\n\ntype.Valores permitidos: [\"market\",\"limit\",\"stop\",\"trailing_stop\",\"take\",\"stop_limit\",\"stop_market\"]\n\n- direction (string · enum; obligatorio)\n\ndirection ejemplo: long\n\ndirection.Tipo: string · enum\n\ndirection.Dirección de la orden. Para una orden de cierre, debe coincidir con la dirección de la posición a la que está vinculada.\n\ndirection.Valores permitidos: [\"long\",\"short\"]\n\n- positionId (string · uuid · nullable; opcional)\n\npositionId ejemplo: 00000000-0000-4000-8000-000000000000\n\npositionId.Tipo: string · uuid · nullable\n\npositionId.Posición a la que está vinculada una orden de cierre (`stop`, `take`, `trailing_stop`). Obligatoria para esos tipos, ignorada para las órdenes de aumento.\n\npositionId.format: uuid\n\npositionId.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- amount (string · int32; obligatorio)\n\namount ejemplo: 100000000000\n\namount.Tipo: string · int32\n\namount.Con qué se dimensiona la orden, fp9 en bruto: la unidad depende de la clase de orden. En una orden de aumento (`market`, `limit`, `stop_market`, `stop_limit`) es un monto **cotización** reservado del saldo libre (margen, comisión, spread y buffer): la cuenta debe tener al menos esta cantidad, y la reserva se libera cuando se cancela la orden. En una orden de cierre (`stop`, `take`, `trailing_stop`) es el tamaño en **activo base** de la posición a cerrar y no se reserva nada; un tamaño mayor que el que mantiene la posición la cierra en su totalidad.\n\namount.format: int32\n\namount.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- expectedAmount (string · int32 · nullable; opcional)\n\nexpectedAmount ejemplo: 0\n\nexpectedAmount.Tipo: string · int32 · nullable\n\nexpectedAmount.Tolerancia de deslizamiento para órdenes de aumento: el tamaño de posición que el llamador espera para `amount`, fp9 en bruto. La ejecución fuera de la tolerancia falla con `slippage_tolerance`. Omitida o `0`: sin comprobación de tolerancia. No aplicable a las órdenes de cierre.\n\nexpectedAmount.format: int32\n\nexpectedAmount.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- leverage (string · int32 · nullable; opcional)\n\nleverage ejemplo: 10000000000\n\nleverage.Tipo: string · int32 · nullable\n\nleverage.Apalancamiento, fp9 en bruto (`10000000000` = 10x). Obligatorio para órdenes de incremento y debe estar dentro de los límites de apalancamiento del mercado.\n\nleverage.format: int32\n\nleverage.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- triggerPrice (string · int32 · nullable; opcional)\n\ntriggerPrice ejemplo: 65000000000000\n\ntriggerPrice.Tipo: string · int32 · nullable\n\ntriggerPrice.Precio al que se activa la orden, fp9 en bruto. Obligatorio para `limit`, `stop`, `take`, `stop_market` y `stop_limit`, y rechazado para `market`. Para `stop` / `take`, `0` significa que la orden se crea sin un disparador y se puede establecer más tarde.\n\ntriggerPrice.format: int32\n\ntriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- stopTriggerPrice (string · int32 · nullable; opcional)\n\nstopTriggerPrice ejemplo: 1000000000\n\nstopTriggerPrice.Tipo: string · int32 · nullable\n\nstopTriggerPrice.Stop-loss asociado a una orden de incremento, fp9 en bruto. Debe situarse por debajo del precio de activación de entrada para `long` y por encima de él para `short`.\n\nstopTriggerPrice.format: int32\n\nstopTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- takeTriggerPrice (string · int32 · nullable; opcional)\n\ntakeTriggerPrice ejemplo: 1000000000\n\ntakeTriggerPrice.Tipo: string · int32 · nullable\n\ntakeTriggerPrice.Take-profit asociado a una orden de incremento, fp9 en bruto. Debe situarse por encima del precio de activación de entrada para `long` y por debajo de él para `short`.\n\ntakeTriggerPrice.format: int32\n\ntakeTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- trailingStopActivationPrice (string · int32 · nullable; opcional)\n\ntrailingStopActivationPrice ejemplo: 1000000000\n\ntrailingStopActivationPrice.Tipo: string · int32 · nullable\n\ntrailingStopActivationPrice.Precio al que un `trailing_stop` comienza el trailing, fp9 en bruto. Omitido — la orden hace trailing desde el momento en que se crea.\n\ntrailingStopActivationPrice.format: int32\n\ntrailingStopActivationPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- trailingStopOffset (string · int32 · nullable; opcional)\n\ntrailingStopOffset ejemplo: 1000000000\n\ntrailingStopOffset.Tipo: string · int32 · nullable\n\ntrailingStopOffset.Distancia de seguimiento como un monto absoluto de cotización, fp9 en bruto. Se requiere exactamente uno de `trailingStopOffset` / `trailingStopOffsetPercent`.\n\ntrailingStopOffset.format: int32\n\ntrailingStopOffset.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- trailingStopOffsetPercent (string · int32 · nullable; opcional)\n\ntrailingStopOffsetPercent ejemplo: 50000000\n\ntrailingStopOffsetPercent.Tipo: string · int32 · nullable\n\ntrailingStopOffsetPercent.Distancia de seguimiento como una fracción del precio, fp9 en bruto y estrictamente por debajo de `1000000000` (100%). Se requiere exactamente uno de `trailingStopOffset` / `trailingStopOffsetPercent`.\n\ntrailingStopOffsetPercent.format: int32\n\ntrailingStopOffsetPercent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- stopLimitPrice (string · int32 · nullable; opcional)\n\nstopLimitPrice ejemplo: 1000000000\n\nstopLimitPrice.Tipo: string · int32 · nullable\n\nstopLimitPrice.Precio límite al que se coloca una orden `stop_limit` una vez que se activa su disparador, fp9 en bruto. Obligatorio para ese tipo; debe estar en o por debajo del precio de activación para `long` y en o por encima de él para `short`.\n\nstopLimitPrice.format: int32\n\nstopLimitPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- sizeMode (string · enum; opcional)\n\nsizeMode ejemplo: quote\n\nsizeMode.Tipo: string · enum\n\nsizeMode.Cómo se expresa el tamaño de una orden de aumento: `quote` (predeterminado) lo dimensiona por `amount`, `base` lo dimensiona por `baseSize` mientras que `amount` permanece como reserva. Solo órdenes de aumento — una orden de cierre siempre se dimensiona por `amount` en unidades del activo base.\n\nsizeMode.Valores permitidos: [\"quote\",\"base\"]\n\n- baseSize (string · int32 · nullable; opcional)\n\nbaseSize ejemplo: 1000000000\n\nbaseSize.Tipo: string · int32 · nullable\n\nbaseSize.Tamaño de la orden en unidades del activo base, fp9 en bruto. Obligatorio cuando `sizeMode` es `base` y rechazado en caso contrario, y significativo solo para órdenes de aumento.\n\nbaseSize.format: int32\n\nbaseSize.pattern: ^(?:-?[1-9][0-9]*|0)$\n\nEjemplo\n\n\n\n```json\n{\n  \"accountId\": \"00000000-0000-4000-8000-000000000000\",\n  \"marketId\": \"00000000-0000-4000-8000-000000000000\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"amount\": \"100000000000\"\n}\n```\n\n<a id=\"example-curl\"></a>\n\n## Ejemplo · cURL\n\n```bash\ncurl --request POST 'https://api.upscale.trade/orders' \\\n  --header 'Accept: application/json' \\\n  --header 'Authorization: Bearer YOUR_API_KEY' \\\n  --header 'Content-Type: application/json' \\\n  --data-raw '{\n  \"accountId\": \"00000000-0000-4000-8000-000000000000\",\n  \"marketId\": \"00000000-0000-4000-8000-000000000000\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"amount\": \"100000000000\"\n}'\n```\n\n<a id=\"example-javascript\"></a>\n\n## Ejemplo · JavaScript\n\n```javascript\nconst response = await fetch(\"https://api.upscale.trade/orders\", {\n  method: \"POST\",\n  headers: {\n    \"Accept\": \"application/json\",\n    \"Authorization\": \"Bearer YOUR_API_KEY\",\n    \"Content-Type\": \"application/json\"\n  },\n  body: \"{\\n  \\\"accountId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"marketId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"type\\\": \\\"market\\\",\\n  \\\"direction\\\": \\\"long\\\",\\n  \\\"amount\\\": \\\"100000000000\\\"\\n}\",\n});\nconsole.log(response.status, await response.text());\n```\n\n<a id=\"example-python\"></a>\n\n## Ejemplo · Python\n\n```python\nimport requests\n\nresponse = requests.request(\n    \"POST\",\n    \"https://api.upscale.trade/orders\",\n    headers={\"Accept\":\"application/json\",\"Authorization\":\"Bearer YOUR_API_KEY\",\"Content-Type\":\"application/json\"},\n    data=\"{\\n  \\\"accountId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"marketId\\\": \\\"00000000-0000-4000-8000-000000000000\\\",\\n  \\\"type\\\": \\\"market\\\",\\n  \\\"direction\\\": \\\"long\\\",\\n  \\\"amount\\\": \\\"100000000000\\\"\\n}\",\n    timeout=30,\n)\nprint(response.status_code, response.text)\n```\n\n<a id=\"response-401\"></a>\n\n## Respuesta 401\n\n**401**  — No autorizado\n\n<a id=\"response-403\"></a>\n\n## Respuesta 403\n\n**403**  — La cuenta pertenece a otro usuario (`account_access_denied`), o la solicitud se autentica con una clave de API mientras `api_trading` está deshabilitado en la cuenta (`api_trading_not_enabled`). El trading en la cuenta ha terminado en su estado actual (`challenge_closed`), o la cuenta está bloqueada por el límite de capital gestionado (`funded_limit_trading_locked`). El mercado está en pausa (`market_paused`) o solo acepta órdenes de cierre (`market_close_only`).\n\n<a id=\"response-404\"></a>\n\n## Respuesta 404\n\n**404**  — No existe tal cuenta, mercado o posición.\n\n<a id=\"response-409\"></a>\n\n## Respuesta 409\n\n**409**  — Otra llamada con la misma `x-idempotency-key` sigue en ejecución (`idempotency_key_in_flight`). Reintenta cuando haya terminado.\n\n<a id=\"response-429\"></a>\n\n## Respuesta 429\n\n**429**  — Se superó el límite de velocidad de la clave de API (`api_key_rate_limit_exceeded`). `Retry-After` indica cuándo volver; el cuerpo incluye el bucket (`read` / `write`), la ventana que se activó, su límite y `retryAt`.\n\n<a id=\"response-default-orderresponse\"></a>\n\n## Respuesta default · OrderResponse\n\n**default** application/json — Respuesta\n\nEsquema: OrderResponse\n\nTipo: object\n\nCampos obligatorios: id, txId, trader, market, status, type, direction, triggerPrice, requestedTriggerPrice, stopPrice, limitPrice, stopTriggerPrice, takeTriggerPrice, trailingStopActivationPrice, trailingStopOffset, trailingStopOffsetPercent, leverage, index, positionId, parentOrderId, expiration, amount, indexPrice, settlementOraclePrice, createdAt, error, realizedPnl, rawRealizedPnl, profitAdjustmentApplied, executedAfterPause, sizeMode, baseSize, reservedAmount, errorCode, reason\n\nTipos de campos obligatorios: id (string · uuid; obligatorio), txId (string; obligatorio), trader (string · uuid; obligatorio), market (string · uuid; obligatorio), status (string · enum; obligatorio), type (string · enum; obligatorio), direction (string · enum; obligatorio), triggerPrice (string · int32; obligatorio), requestedTriggerPrice (string · int32 · nullable; obligatorio), stopPrice (string · int32; obligatorio), limitPrice (string · int32; obligatorio), stopTriggerPrice (string · int32; obligatorio), takeTriggerPrice (string · int32; obligatorio), trailingStopActivationPrice (string · int32; obligatorio), trailingStopOffset (string · int32; obligatorio), trailingStopOffsetPercent (string · int32; obligatorio), leverage (string · int32 · nullable; obligatorio), index (string; obligatorio), positionId (string[]; obligatorio), parentOrderId (string[]; obligatorio), expiration (string · date-time · nullable; obligatorio), amount (string · int32; obligatorio), indexPrice (string · int32 · nullable; obligatorio), settlementOraclePrice (string · int32; obligatorio), createdAt (string · date-time; obligatorio), error (string[]; obligatorio), realizedPnl (string · int32 · nullable; obligatorio), rawRealizedPnl (string · int32 · nullable; obligatorio), profitAdjustmentApplied (boolean; obligatorio), executedAfterPause (boolean; obligatorio), sizeMode (string · enum; obligatorio), baseSize (string · int32 · nullable; obligatorio), reservedAmount (string · int32 · nullable; obligatorio), errorCode (string[]; obligatorio), reason (string · enum · nullable; obligatorio)\n\n- id (string · uuid; obligatorio)\n\nid ejemplo: 00000000-0000-4000-8000-000000000000\n\nid.Tipo: string · uuid\n\nid.Identificador de la orden.\n\nid.format: uuid\n\nid.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- txId (string; obligatorio)\n\ntxId ejemplo: string\n\ntxId.Tipo: string\n\ntxId.Identificador de la orden. Se conserva por compatibilidad con versiones anteriores, siempre igual a `id`.\n\n- trader (string · uuid; obligatorio)\n\ntrader ejemplo: 00000000-0000-4000-8000-000000000000\n\ntrader.Tipo: string · uuid\n\ntrader.Cuenta del trader a la que pertenece la orden.\n\ntrader.format: uuid\n\ntrader.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- market (string · uuid; obligatorio)\n\nmarket ejemplo: 00000000-0000-4000-8000-000000000000\n\nmarket.Tipo: string · uuid\n\nmarket.Mercado en el que se coloca la orden.\n\nmarket.format: uuid\n\nmarket.pattern: ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$\n\n- status (string · enum; obligatorio)\n\nstatus ejemplo: active\n\nstatus.Tipo: string · enum\n\nstatus.Estado del ciclo de vida: `active` mientras espera, `executed` una vez ejecutada, `canceled` cuando es cancelada por el trader o la plataforma, `canceled_by_update` cuando es reemplazada por una edición, `canceled_by_position` cuando la posición a la que estaba vinculada desapareció, `canceled_by_error` cuando falló la ejecución — consulta `errorCode`.\n\nstatus.Valores permitidos: [\"active\",\"canceled\",\"canceled_by_update\",\"canceled_by_error\",\"canceled_by_position\",\"executed\"]\n\n- type (string · enum; obligatorio)\n\ntype ejemplo: market\n\ntype.Tipo: string · enum\n\ntype.Tipo de orden. `liquidation` marca una orden que el propio motor generó.\n\ntype.Valores permitidos: [\"market\",\"limit\",\"stop\",\"trailing_stop\",\"take\",\"stop_limit\",\"stop_market\",\"liquidation\"]\n\n- direction (string · enum; obligatorio)\n\ndirection ejemplo: long\n\ndirection.Tipo: string · enum\n\ndirection.Dirección de la orden.\n\ndirection.Valores permitidos: [\"long\",\"short\"]\n\n- triggerPrice (string · int32; obligatorio)\n\ntriggerPrice ejemplo: 1000000000\n\ntriggerPrice.Tipo: string · int32\n\ntriggerPrice.Precio al que se dispara la orden, fp9 en bruto. `0` cuando la orden no lleva disparador.\n\ntriggerPrice.format: int32\n\ntriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- requestedTriggerPrice (string · int32 · nullable; obligatorio)\n\nrequestedTriggerPrice ejemplo: 1000000000\n\nrequestedTriggerPrice.Tipo: string · int32 · nullable\n\nrequestedTriggerPrice.Precio de activación tal como se solicitó, antes de que el motor lo desplazara hasta la distancia mínima de stop, fp9 en bruto. Nulo cuando el precio solicitado se mantuvo tal cual.\n\nrequestedTriggerPrice.format: int32\n\nrequestedTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- stopPrice (string · int32; obligatorio)\n\nstopPrice ejemplo: 1000000000\n\nstopPrice.Tipo: string · int32\n\nstopPrice.Precio de activación de una orden `stop_market` / `stop_limit`, fp9 en bruto; `0` para cualquier otro tipo.\n\nstopPrice.format: int32\n\nstopPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- limitPrice (string · int32; obligatorio)\n\nlimitPrice ejemplo: 1000000000\n\nlimitPrice.Tipo: string · int32\n\nlimitPrice.Precio al que se coloca la orden una vez activada, fp9 en bruto: el precio stop-limit, recurriendo al precio de activación como alternativa.\n\nlimitPrice.format: int32\n\nlimitPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- stopTriggerPrice (string · int32; obligatorio)\n\nstopTriggerPrice ejemplo: 1000000000\n\nstopTriggerPrice.Tipo: string · int32\n\nstopTriggerPrice.Stop-loss asociado a la orden, fp9 en bruto. `0` cuando no hay ninguno asociado.\n\nstopTriggerPrice.format: int32\n\nstopTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- takeTriggerPrice (string · int32; obligatorio)\n\ntakeTriggerPrice ejemplo: 1000000000\n\ntakeTriggerPrice.Tipo: string · int32\n\ntakeTriggerPrice.Take-profit asociado a la orden, fp9 en bruto. `0` cuando no hay ninguno asociado.\n\ntakeTriggerPrice.format: int32\n\ntakeTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- trailingStopActivationPrice (string · int32; obligatorio)\n\ntrailingStopActivationPrice ejemplo: 1000000000\n\ntrailingStopActivationPrice.Tipo: string · int32\n\ntrailingStopActivationPrice.Precio al que un stop móvil comienza a hacer seguimiento, fp9 sin procesar. `0` cuando hace seguimiento desde la creación.\n\ntrailingStopActivationPrice.format: int32\n\ntrailingStopActivationPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- trailingStopOffset (string · int32; obligatorio)\n\ntrailingStopOffset ejemplo: 1000000000\n\ntrailingStopOffset.Tipo: string · int32\n\ntrailingStopOffset.Distancia de seguimiento como un importe absoluto de cotización, fp9 sin procesar. `0` cuando la distancia se establece como porcentaje.\n\ntrailingStopOffset.format: int32\n\ntrailingStopOffset.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- trailingStopOffsetPercent (string · int32; obligatorio)\n\ntrailingStopOffsetPercent ejemplo: 1000000000\n\ntrailingStopOffsetPercent.Tipo: string · int32\n\ntrailingStopOffsetPercent.Distancia de seguimiento como una fracción del precio, fp9 sin procesar. `0` cuando la distancia es absoluta.\n\ntrailingStopOffsetPercent.format: int32\n\ntrailingStopOffsetPercent.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- leverage (string · int32 · nullable; obligatorio)\n\nleverage ejemplo: 1000000000\n\nleverage.Tipo: string · int32 · nullable\n\nleverage.Apalancamiento de la orden, fp9 en bruto. Nulo en órdenes de cierre, que heredan el apalancamiento de la posición.\n\nleverage.format: int32\n\nleverage.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- index (string; obligatorio)\n\nindex ejemplo: string\n\nindex.Tipo: string\n\nindex.Identificador de la orden. Se conserva por compatibilidad con versiones anteriores, siempre igual a `id`.\n\n- positionId (string[]; obligatorio)\n\npositionId ejemplo: [\n  \"string\"\n]\n\npositionId.Tipo: string[]\n\npositionId.Posición a la que está asociada una orden de cierre. Nulo para órdenes que abren o aumentan una posición.\n\npositionId.[]Tipo: string\n\n- parentOrderId (string[]; obligatorio)\n\nparentOrderId ejemplo: [\n  \"string\"\n]\n\nparentOrderId.Tipo: string[]\n\nparentOrderId.Orden de la que se generó esta: un stop o un take creado a partir de `stopTriggerPrice` / `takeTriggerPrice`, o la orden limit en la que se convirtió un `stop_limit`. Nulo cuando la orden se envió directamente.\n\nparentOrderId.[]Tipo: string\n\n- expiration (string · date-time · nullable; obligatorio)\n\nexpiration ejemplo: 2026-05-01T12:30:00.000Z\n\nexpiration.Tipo: string · date-time · nullable\n\nexpiration.Siempre nulo. Se mantiene por compatibilidad con versiones anteriores: las órdenes no expiran por sí solas.\n\nexpiration.format: date-time\n\n- amount (string · int32; obligatorio)\n\namount ejemplo: 1000000000\n\namount.Tipo: string · int32\n\namount.Tamaño de la orden, fp9 en bruto, en la unidad que usa su clase: en una orden de incremento, un importe de cotización — la reserva mientras espera, y lo que realmente gastó una vez ejecutada; en una orden de cierre (`stop`, `take`, `trailing_stop`), el tamaño del activo base que cierra, tal como se solicitó al crearla.\n\namount.format: int32\n\namount.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- indexPrice (string · int32 · nullable; obligatorio)\n\nindexPrice ejemplo: 1000000000\n\nindexPrice.Tipo: string · int32 · nullable\n\nindexPrice.Precio índice al que se ejecutó la orden, fp9 en bruto. Nulo mientras la orden no se haya ejecutado.\n\nindexPrice.format: int32\n\nindexPrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- settlementOraclePrice (string · int32; obligatorio)\n\nsettlementOraclePrice ejemplo: 1000000000\n\nsettlementOraclePrice.Tipo: string · int32\n\nsettlementOraclePrice.Siempre `1000000000` (1.0). Se mantiene por compatibilidad con versiones anteriores.\n\nsettlementOraclePrice.format: int32\n\nsettlementOraclePrice.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- createdAt (string · date-time; obligatorio)\n\ncreatedAt ejemplo: 2026-05-01T12:30:00.000Z\n\ncreatedAt.Tipo: string · date-time\n\ncreatedAt.Cuándo se aceptó la orden.\n\ncreatedAt.format: date-time\n\n- error (string[]; obligatorio)\n\nerror ejemplo: [\n  \"string\"\n]\n\nerror.Tipo: string[]\n\nerror.Siempre null. Se mantiene por compatibilidad hacia atrás — utilice `errorCode`.\n\nerror.[]Tipo: string\n\n- realizedPnl (string · int32 · nullable; obligatorio)\n\nrealizedPnl ejemplo: 1000000000\n\nrealizedPnl.Tipo: string · int32 · nullable\n\nrealizedPnl.Pnl realizado por esta orden, fp9 en bruto. Se establece solo en una orden de cierre ejecutada; null mientras está pendiente y en órdenes que abren o aumentan una posición.\n\nrealizedPnl.format: int32\n\nrealizedPnl.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- rawRealizedPnl (string · int32 · nullable; obligatorio)\n\nrawRealizedPnl ejemplo: 1000000000\n\nrawRealizedPnl.Tipo: string · int32 · nullable\n\nrawRealizedPnl.Pnl realizado antes del ajuste de 60 segundos, fp9 en bruto. Difiere de `realizedPnl` solo cuando se activó el ajuste.\n\nrawRealizedPnl.format: int32\n\nrawRealizedPnl.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- profitAdjustmentApplied (boolean; obligatorio)\n\nprofitAdjustmentApplied ejemplo: true\n\nprofitAdjustmentApplied.Tipo: boolean\n\nprofitAdjustmentApplied.Si el ajuste de 60 segundos limitó la ganancia de esta orden — dentro de un minuto de una apertura o un aumento, el pnl de la posición no puede crecer por encima de lo que era en ese momento.\n\n- executedAfterPause (boolean; obligatorio)\n\nexecutedAfterPause ejemplo: true\n\nexecutedAfterPause.Tipo: boolean\n\nexecutedAfterPause.Indica si la orden se ejecutó después de una pausa del mercado. No lo establece el motor actual — siempre `false`.\n\n- sizeMode (string · enum; obligatorio)\n\nsizeMode ejemplo: quote\n\nsizeMode.Tipo: string · enum\n\nsizeMode.Cómo se expresó el tamaño al crearse: `quote` dimensiona la orden por `amount`, `base` la dimensiona por `baseSize`.\n\nsizeMode.Valores permitidos: [\"quote\",\"base\"]\n\n- baseSize (string · int32 · nullable; obligatorio)\n\nbaseSize ejemplo: 1000000000\n\nbaseSize.Tipo: string · int32 · nullable\n\nbaseSize.Tamaño de la orden en unidades del activo base, fp9 en bruto. Nulo para órdenes dimensionadas por `quote`.\n\nbaseSize.format: int32\n\nbaseSize.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- reservedAmount (string · int32 · nullable; obligatorio)\n\nreservedAmount ejemplo: 1000000000\n\nreservedAmount.Tipo: string · int32 · nullable\n\nreservedAmount.Importe de quote reservado cuando se creó la orden con sizeMode=base, fp9 en bruto. Se mantiene en la reserva original después de la ejecución, mientras que `amount` se reescribe a lo que se gastó. Nulo para órdenes dimensionadas por `quote`, donde `amount` es la reserva.\n\nreservedAmount.format: int32\n\nreservedAmount.pattern: ^(?:-?[1-9][0-9]*|0)$\n\n- errorCode (string[]; obligatorio)\n\nerrorCode ejemplo: [\n  \"string\"\n]\n\nerrorCode.Tipo: string[]\n\nerrorCode.Por qué falló la ejecución, establecido junto con el estado `canceled_by_error` — por ejemplo `insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth` o `slippage_tolerance`. Nulo en caso contrario.\n\nerrorCode.[]Tipo: string\n\n- reason (string · enum · nullable; obligatorio)\n\nreason ejemplo: force_close\n\nreason.Tipo: string · enum · nullable\n\nreason.Por qué la plataforma canceló la orden por sí misma, por ejemplo `force_close` o `weekly_session_risk_close`. Nulo para cancelaciones impulsadas por el trader.\n\nreason.Valores permitidos: [\"force_close\",\"stop_accounts_fail\",\"stop_accounts_freeze\",\"stop_accounts_promote\",\"stop_accounts_manual\",\"weekly_session_risk_close\",null]\n\nEjemplo\n\n\n\n```json\n{\n  \"id\": \"00000000-0000-4000-8000-000000000000\",\n  \"txId\": \"string\",\n  \"trader\": \"00000000-0000-4000-8000-000000000000\",\n  \"market\": \"00000000-0000-4000-8000-000000000000\",\n  \"status\": \"active\",\n  \"type\": \"market\",\n  \"direction\": \"long\",\n  \"triggerPrice\": \"1000000000\",\n  \"requestedTriggerPrice\": \"1000000000\",\n  \"stopPrice\": \"1000000000\",\n  \"limitPrice\": \"1000000000\",\n  \"stopTriggerPrice\": \"1000000000\",\n  \"takeTriggerPrice\": \"1000000000\",\n  \"trailingStopActivationPrice\": \"1000000000\",\n  \"trailingStopOffset\": \"1000000000\",\n  \"trailingStopOffsetPercent\": \"1000000000\",\n  \"leverage\": \"1000000000\",\n  \"index\": \"string\",\n  \"positionId\": [\n    \"string\"\n  ],\n  \"parentOrderId\": [\n    \"string\"\n  ],\n  \"expiration\": \"2026-05-01T12:30:00.000Z\",\n  \"amount\": \"1000000000\",\n  \"indexPrice\": \"1000000000\",\n  \"settlementOraclePrice\": \"1000000000\",\n  \"createdAt\": \"2026-05-01T12:30:00.000Z\",\n  \"error\": [\n    \"string\"\n  ],\n  \"realizedPnl\": \"1000000000\",\n  \"rawRealizedPnl\": \"1000000000\",\n  \"profitAdjustmentApplied\": true,\n  \"executedAfterPause\": true,\n  \"sizeMode\": \"quote\",\n  \"baseSize\": \"1000000000\",\n  \"reservedAmount\": \"1000000000\",\n  \"errorCode\": [\n    \"string\"\n  ],\n  \"reason\": \"force_close\"\n}\n```","text":"Crear nueva orden Coloca una orden y la devuelve tal como la almacenó el motor de trading. Las órdenes de incremento (`market`, `limit`, `stop_market`, `stop_limit`) abren o amplían una posición; las órdenes de cierre (`stop`, `take`, `trailing_stop`) se vinculan a una posición existente mediante `positionId`. `amount` se lee en una unidad diferente por cada uno de los dos: en una orden de aumento es un importe de cotización reservado del saldo libre, en una orden de cierre es el tamaño del activo base de la posición a cerrar, sin reservar nada. El resto de los campos de tamaño (`expectedAmount`, `sizeMode`, `baseSize`, `leverage`) pertenecen solo a las órdenes de aumento. Más allá del esquema a nivel de campo, la solicitud se verifica para: - **Forma para el tipo.** Cada rechazo aquí es un `400` cuyo código nombra la combinación de campos en falta: - tamaño — `amount_not_positive`, `base_size_required`, `base_size_negative`, `base_size_not_allowed`; - apalancamiento — `leverage_required`, `leverage_negative`; - precio de activación — `trigger_price_required`, `trigger_price_negative`; - stop-loss / take-profit adjuntos a una orden de incremento — `stop_trigger_price_negative`, `take_trigger_price_negative`, `stop_trigger_price_gt_trigger_price`, `stop_trigger_price_lt_trigger_price`, `take_trigger_price_gt_trigger_price`, `take_trigger_price_lt_trigger_price`; - precio de stop-limit — `stop_limit_price_required`, `stop_limit_price_negative`, `stop_limit_price_gt_trigger_price`, `stop_limit_price_lt_trigger_price`; - stop móvil — `trailing_stop_activation_price_negative`, `trailing_stop_offset_required`, `trailing_stop_offset_conflict`, `trailing_stop_offset_negative`, `trailing_stop_offset_percent_negative`, `trailing_stop_offset_percent_gte_one`; - órdenes de cierre — `position_id_required`. - **Apalancamiento** de una orden de incremento. Debe mantenerse dentro de los límites del mercado: no por debajo del mínimo del mercado ni por encima del máximo de la fase, con `invalid_leverage` (`leverage` más `minLeverage` o `maxLeverage` en el cuerpo). - **Cuenta.** Debe pertenecer al llamador y estar en un estado de trading; las órdenes de incremento se rechazan además mientras la cuenta está bloqueada por el límite de capital gestionado, y necesitan `amount` disponible como saldo libre. - **Mercado.** Debe estar abierto y dentro de la categoría en la que la cuenta puede operar (cripto o RWA). Un mercado de solo cierre no acepta nada más que una orden `take` creada sin un precio de activación. - **Posición**, cuando se proporciona `positionId`: debe existir (`position_not_found`), estar abierta, estar en la misma cuenta, pertenecer al mismo mercado y tener la misma dirección que la orden (`position_not_available`). - **Precio de activación**, contra el precio de mercado actual y — para `stop` / `take` — contra el precio de liquidación de la posición (`trigger_price_gt_current`, `trigger_price_lt_current`, `trigger_price_gt_liquidation`, `trigger_price_lt_liquidation`). Una orden `market` con un stop-loss / take-profit adjunto se comprueba contra el precio de liquidación que tendría su posición después de la ejecución: `market_price_unavailable` cuando no hay un precio actual contra el que comprobar, `order_validation_invariant` cuando faltan los campos de tamaño necesarios para esa proyección. - **Nocional** de una orden de aumento. `(amount − fee) × leverage` debe ajustarse al nocional abierto máximo que el mercado permite en esa dirección (`order_exceeds_max_open_notional`). Una orden diferida no se ejecuta aquí, por lo que aún puede fallar cuando su disparador se active más tarde: entonces termina con el estado `canceled_by_error` y un `errorCode` (`insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth`, `order_exceeds_max_open_notional`, `order_zero_size_at_execution`, `slippage_tolerance`, `market_close_only_at_execution`), y se libera su reserva. Envía un encabezado `x-idempotency-key` para que la llamada sea segura frente a repeticiones: dentro de la ventana de repetición indicada en ese encabezado, la misma clave en la misma ruta reproduce la respuesta almacenada (marcada con `X-Idempotency-Cached: true` y `X-Idempotency-Timestamp`) en lugar de actuar de nuevo, y una segunda llamada que llegue mientras la primera aún se está ejecutando recibe `409` (`idempotency_key_in_flight`). POST /orders Trading x-idempotency-key Clave de idempotencia — cualquier cadena opaca, un uuid v4 funciona bien. Repetir la llamada con la misma clave en esta ruta dentro de 1 hora reproduce la respuesta almacenada en lugar de actuar de nuevo; una reproducción incluye `X-Idempotency-Cached: true` y `X-Idempotency-Timestamp`. Omite el encabezado para optar por no participar. string accountId Trader account the order is placed on. Must belong to the caller. string · uuid marketId Market the order is placed on, as returned by `GET /v2/markets`. string · uuid type Order type. Increase (position-opening) types: `market`, `limit`, `stop_market`, `stop_limit`. Close types, attached to an existing position: `stop`, `take`, `trailing_stop`. `liquidation` is raised by the platform itself and `add_margin` / `remove_margin` are legacy — none of the three is accepted here. string · enum direction Order direction. For a close order it must match the direction of the position it is attached to. string · enum positionId Position a close order (`stop`, `take`, `trailing_stop`) is attached to. Required for those types, ignored for increase orders. string · uuid · nullable amount What the order is sized by, fp9 raw — the unit depends on the order class. On an increase order (`market`, `limit`, `stop_market`, `stop_limit`) it is a **quote** amount reserved from the free balance (margin, fee, spread and buffer): the account must hold at least this much, and the reserve is released when the order is cancelled. On a close order (`stop`, `take`, `trailing_stop`) it is the **base asset** size of the position to close and nothing is reserved; a size larger than the position holds closes it in full. string · int32 expectedAmount Slippage tolerance for increase orders: the position size the caller expects for `amount`, fp9 raw. Execution outside the tolerance fails with `slippage_tolerance`. Omitted or `0` — no tolerance check. Not applicable to close orders. string · int32 · nullable leverage Leverage, fp9 raw (`10000000000` = 10x). Required for increase orders and must be within the leverage bounds of the market. string · int32 · nullable triggerPrice Price at which the order fires, fp9 raw. Required for `limit`, `stop`, `take`, `stop_market` and `stop_limit`, and rejected for `market`. For `stop` / `take`, `0` means the order is created without a trigger and can be set later. string · int32 · nullable stopTriggerPrice Stop-loss attached to an increase order, fp9 raw. Must sit below the entry trigger price for `long` and above it for `short`. string · int32 · nullable takeTriggerPrice Take-profit attached to an increase order, fp9 raw. Must sit above the entry trigger price for `long` and below it for `short`. string · int32 · nullable trailingStopActivationPrice Price at which a `trailing_stop` starts trailing, fp9 raw. Omitted — the order trails from the moment it is created. string · int32 · nullable trailingStopOffset Trailing distance as an absolute quote amount, fp9 raw. Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required. string · int32 · nullable trailingStopOffsetPercent Trailing distance as a fraction of price, fp9 raw and strictly below `1000000000` (100%). Exactly one of `trailingStopOffset` / `trailingStopOffsetPercent` is required. string · int32 · nullable stopLimitPrice Limit price a `stop_limit` order is placed at once its trigger fires, fp9 raw. Required for that type; must be at or below the trigger price for `long` and at or above it for `short`. string · int32 · nullable sizeMode How the size of an increase order is expressed: `quote` (default) sizes it by `amount`, `base` sizes it by `baseSize` while `amount` stays the reserve. Increase orders only — a close order is always sized by `amount` in base asset units. string · enum baseSize Order size in base asset units, fp9 raw. Required when `sizeMode` is `base` and rejected otherwise, and meaningful for increase orders only. string · int32 · nullable 401 No autorizado 403 La cuenta pertenece a otro usuario (`account_access_denied`), o la solicitud se autentica con una clave de API mientras `api_trading` está deshabilitado en la cuenta (`api_trading_not_enabled`). El trading en la cuenta ha terminado en su estado actual (`challenge_closed`), o la cuenta está bloqueada por el límite de capital gestionado (`funded_limit_trading_locked`). El mercado está en pausa (`market_paused`) o solo acepta órdenes de cierre (`market_close_only`). 404 No existe tal cuenta, mercado o posición. 409 Otra llamada con la misma `x-idempotency-key` sigue en ejecución (`idempotency_key_in_flight`). Reintenta cuando haya terminado. 429 Se superó el límite de velocidad de la clave de API (`api_key_rate_limit_exceeded`). `Retry-After` indica cuándo volver; el cuerpo incluye el bucket (`read` / `write`), la ventana que se activó, su límite y `retryAt`. default Respuesta id Order identifier. string · uuid txId Order identifier. Kept for backward compatibility, always equal to `id`. string trader Trader account the order belongs to. string · uuid market Market the order is placed on. string · uuid status Lifecycle state: `active` while it waits, `executed` once filled, `canceled` when cancelled by the trader or the platform, `canceled_by_update` when replaced by an edit, `canceled_by_position` when the position it was attached to went away, `canceled_by_error` when execution failed — see `errorCode`. string · enum type Order type. `liquidation` marks an order the engine raised itself. string · enum direction Order direction. string · enum triggerPrice Price at which the order fires, fp9 raw. `0` when the order carries no trigger. string · int32 requestedTriggerPrice Trigger price as requested, before the engine pushed it out to the minimum stop distance, fp9 raw. Null when the requested price was kept as is. string · int32 · nullable stopPrice Trigger price of a `stop_market` / `stop_limit` order, fp9 raw; `0` for every other type. string · int32 limitPrice Price the order is placed at once triggered, fp9 raw: the stop-limit price, falling back to the trigger price. string · int32 stopTriggerPrice Stop-loss attached to the order, fp9 raw. `0` when none is attached. string · int32 takeTriggerPrice Take-profit attached to the order, fp9 raw. `0` when none is attached. string · int32 trailingStopActivationPrice Price at which a trailing stop starts trailing, fp9 raw. `0` when it trails from creation. string · int32 trailingStopOffset Trailing distance as an absolute quote amount, fp9 raw. `0` when the distance is set as a percent. string · int32 trailingStopOffsetPercent Trailing distance as a fraction of price, fp9 raw. `0` when the distance is absolute. string · int32 leverage Leverage of the order, fp9 raw. Null on close orders, which inherit the leverage of the position. string · int32 · nullable index Order identifier. Kept for backward compatibility, always equal to `id`. string positionId Position a close order is attached to. Null for orders that open or grow a position. string[] parentOrderId Order this one was spawned from: a stop or take created out of `stopTriggerPrice` / `takeTriggerPrice`, or the limit order a `stop_limit` turned into. Null when the order was submitted directly. string[] expiration Always null. Kept for backward compatibility — orders do not expire on their own. string · date-time · nullable amount Size of the order, fp9 raw, in the unit its class uses: on an increase order a quote amount — the reserve while it waits, and what it actually spent once executed; on a close order (`stop`, `take`, `trailing_stop`) the base asset size it closes, as requested at creation. string · int32 indexPrice Index price the order executed at, fp9 raw. Null while the order has not executed. string · int32 · nullable settlementOraclePrice Always `1000000000` (1.0). Kept for backward compatibility. string · int32 createdAt When the order was accepted. string · date-time error Always null. Kept for backward compatibility — use `errorCode`. string[] realizedPnl Pnl realised by this order, fp9 raw. Set only on an executed close order; null while pending and on orders that open or grow a position. string · int32 · nullable rawRealizedPnl Realised pnl before the 60-second adjustment, fp9 raw. Differs from `realizedPnl` only when the adjustment fired. string · int32 · nullable profitAdjustmentApplied Whether the 60-second adjustment capped the profit of this order — inside a minute of an open or increase the position pnl cannot grow above what it was at that moment. boolean executedAfterPause Whether the order executed after a market pause. Not set by the current engine — always `false`. boolean sizeMode How the size was expressed on creation: `quote` sizes the order by `amount`, `base` sizes it by `baseSize`. string · enum baseSize Order size in base asset units, fp9 raw. Null for `quote`-sized orders. string · int32 · nullable reservedAmount Quote amount reserved when the order with sizeMode=base was created, fp9 raw. Stays at the original reserve after execution, while `amount` is rewritten to what was spent. Null for `quote`-sized orders, where `amount` is the reserve. string · int32 · nullable errorCode Why execution failed, set together with status `canceled_by_error` — for example `insufficient_reserve_at_execution`, `order_below_min_notional`, `order_exceeds_market_depth` or `slippage_tolerance`. Null otherwise. string[] reason Why the platform cancelled the order itself, for example `force_close` or `weekly_session_risk_close`. Null for trader-driven cancellations. string · enum · nullable","api":{"title":"API pública de Upscale","version":"d796ac9","documentation":"https://docs.upscale.trade/es/developers","playgroundServer":"https://api.upscale.trade"}}