Order Queries

Orders

Purpose

Lists orders using account, instrument, status, time, and pagination filters. The client unwraps the server items envelope, and fills an empty account field from the client default.

Signature

func (c *TradeClient) Orders(req model.OrdersRequest) ([]model.Order, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrdersRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoUses the client default when emptyTrading account ID
SecretKeystringNoUses client configuration when both Account and SecretKey are empty; otherwise omitted when emptyInstitutional-account authentication key
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
SegTypestringNoOmitted if emptyAllowed values: ALL, SEC, FUT, FUND
SymbolstringNoOmitted if emptyInstrument symbol
IsBriefboolNoOmitted when falseWhether to return brief order data
StartDateint64NoOmitted when zeroStart of the query range as a millisecond timestamp
EndDateint64NoOmitted when zeroEnd of the query range as a millisecond timestamp
LimitintNoOmitted when zeroResult count; server default 100, maximum 300
States[]stringNoOmitted if emptyOrder-status values
ParentIdint64NoOmitted when zeroParent order ID
SortBystringNoOmitted if emptyAllowed values: LATEST_CREATED, LATEST_STATUS_UPDATED
ShowCharges*boolNoOmitted when nilWhether to request charge details; a pointer distinguishes explicit false from omission
PageTokenstringNoOmitted if emptyPagination cursor
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Time range: StartDate and EndDate are optional; omitting either bound applies no corresponding time filter. The interface defines no maximum time span, but per-response result limits still apply. Use a reasonable time range.

Returns

([]model.Order, error). Key fields from model.Order:

FieldTypeDescription
AccountstringAccount ID
IDint64Order ID
OrderIdint64Order number
ActionstringTrade direction (BUY/SELL)
OrderTypestringOrder type
TotalQuantityint64Order quantity
LimitPricefloat64Limit price
AuxPricefloat64Auxiliary price (stop price)
TrailingPercentfloat64Trailing stop percentage
StatusstringOrder status
FilledQuantityint64Filled quantity
AvgFillPricefloat64Volume-weighted average of fill prices, excluding commissions and other fees
TimeInForcestringTime in force
OutsideRthboolOutside regular trading hours
OrderLegs[]OrderLegAttached orders
AlgoParams*AlgoParamsAlgorithm parameters
SymbolstringInstrument symbol
SecTypestringSecurity type
MarketstringMarket
CurrencystringCurrency
ExpirystringExpiry date
StrikestringStrike price
RightstringOption side
IdentifierstringContract identifier
NamestringContract name
Commissionfloat64Commission
RealizedPnlfloat64Realized P&L
OpenTimeint64Open time in milliseconds
UpdateTimeint64Update time in milliseconds
LatestTimeint64Latest time in milliseconds
RemarkstringRemark
SourcestringOrder source
UserMarkstringUser mark
ExternalIdstringExternal ID
TotalQuantityScaleintOrder quantity scale
FilledQuantityScaleintFilled quantity scale
FilledCashAmountfloat64Filled cash amount
Gstfloat64GST
LiquidationboolWhether this is a liquidation order
AttrDescstringAttribute description
AttrList[]stringAttribute list
AlgoStrategystringAlgorithm strategy
Discountfloat64Discount
ReplaceStatusstringReplacement status
CancelStatusstringCancellation status
CanModifyboolWhether the order can be modified
CanCancelboolWhether the order can be cancelled
IsOpenboolWhether the order is open
OrderDiscountfloat64Order discount
TradingSessionTypestringTrading session type
LatestPricefloat64Latest price
DisplaySizeint64Iceberg display size
MinDisplaySizeint64Iceberg minimum display size
CheckIntervalsint64Iceberg price-check interval in seconds
PriceTypestringIceberg price type
StartTimeint64Effective start time in milliseconds
EndTimeint64Effective end time in milliseconds
OrderLeg fieldTypeDescription
LegTypestringAttached-order type
Pricefloat64Price
TimeInForcestringTime in force
Quantityint64Quantity
AlgoParams fieldTypeDescription
AlgoStrategystringAlgorithm strategy
StartTimestringStart time
EndTimestringEnd time
ParticipationRatefloat64Participation rate

Commission and GST are returned separately. Refer to the account statement for the exact calculation basis and currency. Go numeric fields are non-pointer values, so a missing value and an explicit zero both appear as 0.

Invocation example

result, err := tc.Orders(model.OrdersRequest{
	Account: "U123456",
	Market: "US",
	SecType: "STK",
	Symbol: "AAPL",
	StartDate: 1,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "id": 123456789,
    "orderId": 123456789,
    "symbol": "AAPL",
    "secType": "STK",
    "market": "US",
    "action": "BUY",
    "orderType": "LMT",
    "limitPrice": 310.00,
    "totalQuantity": 100,
    "filledQuantity": 100,
    "avgFillPrice": 309.85,
    "status": "Filled",
    "account": "12345678",
    "currency": "USD",
    "openTime": 1785504600000,
    "updateTime": 1785505200000
  }
]

Rate limit

The base rate limit is 120 requests/min. Orders and GetOrder both use orders and share this quota.


Get Order

Purpose

Retrieves one order by global ID or account-level order ID. The client fills an empty account field from the client default.

Signature

func (c *TradeClient) GetOrder(req model.GetOrderRequest) (*model.Order, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.GetOrderRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoUses the client default when emptyTrading account ID
SecretKeystringNoUses client configuration when both Account and SecretKey are empty; otherwise omitted when emptyInstitutional-account authentication key
Idint64ConditionallyOmitted when zeroGlobal order ID; provide Id or OrderId
OrderIdint64ConditionallyOmitted when zeroAccount-level order ID; provide Id or OrderId
IsBriefboolNoOmitted when falseWhether to return brief order data
ShowCharges*boolNoOmitted when nilWhether to request charge details; a pointer distinguishes explicit false from omission
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

(*model.Order, error). Key fields from model.Order:

FieldTypeDescription
AccountstringAccount ID
IDint64Order ID
OrderIdint64Order number
ActionstringTrade direction (BUY/SELL)
OrderTypestringOrder type
TotalQuantityint64Order quantity
LimitPricefloat64Limit price
AuxPricefloat64Auxiliary price (stop price)
TrailingPercentfloat64Trailing stop percentage
StatusstringOrder status
FilledQuantityint64Filled quantity
AvgFillPricefloat64Average fill price
TimeInForcestringTime in force
OutsideRthboolOutside regular trading hours
OrderLegs[]OrderLegAttached orders
AlgoParams*AlgoParamsAlgorithm parameters
SymbolstringInstrument symbol
SecTypestringSecurity type
MarketstringMarket
CurrencystringCurrency
ExpirystringExpiry date
StrikestringStrike price
RightstringOption side
IdentifierstringContract identifier
NamestringContract name
Commissionfloat64Commission
RealizedPnlfloat64Realized P&L
OpenTimeint64Open time in milliseconds
UpdateTimeint64Update time in milliseconds
LatestTimeint64Latest time in milliseconds
RemarkstringRemark
SourcestringOrder source
UserMarkstringUser mark
ExternalIdstringExternal ID
TotalQuantityScaleintOrder quantity scale
FilledQuantityScaleintFilled quantity scale
FilledCashAmountfloat64Filled cash amount
Gstfloat64GST
LiquidationboolWhether this is a liquidation order
AttrDescstringAttribute description
AttrList[]stringAttribute list
AlgoStrategystringAlgorithm strategy
Discountfloat64Discount
ReplaceStatusstringReplacement status
CancelStatusstringCancellation status
CanModifyboolWhether the order can be modified
CanCancelboolWhether the order can be cancelled
IsOpenboolWhether the order is open
OrderDiscountfloat64Order discount
TradingSessionTypestringTrading session type
LatestPricefloat64Latest price
DisplaySizeint64Iceberg display size
MinDisplaySizeint64Iceberg minimum display size
CheckIntervalsint64Iceberg price-check interval in seconds
PriceTypestringIceberg price type
StartTimeint64Effective start time in milliseconds
EndTimeint64Effective end time in milliseconds

OrderLeg fields

FieldTypeDescription
LegTypestringAttached-order type
Pricefloat64Price
TimeInForcestringTime in force
Quantityint64Quantity

AlgoParams fields

FieldTypeDescription
AlgoStrategystringAlgorithm strategy
StartTimestringAlgorithm-order start time
EndTimestringAlgorithm-order end time
ParticipationRatefloat64Participation rate

Invocation example

result, err := tc.GetOrder(model.GetOrderRequest{
	Account: "U123456",
	Id: 123456789,
	Lang: "en_US",
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
{
    "id": 123456789,
    "orderId": 123456789,
    "symbol": "AAPL",
    "secType": "STK",
    "market": "US",
    "action": "BUY",
    "orderType": "LMT",
    "limitPrice": 310.00,
    "totalQuantity": 100,
    "filledQuantity": 100,
    "avgFillPrice": 309.85,
    "status": "Filled",
    "account": "12345678",
    "currency": "USD",
    "openTime": 1785504600000,
    "updateTime": 1785505200000
  }

Rate limit

The base rate limit is 120 requests/min. Orders and GetOrder both use orders and share this quota.


Active Orders

Purpose

Lists open orders and optionally filters attached orders by parent ID. The client unwraps the server items envelope, and fills an empty account field from the client default.

Signature

func (c *TradeClient) ActiveOrders(req model.OrdersRequest) ([]model.Order, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrdersRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoUses the client default when emptyTrading account ID
SecretKeystringNoUses client configuration when both Account and SecretKey are empty; otherwise omitted when emptyInstitutional-account authentication key
SymbolstringNoOmitted if emptyInstrument symbol
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
SegTypestringNoOmitted if emptyAllowed values: ALL, SEC, FUT, FUND
StartDateint64NoOmitted when zeroStart of the query range as a millisecond timestamp
EndDateint64NoOmitted when zeroEnd of the query range as a millisecond timestamp
States[]stringNoOmitted if emptyOrder-status values
SortBystringNoOmitted if emptyAllowed values: LATEST_CREATED, LATEST_STATUS_UPDATED
ShowCharges*boolNoOmitted when nilWhether to request charge details; a pointer distinguishes explicit false from omission
IsBriefboolNoOmitted when falseWhether to return brief order data
LimitintNoOmitted when zeroResult count; server default 100, maximum 300
ParentIdint64NoOmitted when zeroParent order ID; filters attached orders
PageTokenstringNoOmitted if emptyPagination cursor
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Order, error). Key fields from model.Order:

FieldTypeDescription
AccountstringAccount ID
IDint64Order ID
OrderIdint64Order number
ActionstringTrade direction (BUY/SELL)
OrderTypestringOrder type
TotalQuantityint64Order quantity
LimitPricefloat64Limit price
AuxPricefloat64Auxiliary price (stop price)
TrailingPercentfloat64Trailing stop percentage
StatusstringOrder status
FilledQuantityint64Filled quantity
AvgFillPricefloat64Average fill price
TimeInForcestringTime in force
OutsideRthboolOutside regular trading hours
OrderLegs[]OrderLegAttached orders
AlgoParams*AlgoParamsAlgorithm parameters
SymbolstringInstrument symbol
SecTypestringSecurity type
MarketstringMarket
CurrencystringCurrency
ExpirystringExpiry date
StrikestringStrike price
RightstringOption side
IdentifierstringContract identifier
NamestringContract name
Commissionfloat64Commission
RealizedPnlfloat64Realized P&L
OpenTimeint64Open time in milliseconds
UpdateTimeint64Update time in milliseconds
LatestTimeint64Latest time in milliseconds
RemarkstringRemark
SourcestringOrder source
UserMarkstringUser mark
ExternalIdstringExternal ID
TotalQuantityScaleintOrder quantity scale
FilledQuantityScaleintFilled quantity scale
FilledCashAmountfloat64Filled cash amount
Gstfloat64GST
LiquidationboolWhether this is a liquidation order
AttrDescstringAttribute description
AttrList[]stringAttribute list
AlgoStrategystringAlgorithm strategy
Discountfloat64Discount
ReplaceStatusstringReplacement status
CancelStatusstringCancellation status
CanModifyboolWhether the order can be modified
CanCancelboolWhether the order can be cancelled
IsOpenboolWhether the order is open
OrderDiscountfloat64Order discount
TradingSessionTypestringTrading session type
LatestPricefloat64Latest price
DisplaySizeint64Iceberg display size
MinDisplaySizeint64Iceberg minimum display size
CheckIntervalsint64Iceberg price-check interval in seconds
PriceTypestringIceberg price type
StartTimeint64Effective start time in milliseconds
EndTimeint64Effective end time in milliseconds

OrderLeg fields

FieldTypeDescription
LegTypestringAttached-order type
Pricefloat64Price
TimeInForcestringTime in force
Quantityint64Quantity

AlgoParams fields

FieldTypeDescription
AlgoStrategystringAlgorithm strategy
StartTimestringAlgorithm-order start time
EndTimestringAlgorithm-order end time
ParticipationRatefloat64Participation rate

Invocation example

result, err := tc.ActiveOrders(model.OrdersRequest{
	Account: "U123456",
	Market: "US",
	SecType: "STK",
	Symbol: "AAPL",
	StartDate: 1,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "id": 123456790,
    "orderId": 123456790,
    "symbol": "TSLA",
    "secType": "STK",
    "market": "US",
    "action": "BUY",
    "orderType": "LMT",
    "limitPrice": 280.00,
    "totalQuantity": 50,
    "filledQuantity": 0,
    "status": "Submitted",
    "account": "12345678",
    "currency": "USD",
    "openTime": 1785504600000
  }
]

Rate limit

The base rate limit is 120 requests/min.


Inactive Orders

Purpose

Lists inactive or cancelled orders using OrdersRequest filters. The client unwraps the server items envelope, and fills an empty account field from the client default.

Signature

func (c *TradeClient) InactiveOrders(req model.OrdersRequest) ([]model.Order, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrdersRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoUses the client default when emptyTrading account ID
SecretKeystringNoUses client configuration when both Account and SecretKey are empty; otherwise omitted when emptyInstitutional-account authentication key
SymbolstringNoOmitted if emptyInstrument symbol
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
SegTypestringNoOmitted if emptyAllowed values: ALL, SEC, FUT, FUND
StartDateint64NoOmitted when zeroStart of the query range as a millisecond timestamp
EndDateint64NoOmitted when zeroEnd of the query range as a millisecond timestamp
States[]stringNoOmitted if emptyOrder-status values
SortBystringNoOmitted if emptyAllowed values: LATEST_CREATED, LATEST_STATUS_UPDATED
ShowCharges*boolNoOmitted when nilWhether to request charge details; a pointer distinguishes explicit false from omission
IsBriefboolNoOmitted when falseWhether to return brief order data
LimitintNoOmitted when zeroResult count; server default 100, maximum 300
ParentIdint64NoOmitted when zeroParent order ID
PageTokenstringNoOmitted if emptyPagination cursor
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Order, error). Key fields from model.Order:

FieldTypeDescription
AccountstringAccount ID
IDint64Order ID
OrderIdint64Order number
ActionstringTrade direction (BUY/SELL)
OrderTypestringOrder type
TotalQuantityint64Order quantity
LimitPricefloat64Limit price
AuxPricefloat64Auxiliary price (stop price)
TrailingPercentfloat64Trailing stop percentage
StatusstringOrder status
FilledQuantityint64Filled quantity
AvgFillPricefloat64Average fill price
TimeInForcestringTime in force
OutsideRthboolOutside regular trading hours
OrderLegs[]OrderLegAttached orders
AlgoParams*AlgoParamsAlgorithm parameters
SymbolstringInstrument symbol
SecTypestringSecurity type
MarketstringMarket
CurrencystringCurrency
ExpirystringExpiry date
StrikestringStrike price
RightstringOption side
IdentifierstringContract identifier
NamestringContract name
Commissionfloat64Commission
RealizedPnlfloat64Realized P&L
OpenTimeint64Open time in milliseconds
UpdateTimeint64Update time in milliseconds
LatestTimeint64Latest time in milliseconds
RemarkstringRemark
SourcestringOrder source
UserMarkstringUser mark
ExternalIdstringExternal ID
TotalQuantityScaleintOrder quantity scale
FilledQuantityScaleintFilled quantity scale
FilledCashAmountfloat64Filled cash amount
Gstfloat64GST
LiquidationboolWhether this is a liquidation order
AttrDescstringAttribute description
AttrList[]stringAttribute list
AlgoStrategystringAlgorithm strategy
Discountfloat64Discount
ReplaceStatusstringReplacement status
CancelStatusstringCancellation status
CanModifyboolWhether the order can be modified
CanCancelboolWhether the order can be cancelled
IsOpenboolWhether the order is open
OrderDiscountfloat64Order discount
TradingSessionTypestringTrading session type
LatestPricefloat64Latest price
DisplaySizeint64Iceberg display size
MinDisplaySizeint64Iceberg minimum display size
CheckIntervalsint64Iceberg price-check interval in seconds
PriceTypestringIceberg price type
StartTimeint64Effective start time in milliseconds
EndTimeint64Effective end time in milliseconds

OrderLeg fields

FieldTypeDescription
LegTypestringAttached-order type
Pricefloat64Price
TimeInForcestringTime in force
Quantityint64Quantity

AlgoParams fields

FieldTypeDescription
AlgoStrategystringAlgorithm strategy
StartTimestringAlgorithm-order start time
EndTimestringAlgorithm-order end time
ParticipationRatefloat64Participation rate

Invocation example

result, err := tc.InactiveOrders(model.OrdersRequest{
	Account: "U123456",
	Market: "US",
	SecType: "STK",
	Symbol: "AAPL",
	StartDate: 1,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "id": 123456789,
    "orderId": 123456789,
    "symbol": "AAPL",
    "secType": "STK",
    "market": "US",
    "action": "BUY",
    "orderType": "LMT",
    "limitPrice": 310.00,
    "totalQuantity": 100,
    "filledQuantity": 100,
    "avgFillPrice": 309.85,
    "status": "Filled",
    "account": "12345678",
    "currency": "USD",
    "openTime": 1785504600000,
    "updateTime": 1785505200000
  }
]

Rate limit

The base rate limit is 120 requests/min.


Filled Orders

Purpose

Lists filled orders using OrdersRequest filters. The client unwraps the server items envelope, and fills an empty account field from the client default.

Signature

func (c *TradeClient) FilledOrders(req model.OrdersRequest) ([]model.Order, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrdersRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoUses the client default when emptyTrading account ID
SecretKeystringNoUses client configuration when both Account and SecretKey are empty; otherwise omitted when emptyInstitutional-account authentication key
SymbolstringNoOmitted if emptyInstrument symbol
MarketstringNoOmitted if emptyAllowed values: ALL, US, HK, CN, SG
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
SegTypestringNoOmitted if emptyAllowed values: ALL, SEC, FUT, FUND
StartDateint64NoOmitted when zeroStart of the query range as a millisecond timestamp
EndDateint64NoOmitted when zeroEnd of the query range as a millisecond timestamp
States[]stringNoOmitted if emptyOrder-status values
SortBystringNoOmitted if emptyAllowed values: LATEST_CREATED, LATEST_STATUS_UPDATED
ShowCharges*boolNoOmitted when nilWhether to request charge details; a pointer distinguishes explicit false from omission
IsBriefboolNoOmitted when falseWhether to return brief order data
LimitintNoOmitted when zeroResult count; server default 100, maximum 300
ParentIdint64NoOmitted when zeroParent order ID
PageTokenstringNoOmitted if emptyPagination cursor
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Order, error). Key fields from model.Order:

FieldTypeDescription
AccountstringAccount ID
IDint64Order ID
OrderIdint64Order number
ActionstringTrade direction (BUY/SELL)
OrderTypestringOrder type
TotalQuantityint64Order quantity
LimitPricefloat64Limit price
AuxPricefloat64Auxiliary price (stop price)
TrailingPercentfloat64Trailing stop percentage
StatusstringOrder status
FilledQuantityint64Filled quantity
AvgFillPricefloat64Average fill price
TimeInForcestringTime in force
OutsideRthboolOutside regular trading hours
OrderLegs[]OrderLegAttached orders; fields are listed in the Orders return table on this page
AlgoParams*AlgoParamsAlgorithm parameters; fields are listed in the Orders return table on this page
SymbolstringInstrument symbol
SecTypestringSecurity type
MarketstringMarket
CurrencystringCurrency
ExpirystringExpiry date
StrikestringStrike price
RightstringOption side
IdentifierstringContract identifier
NamestringContract name
Commissionfloat64Commission
RealizedPnlfloat64Realized P&L
OpenTimeint64Open time in milliseconds
UpdateTimeint64Update time in milliseconds
LatestTimeint64Latest time in milliseconds
RemarkstringRemark
SourcestringOrder source
UserMarkstringUser mark
ExternalIdstringExternal ID
TotalQuantityScaleintOrder quantity scale
FilledQuantityScaleintFilled quantity scale
FilledCashAmountfloat64Filled cash amount
Gstfloat64GST
LiquidationboolWhether this is a liquidation order
AttrDescstringAttribute description
AttrList[]stringAttribute list
AlgoStrategystringAlgorithm strategy
Discountfloat64Discount
ReplaceStatusstringReplacement status
CancelStatusstringCancellation status
CanModifyboolWhether the order can be modified
CanCancelboolWhether the order can be cancelled
IsOpenboolWhether the order is open
OrderDiscountfloat64Order discount
TradingSessionTypestringTrading session type
LatestPricefloat64Latest price
DisplaySizeint64Iceberg display size
MinDisplaySizeint64Iceberg minimum display size
CheckIntervalsint64Iceberg price-check interval in seconds
PriceTypestringIceberg price type
StartTimeint64Effective start time in milliseconds
EndTimeint64Effective end time in milliseconds

OrderLeg fields

FieldTypeDescription
LegTypestringAttached-order type
Pricefloat64Price
TimeInForcestringTime in force
Quantityint64Quantity

AlgoParams fields

FieldTypeDescription
AlgoStrategystringAlgorithm strategy
StartTimestringAlgorithm-order start time
EndTimestringAlgorithm-order end time
ParticipationRatefloat64Participation rate

Invocation example

result, err := tc.FilledOrders(model.OrdersRequest{
	Account: "U123456",
	Market: "US",
	SecType: "STK",
	Symbol: "AAPL",
	StartDate: 1,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "id": 123456789,
    "orderId": 123456789,
    "symbol": "AAPL",
    "secType": "STK",
    "market": "US",
    "action": "BUY",
    "orderType": "LMT",
    "limitPrice": 310.00,
    "totalQuantity": 100,
    "filledQuantity": 100,
    "avgFillPrice": 309.85,
    "status": "Filled",
    "account": "12345678",
    "currency": "USD",
    "openTime": 1785504600000,
    "updateTime": 1785505200000
  }
]

Rate limit

The base rate limit is 120 requests/min.


Order Transactions

Purpose

Lists execution records for orders or an instrument and time range. The client unwraps the server items envelope, and fills an empty account field from the client default.

Signature

func (c *TradeClient) OrderTransactions(req model.OrderTransactionsRequest) ([]model.Transaction, error)

Requires a trading account accessible through the configuration. Institutional accounts can authenticate with SecretKey.

Parameters

model.OrderTransactionsRequest

SDK fieldTypeRequiredSerializationSDK default and constraints
AccountstringNoUses the client default when emptyTrading account ID
SecretKeystringNoUses client configuration when both Account and SecretKey are empty; otherwise omitted when emptyInstitutional-account authentication key
OrderIdint64NoOmitted when zeroAccount-level order ID
SymbolstringNoOmitted if emptyInstrument symbol
SecTypestringNoOmitted if emptyAllowed values: ALL, STK, OPT, WAR, IOPT, FUT, FOP, CASH, MLEG, FUND
StartDateint64NoOmitted when zeroStart of the query range as a millisecond timestamp
EndDateint64NoOmitted when zeroEnd of the query range as a millisecond timestamp
SinceDatestringNoOmitted if emptyNone; yyyyMMdd
ToDatestringNoOmitted if emptyEnd date in yyyyMMdd format
ExpirystringNoOmitted if emptyExpiry date
Strikefloat64NoOmitted when zeroStrike price
RightstringNoOmitted if emptyAllowed values: PUT, CALL (option side); br, nr when used as quote adjustment
LimitintNoOmitted when zeroResult count
PageTokenstringNoOmitted if emptyPagination cursor
LangstringNoOmitted if emptyAllowed values: zh_CN, zh_TW, en_US

Returns

([]model.Transaction, error). Key fields from model.Transaction:

FieldTypeDescription
IDint64Transaction record ID
OrderIDint64Order ID
AccountIdint64Account numeric ID
AccountstringAccount ID
SymbolstringSymbol code
SecTypestringSecurity type
MarketstringMarket
CurrencystringCurrency
IdentifierstringIdentifier
ActionstringTrade direction (BUY/SELL)
Pricefloat64Order price
FilledPricefloat64Filled price
Quantityint64Order quantity
FilledQuantityint64Filled quantity
FilledQuantityScaleintFilled quantity scale
Amountfloat64Order amount
FilledAmountfloat64Filled amount
Commissionfloat64Commission
TransactedAtstringTransaction time in YYYY-MM-DD HH:MM:SS format
TransactionTimeint64Transaction time in milliseconds
Timeint64Compatibility time field

The current API response may not populate Time.

Invocation example

result, err := tc.OrderTransactions(model.OrderTransactionsRequest{
	Account: "U123456",
	Symbol: "AAPL",
	SecType: "STK",
	StartDate: 1,
	EndDate: 1,
})
if err != nil {
	log.Fatal(err)
}
fmt.Printf("%#v\n", result)
[
  {
    "id": 987654321,
    "orderId": 123456789,
    "symbol": "AAPL",
    "secType": "STK",
    "action": "BUY",
    "filledQuantity": 100,
    "filledPrice": 309.85,
    "filledAmount": 30985.00,
    "transactionTime": 1785505200000,
    "account": "12345678",
    "currency": "USD"
  }
]

Rate limit

The base rate limit is 60 requests/min.



Did this page help you?