账户

盈亏流水

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"
      }
    ]
  }
}

错误码

参见错误码文档。