Skip to content

staff.orders ​

5 methods on staff.orders. Each returns the answer's data and throws NoviqaError on a failed answer.

list ​

GET/admin/v1/orders

List orders

One page of open pending orders across accounts, each with its account's group and the current price from execution (0 when execution does not answer). With history=true (MT5 "Open only" unchecked) the page also holds orders of the history (filled, cancelled, expired, rejected; state and done_at tell them apart), those done in [from, to) when given (RFC 3339 times like the deals list); open orders are always listed. History orders never reach further back than the caller's report history depth. Ordered by id. Rows are limited to trading accounts whose group is in the caller's group scope. Filters: group a group mask (e.g. real\*), company the licence company of the group, login an exact login, symbol an exact symbol name (any case). page is 1-based (default 1), limit defaults to 100, at most 1000; total counts every match.

More details

Rights: the staff member needs every one of: trades.view.

Parameters
groupstring · query
companystring · query
logininteger · query
symbolstring · query
pageinteger · query
limitinteger · query
historyboolean · query
true: also orders of the history (MT5 "Open only" unchecked)
fromstring · query
history orders done at or after; RFC 3339
tostring · query
history orders done before
Returns
Promise<OpenOrder_>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.orders.list({
  group: "string",
  company: "string",
  login: 1001
})
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/orders?group=string&company=string&login=1001" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "items": [
      {
        "activated_at": "2026-09-25T10:15:00Z",
        "by_position_id": 1,
        "comment": "Deposit via bank",
        "contract_size": "1.08452",
        "created_at": "2026-09-25T10:15:00Z",
        "dealer": 1,
        "deviation_pts": 1,
        "digits": 5,
        "done_at": "2026-09-25T10:15:00Z",
        "expiration": "string",
        "expires_at": "2026-09-25T10:15:00Z",
        "external_id": "string"
      }
    ],
    "page": 1,
    "total": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.orders.list(query?: { group?, company?, login?, symbol?, page?, limit?, history?, from?, to? }, options?: RequestOptions): Promise<http.tradePage_account.OpenOrder_>

count ​

GET/admin/v1/orders/count

Count pending orders

How many pending orders GET /admin/v1/orders would list with the same authorized filters. Reads a database count only, without order rows or execution prices. Page and limit do not restrict the count.

More details

Rights: the staff member needs every one of: trades.view.

Parameters
groupstring · query
companystring · query
logininteger · query
symbolstring · query
pageinteger · query
limitinteger · query
Returns
Promise<count>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.orders.count({
  group: "string",
  company: "string",
  login: 1001
})
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/orders/count?group=string&company=string&login=1001" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "total": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.orders.count(query?: { group?, company?, login?, symbol?, page?, limit? }, options?: RequestOptions): Promise<http.count>

delete ​

POST/admin/v1/orders/delete

Delete orders of any accounts

The Orders list delete: like the single-account route over 1-1000 order ids of any accounts. Answers every id in id order with its login and result: deleted, not_found, forbidden (account out of scope or hidden) or error with error saying why (that account failed; others still run). Runs in execution under the account's lock and is written to the trade log as one correction event (sent to the account's open terminals). A refusal by execution comes back as an error with its code.

More details

Rights: the staff member needs every one of: trades.edit, trades.delete.

Parameters
Idempotency-Keystring · header
Optional UUID used as the correction request id: a retry with the same key is applied once.
Request body
idsinteger[]
Returns
Promise<DeleteResult>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.csrf_invalid: request refused: reload the page and try again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
403trade.disabled: trading is disabled
500internal: something went wrong
504trade.timeout: request timed out
ts
import { staff } from "@/lib/noviqa"

const data = await staff.orders.delete({
  ids: [
    20451,
    31877
  ]
})
bash
curl -X POST "$NOVIQA_API_URL/admin/v1/orders/delete" \
  -H "Authorization: Bearer $NOVIQA_TOKEN" \
  -H "Content-Type: application/json" \
  --data-raw '{
  "ids": [
    20451,
    31877
  ]
}'
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "deleted": 1,
    "items": [
      {
        "error": "string",
        "id": 1,
        "login": 1001,
        "result": "string"
      }
    ]
  },
  "request_id": "5b7f2c1e"
}
ts
staff.orders.delete(body: account.idList, options?: RequestOptions): Promise<account.DeleteResult>

window ​

GET/admin/v1/orders/window

Read a bounded orders window

