Skip to main content

Transfer Record Query

QueryTransfers

Version

Available in v2.2.9 and later.

Parameters

FieldTypeDescription
accountAccountAccount
startDate*stringQuery start date (YYYYMMDD). When nil is provided, the server default range is used
endDate*stringQuery end date (YYYYMMDD)
stockNo*stringStock symbol. When nil is provided, all symbols are queried

Result

FieldTypeDescription
IsSuccessboolWhether the request succeeded
Data*[]TransferRecordList of transfer records; an empty list when no records exist
Message*stringError message when IsSuccess is false

Transfer record: TransferRecord fields

Return type : Object

FieldTypeDescription
SeqNostringSequence number
DatestringApplication date
TimestringApplication time
StockNostringStock symbol
MarketMarketMarket: MarketTaiex TWSE, MarketTaisdaq TPEx, MarketTaiemg Emerging
Quantityint64Transferred shares
TargetBranchNostringReceiving branch code
TargetAccountstringReceiving account
Statusint32Status: 10 success; 90 failure

Request example

package main

import (
"fmt"
"fubon"
)

func main() {
// Initialize the SDK and log in
sdk := fubon.NewFubonSDK()

// ... Login and connection initialization steps ...

// Query transfer records for a date range without a stock-symbol filter
startDate := "20260701"
endDate := "20260722"

transfersResult, err := sdk.Stock.QueryTransfers(account, &startDate, &endDate, nil)

// Handle transport or SDK errors
if err != nil {
fmt.Printf("❌ Query Transfers Error: %v (Type: %T)\n", err, err)
return
}

// Check the API result
if !transfersResult.IsSuccess {
message := "No message"
if transfersResult.Message != nil {
message = *transfersResult.Message
}
fmt.Printf("Query transfers failed. Message: %s\n", message)
return
}

// Print the transfer records
if transfersResult.Data != nil && len(*transfersResult.Data) > 0 {
fmt.Printf("✅ Found %d transfer records\n", len(*transfersResult.Data))

for i, record := range *transfersResult.Data {
fmt.Printf("\n--- Record %d ---\n", i+1)
fmt.Printf("SeqNo: %s\n", record.SeqNo)
fmt.Printf("Date: %s\n", record.Date)
fmt.Printf("StockNo: %s\n", record.StockNo)
fmt.Printf("Quantity: %d\n", record.Quantity)
fmt.Printf("Status: %d\n", record.Status)
}
} else {
fmt.Println("Query transfers success but no data returned.")
}
}

Response example

// QueryTransfers response structure
Result{
IsSuccess: true,
Message: nil,
Data: &[]TransferRecord{
{
SeqNo: "418181", // Sequence number
Date: "2026/07/28", // Application date
Time: "10:53:48.340", // Application time
StockNo: "006205", // Stock symbol
Market: MarketTaiex, // Market
Quantity: 1000, // transferred shares
TargetBranchNo: "960C", // Receiving branch code
TargetAccount: "7654321", // Receiving account
Status: 10, // status
},
// ... more records
},
}