Wager

Wager

The Wager method wagers, or bets, for a player and updates the player’s wallet balance on the casino’s platform. Idempotency must be provided.

Responsibilities of the casino platform

The casino platform must:

  • Confirm that the incoming game session ID is valid and is connected with the given account ID. If this validation fails, refuse the wager.
  • Check that the transaction can be approved. Checks should include:
    • Sufficient funds are available
    • The player is within responsible gaming limits
  • Determine whether the transactions have already been processed or not
  • Check if a request with the same transactionid has been performed before:
    • If any of the essential fields transactionid, accountid, or betamount mismatch, the error Transaction parameter mismatch is returned
    • If there are no mismatches, the original response with the status 200 Success - duplicate request is returned. The only values that may change are the balance related parameters, since the player’s balance may have changed
  • In order to handle future Result and Rollback calls, you must store the following parameters: gamesessionid, accountid, roundid, transactionid and betamount

Request Parameters

Parameter Data Type Mandatory Description
accountid String(60) [0-9a-zA-Z] Required Account ID
Example: 5179068
apiversion String Required The API version that will be used
Example: 1.2
betamount Decimal (32,10) Required The wager amount (total of real and bonus money)
Note: Must be 0 for free round transactions when frbid is provided
Examples: 2, 0.4, 0.01 (regular), 0 (free rounds)
device String Required The device currently used by the player
Valid values: desktop, mobile
frbid String(255) Optional* Free Round Bonus ID - Must be the templateId from FRB assign response
*Required for free round transactions
Example: 123abc456 (the templateId from assign response)
gameid String Required Groove game ID
Note: Can contain letters and special characters
Example: 80102, game_123, slot-abc
gamesessionid String(64) Required The game session id from the start game
Example: 11_99d71938-c2d9-4844-b950-d598c2es
request String Required Request method name
Example: wager
roundid String(255) Required Round ID
Example: 802d1812c32686748f2afbcacfcc82114cf
transactionid String(255) Required Transaction ID
Example: 7617edd0924c11e7abb2865556898ad0

Request Examples

Regular Wager (No Free Rounds)

/groove?request=wager&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&gameid=80102&apiversion=1.2&betamount=10.0&roundid=nc8n4nd87&transactionid=trx_id

Free Round Wager

/groove?request=wager&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&gameid=80102&apiversion=1.2&betamount=0&roundid=nc8n4nd87&transactionid=trx_id&frbid=123abc456

**Free Round Transactions:** - `betamount` must be `0` when using free rounds - `frbid` must be the `templateId` from the FRB assign response - The same template can be assigned multiple times to the same player

Response Parameters

Parameter Data Type Mandatory Description
accounttransactionid String(50) Required The casino’s internal transaction ID
Example: 7617edd0924c11e7abb2865556898ad0
apiversion String Required The version of the API being used
Example: 1.2
balance Decimal (32,10) Required The total balance amount after the wager
Examples: 500, 140.25
bonus_balance Decimal (32,10) Optional The player’s bonus balance
Example: 50.0
bonusmoneybet Decimal (32,10) Required The bonus amount used in the bet
If casino doesn’t work with bonuses, value must be 0
code Integer Required Response code
Example: 200
game_mode Integer Optional* Combined real and bonus modes
1 = Real mode
2 = Bonus mode
*Required for CMA-compliant games
order String Optional* The type of order
Valid values: cash_money, bonus_money
*Required for CMA-compliant games
real_balance Decimal (32,10) Required The player’s real balance
Example: 100.0
realmoneybet Decimal (32,10) Required The real money amount used in the bet
status String Required The status of the response
Example: Success
Warning

The sum of `bonusmoneybet` and `realmoneybet` must equal the `betamount` sent by the provider.

Response Example

Success Response

{
    "code": 200,
    "status": "Success",
    "accounttransactionid": "aaaaaaa",
    "balance": 100,
    "bonusmoneybet": 0,
    "realmoneybet": 10,
    "bonus_balance": 50,
    "real_balance": 50,
    "game_mode": 1,
    "order": "cash_money, bonus_money",
    "apiversion": "1.2"
}

Error Codes

Code Status Message
1 Technical error Technical error
110 Operation not allowed Reasons include:
• Wager amount is less than 0
• User with specified accountId not found
• AccountId doesn’t match sessionId
400 Transaction operator mismatch Transaction operator mismatch
409 Round closed or transaction ID exists Round closed or transaction ID exists
1000 Not logged on Not logged on
1006 Out of money Out of money
1019 Gaming limit Loss limit exceeded or Overall bet limit exceeded
1035 Account blocked Account blocked