Upscale
Menu
On this page

Получить историю ордеров по тикеру

Попробовать ↓
GET/orders/{accountId}/{asset}/history
Получить историю ордеров по тикеруТорговля

Ордера аккаунта на одном рынке, достигшие финального состояния, сначала новые, с общим количеством для пагинации.

  • status и errorCode показывают, чем закончился каждый из них: исполнен, отменён трейдером, закрытием позиции или ошибкой исполнения.
  • Ордера, заменённые обновлением, исключаются — вместо них историю несёт замена.
  • Ограничено фазой, в которой аккаунт находится в данный момент.
Базовый URL https://api.upscale.trade

Авторизация

bearerhttp · bearerобязательно

Персональный API-ключ с префиксом usk_.

Параметры

Путь
accountIdstring · uuidобязательно

Идентификатор торгового аккаунта. Должен принадлежать вызывающей стороне.

Пример: 00000000-0000-4000-8000-000000000000
assetstringобязательно

Тикер базового актива рынка, как возвращается GET /v2/markets.

Пример: BTC
Строка запроса
limitintegerнеобязательно

Размер страницы: сколько записей вернуть.

По умолчанию: 20

minimum
1
maximum
100
Пример: 20
offsetintegerнеобязательно

Сколько записей пропустить перед страницей.

По умолчанию: 0

minimum
0
maximum
9007199254740991
Пример: 0

Примеры

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

Ответы

401

Неавторизовано

403

Аккаунт принадлежит другому пользователю (account_access_denied), или запрос аутентифицирован с помощью API-ключа, тогда как api_trading отключён на аккаунте (api_trading_not_enabled).

404

Нет аккаунта с этим идентификатором или нет рынка для этого тикера.

429

Превышен лимит частоты запросов API-ключа (api_key_rate_limit_exceeded). Retry-After указывает, когда вернуться; тело содержит бакет (read / write), окно, которое сработало, его лимит и retryAt.

defaultОтветapplication/json
dataobject[]обязательно

Requested page of orders, newest first.

Элементы массива · object
idstring · uuidобязательно

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})$
Пример: 00000000-0000-4000-8000-000000000000
txIdstringобязательно

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

Пример: string
traderstring · uuidобязательно

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})$
Пример: 00000000-0000-4000-8000-000000000000
marketstring · uuidобязательно

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})$
Пример: 00000000-0000-4000-8000-000000000000
statusstring · enumобязательно

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.

Допустимо: "active" "canceled" "canceled_by_update" "canceled_by_error" "canceled_by_position" "executed"
Пример: active
typestring · enumобязательно

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

Допустимо: "market" "limit" "stop" "trailing_stop" "take" "stop_limit" "stop_market" "liquidation"
Пример: market
directionstring · enumобязательно

Order direction.

Допустимо: "long" "short"
Пример: long
triggerPricestring · int32обязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
requestedTriggerPricestring · int32 · nullableобязательно

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)$
Пример: 1000000000
stopPricestring · int32обязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
limitPricestring · int32обязательно

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)$
Пример: 1000000000
stopTriggerPricestring · int32обязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
takeTriggerPricestring · int32обязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
trailingStopActivationPricestring · int32обязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
trailingStopOffsetstring · int32обязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
trailingStopOffsetPercentstring · int32обязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
leveragestring · int32 · nullableобязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
indexstringобязательно

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

Пример: string
positionIdstring · nullableобязательно

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

Пример: string
parentOrderIdstring · nullableобязательно

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
expirationstring · date-time · nullableобязательно

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

Пример: 2026-05-01T12:30:00.000Z
amountstring · int32обязательно

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)$
Пример: 1000000000
indexPricestring · int32 · nullableобязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
settlementOraclePricestring · int32обязательно

Always 1000000000 (1.0). Kept for backward compatibility.

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
createdAtstring · date-timeобязательно

When the order was accepted.

Пример: 2026-05-01T12:30:00.000Z
errorstring · nullableобязательно

Always null. Kept for backward compatibility — use errorCode.

Пример: string
realizedPnlstring · int32 · nullableобязательно

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)$
Пример: 1000000000
rawRealizedPnlstring · int32 · nullableобязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
profitAdjustmentAppliedbooleanобязательно

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.

Пример: true
executedAfterPausebooleanобязательно

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

Пример: true
sizeModestring · enumобязательно

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

Допустимо: "quote" "base"
Пример: quote
baseSizestring · int32 · nullableобязательно

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

pattern
^(?:-?[1-9][0-9]*|0)$
Пример: 1000000000
reservedAmountstring · int32 · nullableобязательно

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)$
Пример: 1000000000
errorCodestring · nullableобязательно

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
reasonstring · enum · nullableобязательно

Why 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" null
Пример: force_close
Посмотреть пример
[
  {
    "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"
  }
]
totalCountnumberобязательно

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

Пример: 0