Skip to main content
GET
Retrieve an order

Authorizations

Authorization
string
header
required

Authorization: Bearer <key>. Sandbox keys start with mgw_test_ and live keys start with mgw_live_. Each key works only in its own environment, and a live key works only from the IP addresses or ranges registered for it.

Scopes

read

Path Parameters

id
string
required

The order's id.

Pattern: ^ord_[a-z2-7]{20}$

Response

An order.

Fees are not on the order. The broker fixes them only on the contract note, so see GET /v1/accounts/{account}/contract-notes for what an order cost.

object
string
required
Allowed value: "order"
id
string
required

Unique identifier for the order. Starts with ord_.

Pattern: ^ord_[a-z2-7]{20}$
state
enum<string>
required

sending: stored, and the send is in progress. If it still reads sending after its request has ended, its outcome was not recorded: it resolves as an uncertain order does, and an identical order is refused with 409 similar_order_unresolved until then. pending: the exchange has the order. partially_filled, filled: some or all of the order has traded. uncertain: the exchange did not confirm receipt. The gateway does not resubmit it, and our operations team reconciles it against the exchange's records. Until it resolves, an identical order on the same account is refused with 409 similar_order_unresolved. rejected: the broker or the exchange rejected it; see reject_reason. refused: it never reached the exchange: we refused it before sending, or our operations team confirmed the exchange never received it. cancelled: the exchange confirmed the cancel. expired: its time in force ran out. New values can be added: handle an unrecognised value with a safe default.

Available options:
sending,
pending,
partially_filled,
filled,
uncertain,
rejected,
refused,
cancelled,
expired
account
string
required

The account code, in uppercase.

symbol
string
required

The symbol, in uppercase.

side
enum<string>
required

buy or sell. New values can be added: handle an unrecognised value with a safe default.

Available options:
buy,
sell
quantity
integer<int64>
required

The number of shares ordered.

type
enum<string>
required

limit or market. New values can be added: handle an unrecognised value with a safe default.

Available options:
limit,
market
time_in_force
enum<string>
required

How long the order stays open, as sent. New values can be added: handle an unrecognised value with a safe default.

Available options:
day,
gtc,
ioc,
fok
price_kobo
integer<int64> | null
required

The limit price in kobo. Null for a market order.

filled_quantity
integer<int64>
required

The total number of shares traded so far.

exchange_order_id
string | null
required

The exchange's identifier for the order, once it has one.

reason
string | null
required

A sentence explaining the order's current state. It's for people to read, so don't use it in your logic.

reject_reason
enum<string> | null
required

Why the broker or the exchange rejected the order. Set only when state is rejected. New values can be added: handle an unrecognised value with a safe default.

Available options:
insufficient_funds,
market_closed,
settlement_lockout,
etf_limit_orders_only,
limit_orders_etf_only,
unknown_symbol,
symbol_not_tradable,
account_not_at_broker,
rejected_by_exchange,
null
created_at
string<date-time>
required

In UTC, to the second.

updated_at
string<date-time>
required

In UTC, to the second.

filled_at
string<date-time> | null
required

When we recorded the order as filled, in UTC, to the second. We check the broker about every 30 seconds, so this can be later than the fill at the exchange. The exchange's own times are on trades. Null until the order is filled.

average_fill_price_kobo_decimal
string | null
required

The average price the filled shares traded at, in kobo, as a decimal string, before charges. It's exact when it has 12 decimal places or fewer, and otherwise rounded to 12. Null until a share has traded, or when we don't have the exchange's prices for the fills.

Pattern: ^[0-9]+(\.[0-9]{1,12})?$
Example:

"47512.5"

client_reference
string | null
required

Your own reference, as you sent it. Null if you didn't send one.