/
7) seamless player balance callback *

7) seamless player balance callback *

Returns players current balance.

Important info

We recommended you to do not do any checks on balance requests or keep them to very minimal (salt check is required). Since balance requests can come without session or game_id in some cases (provider asks for balance before creating session). We suggest to save the player remote id from createPlayer response on your side and then return balance always for that id.

Request common parameters
Query string nametype (max)descriptionmandatory
callerIdStringCaller authentication usernameY
callerPasswordStringCaller authentication passwordY
callerPrefixString2 or more letter prefix that is used internally to prefix player username for your accountN
usernameStringPlayer username (non-prefixed) created by your createPlayer callY
Player balance
Query string nametype (max)descriptionmandatory
actionstringExternal service action [balance, debit, credit]Y
remote_idinteger(10)Unique player idY
game_idstring (32 - 40)Unique game id, see action getGameListN
session_idstring (32 - 40)Unique game session id generated by gamehubY
keystring (40)Request validation cache key -> sha1([SALT KEY]+[QUERY STRING])Y
gamesession_idstring (255)Enable tracking the player game sessionsN
game_id_hashstring (100)Related to introduction of id_hash from getGameList method, can be used the same way as currently is game_id usedN
currencystring(3)Players currency code. Uppercase letters
Y

Request:

 <REMOTE URL>/?action=balance&callerId=test&callerPassword=12dar67890123&remote_id=1&session_id=12345678901234567890 1324567980abcd&key=38432ff064690c9b03da519d0c685b104545 1c9e&new_parameter=12345&gamesession_id=98erf743arka&game_id_hash=gs_gs-texas-rangers-reward

Response:

{"status":"200","balance":"300.00"}
Status codes

External service can respond with 2 type of status codes. 200 for success, 500 service error. Do not respond with anything else but 200 on balances if possible. They are requests of informational nature and rejecting them is a bad practice and leads to bad player experience. Only status of 200 will be accepted as OK by the Xapi Platform server.

JSON keytype (max)descriptionmandatory
statusinteger(3) Status codeY
balancedouble(10,2)Players balance (after transaction)Y
msgstring(255)Error message N

Example: {"status":"200","balance":"300.00"}, {"status":"500","msg":"internal error"}

Related content