Skip to main content

Query Filled History

FilledHistory

Input Parameters

ParameterTypeDescription
accountAccountAccount
startDate*stringQuery Start Date (Format: YYYYMMDD)
endDate*string (Null default same as Start Date)Query End Date (Format: YYYYMMDD)
info

Maximum query range setting is 30 days per query.

Result Return

ParameterTypeDescription
IsSuccessboolWhether successful
Data*[]FilledDataReturns filled list
Message*stringReturns error message when IsSuccess = false

Filled Information FilledData Fields

Return type : Object

ParameterTypeDescription
Date*stringFilled Date
BranchNo*stringBranch Code
Account*stringAccount
SeqNo*stringOrder Sequence Number (Only returned for active reports)
OrderNo*stringOrder Number
StockNo*stringStock Symbol
BuySellBsActionBuy/Sell Action: BsActionBuy Buy, BsActionSell Sell
FilledNo*stringFill Sequence Number
FilledAvgPrice*stringFilled Average Price
FilledQty*int64Filled Quantity
FilledPrice*stringFilled Price
OrderTypeOrderTypeOrder Type: OrderTypeStock Common, OrderTypeMargin Margin, OrderTypeShort Short Sell, OrderTypeDayTrade Day Trade, OrderTypeSbl SBL
FilledTime*stringFilled Time
UserDef*stringUser Defined Field (Only returned for active reports)

Request Example

package main

import (
"fmt"
"fubon"
)

func main() {
// Initialize SDK and login
sdk := fubon.NewSDK()

// ... Login, connection, and other initialization steps ...

// Query Filled History
startDate := "20250401"
endDate := "20250501"

filledHis, err := sdk.Stock.FilledHistory(account, &startDate, &endDate)

// Error Handling
if err != nil {
fmt.Printf("❌ Filled History Format/Parse Error: %v (Type: %T)\n", err, err)
return
}

// Check Success
if !filledHis.IsSuccess {
message := "No message"
if filledHis.Message != nil {
message = *filledHis.Message
}
fmt.Printf("Filled history failed. Message: %s\n", message)
return
}

// Output Filled History List
if filledHis.Data != nil && len(*filledHis.Data) > 0 {
fmt.Printf("✅ Found %d filled records\n", len(*filledHis.Data))

for i, filled := range *filledHis.Data {
fmt.Printf("\n--- Filled %d ---\n", i+1)
fmt.Printf("Date: %s\n", *filled.Date)
fmt.Printf("OrderNo: %s\n", *filled.OrderNo)
fmt.Printf("StockNo: %s\n", *filled.StockNo)
fmt.Printf("BuySell: %v\n", filled.BuySell)
fmt.Printf("FilledQty: %d\n", *filled.FilledQty)
fmt.Printf("FilledPrice: %s\n", *filled.FilledPrice)
fmt.Printf("FilledAvgPrice: %s\n", *filled.FilledAvgPrice)
fmt.Printf("FilledTime: %s\n", *filled.FilledTime)
fmt.Printf("OrderType: %v\n", filled.OrderType)

if filled.UserDef != nil && *filled.UserDef != "" {
fmt.Printf("UserDef: %s\n", *filled.UserDef)
}
}
} else {
fmt.Println("No filled data returned.")
}
}

Response Example

// FilledHistory Return Structure
Result{
IsSuccess: true,
Message: nil,
Data: &[]FilledData{
{
Date: "2025/04/29", // Filled Date
BranchNo: "6460", // Branch Code
Account: "26", // Account
SeqNo: nil, // Order Sequence Number
OrderNo: "bA422", // Order Number
StockNo: "1101", // Stock Symbol
BuySell: Sell, // Buy/Sell Action
FilledNo: "00000000001", // Fill Sequence Number
FilledAvgPrice: "35.2", // Filled Average Price
FilledQty: 1000, // Filled Quantity
FilledPrice: "35.2", // Filled Price
OrderType: Stock, // Order Type
FilledTime: "10:31:00.931", // Filled Time
UserDef: nil, // User Defined
},
// ... more filled records
},
}