4.2 Get Balance (查询余额)
Description (说明)
This function allows Operator to get the latest member's balance in Game Provider's wallet.
此功能允许运营商在游戏提供商的钱包中获取最新会员余额。
URL (网址)
https://{host}/api/get_balance
Request Method
POST
Request Parameters (请求参数)
| Field (栏位) | Type (型态) | Required (必要) | Description (说明) |
|---|---|---|---|
| agentId | String | Y | Agent ID <= 50 characters 代理帐号 |
| allUser | Boolean | Y | true : return all user's balance 返回所有用户的余额 false : return user's balance from given parameter 从给定参数返回用户余额 |
| userIds | Array of String | N | Array of User ID array size <= 100 欲查询玩家帐号阵列 v24.9.1 update |
| filterNonZeroBalance | Boolean | N | true : filter data where user's balance is not 0. 篩選用户余额不為 0 的資料 false : do not filter user's balance 不进行筛选 default: false v24.9.1 update |
| page | Number | N | Query page 查询页码 default: 1 v24.9.1 update |
| pageSize | Number | N | Qurey result size (max: 2000) 指定一页带有多少笔资料 (上限: 2000) default: 2000 v24.9.1 update |
{
"agentId": "hrgag",
"allUser": false,
"userIds": [
"hrgpl0001"
],
"filterNonZeroBalance": false,
"page": 1,
"pageSize": 2000
}
Return Result (返回结果)
| Field (栏位) | Type (型态) | Description (说明) |
|---|---|---|
| code | String | Status Code fixed 4 characters 状态码 |
| data | Object | |
| list | Array of Object | each record |
| agentId | String | Agent ID <= 50 characters 代理帐号 |
| userId | String | User ID <= 50 characters 玩家帐号 |
| currency | String | Currency type fixed 3 characters 货币代码 |
| balance | String | Current account balance. decimal places <= 4 当前帐户余额 |
| freeCredit | String | Current free credit. decimal places <= 4 当前泥码余额 if your company has not enabled the free credit function, then please ignore this attribute. 若贵司未开启泥码功能,则请忽略此属性 |
| promotionCredit | String | Current promotion credit. decimal places <= 4 当前活动码余额 if your company has not enabled the free credit function, then please ignore this attribute. 若贵司未开启泥码功能,则请忽略此属性 |
| pagination | Object | Pagination info 分页信息 v24.9.1 update |
| page | Number | Current query page 当前页码 v24.9.1 update |
| pageSize | Number | Qurey result size 指定一页几笔资料 v24.9.1 update |
| totalSize | Number | Total result size 此次查询总共有几笔资料 v24.9.1 update |
{
"code": "0000",
"data": {
"list": [
{
"agentId": "hrgag",
"userId": "hrgpl0001",
"currency": "THB",
"balance": "1000.0",
"freeCredit": "0.0",
"promotionCredit": "0.0"
}
],
"pagination": {
"page": 1,
"pageSize": 5,
"totalSize": 5
}
}
}
Sample Request For Each Language (各语言请求范例)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"agentId\":\"hrgag\",\"allUser\":true,\"userIds\":[\"hrgpl0001\"]}");
Request request = new Request.Builder()
.url("https://{host}/api/get_balance")
.method("POST", body)
.addHeader("Authorization", "Basic TWpNQ0JSM1NFYnBrYXdSNTpNak1DQlIzU0VicGthd1I1")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();