Upscale
Menu
On this page

Obtener el historial de órdenes por ticker

Probar ↓
GET/orders/{accountId}/{asset}/history
Obtener el historial de órdenes por tickerTrading

Órdenes de la cuenta en un mercado que han alcanzado un estado final, las más recientes primero, con el recuento total para la paginación.

  • status y errorCode indican cómo terminó cada una: ejecutada, cancelada por el trader, por el cierre de la posición, o por un error de ejecución.
  • Las órdenes reemplazadas por una actualización se omiten — el reemplazo lleva el historial en su lugar.
  • Limitado a la fase en la que se encuentra actualmente la cuenta.
URL base https://api.upscale.trade

Autorización

bearerhttp · bearerobligatorio

Clave de API personal, con el prefijo usk_.

Parámetros

Ruta
accountIdstring · uuidobligatorio

Identificador de la cuenta del trader. Debe pertenecer al solicitante.

Ejemplo: 00000000-0000-4000-8000-000000000000
assetstringobligatorio

Ticker del activo base del mercado, tal como lo devuelve GET /v2/markets.

Ejemplo: BTC
Consulta
limitintegeropcional

Tamaño de página: cuántos registros devolver.

Predeterminado: 20

minimum
1
maximum
100
Ejemplo: 20
offsetintegeropcional

Cuántos registros omitir antes de la página.

Predeterminado: 0

minimum
0
maximum
9007199254740991
Ejemplo: 0

Ejemplos

curl --request GET 'https://api.upscale.trade/orders/{accountId}/{asset}/history' \
  --header 'Accept: application/json' \
  --header 'Authorization: Bearer YOUR_API_KEY'

Respuestas

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).

404

No hay ninguna cuenta con este identificador, o no hay ningún mercado para este ticker.

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
dataobject[]obligatorio

Requested page of orders, newest first.

Elementos del array · object
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
txIdstringobligatorio

Order identifier. Kept for backward compatibility, always equal to id.

Ejemplo: string
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 · int32obligatorio

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

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
requestedTriggerPricestring · int32 · 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 · int32obligatorio

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 · int32obligatorio

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 · int32obligatorio

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

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

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

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

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 · int32obligatorio

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 · int32obligatorio

Trailing distance as a fraction of price, fp9 raw. 0 when the distance is absolute.

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
leveragestring · int32 · 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
indexstringobligatorio

Order identifier. Kept for backward compatibility, always equal to id.

Ejemplo: string
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
expirationstring · date-time · nullableobligatorio

Always null. Kept for backward compatibility — orders do not expire on their own.

Ejemplo: 2026-05-01T12:30:00.000Z
amountstring · int32obligatorio

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 · int32 · nullableobligatorio

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

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

Always 1000000000 (1.0). Kept for backward compatibility.

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

When the order was accepted.

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

Always null. Kept for backward compatibility — use errorCode.

Ejemplo: string
realizedPnlstring · int32 · 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 · int32 · 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
executedAfterPausebooleanobligatorio

Whether the order executed after a market pause. Not set by the current engine — always false.

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 · int32 · nullableobligatorio

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

pattern
^(?:-?[1-9][0-9]*|0)$
Ejemplo: 1000000000
reservedAmountstring · int32 · 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" null
Ejemplo: force_close
Ver ejemplo
[
  {
    "id": "00000000-0000-4000-8000-000000000000",
    "txId": "string",
    "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",
    "index": "string",
    "positionId": "string",
    "parentOrderId": "string",
    "expiration": "2026-05-01T12:30:00.000Z",
    "amount": "1000000000",
    "indexPrice": "1000000000",
    "settlementOraclePrice": "1000000000",
    "createdAt": "2026-05-01T12:30:00.000Z",
    "error": "string",
    "realizedPnl": "1000000000",
    "rawRealizedPnl": "1000000000",
    "profitAdjustmentApplied": true,
    "executedAfterPause": true,
    "sizeMode": "quote",
    "baseSize": "1000000000",
    "reservedAmount": "1000000000",
    "errorCode": "string",
    "reason": "force_close"
  }
]
totalCountnumberobligatorio

Total number of orders matching the request, across all pages.

Ejemplo: 0