查询指定子账号的动态 IP 流量余额(剩余、总量、已用等)。
GET /client/dynamics/account/balance/info
| 参数名 | 类型 | 描述 |
| x-merchant-token | String | 商户令牌 |
| x-merchant-code | String | 商户代码 |
| 参数名 | 必选 | 类型 | 描述 |
| accountId | 否 | String | 子账号 ID(与 获取子账号列表 中的 accountId 一致)。不传或为空时,返回当前商户下所有子账号的流量余额列表。 |
| pageNum | 否 | Integer | 页码(与项目分页约定一致,默认 1)。 |
| pageSize | 否 | Integer | 每页条数(默认与系统分页配置一致)。 |
{
"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('/client/dynamics/account/balance/info?accountId=816219', {
method: 'GET',
headers: {
'x-merchant-token': 'your_token',
'x-merchant-code': 'your_code'
}
})
.then(response => response.json())
.then(data => console.log(data));
// 当前商户全部子账号余额(分页)
fetch('/client/dynamics/account/balance/info?pageNum=1&pageSize=10', {
method: 'GET',
headers: {
'x-merchant-token': 'your_token',
'x-merchant-code': 'your_code'
}
})
.then(response => response.json())
.then(data => console.log(data));
| 参数名 | 类型 | 描述 |
| total | Long | 总记录数 |
| code | Integer | 业务状态码 |
| msg | String | 提示信息 |
| rows | Array | 余额明细列表 |
| rows[].accountId | String | 子账号 ID |
| rows[].balance | Number | 剩余流量(MB) |
| rows[].balanceFormat | String | 剩余流量(展示用格式化字符串) |
| rows[].balanceTotal | Number | 总流量(MB) |
| rows[].balanceTotalFormat | String | 总流量(展示用) |
| rows[].balanceUsed | Number | 已使用流量(MB) |
| rows[].balanceUsedFormat | String | 已使用流量(展示用) |