Skip to main content

Wallet API

Overview

  • Requests and responses contain the header Content-Type: application/json
  • Requests are made via the HTTP POST method
  • All requests passed from/to the Operator’s system have a signature header.
  • Request Direction: Veligames => Operator
Important

We expect idempotent behavior in case of duplicate transactions. If the initial transaction was successfully processed, any subsequent duplicate transactions should be ignored response should be returned with HTTP status code 409 as a DUPLICATE_TRANSACTION.

Important

In some cases, a single roundId is not tied to a specific playerId. For instance, in crash games, rounds are global, meaning all users participating in the same round will share the same roundId.

Important

if sessionId was expired on operator side, /win and /cancel should be still processed. /bet should be processed if isAdjustment=true

Balance

Request

Using this method VeliGames system will receive the current balance of the player and will show it in the game.

POST /balance
PropertyTypeDescriptionRequired
sessionIdstringOne-time identifier generated by OPERATOR for the specific sessionYes
providerIdstringIdentifier of the game providerYes
playerIdstringIdentifier of the playerYes
currencystringPlayer's ISO 4217 currency code. Examples: EUR, USDYes
brandIdstringCasino Brand IdentifierYes
providerIdstringGame provider IdYes
gameIdstringIf session is expired and the gameId is valid, you should return balanceNo

Response

PropertyTypeDescriptionRequired
realobjectReal balance of the playerYes
real.amountdecimalReal balance amount.Yes
real.currencystringReal balance currency.Yes
bonusobjectBonus balance of the playerNo
bonus.amountdecimalBonus balance amount.Yes
bonus.currencystringBonus balance currency.Yes

Error Protocol

ErrorStatus CodeDescription
UNKNOWN_ERROR500General error, internal server error, can be retried
BAD_REQUEST400Missing/invalid parameters
UNAUTHORIZED401Invalid signature
PLAYER_NOT_FOUND404Player does not exist
SESSION_NOT_FOUND404Session does not exist
SESSION_EXPIRED410Session expired

Bet

Request

Using this method VeliGames system will check the player’s balance to ensure enough funds are available to make a bet. The amount of the bet must be subtracted from the player’s balance.

POST /bet
PropertyTypeDescriptionRequired
sessionIdstringSession IdYes
betTypestringType of the bet (BET_SPIN, BET_SPORT, BET_CRASH)Yes
transactionIdstringUnique Id of the transactionYes
gameIdstringIdentifier of the gameYes
playerIdstringIdentifier of the playerYes
roundIdstringIdentifier of the roundYes
providerIdstringIdentifier of the game providerYes
amountobjectAmount object of the betYes
amount.amountdecimalBet amount.Yes
amount.currencystringPlayer's ISO 4217 currency code. Examples: EUR, USDYes
correlationIdstringBet Id IdentifierYes
brandIdstringCasino Brand IdentifierYes
gameTypestringCRASH, OTHERYes
jackpotContributiondecimalAmount of the contribution to the jackpotNo
jackpotIdstringId of the active jackpot to contributeNo
isAdjustmentbooleanSession expiration should be ignored if the bet is adjustmentNo

Response

PropertyTypeDescriptionRequired
walletTransactionIdstringId of the transaction in wallet.Yes
realobjectReal balance of the playerYes
real.amountdecimalReal balance amount.Yes
real.currencystringReal balance currency.Yes
bonusobjectBonus balance of the playerNo
bonus.amountdecimalBonus balance amount.Yes
bonus.currencystringBonus balance currency.Yes
usedBonusAmountdecimalPart of the bet amount which is taken from bonus balanceNo

Error Protocol

ErrorStatus CodeDescription
UNKNOWN_ERROR500General error, internal server error, can be retried
BAD_REQUEST400Missing/invalid parameters
UNAUTHORIZED401Invalid signature
PLAYER_NOT_FOUND404Player does not exist
SESSION_NOT_FOUND404Session does not exist
SESSION_EXPIRED410Session expired
INSUFFICIENT_BALANCE400Balance is insufficient
BET_LIMIT_REACHED400Bet limit reached - for regulated markets
ACCOUNT_LOCKED403Player is locked/frozen
DUPLICATE_TRANSACTION409Duplicate transaction
REALITY_CHECK_WARNING

