8. DEBIT/BET API

This API call is to debit an amount from a player’s balance. This is triggered whenever a player
plays a game. The response would contain information and details of any debited amounts.

8.1 Debit Request

TypeInput
MethodPOST
URLhttps://<OPERATOR-API-BASE-URL>/debit
Headers "Content-Type": "application/json"
POST ParametersJSON Object
Example{
"account_id": "123",
"session_id": "0b3fcbee-9c1e-4c8b-b97a-8746a8a96a ",
"game_id": "123456",
"game_transaction_id": "game_transaction_id",
"value": "value",
"game_round_id": "game_round_id",
"game_type": "casino",
"note": "debiting amount",
"game_provider": "dragon_gaming",
"amount_type": "real",
"context": "{"key":"value"}",
"hash_key": "Hash"
}

8.2 Request Parameters

ParameterTypeDescriptionOptional
account_idStringPlayer Account ID
session_idStringToken received from game launch request
game_idIntegerGame ID
game_transaction_idStringUnique ID of the transaction
valueDecimalBet Amount to be debited from the player's wallet.
game_round_idStringRounds ID of each play/spin
game_typeStringType of the game. casino/slots
table_games/scratch_card/bingo etc…
noteStringAny extra information about the debit
request
game_providerStringGame provider name e.g., drogangaming,
betsoft
YES
amount_typeStringIndicate the type of amount type.
It can be real/bonus/realandbonus/freespins
YES
contextJSON ObjectJSON object containing metadata in case of
cash and bonus combination bets.
e.g.,{"bet_percentage": 100}
YES
hash_keyStringThe computed md5().hex digest() value of
(session_id+value+game_round_id+\
game_transaction_id)

8.3 Response Parameters

ParameterTypeDescription
account_idStringPlayer Account ID
transaction_idStringDebit transaction ID
currencyStringThe 3-letter ISO 4217 currency code of the player
session_idStringToken received from game launch request
cashDecimalCash Balance
modeStringMode of play, for example:
‘Real’ - when playing with real cash
‘GoldCoins’- when playing with gold coins
‘SweepCoins’- when playing with sweep coins
amount_debitedList of
JSON
Object
Bet Amount Details (refer sample response for more details)
type - Cash/Bonus
value - Debited 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)

8.4 Example Debit Response

{
	"account_id": "123",
	"session_id": "123456",
	"transaction_id": "abcd-1234-efgh",
	"cash": 100,
	"currency": "USD",
	"mode": "Real",
	"amount_debited": [{
		"type": "Cash", 
		"value": 0.1,
		"balance_id": "0e4cda43-c9ce-4256-91f4-b7945ad1791b"
	}]
}

8.5 Example Error Response

The error response indicates an insufficient balance (code 6001) with the message
"InsufficientBalance" provides details about the unsuccessful bet request. Refer to section 12 for more
information.

{
	"error": true,
	"code": 6001,
	"message": "InsufficientBalance",
	"detail": "Insufficient Balance"
}