Skip to main content

Reservations and Transfers

Key points
  • Reservations and transfers are pre-order preparation operations, not orders themselves.
  • Buying a disposition stock requires a cash reservation; selling a disposition stock or a full-cash-settlement stock requires a share reservation.
  • These operations have no cancellation mechanism and are irreversible after submission. Confirm the details before submitting.
  • Status changes are not pushed proactively. For cash and share reservations, query after submission; for a transfer, rely on the application response as described below.

What these features do

The Neo API provides three pre-order preparation operations:

OperationMethodsPurpose
Cash reservationreserve_cash, query_reservesReserve funds in an account for a subsequent buy order
Share reservationreserve_stock, query_reserved_stocksReserve inventory for a specified instrument in an account for a subsequent sell order
Transferquery_transfer_inventory, transfer_stock, query_transfersMove inventory from the current account to another specified account

Cash and share reservations both secure the required resource before an order can be submitted. Exchanges require advance collection of funds or shares for certain instruments. An order submitted before the applicable reservation is completed will be rejected.

When it is needed

ScenarioRequired operationDescription
Buy a disposition stockCash reservationBuying during the disposition period requires advance collection of funds. Reserve sufficient cash before submitting the buy order.
Sell a disposition stock or full-cash-settlement stockShare reservationAdvance collection of shares applies. Reserve the instrument inventory before submitting the sell order.
Move inventory between different accounts of the same investorTransferFor example, moving inventory between a primary account and a sub-account.

Orders for ordinary instruments do not require these operations and can be submitted directly.

info

Whether an instrument is designated as a disposition stock or full-cash-settlement stock changes over time. Confirm its status on the trading day before placing an order.

Before you start

Before calling these features, complete the following preparations for the account:

  1. Use fubon-neo SDK version 2.2.9 or later.
  2. Sign the required electronic depository agreement. The backend rejects the operation if the agreement has not been completed.
  3. Use an API key with account-service permission. Both application and query methods in this feature group require that permission.

Operational characteristics

Irreversible after submission

These operations do not provide a cancellation or release interface. Once an application is submitted, it cannot be withdrawn through the API. Confirm the amount, instrument, and quantity before submitting. If the program times out, do not resubmit immediately. For cash and share reservations, query the account-wide total or reserved-share balance first to determine whether the prior application was accepted. A transfer currently cannot be confirmed by query: the record query does not immediately reflect the application and its sequence number cannot be matched to the application's sequence number. Reconcile with your broker or branch before deciding whether to resubmit, or inventory may be moved more than once.

Application service hours

Cash reservation, share reservation, and transfer applications are accepted on trading days from 08:00 to 14:30. The backend rejects requests outside this window; query methods are not subject to this restriction.

Status is not reported proactively

These operations do not use the order-report channel, so no status-change notifications are pushed proactively. For cash and share reservations, wait several seconds before querying, use reasonable polling intervals and a maximum number of attempts, and use the query result—not the immediate application response—as the basis for a subsequent order.


The examples below assume that login has completed and the securities account account has been obtained.

Cash reservation

Apply for a cash reservation

Prepay TWD settlement funds for a subsequent buy order.

result = sdk.stock.reserve_cash(account, 10000)
print(result)
Result {
is_success: True,
message: None,
data : ReserveCashRecord {
date: "2026/07/28",
time: "10:53:23.000",
seq_no: "118036",
branch_no: "20207",
account: "9801163",
currency: "TWD",
amount: 10000,
status: 10
}}

Query cash reservations

result = sdk.stock.query_reserves(account)
print(result)
Result {
is_success: True,
message: None,
data : ReserveCashSummary {
branch_no: "20207",
account: "9801163",
currency: "TWD",
reserved_amount: 9960200,
returned_amount: 0,
ordered_amount: 0,
}}

Share reservation

Apply for a share reservation

Reserve the shares that will be sold. quantity is measured in shares (1 lot = 1,000 shares).

result = sdk.stock.reserve_stock(account, "2330", 1000)
print(result)
Result {
is_success: True,
message: None,
data : ReserveStockRecord {
seq_no: "118036",
stock_no: "2330",
reserved_share: 1000,
}}

Query share reservations

result = sdk.stock.query_reserved_stocks(account)
print(result)
Result {
is_success: True,
message: None,
data : [
ReserveStockItem { stock_no: "2330", market: Taiex, reserved_share: 5599 },
ReserveStockItem { stock_no: "1260", market: Taiemg, reserved_share: 3000 },
]
}

Transfer

Query transferable inventory

Returns the transferable share quantity and market for each instrument. Query before applying for a transfer.

result = sdk.stock.query_transfer_inventory(account)
print(result)
Result {
is_success: True,
message: None,
data : [
TransferInventoryItem { stock_no: "006205", market: Taiex, available_share: 5000 },
TransferInventoryItem { stock_no: "6279", market: Taisdaq, available_share: 2000 },
]
}

Apply for a transfer

Transfer stock out to a specified branch account. quantity is measured in shares (1 lot = 1,000 shares). market is optional—when omitted, the SDK resolves it automatically. Applications must be submitted during service hours and cannot be reversed; see Operational characteristics.

# When market is omitted, the SDK resolves it automatically
result = sdk.stock.transfer_stock(account, "960C", "7654321", "006205", 2000)
print(result)
Result {
is_success: True,
message: None,
data : TransferRecord {
date: "2026/07/28",
time: "10:53:48.340",
seq_no: "418181",
stock_no: "006205",
market: Taiex,
quantity: 2000,
target_branch_no: "960C",
target_account: "7654321",
status: 10
}}

Query transfer records

result = sdk.stock.query_transfers(account)
print(result)
Result {
is_success: True,
message: None,
data : [ TransferRecord {
date: "2026/07/28",
time: "10:53:48.340",
seq_no: "418181",
stock_no: "006205",
market: Taiex,
quantity: 2000,
target_branch_no: "960C",
target_account: "7654321",
status: 10, } ]
}

Complete example

Buying a disposition stock (cash reservation → confirmation → order) and transferring between accounts:

Use the transfer application response as the result

The transfer-record query (query_transfers) does not immediately reflect a successful application, and its seq_no is an empty string, so it cannot be matched to the sequence number returned by the application. Use the status in the application response (10 success; 90 failure) as the result, and retain the application's seq_no for later reconciliation with your broker or branch.

# 1. Reserve the settlement cash required to buy a disposition stock
result = sdk.stock.reserve_cash(account, 10000)
if not result.is_success:
print(result.message)

# 2. Wait several seconds, then query. Submit the buy order only after the reservation is accepted (see "Place Order")
reserves = sdk.stock.query_reserves(account)
print(reserves.data.reserved_amount) # Account-wide pre-collected amount

# --- Inter-account transfer: use the application response to determine acceptance ---
result = sdk.stock.transfer_stock(account, "960C", "7654321", "006205", 1000)
if result.is_success and result.data.status == 10:
print("Transfer accepted; sequence number:", result.data.seq_no)
else:
print("Transfer not accepted:", result.message)

On failure

When a call fails, is_success is False; obtain the reason from message.

ScenarioBehavior
Amount or share quantity is ≤ 0The SDK returns failure without sending a request.
Not logged in, or the API key lacks the required permissionThe SDK returns failure.
A transfer omits market and no transferable inventory is found for the symbolThe SDK returns failure; its message asks you to provide an explicit market.
Backend rejection (for example, insufficient balance or inventory, an invalid account, or outside service hours)message contains the reason returned by the server.