帳戶
鑑權
簽名方式:每個請求用 App Key / Secret 簽名。請求頭如下:
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
Authorization | string · header | 必填 | OpenAPI 後台 上的賬戶 Access Token,作為原始 token 傳入(不帶 Bearer 前綴),並參與簽名計算。 |
X-Api-Key | string · header | 必填 | 你的 App Key。 |
X-Timestamp | string · header | 必填 | 請求時間戳,單位秒(Unix 時間)。 |
X-Api-Signature | string · header | 必填 | HMAC-SHA256 簽名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。 |
僅支援 Longbridge 香港 / 新加坡賬戶
此方法僅支援 Longbridge 香港 / 新加坡賬戶,可操作任意標的,包括美股。
獲取定投統計匯總信息,包括總投入金額和盈虧情況。
請求
查詢參數
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
symbol | string | 可選 | 按標的代碼篩選統計。 |
響應
響應欄位
| 名稱 | 類型 | 必填 | 說明 |
|---|---|---|---|
active_count | string | 可選 | 活躍計劃數量 |
finished_count | string | 可選 | 已完成計劃數量 |
suspended_count | string | 可選 | 已暫停計劃數量 |
rest_days | string | 可選 | 距下次扣款天數 |
total_amount | string | 可選 | 總投入金額 |
total_profit | string | 可選 | 總盈虧 |
nearest_plans | object[] | 可選 | 最近即將執行的定投計劃(結構與 DcaPlan 一致) |
響應 JSON 示例
{
"code": 0,
"message": "success",
"data": {
"active_count": "2",
"finished_count": "1",
"suspended_count": "0",
"rest_days": "3",
"total_amount": "5400",
"total_profit": "120.50",
"nearest_plans": [
{
"plan_id": "1239402174908207104",
"symbol": "AAPL.US",
"stock_name": "Apple Inc.",
"market": "US",
"status": "Active",
"per_invest_amount": "100",
"invest_frequency": "Monthly",
"invest_day_of_month": "15",
"next_trd_date": "1778853600",
"cum_amount": "0",
"cum_profit": "0"
}
]
}
}錯誤碼
參見錯誤碼文檔。