get
https://sandboxapi.legendtrading.com/v2/app/settlement/details
查询单笔结算记录及其资金来源
接口描述
根据 settlement_id 查询单笔结算记录(汇款、入金、出金等),并返回该笔资金的来源。
请求参数(Query Parameters)
| 参数名 | 类型 | 必填 | 描述 |
|---|---|---|---|
settlement_id | string | 是 | 结算记录的唯一标识ID(UUID) |
uid | string | 是 | 您平台上用户的唯一标识 |
返回字段说明
| 字段名 | 类型 | 描述 |
|---|---|---|
settlement_id | string | 结算记录的唯一标识ID(UUID) |
uid | string | 您平台上用户的唯一标识 |
reference | string | 该笔结算对应的您的业务单号,创建时传入 |
category | string | 结算类别,如 CREDIT_CARD_RECEIVED、WIRE_RECEIVED、CRYPTO_SENT |
settlement_status | string | 结算状态:created、pending、in progress、settled、canceled、rejected、on hold |
settled | string | "YES" 表示已结算 |
settled_time | string | 实际结算完成时间(ISO 8601 格式,UTC 时区,含微秒) |
asset_received | string | 收到的资产币种(如 EUR) |
amount_received | string | 收到的资产数量,保留两位小数的字符串 |
asset_pay_to | string | 支付的资产币种(如 USDC) |
amount_pay_to | string | 支付的资产数量,保留两位小数的字符串 |
fee_asset | string | 手续费扣取的币种 |
fee_amount | string | 手续费金额 |
network | string | 区块链网络,链上结算时返回;否则为 null |
txid | string | 区块链交易哈希;法币或内部转账为 null |
trade_id | string | 该笔结算所属的交易标识 |
created_at | string | 记录创建时间(ISO 8601 格式,UTC 时区) |
updated_at | string | 记录最后更新时间(ISO 8601 格式,UTC 时区) |
funding_source | string | 资金来源:card 或 balance |
funding_source_details | object | 卡片识别信息;funding_source 非 card 时为 null |
funding_source
funding_source该字段用于区分刷卡支付与其他所有方式,不再细分为更小的类别:
| 取值 | 含义 |
|---|---|
card | 资金从银行卡入账,包含 Apple Pay 和 Google Pay |
balance | 资金来自用户自己的钱,即平台余额,或已入账的银行转账(电汇、ACH) |
funding_source_details
funding_source_details当 funding_source 为 card 时返回。仅包含卡片展示规则允许的范围——卡号前 6 位、后 4 位和卡组织。不返回完整卡号、有效期和持卡人姓名。
| 字段名 | 类型 | 描述 |
|---|---|---|
payment_method_id | string | 该笔结算使用的支付方式标识 |
first6 | string | 卡号前 6 位(BIN);Apple Pay / Google Pay 为 null |
last4 | string | 卡号后 4 位;Apple Pay / Google Pay 为 null |
brand | string | 卡组织:visa、mastercard,其他为 other |
wallet | string | 使用数字钱包时为 apple_pay 或 google_pay;实体卡为 null |
deleted | boolean | 用户已删除该卡片时为 true。卡片信息仍会照常返回 |
Apple Pay / Google Pay:数字钱包本质是卡片的令牌化形式,因此返回
funding_source: "card"且wallet有值。由于不存储卡号信息,first6、last4均返回null。
已删除的卡片:用户删除卡片后,仍会返回其信息,并将deleted置为true,便于您对账删卡之前产生的结算。
成功返回示例
{
"request_id": "39d91bb6b20584dce2c7877bd71fcf71",
"status": "success",
"code": "100000",
"message": "success",
"data": [
{
"settlement_id": "4f798048-5d5c-43ff-83db-a9dcaf0c6b10",
"uid": "1115496066",
"reference": "partner123456",
"category": "CREDIT_CARD_RECEIVED",
"settlement_status": "settled",
"settled": "YES",
"settled_time": "2026-10-12T23:35:35.123456Z",
"asset_received": "EUR",
"amount_received": "500.00",
"asset_pay_to": "USDC",
"amount_pay_to": "543.74",
"fee_asset": "EUR",
"fee_amount": "15.00",
"network": null,
"txid": null,
"trade_id": "xxxxxxxx",
"created_at": "2026-10-12T23:30:11.000000Z",
"updated_at": "2026-10-12T23:35:35.000000Z",
"funding_source": "card",
"funding_source_details": {
"payment_method_id": "xxxxxxxx",
"first6": "411111",
"last4": "1234",
"brand": "visa",
"wallet": null,
"deleted": false
}
}
],
"metadata": {}
}错误处理
| 状态码 | 含义 |
|---|---|
| 404 | 该结算不存在,或不属于您的平台。两种情况返回完全一致,因此无法通过本接口探测哪些 settlement_id 存在 |
| 422 | 缺少必填参数或参数格式错误 |
注意:这是 v2 接口。旧接口 /app/settlementhistory 仅列出结算记录,不包含
funding_source;如需了解某笔结算的资金来源,请使用本接口。