Upscale
Menu
On this page

Cambiar el precio de activación de la orden

Probar ↓
PATCH/orders/{orderId}
Cambiar el precio de activación de la ordenTrading

Edita una orden pendiente: precio de activación, amount reservado, tolerancia al deslizamiento, o tamaño base. El motor hace esto reemplazando la orden, por lo que la respuesta contiene una nueva orden con un nuevo identificador, mientras que la anterior termina como canceled_by_update.

Verificado más allá del esquema:

  • La orden debe existir y seguir estando active, y su cuenta debe pertenecer al solicitante y estar en un estado de trading.
  • Las órdenes market y liquidation no se pueden editar en absoluto, ni tampoco una orden stop / take que se creó sin un precio de activación (order_not_updatable); un precio de activación que está establecido no se puede restablecer a 0 (trigger_price_reset_forbidden).
  • Aumentar la reserva de una orden de incremento requiere la diferencia como saldo libre, y se rechaza mientras la cuenta esté bloqueada por el límite de capital gestionado.
  • Una orden creada con sizeMode: base necesita un amount nuevo siempre que baseSize cambie (base_size_requires_amount).
  • El mercado debe estar abierto, y la orden resultante se vuelve a comprobar exactamente como en la creación — la misma forma de campos, precio de activación y códigos de nocional listados en POST /orders se aplican aquí, excepto invalid_leverage: el apalancamiento no se puede editar.

Una solicitud que no establece ninguno de los campos no cambia nada y devuelve la orden tal como está.

URL base https://api.upscale.trade

Autorización

bearerhttp · bearerobligatorio

Clave de API personal, con el prefijo usk_.

Parámetros

Ruta
orderIdstring · uuidobligatorio

Identificador de la orden que se va a editar.

Ejemplo: 00000000-0000-4000-8000-000000000000

Cuerpo de la solicitud · obligatorio

Campos opcionales: 4
triggerPricestring · fp9opcional

New trigger price, fp9 raw. Bounds are re-checked against the current market price (and, for stop / take, against the liquidation price of the position). A trigger price that is already set cannot be reset to 0.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 65000000000000
amountstring · fp9opcional

New amount, fp9 raw, in the unit its order class uses — see the same field on order creation. On an increase order it is the quote reserve: growing it requires the difference to be available as free balance, and it is required together with baseSize on a base-sized order. On a close order it is the base asset size of the position to close.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 100000000000
expectedAmountstring · fp9opcional

New slippage tolerance, fp9 raw. See the same field on order creation.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
baseSizestring · fp9opcional

New size in base asset units, fp9 raw. Only for orders created with sizeMode: base.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000

Ejemplos

curl --request PATCH 'https://api.upscale.trade/orders/{orderId}' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data-raw '{}'

Respuestas

401

No autorizado

403

La orden ya no está activa. La cuenta pertenece a otro usuario (account_access_denied), o la solicitud está autenticada 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 hay ninguna orden con este identificador.

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.

defaultRespuestaapplication/json
idstring · uuidobligatorio

Order identifier.

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})$
Ejemplo: 00000000-0000-4000-8000-000000000000
traderstring · uuidobligatorio

Trader account the order belongs to.

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})$
Ejemplo: 00000000-0000-4000-8000-000000000000
marketstring · uuidobligatorio

Market the order is placed on.

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})$
Ejemplo: 00000000-0000-4000-8000-000000000000
statusstring · enumobligatorio

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.

Permitido: "active" "canceled" "canceled_by_update" "canceled_by_error" "canceled_by_position" "executed"
Ejemplo: active
typestring · enumobligatorio

Order type. liquidation marks an order the engine raised itself.

Permitido: "market" "limit" "stop" "trailing_stop" "take" "stop_limit" "stop_market" "liquidation"
Ejemplo: market
directionstring · enumobligatorio

Order direction.

Permitido: "long" "short"
Ejemplo: long
triggerPricestring · fp9obligatorio

Price at which the order fires, fp9 raw. 0 when the order carries no trigger.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
requestedTriggerPricestring · fp9 · nullableobligatorio

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.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
stopPricestring · fp9obligatorio

Trigger price of a stop_market / stop_limit order, fp9 raw; 0 for every other type.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
limitPricestring · fp9obligatorio

