# Get orders history by ticker

`GET /orders/{accountId}/{asset}/history`

Orders of the account on one market that have reached a final state, newest first, with the total count for paging.

- `status` and `errorCode` tell how each one ended: executed, cancelled by the trader, by the position closing, or by an execution error.
- Orders replaced by an update are left out — the replacement carries the history instead.
- Limited to the phase the account is currently in.

## Authorization

bearer: http · bearer (required). Personal API key, prefixed with `usk_`.

## Parameters

- path: accountId (string · uuid; required). Trader account identifier. Must belong to the caller.

Type: string · uuid

format: uuid

- path: asset (string; required). Base asset ticker of the market, as returned by `GET /v2/markets`.

Type: string

Example: "BTC"

- query: limit (integer; optional). Page size: how many records to return.

Type: integer

Example: 20

Default: 20

minimum: 1

maximum: 100

- query: offset (integer; optional). How many records to skip before the page.

Type: integer

Example: 0

Default: 0

minimum: 0

maximum: 9007199254740991

## Example · cURL

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

## Example · JavaScript

```javascript
const response = await fetch("https://api.upscale.trade/orders/{accountId}/{asset}/history", {
  method: "GET",
  headers: {
    "Accept": "application/json",
    "Authorization": "Bearer YOUR_API_KEY"
  },
});
console.log(response.status, await response.text());
```

## Example · Python

```python
import requests

response = requests.request(
    "GET",
    "https://api.upscale.trade/orders/{accountId}/{asset}/history",
    headers={"Accept":"application/json","Authorization":"Bearer YOUR_API_KEY"},
    timeout=30,
)
print(response.status_code, response.text)
```

## Response 401

**401**  — Unauthorized

## Response 403

**403**  — 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`).

## Response 404

**404**  — No account with this identifier, or no market for this ticker.

## Response 429

**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`.

## Response default · OrdersPaginatedResponse

**default** application/json — Response

Schema: OrdersPaginatedResponse

Type: object

Required fields: data, totalCount

Required field types: data (object[]; required), totalCount (number; required)

- data (object[]; required)

data example: [
  {
    "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"
  }
]

data.Type: object[]

data.Requested page of orders, newest first.

data.[]Type: object

data.[]Required fields: id, txId, trader, market, status, type, direction, triggerPrice, requestedTriggerPrice, stopPrice, limitPrice, stopTriggerPrice, takeTriggerPrice, trailingStopActivationPrice, trailingStopOffset, trailingStopOffsetPercent, leverage, index, positionId, parentOrderId, expiration, amount, indexPrice, settlementOraclePrice, createdAt, error, realizedPnl, rawRealizedPnl, profitAdjustmentApplied, executedAfterPause, sizeMode, baseSize, reservedAmount, errorCode, reason

data.[]Required field types: id (string · uuid; required), txId (string; required), trader (string · uuid; required), market (string · uuid; required), status (string · enum; required), type (string · enum; required), direction (string · enum; required), triggerPrice (string · int32; required), requestedTriggerPrice (string · int32 · nullable; required), stopPrice (string · int32; required), limitPrice (string · int32; required), stopTriggerPrice (string · int32; required), takeTriggerPrice (string · int32; required), trailingStopActivationPrice (string · int32; required), trailingStopOffset (string · int32; required), trailingStopOffsetPercent (string · int32; required), leverage (string · int32 · nullable; required), index (string; required), positionId (string · nullable; required), parentOrderId (string · nullable; required), expiration (string · date-time · nullable; required), amount (string · int32; required), indexPrice (string · int32 · nullable; required), settlementOraclePrice (string · int32; required), createdAt (string · date-time; required), error (string · nullable; required), realizedPnl (string · int32 · nullable; required), rawRealizedPnl (string · int32 · nullable; required), profitAdjustmentApplied (boolean; required), executedAfterPause (boolean; required), sizeMode (string · enum; required), baseSize (string · int32 · nullable; required), reservedAmount (string · int32 · nullable; required), errorCode (string · nullable; required), reason (string · enum · nullable; required)

- data.[]id (string · uuid; required)

data.[]id example: 00000000-0000-4000-8000-000000000000

data.[]id.Type: string · uuid

data.[]id.Order identifier.

data.[]id.format: uuid

data.[]id.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})$

- data.[]txId (string; required)

data.[]txId example: string

data.[]txId.Type: string

data.[]txId.Order identifier. Kept for backward compatibility, always equal to `id`.

- data.[]trader (string · uuid; required)

data.[]trader example: 00000000-0000-4000-8000-000000000000

