帳戶

盈虧流水

GEThttps://openapi.longbridge.com/v1/portfolio/profit-analysis/flows

鑑權

簽名方式:每個請求用 App Key / Secret 簽名。請求頭如下:

名稱類型必填說明
Authorizationstring · header必填OpenAPI 後台 上的賬戶 Access Token,作為原始 token 傳入(不帶 Bearer 前綴),並參與簽名計算。
X-Api-Keystring · header必填你的 App Key。
X-Timestampstring · header必填請求時間戳,單位秒(Unix 時間)。
X-Api-Signaturestring · header必填HMAC-SHA256 簽名。格式:HMAC-SHA256 SignedHeaders=authorization;x-api-key;x-timestamp, Signature=。

查詢賬戶資金流水歷史,包含入金、出金、股息和結算等。

>_ CLI
longbridge cash-flow
longbridge cash-flow --format json

請求

查詢參數

名稱類型必填說明
symbolstring必填證券代碼
pageinteger可選頁碼(預設 1)
sizeinteger可選每頁數量(預設 20)
derivativeboolean可選是否包含衍生品倉位

響應

響應欄位

名稱類型必填說明
flows_listobject[]必填資金流水列表(分頁),
└ executed_datestring必填執行日期(如 `2024-01-15`)
└ executed_timestampstring可選執行時間戳
└ codestring可選證券代碼
└ directionstring可選方向:`In`(買入)或 `Out`(賣出)
└ executed_quantitystring可選成交數量
└ executed_pricestring可選成交價格
└ executed_coststring可選成交成本
└ describestring可選描述說明
has_moreboolean可選是否有更多頁

響應 JSON 示例

{
  "code": 0,
  "message": "success",
  "data": {
    "has_more": false,
    "flows_list": [
      {
        "code": "AAPL",
        "symbol": "AAPL.US",
        "direction": "In",
        "executed_date": "2025-11-22",
        "executed_timestamp": "1763769600",
        "executed_quantity": "10",
        "executed_price": "180.50",
        "executed_cost": "1805.00",
        "describe": "Buy AAPL.US"
      }
    ]
  }
}

錯誤碼

參見錯誤碼文檔。