Skip to main content

Get Batch Order List

BatchOrderLists

Input Parameters

ParameterTypeDescription
accountAccountAccount

Result Return

ParameterTypeDescription
IsSuccessboolWhether successful
Data*[]BatchResultReturns batch order info list
Message*stringReturns error message when IsSuccess = false

Batch Order BatchResult Fields

Return type : Object

ParameterTypeDescription
FunctionType*int64Function Type: 0 New Order, 10 Execute New Order, 15 Change Price, 20 Change Qty, 30 Cancel Order, 90 Fail
Date*stringTransaction Date
BranchNo*stringBranch Code
Account*stringAccount
BatchSeqNo*stringBatch Order Sequence Number

Request Example

package main

import (
"fmt"
"fubon"
)

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

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

// Query Batch Order List
batchList, err := sdk.Stock.BatchOrderLists(account)

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

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

// Output Batch List
if batchList.Data != nil && len(*batchList.Data) > 0 {
fmt.Printf("✅ Found %d batch orders\n", len(*batchList.Data))

for i, batch := range *batchList.Data {
fmt.Printf("\n--- Batch %d ---\n", i+1)
fmt.Printf("Date: %s\n", *batch.Date)
fmt.Printf("BatchSeqNo: %s\n", *batch.BatchSeqNo)
fmt.Printf("FunctionType: %d\n", *batch.FunctionType)
fmt.Printf("Account: %s\n", *batch.Account)
}
} else {
fmt.Println("Get batch list success but no data returned.")
}
}

Response Example

// BatchOrderLists Return Structure
Result{
IsSuccess: true,
Message: nil,
Data: &[]BatchResult{
{
FunctionType: 0, // Function Type (New Order)
Date: "2023/10/04", // Transaction Date
BranchNo: "6460", // Branch Code
Account: "26", // Account
BatchSeqNo: "11EE626533D072228000000C29304663", // Batch Order Sequence Number
},
// ... more batch orders
},
}