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
(说明)
agentIdStringYAgent ID <= 50 characters
代理帐号
userIdStringYUser ID <= 50 characters
玩家帐号
allWithdrawBooleanYtrue : withdraw account all balance
提取账户全部余额

false : withdraw account balance with parameter (decided by parameter "balance")
依照参数amount进行取款
amountStringNAmount to be withdraw. (positive number) decimal places <= 4
取款金额 (数值必须为正数)
freeCreditStringNFree credit to be withdraw. (positive number) decimal places <= 4
取款泥码额度 (数值必须为正数)

if your company has not enabled the free credit function, then please ignore this attribute.
若贵司未开启泥码功能,则请忽略此属性
transactionCodeStringYTransaction 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
(说明)
codeStringStatus Code fixed 4 characters
状态码

Please refer to 5.4 Status Code for details.
详情请参考 5.4 状态代码
dataObject
agentIdStringAgent ID <= 50 characters
代理帐号
userIdStringUser ID <= 50 characters
玩家帐号
currencyStringCurrency type fixed 3 characters
货币代码

Please refer to 5.2 Currencies for details.
详情请参考 5.2 货币类型
withdrawAmountStringWithdraw balance decimal places <= 4
取款总额
currentBalanceStringCurrent account balance decimal places <= 4
取款后当前帐户余额
currentFreeCreditStringCurrent 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();