At most 100 stored orders using first/last/after/before/around keyset navigation and deterministic order-ID ties. Current trading group/company and hidden-account restrictions apply. IDs and decimals are strings; dealer and linked identifiers, expires_at, activated_at and done_at may be null. Stored typed sorts/filters include order_id, login, dealer, position_id, by_position_id, gateway_id, group, symbol, external_id, comment, action, kind, state, fill_policy, expiration, reason, price, trigger_price, price_sl, price_tp, volume_initial, volume_current, contract_size, rate_margin, time_create, expires_at, activated_at and done_at. Order kinds use market/limit/stop/stop_limit; expiry uses until_cancelled/today/specified_time/specified_day. Market current-price/profit ranking is unsupported. Query and resource-bound cursors confer no authority and cannot cross Orders/Positions or changed actor/rights/scope. The deals projection checkpoint and rows share one read-only repeatable-read snapshot; an ahead minimum returns projection_pending without rows/navigation and retry_after_ms 1000. This watermark covers projected trade events, not independent account/group/symbol metadata or market freshness. Current price, proof and calculated_at are null; valuation is unavailable. Legacy GET orders is unchanged. Existing authorization is group/account scoped; this endpoint does not introduce a new broker selector or token authority.

More details

Rights: the staff member needs every one of: trades.view.

Parameters
limitinteger · query
edgestring · query
cursorstring · query
anchor_idstring · query
sort_fieldstring · query
sort_directionstring · query
filterstring · query
searchstring · query
loginstring · query
symbolstring · query
groupstring · query
companystring · query
min_projection_seqstring · query
Returns
Promise<OrderWindowRow_>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.orders.window({
  limit: 1,
  edge: "string",
  anchor_id: "string"
})
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/orders/window?limit=1&edge=string&anchor_id=string" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "after": "string",
    "before": "string",
    "calculated_at": "2026-09-25T10:15:00Z",
    "consistency": "string",
    "first_key": "string",
    "has_after": true,
    "has_before": true,
    "items": [
      {
        "activated_at": "2026-09-25T10:15:00Z",
        "by_position_id": "string",
        "comment": "Deposit via bank",
        "contract_size": "string",
        "created_at": "2026-09-25T10:15:00Z",
        "dealer": "string",
        "digits": 5,
        "done_at": "2026-09-25T10:15:00Z",
        "expiration": "string",
        "expires_at": "2026-09-25T10:15:00Z",
        "external_id": "string",
        "fill_policy": "string"
      }
    ],
    "last_key": "string",
    "page_id": "string",
    "projection_seq": "string",
    "proof": "string"
  },
  "request_id": "5b7f2c1e"
}
ts
staff.orders.window(query?: { limit?, edge?, cursor?, anchor_id?, sort_field?, sort_direction?, filter?, search?, login?, symbol?, group?, company?, min_projection_seq? }, options?: RequestOptions): Promise<account.TradeWindowPage_account.OrderWindowRow_>

windowCount ​

GET/admin/v1/orders/window/count

Count a filtered orders window

Exact authorized full-filter structural count from its own read-only repeatable-read checkpoint snapshot, using the same typed stored predicates as orders/window. Navigation does not limit total. Total is null and consistency projection_pending with retry_after_ms 1000 when minimum exceeds the checkpoint. Count freshness is independent of a page snapshot; no live valuation or legacy orders/count behavior changes.

More details

Rights: the staff member needs every one of: trades.view.

Parameters
limitinteger · query
edgestring · query
cursorstring · query
anchor_idstring · query
sort_fieldstring · query
sort_directionstring · query
filterstring · query
searchstring · query
loginstring · query
symbolstring · query
groupstring · query
companystring · query
min_projection_seqstring · query
Returns
Promise<PositionWindowCount>
The answer's data.
Errors
400invalid_input: invalid input
401auth.session_expired: session expired, sign in again
403auth.invalid_terminal: this terminal cannot be used here
403auth.otp_enrol_required: your group requires one-time codes: set them up to continue
403auth.password_change_required: you must change your password first
403forbidden: you do not have access to this action
500internal: something went wrong
ts
import { staff } from "@/lib/noviqa"

const data = await staff.orders.windowCount({
  limit: 1,
  edge: "string",
  anchor_id: "string"
})
bash
curl -X GET "$NOVIQA_API_URL/admin/v1/orders/window/count?limit=1&edge=string&anchor_id=string" \
  -H "Authorization: Bearer $NOVIQA_TOKEN"
json
{
  "success": true,
  "code": "ok",
  "message": "done",
  "data": {
    "consistency": "string",
    "projection_seq": "string",
    "query_id": "string",
    "resource": "string",
    "retry_after_ms": 1,
    "total": 1
  },
  "request_id": "5b7f2c1e"
}
ts
staff.orders.windowCount(query?: { limit?, edge?, cursor?, anchor_id?, sort_field?, sort_direction?, filter?, search?, login?, symbol?, group?, company?, min_projection_seq? }, options?: RequestOptions): Promise<account.PositionWindowCount>