Win

Request

Using this method VeliGames system will send the Operator the winning result of a bet. The player balance should be updated by the amount and returned in the response. Operator should to not reject win on the round even if the session is expired. It can be a retry or bet can be settled later.

POST /win
PropertyTypeDescriptionRequired
sessionIdstringSession IdYes
winTypestringType of the win (WIN_ORDINARY, WIN_FREE, WIN_JACKPOT). WIN_FREE is only sent if freespin/freebet was assigned by operator.Yes
transactionIdstringUnique Id of the transactionYes
gameIdstringIdentifier of the gameYes
playerIdstringIdentifier of the playerYes
roundIdstringIdentifier of the roundYes
correlationIdstringBet Id IdentifierYes
providerIdstringIdentifier of the game providerYes
amountobjectAmount object of the betYes
amount.amountdecimalWin amount.Yes
amount.currencystringPlayer's ISO 4217 currency code. Examples: EUR, USDYes
brandIdstringCasino Brand IdentifierYes
gameTypestringCRASH, OTHERYes
rewardIdstringReward (Freespin / Freebet identifier)No, Yes if WIN_FREE

Response

PropertyTypeDescriptionRequired
walletTransactionIdstringId of the transaction in wallet.Yes
realobjectReal balance of the playerYes
real.amountdecimalReal balance amount.Yes
real.currencystringReal balance currency.Yes
bonusobjectBonus balance of the playerNo
bonus.amountdecimalBonus balance amount.Yes
bonus.currencystringBonus balance currency.Yes

Error Protocol

ErrorStatus CodeDescription
UNKNOWN_ERROR500General error, internal server error, can be retried
BAD_REQUEST400Missing/invalid parameters
UNAUTHORIZED401Invalid signature
PLAYER_NOT_FOUND404Player does not exist
SESSION_NOT_FOUND404Session does not exist
DUPLICATE_TRANSACTION409Duplicate transaction
SESSION_EXPIRED410Session expired
FREE_BET_NOT_FOUND404RewardId is not registered on the operator side or was cancelled

Cancel

Request

Using this method VeliGames system will send the Operator in order to reverse the transaction and adjust the player's balance, The Operator should return the money back to the player's balance. Operator should to not reject cancel of the transaction even if the session is expired.

POST /cancel
PropertyTypeDescriptionRequired
sessionIdstringSession IdYes
cancelTypestringType of the cancel (CANCEL_ROUND, CANCEL_BET, CANCEL_TRANSACTION)Yes
transactionIdstringUnique Id of the transactionYes
refTransactionIdstringReference to the original transaction ID (Not relevant for CANCEL_ROUNDYes/No
gameIdstringIdentifier of the gameYes
playerIdstringIdentifier of the playerYes
roundIdstringIdentifier of the roundYes
correlationIdstringBet Id IdentifierNo
providerIdstringIdentifier of the game providerYes
adjustmentRefundobjectAdjustment refund amount object (If cancelType = CANCEL_BET)No
adjustmentRefund.amountdecimalRefund amountYes
adjustmentRefund.currencystringPlayer's ISO 4217 currency code. Examples: EUR, USDYes
brandIdstringCasino Brand IdentifierYes
gameTypestringCRASH, OTHERYes

Response

PropertyTypeDescriptionRequired
walletTransactionIdstringId of the transaction in wallet.Yes
realobjectReal balance of the playerYes
real.amountdecimalReal balance amount.Yes
real.currencystringReal balance currency.Yes
bonusobjectBonus balance of the playerNo
bonus.amountdecimalBonus balance amount.Yes
bonus.currencystringBonus balance currency.Yes

Error Protocol

ErrorStatus CodeDescription
UNKNOWN_ERROR500General error, internal server error, can be retried
BAD_REQUEST400Missing/invalid parameters
UNAUTHORIZED401Invalid signature
PLAYER_NOT_FOUND404Player does not exist
SESSION_NOT_FOUND404Session does not exist
TRANSACTION_NOT_FOUND404Transaction not found
DUPLICATE_TRANSACTION409Duplicate transaction
SESSION_EXPIRED410Session expired