Upscale
Menu
On this page

Change order trigger price

Try it out ↓
PATCH/orders/{orderId}
Change order trigger priceTrading

Edits a pending order: trigger price, reserved amount, slippage tolerance, or base size. The engine does this by replacing the order, so the response carries a new order with a new identifier, while the previous one ends up as canceled_by_update.

Checked beyond the schema:

  • The order must exist and still be active, and its account must belong to the caller and be in a trading status.
  • market and liquidation orders cannot be edited at all, nor can a stop / take order that was created without a trigger price (order_not_updatable); a trigger price that is set cannot be reset to 0 (trigger_price_reset_forbidden).
  • Growing the reserve of an increase order requires the difference as free balance, and is refused while the account is locked by the managed capital limit.
  • An order created with sizeMode: base needs a fresh amount whenever baseSize changes (base_size_requires_amount).
  • The market must be open, and the resulting order is re-checked exactly as on creation — the same field-shape, trigger-price and notional codes listed on POST /orders apply here, except invalid_leverage: leverage cannot be edited.

A request that sets none of the fields changes nothing and returns the order as it stands.

Base URL https://api.upscale.trade

Authorization

bearerhttp · bearerrequired

Personal API key, prefixed with usk_.

Parameters

Path
orderIdstring · uuidrequired

Identifier of the order to edit.

Example: 00000000-0000-4000-8000-000000000000

Request body · required

4 optional fields
triggerPricestring · fp9optional

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)$
Example: 65000000000000
amountstring · fp9optional

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)$
Example: 100000000000
expectedAmountstring · fp9optional

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

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

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

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

Examples

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 '{}'

Responses

401

Unauthorized

403

The order is no longer active. The account belongs to another user (account_access_denied), or the request is authenticated with an API key while api_trading is disabled on the account (api_trading_not_enabled). Trading on the account is over in its current status (challenge_closed), or the account is locked by the managed capital limit (funded_limit_trading_locked). The market is paused (market_paused) or accepts closing orders only (market_close_only).

404

No order with this identifier.

429

Rate limit of the API key exceeded (api_key_rate_limit_exceeded). Retry-After says when to come back; the body carries the bucket (read / write), the window that tripped, its limit and retryAt.

defaultResponseapplication/json
idstring · uuidrequired

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

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

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

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.

Allowed: "active" "canceled" "canceled_by_update" "canceled_by_error" "canceled_by_position" "executed"
Example: active
typestring · enumrequired

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

Allowed: "market" "limit" "stop" "trailing_stop" "take" "stop_limit" "stop_market" "liquidation"
Example: market
directionstring · enumrequired

Order direction.

Allowed: "long" "short"
Example: long
triggerPricestring · fp9required

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

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

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)$
Example: 1000000000
stopPricestring · fp9required

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

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

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)$
Example: 1000000000
stopTriggerPricestring · fp9required

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

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

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

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

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

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

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

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

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)$
Example: 1000000000
leveragestring · fp9 · nullablerequired

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

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

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

Example: string
parentOrderIdstring · nullablerequired

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: string
amountstring · fp9required

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)$
Example: 1000000000
indexPricestring · fp9 · nullablerequired

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

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

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)$
Example: 1000000000
priceImpactstring · fp9 · nullablerequired

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)$
Example: 1000000000
createdAtstring · date-timerequired

When the order was accepted.

Example: 2026-05-01T12:30:00.000Z
realizedPnlstring · fp9 · nullablerequired

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)$
Example: 1000000000
rawRealizedPnlstring · fp9 · nullablerequired

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

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

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
sizeModestring · enumrequired

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

Allowed: "quote" "base"
Example: quote
baseSizestring · fp9 · nullablerequired

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

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

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)$
Example: 1000000000
errorCodestring · nullablerequired

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: string
reasonstring · enum · nullablerequired

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

Allowed: "force_close" "stop_accounts_fail" "stop_accounts_freeze" "stop_accounts_promote" "stop_accounts_manual" "weekly_session_risk_close"
Example: force_close
vpiobject · nullablerequired

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

Object · 5 fields
spreadstring · fp9required

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

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

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

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

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

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

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

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

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

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