9) seamless credit players balance callback *
Returns player balance after credit transaction. Credit is called after every debit, even if credit amount is 0. This signifies that a game round is complete.
Credit requests are called after the debit request, as a response/win. Includes amount to a credit to player.
Query string name | type (max) | description | mandatory |
---|---|---|---|
callerId | String | Caller authentication username | Y |
callerPassword | String | Caller authentication password | Y |
callerPrefix | String | 2 or more letter prefix that is used internally to prefix player username for your account | N |
username | String | Player username (non-prefixed) created by your createPlayer call | Y |
Query string name | type (max) | description | mandatory | ||
---|---|---|---|---|---|
action | String | Type of action [credit] | Y | ||
remote_id | integer(10) | Unique player id | Y | ||
amount | double(10,2) | Amount to credit to players account | Y | ||
provider | string (2) | Game provider | Y | ||
game_id | string (32 - 40) | Unique game id, see action available_games | Y | ||
transaction_id | string(32- 70) | Unique transaction id for current transaction | Y | ||
gameplay_final | Integer(1) | It tells you if the round is finished(1 - finished, 0 - unfished) | Y | ||
round_id | string (32 - 70) | Game round id for current running game round | Y | ||
session_id | string (32 - 40) | Unique game session id generated by gamehub | Y | ||
key | string(40) | Request validation cache key | Y | ||
gamesession_id | string (255) | Enable tracking the player game sessions, if player has multiple sessions open we use session from the last launched game | Y | ||
game_id_hash | string (100) | Related to introduction of id_hash from getGameList method, can be used the same way as currently is game_id used | N | ||
is_freeround_win | Integer (1/0) | This win came from freerounds if 1, else 0 | N | ||
freeround_id | string(100) | ID of the freerounds. It should be the same as "freeround_id " paramater in AddFreerounds response | N | ||
freeround_spins_remaining | integer(3) | Number of freeround spins remaining. Currently not available for all providers | N | ||
freeround_completed | Integer (1/0) | Freerounds completed if 1, else 0 | N | ||
is_promo_win | integer (1/0) | Transaction is a promo win if 1, else 0 | N | ||
is_jackpot_win | Integer (1/0) | This is a jackpot win if 1, else 0 | N | ||
jackpot_win_ids | array of alphanumeric ids | Ids' of the jackpots this win belongs to. - deprecated | N | ||
jackpot_win_in_amount | double(10,2) | Jackpot amount won - already included in the amount property. | N | ||
is_featurebuy_win | Integer (1/0) | This is a featurebuy win if 1, else 0 | N | ||
currency | string(3) | Players currency code. Uppercase letters | Y | ||
jackpot_contribution_in_amount | double(10,6) | Amount of bet that is contributed to the jackpot contribution. Already included in bet. | N |
Request: <REMOTE URL>/?action=credit&callerId=test&callerPassword=12dar67890123&remote_id=1&amount=0.3&game_id=3&transaction _id=27&round_id=123&session_id=12345678901 2345678901324567980abcd &key=49f749364b129d9f91d2bef7dd044a93af0fb676&new_parameter=
12345
&gamesession_id=98erf743arka&game_id_hash=gs_gs-texas-rangers-reward
Response: {"status":"200","balance":"300.00"}
If we get the request with the transaction_id that was already processed on our side, on a retry, the response of the transaction should be the same as on first request.
For example if transaction_id = 61385912731123 response was {"status":"200","balance":"105793.30"}, on a retry with same transaction_id it should be exactly the same response.
External service can respond with 3 type of status codes. 200 for success, 500 service error and 403 for credit transaction refusal (Credits should not be Refused!). Only status of 200 will be accepted as OK by the Xapi Platform server.
JSON key | type (max) | description | mandatory |
---|---|---|---|
status | integer(3) | Status code | Y |
Balance | double(10,2) | Players balance (after transaction) | Y |
msg | string(255) | Error message | N |
transaction_id | string(8 - 64) | transaction id | N |
Example: {"status":"200","balance":"300.00"}, {"status":"403","balance":"0.30","msg":"Insufficient funds"}, {"status":"500","msg":"internal error"}
With round_id win can be connected to the corresponding bet. Please be aware there can be some cases of wins without bet before them. For example, in some cases some kind of ingame award, or bonus game or ingame freespins. It depends from provider to provider. Please do not decline those wins.
Jackpot wins
- all credit requests coming from jackpot win will have is_jackpot_win = 1 and jackpot_win_in_amount > 0
Flowchart: