Skip to main content

Cash Reservation Query

QueryReserves

Version

Available in v2.2.9 and later.

Parameters

FieldTypeDescription
accountAccountAccount

Result

FieldTypeDescription
is_successboolWhether the request succeeded
dataReserveCashSummaryAccount-wide pre-collected cash summary
messagestringError message when is_success is false

Pre-collected cash summary: ReserveCashSummary fields

Return type : Object

FieldTypeDescription
branch_nostringBranch code
accountstringAccount
currencystringCurrency: TWD
reserved_amountintPre-collected amount (TWD)
returned_amountintReturned amount (TWD)
ordered_amountintAmount used by orders (TWD)

Request example

auto reserves_response = sdk->stock->query_reserves(target_account);

// Output using custom .cpp and .hpp helpers
if (!reserves_response.is_success) {
std::cout << "query reserves failed reason: "
<< (reserves_response.message.has_value() ? reserves_response.message.value() : "No message")
<< std::endl;
}
else {
if (reserves_response.data.has_value()) {
std::cout << reserves_response.data.value() << std::endl;
}
else {
std::cout << "Query reserves success but no data returned." << std::endl;
}
}

Response example

// Output using custom .cpp and .hpp helpers
[ReserveCashSummary]
branch_no: 20207 // Branch code (string)
account: 9801163 // Account (string)
currency: TWD // currency (string)
reserved_amount: 9960200 // pre-collected amount (int)
returned_amount: 0 // returned amount (int)
ordered_amount: 0 // amount used by orders (int)