Content-Type: application/json

4.1 Player Balance
4.1.1 Endpoint

POST {MERCHANT-URL}/wallet/balance

4.1.2 Request Parameters
{
  "reqTraceId": "xxxx",
  "playerId": "PLAYER_123456",
  "currencyCode": "BR_BRL"
}

4.1.3 Parameter Description
Field	Type	Required	Description
reqTraceId	string	Yes	Request trace ID
playerId	string	Yes	Player ID, e.g., PLAYER_123456
currencyCode	string	Yes	Currency code, e.g., BR_BRL
4.1.4 Response
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "balance": "1000.00"
  }
}

4.1.5 Field Description
Root Fields
Field	Type	Required	Description
success	boolean	Yes	Whether the request succeeded
code	string	Yes	Response code (C10000 = OK)
msg	string	Yes	Response message
data	object	Yes	Response data
data Fields
Field	Type	Required	Description
balance	string	Yes	Player balance
4.1.6 Success Example
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "balance": "1000.00"
  }
}

4.1.7 Error Example
{
  "success": false,
  "code": "C40000",
  "msg": "Invalid parameters",
  "data": null
}

4.1.8 Usage Scenario

Used to query the player's current balance.

4.2 Player Information
4.2.1 Endpoint

POST {MERCHANT-URL}/player/info

4.2.2 Request Parameters
{
  "reqTraceId": "xxxx",
  "playerId": "PLAYER_123456",
  "currencyCode": "BR_BRL"
}

4.2.3 Parameter Description
Field	Type	Required	Description
reqTraceId	string	Yes	Request trace ID
playerId	string	Yes	Player ID
currencyCode	string	Yes	Currency code
4.2.4 Response
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "nickName": "PlayerOne",
    "avatarUrl": "https://example.com/avatar/playerone.png"
  }
}

4.2.5 Field Description
Root Fields
Field	Type	Required	Description
success	boolean	Yes	Whether the request succeeded
code	string	Yes	Response code
msg	string	Yes	Response message
data	object	Yes	Response data
data Fields
Field	Type	Required	Description
nickName	string	Yes	Player nickname
avatarUrl	string	Yes	Player avatar URL
4.2.6 Success Example
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "nickName": "PlayerOne",
    "avatarUrl": "https://example.com/avatar/playerone.png"
  }
}

4.2.7 Error Example
{
  "success": false,
  "code": "C40000",
  "msg": "Invalid parameters",
  "data": null
}

4.2.8 Usage Scenario

Fetch player profile data to display in the game UI.

4.3 Bet (No Integration Required)
4.3.1 Endpoint

POST {MERCHANT-URL}/wallet/bet

4.3.2 Request Parameters
{
  "reqTraceId": "TRACE_XXX",
  "playerId": "PLAYER_123456",
  "currencyCode": "BR_BRL",
  "gameCode": "FORTUNE_DRAGON",
  "roundId": "ROUND_789012",
  "betId": "BET_345678",
  "betAmount": "100.00",
  "timestamp": "2024-12-25T10:30:00Z",
  "transactionId": "TXN_789012"
}

4.3.3 Parameter Description
Field	Type	Required	Description
reqTraceId	string	Yes	Tracking ID
playerId	string	Yes	Player ID
currencyCode	string	Yes	Currency code
gameCode	string	Yes	Game code
roundId	string	Yes	Round ID
betId	string	Yes	Bet order ID
betAmount	string	Yes	Bet amount
timestamp	string	Yes	Transaction time (ISO format)
transactionId	string	Yes	Unique transaction ID for settlement
4.3.4 Response
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "merchantBetId": "MBET_987654",
    "balance": "900.00"
  }
}

4.3.5 Field Description
data Fields
Field	Type	Required	Description
merchantBetId	string	Yes	Merchant bet order ID
balance	string	Yes	Latest merchant balance
4.3.6 Success Example
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "merchantBetId": "MBET_987654",
    "balance": "900.00"
  }
}

4.3.7 Error Example
{
  "success": false,
  "code": "C40000",
  "msg": "Invalid parameters",
  "data": null
}

4.3.8 Usage Scenario

Player places a bet

Deduct balance

Create a betting record

4.4 Win (Payout)
4.4.1 Endpoint

POST {MERCHANT-URL}/wallet/win

