This API call is to credit an amount to a player’s wallet when something goes wrong at the server/game-engine side and a previous debit request needs to be refunded. Its response would contain the information of any credited amount.
10.1 Refund Request
Type | Input |
Method | POST |
URL | https://<OPERATOR-API-BASE-URL>/refund |
Headers | "Content-Type": "application/json" |
POST Parameters | JSON Object |
Example | { "account_id": "1234", "game_transaction_id": "abcd-efgh-1234", "transaction_id": "abcd-efgh-ijkl-7890", "value": 0, "game_id": 123456, "game_round_id": "string", "game_type": "string", "note": "cancel transaction", "game_provider": "dragon_gaming", "session_id": "abcd-efgh-1234", "already_closed_round": true, "hash_key": "123abc-cbhf" } |
10.2 Request Parameters
Parameter | Type | Description | Optional |
account_id | String | Player Account ID | |
game_transaction_id | String | Original transaction ID | |
transaction_id | String | Refund transaction ID | |
value | Integer | Refund Amount is to be credited to player's wallet | |
game_id | Integer | Game ID | |
game_round_id | String | Rounds ID of each play/spin | |
game_type | String | Type of game. slots/table_games/scratch_cards/bingo etc… | |
note | String | Extra information about the cancel request | |
game_provider | String | Game provider name e.g., drogangaming,betsoft | YES |
session_id | String | Token received from game launch request | |
already_closed_round | Bool | Already closed round | YES |
hash_key | String | The computed md5().hex digest() value of (session_id+value+game_round_id+ game_transaction_id ) |
10.3 Response Parameters
Parameter | Type | Description |
account_id | String | Player Account ID |
session_id | String | Token received from game launch request |
cash | Decimal | Cash balance |
transaction_id | String | Refund transaction ID |
currency | String | The 3-letter ISO 4217 currency code of the player |
mode | String | Mode of play, for example: ‘real’ - when playing with real cash ‘goldcoins’ - when playing with gold coins ‘sweepcoins’ - when playing with sweep coins |
amount_credited | Decimal | Refund Amount Details (refer to sample response for more details) type - Cash/Bonus value -Credited value balance_id – Balance identifier at Operator end. Can be None if not applicable. |
gold_coins | Decimal | Gold coins balance. (applicable only for mode=GoldCoins) |
sweep_coins | Decimal | Sweep coins balance. (applicable only for mode=SweepCoins) |
10.4 Example Refund Response
{ "account_id": "123", "session_id": "abcd-12d8-gh9i", "cash": 100, "transaction_id": "abcd-efgh-ijkl-7890", "currency": "USD", "mode": "Real", "amount_credited": [{ "type": "Cash", "value": 0.1, "balance_id": "0e4cda43-c9ce-4256-91f4-b7945ad1791b" }] }
10.5 Example Error Response
The error response indicates an already refunded failure (code 5011) with the message
"AlreadyRefunded," providing details about the unsuccessful refund process. Refer to section 12 for more information.
{ "error": true, "code": 6007, "message": "AlredyRefunded", "detail": "Already Refunded" }