data.[]trader.Type: string · uuid

data.[]trader.Trader account the order belongs to.

data.[]trader.format: uuid

data.[]trader.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})$

- data.[]market (string · uuid; required)

data.[]market example: 00000000-0000-4000-8000-000000000000

data.[]market.Type: string · uuid

data.[]market.Market the order is placed on.

data.[]market.format: uuid

data.[]market.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})$

- data.[]status (string · enum; required)

data.[]status example: active

data.[]status.Type: string · enum

data.[]status.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`.

data.[]status.Allowed values: ["active","canceled","canceled_by_update","canceled_by_error","canceled_by_position","executed"]

- data.[]type (string · enum; required)

data.[]type example: market

data.[]type.Type: string · enum

data.[]type.Order type. `liquidation` marks an order the engine raised itself.

data.[]type.Allowed values: ["market","limit","stop","trailing_stop","take","stop_limit","stop_market","liquidation"]

- data.[]direction (string · enum; required)

data.[]direction example: long

data.[]direction.Type: string · enum

data.[]direction.Order direction.

data.[]direction.Allowed values: ["long","short"]

- data.[]triggerPrice (string · int32; required)

data.[]triggerPrice example: 1000000000

data.[]triggerPrice.Type: string · int32

data.[]triggerPrice.Price at which the order fires, fp9 raw. `0` when the order carries no trigger.

data.[]triggerPrice.format: int32

data.[]triggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]requestedTriggerPrice (string · int32 · nullable; required)

data.[]requestedTriggerPrice example: 1000000000

data.[]requestedTriggerPrice.Type: string · int32 · nullable

data.[]requestedTriggerPrice.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.

data.[]requestedTriggerPrice.format: int32

data.[]requestedTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]stopPrice (string · int32; required)

data.[]stopPrice example: 1000000000

data.[]stopPrice.Type: string · int32

data.[]stopPrice.Trigger price of a `stop_market` / `stop_limit` order, fp9 raw; `0` for every other type.

data.[]stopPrice.format: int32

data.[]stopPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]limitPrice (string · int32; required)

data.[]limitPrice example: 1000000000

data.[]limitPrice.Type: string · int32

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

data.[]limitPrice.format: int32

data.[]limitPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]stopTriggerPrice (string · int32; required)

data.[]stopTriggerPrice example: 1000000000

data.[]stopTriggerPrice.Type: string · int32

data.[]stopTriggerPrice.Stop-loss attached to the order, fp9 raw. `0` when none is attached.

data.[]stopTriggerPrice.format: int32

data.[]stopTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]takeTriggerPrice (string · int32; required)

data.[]takeTriggerPrice example: 1000000000

data.[]takeTriggerPrice.Type: string · int32

data.[]takeTriggerPrice.Take-profit attached to the order, fp9 raw. `0` when none is attached.

data.[]takeTriggerPrice.format: int32

data.[]takeTriggerPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]trailingStopActivationPrice (string · int32; required)

data.[]trailingStopActivationPrice example: 1000000000

data.[]trailingStopActivationPrice.Type: string · int32

data.[]trailingStopActivationPrice.Price at which a trailing stop starts trailing, fp9 raw. `0` when it trails from creation.

data.[]trailingStopActivationPrice.format: int32

data.[]trailingStopActivationPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]trailingStopOffset (string · int32; required)

data.[]trailingStopOffset example: 1000000000

data.[]trailingStopOffset.Type: string · int32

data.[]trailingStopOffset.Trailing distance as an absolute quote amount, fp9 raw. `0` when the distance is set as a percent.

data.[]trailingStopOffset.format: int32

data.[]trailingStopOffset.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]trailingStopOffsetPercent (string · int32; required)

data.[]trailingStopOffsetPercent example: 1000000000

data.[]trailingStopOffsetPercent.Type: string · int32

data.[]trailingStopOffsetPercent.Trailing distance as a fraction of price, fp9 raw. `0` when the distance is absolute.

data.[]trailingStopOffsetPercent.format: int32

data.[]trailingStopOffsetPercent.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]leverage (string · int32 · nullable; required)

data.[]leverage example: 1000000000

data.[]leverage.Type: string · int32 · nullable

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

data.[]leverage.format: int32

data.[]leverage.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]index (string; required)

data.[]index example: string

data.[]index.Type: string

data.[]index.Order identifier. Kept for backward compatibility, always equal to `id`.

- data.[]positionId (string · nullable; required)

data.[]positionId example: string

data.[]positionId.Type: string · nullable

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

- data.[]parentOrderId (string · nullable; required)

data.[]parentOrderId example: string

data.[]parentOrderId.Type: string · nullable

data.[]parentOrderId.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.

- data.[]expiration (string · date-time · nullable; required)

data.[]expiration example: 2026-05-01T12:30:00.000Z

data.[]expiration.Type: string · date-time · nullable

data.[]expiration.Always null. Kept for backward compatibility — orders do not expire on their own.

data.[]expiration.format: date-time

- data.[]amount (string · int32; required)

data.[]amount example: 1000000000

data.[]amount.Type: string · int32

data.[]amount.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.

data.[]amount.format: int32

data.[]amount.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]indexPrice (string · int32 · nullable; required)

data.[]indexPrice example: 1000000000

data.[]indexPrice.Type: string · int32 · nullable

data.[]indexPrice.Index price the order executed at, fp9 raw. Null while the order has not executed.

data.[]indexPrice.format: int32

data.[]indexPrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]settlementOraclePrice (string · int32; required)

data.[]settlementOraclePrice example: 1000000000

data.[]settlementOraclePrice.Type: string · int32

data.[]settlementOraclePrice.Always `1000000000` (1.0). Kept for backward compatibility.

data.[]settlementOraclePrice.format: int32

data.[]settlementOraclePrice.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]createdAt (string · date-time; required)

data.[]createdAt example: 2026-05-01T12:30:00.000Z

data.[]createdAt.Type: string · date-time

data.[]createdAt.When the order was accepted.

data.[]createdAt.format: date-time

- data.[]error (string · nullable; required)

data.[]error example: string

data.[]error.Type: string · nullable

data.[]error.Always null. Kept for backward compatibility — use `errorCode`.

- data.[]realizedPnl (string · int32 · nullable; required)

data.[]realizedPnl example: 1000000000

data.[]realizedPnl.Type: string · int32 · nullable

data.[]realizedPnl.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.

data.[]realizedPnl.format: int32

data.[]realizedPnl.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]rawRealizedPnl (string · int32 · nullable; required)

data.[]rawRealizedPnl example: 1000000000

data.[]rawRealizedPnl.Type: string · int32 · nullable

data.[]rawRealizedPnl.Realised pnl before the 60-second adjustment, fp9 raw. Differs from `realizedPnl` only when the adjustment fired.

data.[]rawRealizedPnl.format: int32

data.[]rawRealizedPnl.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]profitAdjustmentApplied (boolean; required)

data.[]profitAdjustmentApplied example: true

data.[]profitAdjustmentApplied.Type: boolean

data.[]profitAdjustmentApplied.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.

- data.[]executedAfterPause (boolean; required)

data.[]executedAfterPause example: true

data.[]executedAfterPause.Type: boolean

data.[]executedAfterPause.Whether the order executed after a market pause. Not set by the current engine — always `false`.

- data.[]sizeMode (string · enum; required)

data.[]sizeMode example: quote

data.[]sizeMode.Type: string · enum

data.[]sizeMode.How the size was expressed on creation: `quote` sizes the order by `amount`, `base` sizes it by `baseSize`.

data.[]sizeMode.Allowed values: ["quote","base"]

- data.[]baseSize (string · int32 · nullable; required)

data.[]baseSize example: 1000000000

data.[]baseSize.Type: string · int32 · nullable

data.[]baseSize.Order size in base asset units, fp9 raw. Null for `quote`-sized orders.

data.[]baseSize.format: int32

data.[]baseSize.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]reservedAmount (string · int32 · nullable; required)

data.[]reservedAmount example: 1000000000

data.[]reservedAmount.Type: string · int32 · nullable

data.[]reservedAmount.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.

data.[]reservedAmount.format: int32

data.[]reservedAmount.pattern: ^(?:-?[1-9][0-9]*|0)$

- data.[]errorCode (string · nullable; required)

data.[]errorCode example: string

data.[]errorCode.Type: string · nullable

data.[]errorCode.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.

- data.[]reason (string · enum · nullable; required)

data.[]reason example: force_close

data.[]reason.Type: string · enum · nullable

data.[]reason.Why the platform cancelled the order itself, for example `force_close` or `weekly_session_risk_close`. Null for trader-driven cancellations.

data.[]reason.Allowed values: ["force_close","stop_accounts_fail","stop_accounts_freeze","stop_accounts_promote","stop_accounts_manual","weekly_session_risk_close",null]

- totalCount (number; required)

totalCount example: 0

totalCount.Type: number

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

Example



```json
{
  "data": [
    {
      "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"
    }
  ],
  "totalCount": 0
}
```