Skip to main content

交割款查詢

QuerySettlement

輸入參數

參數類別說明
accountAccount帳號
rangestring時間區間,目前有效值為"0d"(當日)、"3d"

Result 回傳

參數類別說明
is_successbool是否成功
dataSettlementData回傳交割款資訊
messagestring當is_success = False 回傳錯誤訊息

交割資訊 SettlementData 欄位

Return type : Object

參數類別說明
> accountobjectObject
>> accountstring帳號
>> branch_nostring分公司代號
> detailslistObject
>> datestring查詢日
>> settlement_datestring (Optional)交割日 (若查無資料為空值)
>> buy_valueint (Optional)買進金額 (若查無資料為空值)
>> buy_feeint (Optional)買進手續費 (若查無資料為空值)
>> buy_settlementint (Optional)買進應收付款 (若查無資料為空值)
>> buy_taxint (Optional)買進交易稅 (若查無資料為空值)
>> sell_valueint (Optional)賣出金額 (若查無資料為空值)
>> sell_feeint (Optional)賣出手續費 (若查無資料為空值)
>> sell_settlementint (Optional)賣出應收付款 (若查無資料為空值)
>> sell_taxint (Optional)賣出交易稅 (若查無資料為空值)
>> total_bs_valueint (Optional)合計買賣金額 (若查無資料為空值)
>> total_feeint (Optional)合計手續費 (若查無資料為空值)
>> total_taxint (Optional)合計交易稅 (若查無資料為空值)
>> total_settlement_amountint (Optional)合計交割金額 (若查無資料為空值)
>> currencystring (Optional)幣別 (若查無資料為空值)

請求範例

auto settlement_response = sdk->accounting->query_settlement(target_account, "3d");

// 搭配自定義 .cpp & hpp Output
if (settlement_response.is_success && settlement_response.data.has_value()) {
std::cout << *settlement_response.data << std::endl;
}

回傳範例

{
isSuccess = true,
message = ,
data = SettlementData{
account = AccountRes { // 帳戶資訊
account = 26, // 帳號 (string)
branchNo = 6460 // 分公司代號 (string)
},
details = [
Settlement{ // 交割資訊
date = 2024/03/04, // 查詢日 (string)
settlementDate = 2024/03/06, // 交割日期 (string)
buyValue = 735500, // 買進金額 (int)
buyFee = 313, // 買進費用 (int)
buySettlement = -1429513, // 買進應收付款 (int)
buyTax = 0, // 買進交易稅 (int)
sellValue = 770500, // 賣出金額 (int)
sellFee = 320, // 賣出費用 (int)
sellSettlement = 0, // 賣出應收付款 (int)
sellTax = 2309, // 賣出交易稅 (int)
totalBsValue = 1506000, // 合計買賣金額 (int)
totalFee = 633, // 合計手續費 (int)
totalSettlementAmount = -1429513, // 合計交割款金額 (int)
totalTax = 2309, // 合計交易稅 (int)
currency = TWD // 幣別 (string)
},
Settlement{
date = 2024/03/05, // 查詢日 (string)
settlementDate = 2024/03/07, // 交割日期 (string)
buyValue = 2261470, // 買進金額 (int)
buyFee = 1065, // 買進費用 (int)
buySettlement = -3895335, // 買進應收付款 (int)
buyTax = 0, // 買進交易稅 (int)
sellValue = 2488170, // 賣出金額 (int)
sellFee = 1137, // 賣出費用 (int)
sellSettlement = 677626, // 賣出應收付款 (int)
sellTax = 7412, // 賣出交易稅 (int)
totalBsValue = 4749640, // 合計買賣金額 (int)
totalFee = 2202, // 合計買賣手續費 (int)
totalSettlementAmount = -3217709, // 合計交割款金額 (int)
totalTax = 7412, // 合計交易稅 (int)
currency = TWD // 幣別 (string)
},
Settlement{
date = 2024/03/06, // 查詢日 (string)
settlementDate = , // 交割日期 (string)
buyValue = , // 買進金額 (int)
buyFee = , // 買進費用 (int)
buySettlement = , // 買進應收付款 (int)
buyTax = , // 買進交易稅 (int)
sellValue = , // 賣出金額 (int)
sellFee = , // 賣出費用 (int)
sellSettlement = , // 賣出應收付款 (int)
sellTax = , // 賣出交易稅 (int)
totalBsValue = , // 合計買賣金額 (int)
totalFee = , // 合計買賣手續費 (int)
totalSettlementAmount = , // 合計交割款金額 (int)
totalTax = , // 合計交易稅 (int)
currency = // 幣別 (string)
}
]
}
}