Skip to content
Order Queries

Get Order History

Gets the order history of the current account page by page, optionally filtered by market, security, side, status, security type, and time range. Always pass type as 4; otherwise filters such as market are ignored. page starts at 1; when has_more is true, increase page by 1 to load more. Take-profit and stop-loss orders attached to an order are returned in attached_orders. Do not call this operation for an account that has not been opened.

When you call this operation through WhaleCore requestService(), you do not need to set requiresTradeToken to true.

WhaleCore's orderService() wraps this endpoint as the typed method getHistoryOrders. If you use WhaleCore, prefer that method.

GEThttps://api.lbkrs.com/v4/orders/history

Parameters

account_channelstringqueryRequired

Account channel (account_channel) of the current account

pagestringqueryRequired

Page number, starting from 1

limitstringqueryRequired

Number of items per page

typeintegerqueryRequired

Query type. Always pass 4

4

marketstringquery

Filter by market, for example US or HK. Requires type

counter_idstringquery

Filter by security. Security ID (counter_id), for example ST/US/AAPL or ST/HK/700

actionstringquery

Filter by side

statusintegerquery

Filter by order status:

  • 0 - All
  • 1 - Filled
  • 2 - Canceled
  • 3 - Rejected
  • 4 - Expired

01234

security_typesarrayquery

Filter by security type

start_atstringquery

Start time as a Unix timestamp in seconds; pass it together with end_at

end_atstringquery

End time as a Unix timestamp in seconds; pass it together with start_at

excluded_statusesstringquery

Order statuses to exclude, using the status values, as a JSON array string such as [2]

Responses

HTTP 200The request succeeded. The response body contains the result of the “Get Order History” operation.
Standard response envelopecodemessagedata
dataobjectdata structure
ordersarray<object>

Historical orders on the current page

Child attributes
idstring

Order ID

counter_idstring

Security ID (counter_id), for example ST/US/AAPL or ST/HK/700

namestring

Security name

statusstring

Order status:

  • NotReported - Not reported
  • ReplacedNotReported - Not reported after a successful modification
  • ProtectedNotReported - Not reported (protected order)
  • VarietiesNotReported - Conditional order being monitored and not yet triggered
  • NotActivate - Not reported (conditional order not activated)
  • WaitToActivate - Not reported (conditional order waiting for activation)
  • Activated - Not reported (conditional order activated)
  • SuspenedStatus - Suspended
  • WaitToNew - Submitted, waiting to be reported
  • PendingNewStatus - Pending new
  • NewStatus - New
  • WaitToReplace - Modification waiting to be reported
  • PendingReplaceStatus - Pending modification
  • ReplacedStatus - Modified
  • WaitToCancel - Cancellation waiting to be reported
  • PendingCancelStatus - Pending cancellation
  • PartialFilledStatus - Partially filled
  • FilledStatus - Filled (final)
  • RejectedStatus - Rejected (final)
  • CanceledStatus - Canceled (final)
  • ExpiredStatus - Expired (final)
  • PartialWithdrawal - Canceled after a partial fill (final)

SuspenedStatus is the existing spelling used by the service.

Values
NotReported
ReplacedNotReported
ProtectedNotReported
VarietiesNotReported
NotActivate
WaitToActivate
Activated
SuspenedStatus
WaitToNew
PendingNewStatus
NewStatus
WaitToReplace
PendingReplaceStatus
ReplacedStatus
WaitToCancel
PendingCancelStatus
PartialFilledStatus
FilledStatus
RejectedStatus
CanceledStatus
ExpiredStatus
PartialWithdrawal
actioninteger

Order side:

  • 1 - Buy
  • 2 - Sell
order_typestring

Order type, for example LO (limit), MO (market), ELO (enhanced limit), ALO (at-auction limit), AO (at-auction market), ODD (odd lot), LIT (limit if touched), MIT (market if touched), TSLPAMT / TSLPPCT (trailing stop limit by amount / percentage), TSMAMT / TSMPCT (trailing stop market by amount / percentage), or MOC (market on close)

pricestring

Order price

quantitystring

Order quantity

executed_pricestring

Average filled price

executed_qtystring

Filled quantity

trigger_pricestring

Trigger price of a conditional order

trigger_statusinteger

Trigger status of a conditional order:

  • 1 - Not triggered
  • 2 - Invalidated
  • 3 - Triggered
  • 4 - Active
Values
1
2
3
4
trigger_countinteger

Number of triggers within one minute for a conditional order

trigger_atstring

Trigger time of a conditional order as a Unix timestamp in seconds; returned only after the order is triggered

monitor_pricestring

Monitoring price of a trailing order

tailing_amountstring

Trailing amount

tailing_percentstring

Trailing percentage

limit_offsetstring

Limit offset of a trailing stop limit order

force_only_rthinteger

Trading session (force_only_rth). US stocks:

  • 0 - Any session
  • 1 - Regular trading hours only
  • 4 - Overnight

Hong Kong and Singapore stocks:

  • 1 - Regular trading hours only
  • 2 - Regular trading hours plus pre-market and after-hours
  • 3 - Overnight only
  • 4 - Options pre-market
time_in_forceinteger

Time in force:

  • 0 - Day
  • 1 - Good till canceled (GTC)
  • 3 - Immediate or cancel (IOC)
  • 5 - Fill or kill (FOK)
  • 6 - Good till date (GTD); an expiry time is also required
gtdstring

Expiry date when time_in_force=6, in YYYY-MM-DD format

currencystring

Order currency

msgstring

Reason for a rejected or abnormal order, localized to the request language

submitted_atinteger

Submission time as a Unix timestamp in seconds

done_atinteger

Completion time as a Unix timestamp in seconds

security_typestring

Security type; returned for single-option orders

contract_directionstring

Option direction (C for call, P for put); returned for single-option orders

strike_pricestring

Strike price; returned for single-option orders

multi_legobject

Multi-leg option combination

Child attributes
strategyinteger

Combination strategy type

strategy_namestring

Combination strategy name

multi_leg_idstring

Multi-leg combination ID

codestring

Combination code for display

namestring

Combination name

legsarray<object>

Legs of the combination

Child attributes
counter_idstring

Security ID of the option contract in this leg

actioninteger

Order side:

  • 1 - Buy
  • 2 - Sell
Values
1
2
ratio_quantitystring

Ratio quantity of this leg in the combination

quantitystring

Order quantity of this leg, in contracts

security_typestring

Security type of this leg

expire_datestring

Option expiry date

contract_directionstring

Option direction:

  • C - Call
  • P - Put
Values
C
P
strike_pricestring

Strike price

attached_ordersarray<object>

Take-profit and stop-loss orders attached to the main order

has_moreboolean

Whether there is another page

Whale Docs