/orders/{orderId}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
marketyliquidationno se pueden editar en absoluto, ni tampoco una ordenstop/takeque se creó sin un precio de activación (order_not_updatable); un precio de activación que está establecido no se puede restablecer a0(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: basenecesita unamountnuevo siempre quebaseSizecambie (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 /ordersse aplican aquí, exceptoinvalid_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á.
https://api.upscale.tradeParámetros
orderIdstring · uuidobligatorioIdentificador de la orden que se va a editar.
00000000-0000-4000-8000-000000000000Cuerpo de la solicitud · obligatorio
Campos opcionales: 4
triggerPricestring · fp9opcionalNew 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)$
65000000000000amountstring · fp9opcionalNew 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)$
100000000000expectedAmountstring · fp9opcionalNew slippage tolerance, fp9 raw. See the same field on order creation.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000baseSizestring · fp9opcionalNew size in base asset units, fp9 raw. Only for orders created with sizeMode: base.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
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 '{}'const response = await fetch("https://api.upscale.trade/orders/{orderId}", {
method: "PATCH",
headers: {
"Accept": "application/json",
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: "{}",
});
console.log(response.status, await response.text());import requests
response = requests.request(
"PATCH",
"https://api.upscale.trade/orders/{orderId}",
headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY","Content-Type":"application/json"},
data="{}",
timeout=30,
)
print(response.status_code, response.text)Respuestas
No autorizado
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).
No hay ninguna orden con este identificador.
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 · uuidobligatorioOrder 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})$
00000000-0000-4000-8000-000000000000traderstring · uuidobligatorioTrader 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})$
00000000-0000-4000-8000-000000000000marketstring · uuidobligatorioMarket 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})$
00000000-0000-4000-8000-000000000000statusstring · enumobligatorioLifecycle 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.
"active" "canceled" "canceled_by_update" "canceled_by_error" "canceled_by_position" "executed"activetypestring · enumobligatorioOrder type. liquidation marks an order the engine raised itself.
"market" "limit" "stop" "trailing_stop" "take" "stop_limit" "stop_market" "liquidation"marketdirectionstring · enumobligatorioOrder direction.
"long" "short"longtriggerPricestring · fp9obligatorioPrice at which the order fires, fp9 raw. 0 when the order carries no trigger.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000requestedTriggerPricestring · fp9 · nullableobligatorioTrigger 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)$
1000000000stopPricestring · fp9obligatorioTrigger price of a stop_market / stop_limit order, fp9 raw; 0 for every other type.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000limitPricestring · fp9obligatorioPrice 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)$
1000000000stopTriggerPricestring · fp9obligatorioStop-loss attached to the order, fp9 raw. 0 when none is attached.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000takeTriggerPricestring · fp9obligatorioTake-profit attached to the order, fp9 raw. 0 when none is attached.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000trailingStopActivationPricestring · fp9obligatorioPrice at which a trailing stop starts trailing, fp9 raw. 0 when it trails from creation.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000trailingStopOffsetstring · fp9obligatorioTrailing distance as an absolute quote amount, fp9 raw. 0 when the distance is set as a percent.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000trailingStopOffsetPercentstring · fp9obligatorioTrailing 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)$
1000000000leveragestring · fp9 · nullableobligatorioLeverage of the order, fp9 raw. Null on close orders, which inherit the leverage of the position.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000positionIdstring · nullableobligatorioPosition a close order is attached to. Null for orders that open or grow a position.
stringparentOrderIdstring · nullableobligatorioOrder 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.
stringamountstring · fp9obligatorioSize 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)$
1000000000indexPricestring · fp9 · nullableobligatorioIndex price the order executed at, fp9 raw. Null while the order has not executed.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000recentVolumestring · fp9 · nullableobligatorioVolume 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)$
1000000000priceImpactstring · fp9 · nullableobligatorioPrice 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)$
1000000000createdAtstring · date-timeobligatorioWhen the order was accepted.
2026-05-01T12:30:00.000ZrealizedPnlstring · fp9 · nullableobligatorioPnl 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)$
1000000000rawRealizedPnlstring · fp9 · nullableobligatorioRealised pnl before the 60-second adjustment, fp9 raw. Differs from realizedPnl only when the adjustment fired.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000profitAdjustmentAppliedbooleanobligatorioWhether 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.
truesizeModestring · enumobligatorioHow the size was expressed on creation: quote sizes the order by amount, base sizes it by baseSize.
"quote" "base"quotebaseSizestring · fp9 · nullableobligatorioOrder size in base asset units, fp9 raw. Null for quote-sized orders.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000reservedAmountstring · fp9 · nullableobligatorioQuote 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)$
1000000000errorCodestring · nullableobligatorioWhy 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.
stringreasonstring · enum · nullableobligatorioWhy the platform cancelled the order itself, for example force_close or weekly_session_risk_close. Null for trader-driven cancellations.
"force_close" "stop_accounts_fail" "stop_accounts_freeze" "stop_accounts_promote" "stop_accounts_manual" "weekly_session_risk_close"force_closevpiobject · nullableobligatorioVPI parameters of the market at the moment the order executed. Null while the order has not executed.
Objeto · 5 campos
spreadstring · fp9obligatorioSpread charged on top of the index price, fp9 raw fraction.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000marketDepthLongstringobligatorioDepth on the long side, in whole USD — not fp9.
- pattern
- ^-?[0-9]+(\.[0-9]+)?$
45604631.000000000marketDepthShortstringobligatorioDepth on the short side, in whole USD — not fp9.
- pattern
- ^-?[0-9]+(\.[0-9]+)?$
38744214.000000000coefficientLongstring · fp9obligatorioPrice-impact coefficient applied to long orders, fp9 raw.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000coefficientShortstring · fp9obligatorioPrice-impact coefficient applied to short orders, fp9 raw.
- pattern
- ^(?:-?[1-9][0-9]*|0)$
1000000000Ver ejemplo
{
"spread": "1000000000",
"marketDepthLong": "45604631.000000000",
"marketDepthShort": "38744214.000000000",
"coefficientLong": "1000000000",
"coefficientShort": "1000000000"
}{
"id": "00000000-0000-4000-8000-000000000000",
"trader": "00000000-0000-4000-8000-000000000000",
"market": "00000000-0000-4000-8000-000000000000",
"status": "active",
"type": "market",
"direction": "long",
"triggerPrice": "1000000000",
"requestedTriggerPrice": "1000000000",
"stopPrice": "1000000000",
"limitPrice": "1000000000",
"stopTriggerPrice": "1000000000",
"takeTriggerPrice": "1000000000",
"trailingStopActivationPrice": "1000000000",
"trailingStopOffset": "1000000000",
"trailingStopOffsetPercent": "1000000000",
"leverage": "1000000000",
"positionId": "string",
"parentOrderId": "string",
"amount": "1000000000",
"indexPrice": "1000000000",
"recentVolume": "1000000000",
"priceImpact": "1000000000",
"createdAt": "2026-05-01T12:30:00.000Z",
"realizedPnl": "1000000000",
"rawRealizedPnl": "1000000000",
"profitAdjustmentApplied": true,
"sizeMode": "quote",
"baseSize": "1000000000",
"reservedAmount": "1000000000",
"errorCode": "string",
"reason": "force_close",
"vpi": {
"spread": "1000000000",
"marketDepthLong": "45604631.000000000",
"marketDepthShort": "38744214.000000000",
"coefficientLong": "1000000000",
"coefficientShort": "1000000000"
}
}