GetOrderHistoryByOrderId

Category: User Permissions: Operator, Trading Call Type: Synchronous

Retrieves the full order history of a specific order by its order ID, including any changes.

A user with Trading permission can retrieve an order history only for the user's accounts and instruments; a user with Operator permission can retrieve all accounts and instruments.

Request

{
  "omsId": 0,
  "orderId": 0
}
KeyValue

omsId

integer. The ID of the Order Management System where the account's order history resides.

orderId

long integer. The ID of the of the order whose history you want to return.

Response

[
    {
        "Side": "Buy",
        "OrderId": 0,
        "Price":  0.0,
        "Quantity":  0.0,
        "DisplayQuantity":  0.0,
        "Instrument": 0,
        "Account": 0,
        "OrderType": "Unknown",
        "ClientOrderId": 0,
        "OrderState": "Unknown",
        "ReceiveTime": 0,
        "ReceiveTimeTicks": 0,
        "OrigQuantity": 0.0,
        "QuantityExecuted": 0.0,
        "AvgPrice": 0.0,
        "CounterPartyId": 0,
        "ChangeReason": "Unknown",
        "OrigOrderId": 0,
        "OrigClOrdId": 0,
        "EnteredBy": 0,
        "IsQuote": false,
        "InsideAsk": 0.0,
        "InsideAskSize": 0.0,
        "InsideBid": 0.0,
        "InsideBidSize": 0.0,
        "LastTradePrice": 0.0,
        "RejectReason": "",
        "IsLockedIn": false,
        "CancelReason": "",
        "OMSId": 0
    },
]

The call GetOrderHistoryByOrderId returns an array containing all four types of orders for the named account. The call returns an empty array if there are no orders for the account.

KeyValue

Side

string. The side of a trade. One of: 0 Buy 1 Sell 2 Short 3 Unknown (an error condition)

OrderId

long integer. The ID of the open order. The OrderID is unique in each Order Management System.

Price

real. The price at which the buy or sell has been ordered.

Quantity

real. The quantity of the product to be bought or sold.

DisplayQuantity

real. The quantity available to buy or sell that is publicly displayed to the market. To display a displayQuantity value, an order must be a Limit order with a reserve.

Instrument

integer. ID of the instrument being traded. The call GetInstruments can supply the instrument IDs that are available.

orderType

string. Describes the type of order this is. One of: 0 Unknown (an error condition) 1 Market order 2 Limit 3 StopMarket 4 StopLimit 5 TrailingStopMarket 6 TrailingStopLimit 7 BlockTrade

ClientOrderId

long integer. An ID supplied by the client to identify the order (like a purchase order number). The ClientOrderId defaults to 0 if not supplied.

OrderState

string. The current state of the order. One of: 0 Unknown 1 Working 2 Rejected 3 Canceled 4 Expired 5 Fully Executed.

ReceiveTime

long integer. Time stamp of the order in POSIX format x 1000 (milliseconds since 1/1/1970 in UTC time zone).

ReceiveTimeTicks

long integer. Time stamp of the order Microsoft Ticks format and UTC time zone. Note: Microsoft Ticks format is usually provided as a string. Here it is provided as a long integer.

OrigQuantity

real. If the open order has been changed or partially filled, this value shows the original quantity of the order.

QuantityExecuted

real. If the open order has been at least partially executed, this value shows the amount that has been executed.

AvgPrice

real. The average executed price for the instrument in the order.

CounterPartyId

integer. The ID of the other party in an off-market trade.

ChangeReason

string. If the order has been changed, this string value holds the reason. One of: 0 Unknown 1 NewInputAccepted 2 NewInputRejected 3 OtherRejected 4 Expired 5 Trade 6 SystemCanceled_NoMoreMarket 7 SystemCanceled_BelowMinimum 8 SystemCanceled_PriceCollar 9 SystemCanceled_MarginFailed 100 UserModified

OrigOrderId

integer. If the order has been changed, this is the ID of the original order.

OrigClOrdId

integer. If the order has been changed, this is the ID of the original client order ID.

EnteredBy

integer. The user ID of the person who entered the order.

IsQuote

Boolean. If this order is a quote, the value for IsQuote is true, else false.

InsideAsk

real. If this order is a quote, this value is the Inside Ask price.

InsideAskSize

real. If this order is a quote, this value is the quantity of the Inside Ask quote.

InsideBid

real. If this order is a quote, this value is the Inside Bid price.

InsideBidSize

real. If this order is a quote, this value is the quantity of the Inside Bid quote.

LastTradePrice

real. The last price that this instrument traded at.

RejectReason

string. If this open order has been rejected, this string holds the reason for the rejection.

IsLockedIn

Boolean. For a block trade, if both parties to the block trade agree that one of the parties will report the trade for both sides, this value is true. Othersise, false.

CancelReason

string. If this order has been canceled, this string holds the cancelation reason.

OMSId

integer. The ID of the Order Management System on which the order took place.

Last updated

Logo