查询流量余额

查询指定用户的流量余额信息。

接口信息

GET /client/dynamics/account/balance/info

请求头

参数名类型描述
x-merchant-tokenString商户令牌
x-merchant-codeString商户代码
Content-TypeStringapplication/json

请求参数

参数名必选类型描述
accountIdLong账号ID
pageSizeInteger每页显示记录数
pageNumInteger当前页码

响应示例

{
    "total": 1,
    "rows": [
        {
          "accountId": "816219",
          "balance": 326999.978943,
          "balanceFormat": "326999.98 MB",
          "balanceTotal": 327000.000000,
          "balanceTotalFormat": "327000.00 MB",
          "balanceUsed": 0.021057,
          "balanceUsedFormat": "0.02 MB"
        }
    ],
    "code": 200,
    "msg": "查询成功"
}

代码示例

// 使用 fetch 查询余额
fetch('/client/dynamics/account/balance/info?accountId=123&pageSize=10&pageNum=1', {
    method: 'GET',
    headers: {
        'x-merchant-token': 'your_token',
        'x-merchant-code': 'your_code',
        'Content-Type': 'application/json'
    }
})
.then(response => response.json())
.then(data => console.log(data));

响应参数说明

参数名类型描述
accountIdLong用户账号ID
balanceBigDecimal剩余流量(MB)
balanceFormatString剩余流量(格式化)
balanceTotalBigDecimal总流量(MB)
balanceTotalFormatString总流量(格式化)
balanceUsedBigDecimal已使用流量(MB)
balanceUsedFormatString已使用流量(格式化)