4.3 Withdraw (取款)
Description (说明)
This function is to transfer player balance from Game Provider's wallet to Operator's wallet.
此功能允许将玩家余额从游戏提供商的钱包转移到运营商的钱包。
URL (网址)
https://{host}/api/withdraw
Request Method
POST
Request Parameters (请求参数)
| Field (栏位) | Type (型态) | Required (必要) | Description (说明) |
|---|---|---|---|
| agentId | String | Y | Agent ID <= 50 characters 代理帐号 |
| userId | String | Y | User ID <= 50 characters 玩家帐号 |
| allWithdraw | Boolean | Y | true : withdraw account all balance 提取账户全部余额 false : withdraw account balance with parameter (decided by parameter "balance") 依照参数amount进行取款 |
| amount | String | N | Amount to be withdraw. (positive number) decimal places <= 4 取款金额 (数值必须为正数) |
| freeCredit | String | N | Free credit to be withdraw. (positive number) decimal places <= 4 取款泥码额度 (数值必须为正数) if your company has not enabled the free credit function, then please ignore this attribute. 若贵司未开启泥码功能,则请忽略此属性 |
| transactionCode | String | Y | Transaction Code <= 30 characters 交易码 unique id using for avoid duplicate operation. 用于避免相同重复操作的唯一ID |
{
"agentId": "hrgag",
"userId": "hrgpl0001",
"allWithdraw": false,
"transactionCode": "1660914288283",
"amount": "100",
"freeCredit": "50"
}
Return Result (返回结果)
| Field (栏位) | Type (型态) | Description (说明) |
|---|---|---|
| code | String | Status Code fixed 4 characters 状态码 |
| data | Object | |
| agentId | String | Agent ID <= 50 characters 代理帐号 |
| userId | String | User ID <= 50 characters 玩家帐号 |
| currency | String | Currency type fixed 3 characters 货币代码 |
| withdrawAmount | String | Withdraw balance decimal places <= 4 取款总额 |
| currentBalance | String | Current account balance decimal places <= 4 取款后当前帐户余额 |
| currentFreeCredit | String | Current free credit decimal places <= 4 取款后当前泥码余额 if your company has not enabled the free credit function, then please ignore this attribute. 若贵司未开启泥码功能,则请忽略此属性 |
{
"code": "0000",
"data": {
"agentId": "hrgag",
"userId": "hrgpl0001",
"currency": "THB",
"withdrawAmount": "-150",
"currentBalance": "0.0",
"currentFreeCredit": "0.0"
}
}
Sample Request For Each Language (各语言请求范例)
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\"agentId\":\"hrgag\",\"userId\":\"hrgpl0001\",\"allWithdraw\":false,\"transactionCode\":\"1660914288283\",\"amount\":\"100\",\"freeCredit\":\"50\"}");
Request request = new Request.Builder()
.url("https://{host}/api/withdraw")
.method("POST", body)
.addHeader("Authorization", "Basic TWpNQ0JSM1NFYnBrYXdSNTpNak1DQlIzU0VicGthd1I1")
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute();