10. REFUND/CANCEL API

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

TypeInput
MethodPOST
URLhttps://<OPERATOR-API-BASE-URL>/refund
Headers "Content-Type": "application/json"
POST ParametersJSON 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

ParameterTypeDescriptionOptional
account_idStringPlayer Account ID
game_transaction_idStringOriginal transaction ID
transaction_idStringRefund transaction ID
valueIntegerRefund Amount is to be credited to player's wallet
game_idIntegerGame ID
game_round_idStringRounds ID of each play/spin
game_typeStringType of game. slots/table_games/scratch_cards/bingo etc…
noteStringExtra information about the cancel
request
game_providerStringGame provider name e.g., drogangaming,betsoftYES
session_idStringToken received from game launch request
already_closed_roundBoolAlready closed roundYES
hash_keyStringThe computed md5().hex digest() value of
(session_id+value+game_round_id+
game_transaction_id )

10.3 Response Parameters

ParameterTypeDescription
account_idStringPlayer Account ID
session_idStringToken received from game launch request
cashDecimalCash balance
transaction_idStringRefund transaction ID
currencyStringThe 3-letter ISO 4217 currency code of the player
modeStringMode of play, for example:
‘real’ - when playing with real cash
‘goldcoins’ - when playing with gold coins
‘sweepcoins’ - when playing with sweep coins
amount_creditedDecimalRefund 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_coinsDecimalGold coins balance.
(applicable only for mode=GoldCoins)
sweep_coinsDecimalSweep 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"
}