4.4.2 Request Parameters
{
  "reqTraceId": "TRACE_XXX",
  "playerId": "PLAYER_123456",
  "currencyCode": "BR_BRL",
  "gameCode": "FORTUNE_DRAGON",
  "roundId": "ROUND_789012",
  "transactionId": "TXN_789012",
  "betId": "BET_345678",
  "betAmount": "100.00",
  "winAmount": "500.00",
  "isFree": false,
  "isEnd": true,
  "betTime": 1703498999000,
  "settledTime": 1703499000000,
  "type": "bet_win"
}

4.4.3 Parameter Description
Field	Type	Required	Description
playerId	string	Yes	Player ID
currencyCode	string	Yes	Currency code
gameCode	string	Yes	Game code
transactionId	string	Yes	Unique payout order ID
roundId	string	Yes	Round ID
betId	string	Yes	Bet ID
betAmount	string	Yes	Bet amount
winAmount	string	Yes	Win amount
isFree	boolean	Yes	Whether the bet was a free spin
isEnd	boolean	Yes	Whether the round has ended
betTime	long	Yes	Bet timestamp (Unix ms)
settledTime	long	Yes	Settlement timestamp (Unix ms)
type	string	Yes	win or bet_win
4.4.4 Notes

This endpoint must be implemented by the operator.

Fast games (e.g., slots) may return combined bet + win in the same callback:

type = win → Only payout (bet already reported)

type = bet_win → Includes both bet deduction and win payout

4.4.5 Response
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "merchantBetId": "MBET_987654",
    "balance": "1400.00"
  }
}

4.4.6 Data Fields
Field	Type	Required	Description
merchantBetId	string	Yes	Merchant bet ID
balance	string	Yes	Updated balance
4.4.7 Success Example
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "merchantBetId": "MBET_987654",
    "balance": "1400.00"
  }
}

4.4.8 Error Example
{
  "success": false,
  "code": "C40000",
  "msg": "Invalid parameters",
  "data": null
}


Insufficient balance example:

{
  "code": "G30003",
  "msg": "Insufficient balance"
}

4.4.9 Usage Scenario

Operator receives game payout information

Handles combined bet & win operations

Updates player balance

Records transaction history

4.5 Cancel Bet / Cancel Win (No Integration Required)
4.5.1 Endpoint

POST {MERCHANT-URL}/wallet/cancel

4.5.2 Request Parameters
{
  "reqTraceId": "TRACE_XXX",
  "playerId": "PLAYER_123456",
  "currencyCode": "BR_BRL",
  "gameCode": "FORTUNE_DRAGON",
  "betId": "BET_345678",
  "merchantBetId": "MBET_987654",
  "betAmount": "100.00",
  "cancelType": "BET",
  "transactionId": "TXN_789012"
}

4.5.3 Parameter Description
Field	Type	Required	Description
playerId	string	Yes	Player ID
currencyCode	string	Yes	Currency code
gameCode	string	Yes	Game code
betId	string	Yes	Bet ID
merchantBetId	string	Yes	Merchant bet ID
betAmount	string	Yes	Bet amount
cancelType	string	Yes	BET (cancel bet) / WIN (cancel payout)
transactionId	string	Yes	Unique transaction ID
4.5.4 Notes

Only some games support cancel operations

4.5.5 Response
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "merchantBetId": "MBET_987654",
    "betId": "BET_345678",
    "balance": "1000.00",
    "currencyCode": "BR_BRL"
  }
}

4.5.6 Data Field Description
Field	Type	Required	Description
merchantBetId	string	Yes	Merchant bet ID
betId	string	Yes	Bet order ID
balance	string	Yes	Updated balance
currencyCode	string	Yes	Currency code
4.5.7 Success Example
{
  "success": true,
  "code": "C10000",
  "msg": "Request succeeded",
  "data": {
    "merchantBetId": "MBET_987654",
    "betId": "BET_345678",
    "balance": "1000.00",
    "currencyCode": "BR_BRL"
  }
}

4.5.8 Error Example
{
  "success": false,
  "code": "C40000",
  "msg": "Invalid parameters",
  "data": null
}

4.5.9 Usage Scenario

Cancel bet / cancel payout

Restore player balance

Maintain consistency of transaction records