Share Reservation Application
ReserveStock
Version
Available in v2.2.9 and later.
Usage limits
- Applications are accepted on trading days from 08:00 to 14:30. Requests outside this window are rejected by the backend.
- An application cannot be cancelled through the API after it is submitted.
- For the complete workflow, see Reservations and Transfers.
Parameters
| Field | Type | Description |
|---|---|---|
| account | Account | Account |
| stockNo | string | Stock symbol |
| quantity | int64 | Number of shares to reserve. Unit: shares (1 lot = 1,000 shares); must be greater than 0 |
Result
| Field | Type | Description |
|---|---|---|
| IsSuccess | bool | Whether the request succeeded |
| Data | *ReserveStockRecord | Share reservation application details |
| Message | *string | Error message when IsSuccess is false |
Share reservation record: ReserveStockRecord fields
Return type : Object
| Field | Type | Description |
|---|---|---|
| SeqNo | string | Sequence number |
| StockNo | string | Stock symbol |
| ReservedShare | int64 | Shares reserved in this request |
Request example
package main
import (
"fmt"
"fubon"
)
func main() {
// Initialize the SDK and log in
sdk := fubon.NewFubonSDK()
// ... Login and connection initialization steps ...
// Apply to reserve 599 shares
reserveResult, err := sdk.Stock.ReserveStock(account, "2330", 599)
// Handle transport or SDK errors
if err != nil {
fmt.Printf("❌ Reserve Stock Error: %v (Type: %T)\n", err, err)
return
}
// Check the API result
if !reserveResult.IsSuccess {
message := "No message"
if reserveResult.Message != nil {
message = *reserveResult.Message
}
fmt.Printf("Reserve stock failed. Message: %s\n", message)
return
}
// Print the share reservation result
if reserveResult.Data != nil {
record := *reserveResult.Data
fmt.Printf("✅ Reserve stock accepted\n")
fmt.Printf("SeqNo: %s\n", record.SeqNo)
fmt.Printf("StockNo: %s\n", record.StockNo)
fmt.Printf("ReservedShare: %d\n", record.ReservedShare)
} else {
fmt.Println("Reserve stock success but no data returned.")
}
}
Response example
// ReserveStock response structure
Result{
IsSuccess: true,
Message: nil,
Data: &ReserveStockRecord{
SeqNo: "417106", // Sequence number
StockNo: "2330", // Stock symbol
ReservedShare: 599, // Shares reserved in this request
},
}