Price the order is placed at once triggered, fp9 raw: the stop-limit price, falling back to the trigger price.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
stopTriggerPricestring · fp9obligatorio

Stop-loss attached to the order, fp9 raw. 0 when none is attached.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
takeTriggerPricestring · fp9obligatorio

Take-profit attached to the order, fp9 raw. 0 when none is attached.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
trailingStopActivationPricestring · fp9obligatorio

Price at which a trailing stop starts trailing, fp9 raw. 0 when it trails from creation.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
trailingStopOffsetstring · fp9obligatorio

Trailing distance as an absolute quote amount, fp9 raw. 0 when the distance is set as a percent.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
trailingStopOffsetPercentstring · fp9obligatorio

Trailing distance as a price multiplier, fp9 raw: one minus the percent, so 5% is 950000000. 0 when the distance is absolute.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
leveragestring · fp9 · nullableobligatorio

Leverage of the order, fp9 raw. Null on close orders, which inherit the leverage of the position.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
positionIdstring · nullableobligatorio

Position a close order is attached to. Null for orders that open or grow a position.

Ejemplo: string
parentOrderIdstring · nullableobligatorio

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.

Ejemplo: string
amountstring · fp9obligatorio

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.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
indexPricestring · fp9 · nullableobligatorio

Index price the order executed at, fp9 raw. Null while the order has not executed.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
recentVolumestring · fp9 · nullableobligatorio

Volume of the previous opens and increases on the same account, market and direction that was still counted in the price impact of this order when it executed, USD fp9 raw. The recovery window is configurable, 60 seconds by default. Fixed at execution. Null for orders that have not executed, close orders and markets without dynamic price impact.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
priceImpactstring · fp9 · nullableobligatorio

Price impact applied to this open or increase, excluding the static spread, as a fraction fp9 raw (10000000 = 1%). Includes the recent volume in recentVolume. Fixed at execution. Null for orders that have not executed, close orders and markets without dynamic price impact.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
createdAtstring · date-timeobligatorio

When the order was accepted.

Ejemplo: 2026-05-01T12:30:00.000Z
realizedPnlstring · fp9 · nullableobligatorio

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.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
rawRealizedPnlstring · fp9 · nullableobligatorio

Realised pnl before the 60-second adjustment, fp9 raw. Differs from realizedPnl only when the adjustment fired.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
profitAdjustmentAppliedbooleanobligatorio

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.

Ejemplo: true
sizeModestring · enumobligatorio

How the size was expressed on creation: quote sizes the order by amount, base sizes it by baseSize.

Permitido: "quote" "base"
Ejemplo: quote
baseSizestring · fp9 · nullableobligatorio

Order size in base asset units, fp9 raw. Null for quote-sized orders.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
reservedAmountstring · fp9 · nullableobligatorio

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.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
errorCodestring · nullableobligatorio

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.

Ejemplo: string
reasonstring · enum · nullableobligatorio

Why the platform cancelled the order itself, for example force_close or weekly_session_risk_close. Null for trader-driven cancellations.

Permitido: "force_close" "stop_accounts_fail" "stop_accounts_freeze" "stop_accounts_promote" "stop_accounts_manual" "weekly_session_risk_close"
Ejemplo: force_close
vpiobject · nullableobligatorio

VPI parameters of the market at the moment the order executed. Null while the order has not executed.

Objeto · 5 campos
spreadstring · fp9obligatorio

Spread charged on top of the index price, fp9 raw fraction.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
marketDepthLongstringobligatorio

Depth on the long side, in whole USD — not fp9.

pattern
^-?[0-9]+(\.[0-9]+)?$
Ejemplo: 45604631.000000000
marketDepthShortstringobligatorio

Depth on the short side, in whole USD — not fp9.

pattern
^-?[0-9]+(\.[0-9]+)?$
Ejemplo: 38744214.000000000
coefficientLongstring · fp9obligatorio

Price-impact coefficient applied to long orders, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
coefficientShortstring · fp9obligatorio

Price-impact coefficient applied to short orders, fp9 raw.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
Ver ejemplo
{
  "spread": "1000000000",
  "marketDepthLong": "45604631.000000000",
  "marketDepthShort": "38744214.000000000",
  "coefficientLong": "1000000000",
  "coefficientShort": "1000000000"
}