Transaction API

Overview

The Transaction API enables your games to communicate with Groove for all wallet and gaming operations. Your game sends transaction requests to Groove, which then handles the actual wallet operations with the casino operators.

This standardized API allows your games to work with any casino operator connected to Groove without needing individual integrations.

Transaction Flow

When a player starts your game:

  1. Your game calls Groove’s GetAccount endpoint to validate the session
  2. Your game calls Groove’s GetBalance to retrieve the player’s current balance
  3. During gameplay, your game sends Wager requests to Groove when players bet
  4. Your game sends Result requests to report wins or losses
  5. If needed, your game can send Rollback requests to correct transactions

API Configuration

  • Groove Transaction Endpoint: {GrooveEndpoint}/groove (Groove will provide this)
  • Request Method: GET
  • Response Format: JSON
  • Authentication: HMAC-SHA256 signature in Authorization header ( see Signature Validation)

Transaction Sequence Diagram

sequenceDiagram participant YourGame as Your Game participant Groove participant Casino participant Wallet as Casino Wallet Note over YourGame,Wallet: Session Validation YourGame->>Groove: GetAccount Request Groove->>Casino: Validate Session Casino-->>Groove: Player Details Groove-->>YourGame: Account Validated Note over YourGame,Wallet: Balance Check YourGame->>Groove: GetBalance Request Groove->>Wallet: Get Balance Wallet-->>Groove: Current Balance Groove-->>YourGame: Balance Response Note over YourGame,Wallet: Bet Processing YourGame->>Groove: Wager Request Groove->>Wallet: Deduct Bet Wallet-->>Groove: Updated Balance Groove-->>YourGame: Wager Confirmed Note over YourGame,Wallet: Win Processing YourGame->>Groove: Result Request Groove->>Wallet: Credit Win Wallet-->>Groove: Updated Balance Groove-->>YourGame: Result Confirmed

Transaction Types

Authentication & Session Management (Your Game → Groove)

  • GetAccount - Validate player session and get player details
  • GetBalance - Retrieve current player balance

Core Gaming Transactions (Your Game → Groove)

  • Wager - Process a bet when player places a wager
  • Result - Report the outcome of a game round
  • Wager and Result - Process bet and result in a single transaction

Correction & Special Transactions (Your Game → Groove)

  • Rollback - Cancel or reverse a previous transaction
  • Jackpot - Report a jackpot win to Groove

Security (Groove → Your Game)

Implementation Requirements for Your Game

Making Requests to Groove

  • All requests from your game to Groove use GET method with URL parameters
  • Session ID from game launch must be included in all transactions
  • Transaction IDs must be unique for each transaction
  • Handle timeouts appropriately (recommended 30 second timeout)

Handling Groove Responses

  • Check response codes - 200 means success, others indicate errors
  • Store transaction IDs for potential rollback scenarios
  • Retry logic should respect idempotency (use same transaction ID)
  • Balance updates should be reflected in your game UI immediately

Balance Management

For CMA-compliant games, additional fields are required:

  • game_mode: Combined real and bonus modes (1 = Real, 2 = Bonus)
  • order: Type of order (cash_money, bonus_money)
  • Separate tracking of real_balance and bonus_balance

Error Handling

Standard Response Structure

{
    "code": 200,
    "status": "Success",
    "apiversion": "1.2",
    // Additional fields based on transaction type
}

Error Response Structure

{
    "code": 1,
    "status": "Technical error",
    "message": "Technical error",
    "apiversion": "1.2"
}

Common Error Codes

Code Status Description
200 Success Transaction processed successfully
1 Technical error Generic technical error
102 Wager not found Wager transaction not found
110 Operation not allowed Operation cannot be performed
400 Transaction parameter mismatch Essential fields mismatch
409 Round closed or transaction ID exists Round already closed
1000 Not logged on Session invalid (not for result/rollback)
1006 Out of money Insufficient funds
1019 Gaming limit Loss or bet limit exceeded
1035 Account blocked Player account is blocked

Best Practices for Game Providers

  1. Session Management: Store the Groove session ID from game launch and use it for all transactions
  2. Unique Transaction IDs: Generate unique IDs for each wager and result to enable proper tracking
  3. Error Handling: Implement comprehensive error handling for all Groove responses
  4. Balance Synchronization: Always update your game UI based on balance returned by Groove
  5. Logging: Maintain detailed logs of all transactions for debugging and reconciliation
  6. Timeout Handling: Implement appropriate timeouts and retry logic
  7. Currency Precision: Always use decimal format with maximum of two decimal places

Security Considerations

  • Implement HMAC-SHA256 signature validation for all incoming requests ( see Signature Validation)
  • Use HTTPS for all communications
  • Validate session tokens properly
  • Implement rate limiting to prevent abuse
  • Log all transactions for audit purposes
  • Store Access Keys securely (never in code)

Integration Steps for Your Game

  1. Implement session validation - Call GetAccount when game loads
  2. Add balance retrieval - Call GetBalance to show player’s funds
  3. Process bets - Send Wager requests when players place bets
  4. Report results - Send Result requests after each game round
  5. Handle corrections - Implement Rollback for error scenarios
  6. Support jackpots - Send Jackpot requests for special wins

Continue to GetAccount API

Subsections of Transaction API

GetAccount

GetAccount

Returns player details, such as unique ID, currency, and language.

Responsibilities of the casino platform

The casino platform must confirm the validity of incoming game sessions and account IDs and return the user data relevant for the session. If a retry or rollback request is sent regarding a request that the casino already responded to, the account ID that is returned must be unique per player, and identical.

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
device String Required The device currently used by the player
Valid values: desktop or mobile
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: getaccount

Request Example

/groove?request=getaccount&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&apiversion=1.2

Response Parameters

Parameter Data Type Mandatory Description
accountid String Required Account ID generated by the casino
Example: 5179068
apiversion String Required The version of the API being used
Example: 1.2
bonus_balance Decimal (32,10) Optional The player’s bonus balance
Example: 50.0
city String(32) Required The city where the player logged in
Examples: London, Tel Aviv
code Integer Required Response code (See Appendix)
Example: 200
country String Required Country code (ISO 3166-1 alpha-2)
Examples: IL, UK, US
currency String Required Currency code (ISO)
Example: EUR
game_mode Integer Optional* Combined real and bonus modes
1 = Real mode
2 = Bonus mode
*Required for CMA-compliant games
gamesessionid String(64) Required The ID for the game session
Example: 11_99d71938-c2d9-4844-b950-d598c2es
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
status String Required The status of the response
Example: Success
Info

For Fugaso GP, the following cryptocurrencies are available: BTC, LTC, DOG, ETH, BCH

Response Example

Success Response

{
  "code": 200,
  "status": "Success",
  "accountid": 8877,
  "city": "aaa",
  "country": "IL",
  "currency": "EUR",
  "gamesessionid": "aaaaa",
  "real_balance": 100,
  "bonus_balance": 50,
  "game_mode": 1,
  "order": "cash_money, bonus_money",
  "apiversion": "1.2"
}

Error Codes

Code Status Message
1 Technical error Technical error
1000 Not logged on Not logged on
1003 Authentication failed Authentication failed

GetBalance

GetBalance

Returns the current balance in the specific player account.

Responsibilities of the casino platform

The casino platform must confirm the validity of the incoming game session ID and that it is connected to the given account ID. The casino platform must also return the player’s current balance, both the bonus balance and the real balance.

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
device String Required The device currently used by the player
Valid values: desktop or mobile
gamesessionid String(64) Required The game session id from the start game
Example: 11_99d71938-c2d9-4844-b950-d598c2es
nogsgameid String Required Groove game ID
Note: Can contain letters and special characters
Example: 80102, game_123, slot-abc
request String Required Request method name
Example: getbalance

Request Example

/groove?request=getbalance&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&nogsgameid=80102&apiversion=1.2

Response Parameters

Parameter Data Type Mandatory Description
apiversion String Required The version of the API being used
Example: 1.2
balance Decimal (32,10) Required The total balance amount (real + bonus)
Examples: 500, 140.25
bonus_balance Decimal (32,10) Optional The player’s bonus balance
Example: 50.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
status String Required The status of the response
Example: Success

Response Examples

Success Response

{
    "code": 200,
    "status": "Success",
    "balance": 100,
    "bonus_balance": 50,
    "real_balance": 50,
    "game_mode": 1,
    "order": "cash_money, bonus_money",
    "apiversion": "1.2"
}

Error Response

{
    "code": 1,
    "status": "Technical error",
    "message": "Technical error",
    "apiversion": "1.2"
}

Error Codes

Code Status Message
1 Technical error Technical error

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

Result

Result

The game server uses this method to inform that the wager round is complete. The result 0 indicates that the player lost. Idempotency must be provided.

Info

**Note:** - Result requests may be received after the player goes offline - Result requests may be received without a prior wager request for FRB (free round bonus) and tournament auto-payout - For FRB results without a prior wager, the result represents the win from the free round

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
  • 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
  • Confirm that the incoming accountid and roundid match up with a previously placed wager. If this confirmation fails, refuse the result
  • A result must be accepted even if the game session has expired, since a result can be reported by the game server later. Groove provides the game session for you as information in this call
  • The only expected return code for a valid result call is success. All other return codes are unexpected and will result in the result attempt being resent. Return code 1000 Not logged on is never a valid response to a result call. The casino platform must accept the result even if the session has expired

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
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 result 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
gamestatus String Required Game Status
Valid values: completed, pending
request String Required Request method name
Example: result
result Decimal (32,10) Required The amount of money won by the player
If player did not win, value must be 0
Example: 2.25
roundid String(255) Required Round ID
Example: 802d1812c32686748f2afbcacfcc82114cf
transactionid String(255) Required Transaction ID
Example: 7617edd0924c11e7abb2865556898ad0

Request Examples

Regular Result (After Wager)

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

Free Round Result (No Prior Wager)

/groove?request=result&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&gameid=80102&apiversion=1.2&result=10.0&roundid=nc8n4nd87&transactionid=trx_id&gamestatus=completed&frbid=123abc456

**Free Round Result without Wager:** - Can be sent without a prior wager request - Must include `frbid` (the templateId from assign response) - The `result` amount represents the total win from the free round

Response Parameters

Parameter Data Type Mandatory Description
apiversion String Required The version of the API being used
Example: 1.2
balance Decimal (32,10) Required The total balance amount after the result
Examples: 500, 140.25
bonus_balance Decimal (32,10) Optional The player’s bonus balance
Example: 50.0
bonusWin Decimal (32,10) Required The bonus amount won
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
realMoneyWin Decimal (32,10) Required The real money amount won
status String Required The status of the response
Example: Success
walletTx String(50) Required The wallet transaction ID
Example: de73550e-0612-4a1b-8a0d-a5a3745b
Warning

The sum of `bonusWin` and `realMoneyWin` must equal the `result` amount sent by the provider.

Response Example

Success Response

{
    "code": 200,
    "status": "Success",
    "walletTx": "aaaaaaa",
    "balance": 100,
    "bonusWin": 0,
    "realMoneyWin": 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:
• Result amount is less than 0
• User with specified accountId not found
• AccountId doesn’t match sessionId
• Game status is not pending or completed
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

Rollback

Rollback

This method either rolls back a wager or a wager that did not result in a result. For example, if a player places a wager and the Result request fails, you can send a Rollback request to roll back the original wager.

Responsibilities of the casino platform

The casino platform must confirm that the incoming accountid, roundid, and transactionid are identical to the latest wager in the game round and not included in a result that has been issued for the relevant game round.

The casino platform may, but is not required to, verify that the bet amount in the relevant wager request is identical to the rollback amount.

Info

**Note:** The rollback amount is not mandatory and can be null.

The casino platform must refuse the rollback if any of these assertions fail.

  • 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
  • A rollback can be issued by the game server later. Therefore, a rollback must be accepted even if the game session has expired. Groove provides the game session for you as information in this call
  • The only expected return code for a valid rollback call is 0 success
  • If no matching wager is found, the code 102 Wager not found is returned
  • If the rollback is incorrect, code 110 Operation not allowed is returned
  • Return code 1000 Not logged on is never a valid response to a rollback call. The casino platform must accept the rollback even if the session has expired
  • All other return codes result in a resending of the rollback attempt
  • The Casino must refund the player only if a successful wager was found. Do not refund the player in the case of a failed wager or any other error

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
device String Required The device currently used by the player
Valid values: desktop, mobile
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: rollback
rollbackamount Decimal (32,10) Optional The betamount in the Wager request that you want to rollback
Example: 0.10
In some cases rollback amount can be 0, then rollback amount should be taken from original wager
roundid String(255) Optional Each casino needs to handle the rollback by transactionId, although sometimes the roundId is sent as well
Example: 802d1812c32686748f2afbcacfcc82114cf
transactionid String(255) Required Transaction ID
Example: 7617edd0924c11e7abb2865556898ad0

Request Example

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

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 rollback
Examples: 500, 140.25
bonus_balance Decimal (32,10) Optional The player’s bonus balance
Example: 50.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
status String Required The status of the response
Example: Success

Response Example

Success Response

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

Error Codes

Code Status Description
1 Technical error Technical error
102 Wager not found Reasons include:
• A wager with the given transactionId is not found
• The roundId in the rollback request is not the same as the roundId of a wager with the specified transactionId
110 Operation not allowed Reasons include:
• A win request was already received for the given wager

Wager And Result

Wager And Result

Places a wager and sets the result amount at the same time. Idempotency must be provided, which means equal requests should only be processed once. If a request is duplicated, that is, the requests have the same transactionid, the original response must be sent with the status 200, Success - duplicate request status.

Responsibilities of the casino platform

The same as in the separate Wager and Result requests.

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 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)
Note: The FRB result can be sent without a separate wager
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
gamestatus String Required Game Status
Valid values: completed, pending
request String Required Request method name
Example: wagerAndResult
result Decimal (32,10) Required The amount of money won by the player
Example: 2.25
roundid String(255) Required Round ID
Example: 802d1812c32686748f2afbcacfcc82114cf
transactionid String(255) Required Transaction ID
Example: 7617edd0924c11e7abb2865556898ad0

Request Examples

Regular Wager and Result (No Free Rounds)

/groove?request=wagerAndResult&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&gameid=80102&apiversion=1.2&result=10.0&betamount=5.0&roundid=nc8n4nd87&transactionid=trx_id&gamestatus=completed

Free Round Wager and Result

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

**Free Round Transactions:** - `betamount` must be `0` when using free rounds - `frbid` must be the `templateId` from the FRB assign response - The `result` amount represents the win from the free round

Response Parameters

Parameter Data Type Mandatory Description
apiversion String Required The version of the API being used
Example: 1.2
balance Decimal (32,10) Required The total balance amount after the transaction
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
bonusWin Decimal (32,10) Required The bonus amount won
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
realmoneyWin Decimal (32,10) Required The real money amount won
status String Required The status of the response
Example: Success
walletTx String(50) Required The wallet transaction ID
Example: de73550e-0612-4a1b-8a0d-a5a3745b
Warning

- The sum of `bonusmoneybet` and `realmoneybet` must equal the `betamount` sent by the provider - The sum of `bonusWin` and `realmoneyWin` must equal the `result` amount sent by the provider

Response Example

Success Response

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

Error Codes

The error codes are the same that are used in separate Wager and Result requests.

Jackpot

Jackpot

Groove Gaming sends this request as a Result call when the player wins a jackpot. Idempotency must be provided, which means the same request should only be processed once. If a request is duplicated, the original response must be sent with status 200, Success - duplicate request status.

Request Parameters

Parameter Data Type Mandatory Description
accountid String(60) [0-9a-zA-Z] Required Account ID
Example: 5179068
amount Decimal (32,10) Required The jackpot win amount
Example: 2000
apiversion String Required The API version that will be used
Example: 1.2
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
gamestatus String Required Game Status
Valid values: completed, pending
request String Required Request method name
Example: jackpot
roundid String(255) Required Round ID
Example: 802d1812c32686748f2afbcacfcc82114cf
transactionid String(255) Required Transaction ID
Example: 7617edd0924c11e7abb2865556898ad0

Request Example

/groove?request=jackpot&gamesessionid=123_jdhdujdk&accountid=111&device=desktop&gameid=80102&apiversion=1.2&amount=2000.0&roundid=nc8n4nd87&transactionid=trx_id&gamestatus=completed

Response Parameters

Parameter Data Type Mandatory Description
apiversion String Required The version of the API being used
Example: 1.2
balance Decimal (32,10) Required The total balance amount after the jackpot
Examples: 500, 140.25
bonus_balance Decimal (32,10) Optional The player’s bonus balance
Example: 50.0
bonusWin Decimal (32,10) Required The bonus amount won from jackpot
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
realmoneyWin Decimal (32,10) Required The real money amount won from jackpot
status String Required The status of the response
Example: Success
walletTx String(50) Required The wallet transaction ID
Example: de73550e-0612-4a1b-8a0d-a5a3745b
Warning

The sum of `bonusWin` and `realmoneyWin` must equal the `amount` sent by the provider.

Response Example

Success Response

{
    "code": 200,
    "status": "Success",
    "walletTx": "aaaaaaa",
    "balance": 2100,
    "bonusWin": 0,
    "realMoneyWin": 2000,
    "bonus_balance": 50,
    "real_balance": 2050,
    "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:
• The result amount is less than 0
• A user with the specified accountId cannot be found
• Game status is not pending or completed
400 Transaction operator mismatch Transaction operator mismatch

Signature Validation

Signature Validation

Overview

For enhanced security, Groove can sign transaction API requests using HMAC-SHA256. Your platform should validate these signatures to ensure requests are authentic and haven’t been tampered with.

Prerequisites

Before validating signatures, you’ll need:

  1. Access Key Value: Provided by Groove during integration setup
  2. Secret: Base64 decoded version of the Access Key Value
Secret = base64_decode(<Access Key Value>)

Note: The Access Key is a pseudo-random HS512 secret provided by Groove.

Authorization Header

Each signed request from Groove includes an Authorization header with the following format:

Authorization: HMAC-SHA256 Signature={Signature}

Header Syntax

Component Description Required
HMAC-SHA256 Authorization scheme Optional (but recommended to verify)
Signature Base64 encoded HMAC-SHA256 hash Required

Signature Calculation

The signature is calculated using:

Signature = base64_encode(HMACSHA256(Path-And-Query, Secret))

Where:

  • Path-And-Query: The canonical representation of the request path and query string
  • Secret: The base64 decoded Access Key Value

Path-And-Query Format

The Path-And-Query is the concatenation of:

  1. The request’s absolute URI path
  2. The query string (including the ?)

Example

For a request to:

https://your-domain.com/groove?request=getbalance&gamesessionid=123&accountid=456

The Path-And-Query would be:

/groove?request=getbalance&gamesessionid=123&accountid=456

Implementation Example

PHP Implementation

function validateGrooveSignature($request, $accessKeyValue) {
    // Get the Authorization header
    $authHeader = $_SERVER['HTTP_AUTHORIZATION'] ?? '';
    
    // Extract signature from header
    if (!preg_match('/HMAC-SHA256\s+Signature=(.+)/', $authHeader, $matches)) {
        return false;
    }
    
    $providedSignature = $matches[1];
    
    // Decode the secret
    $secret = base64_decode($accessKeyValue);
    
    // Build Path-And-Query
    $pathAndQuery = $_SERVER['REQUEST_URI'];
    
    // Calculate expected signature
    $hash = hash_hmac('sha256', $pathAndQuery, $secret, true);
    $expectedSignature = base64_encode($hash);
    
    // Compare signatures (constant-time comparison)
    return hash_equals($expectedSignature, $providedSignature);
}

// Usage
$accessKeyValue = "your_base64_access_key_from_groove";
if (validateGrooveSignature($_REQUEST, $accessKeyValue)) {
    // Process the valid request
    processTransaction();
} else {
    // Reject invalid signature
    http_response_code(401);
    echo json_encode([
        "code" => 401,
        "status" => "Unauthorized",
        "message" => "Invalid signature"
    ]);
}

Node.js Implementation

const crypto = require('crypto');

function validateGrooveSignature(req, accessKeyValue) {
    // Get the Authorization header
    const authHeader = req.headers['authorization'] || '';
    
    // Extract signature from header
    const match = authHeader.match(/HMAC-SHA256\s+Signature=(.+)/);
    if (!match) {
        return false;
    }
    
    const providedSignature = match[1];
    
    // Decode the secret
    const secret = Buffer.from(accessKeyValue, 'base64');
    
    // Build Path-And-Query
    const pathAndQuery = req.originalUrl;
    
    // Calculate expected signature
    const hash = crypto
        .createHmac('sha256', secret)
        .update(pathAndQuery)
        .digest('base64');
    
    // Compare signatures (constant-time comparison)
    return crypto.timingSafeEqual(
        Buffer.from(hash),
        Buffer.from(providedSignature)
    );
}

// Usage in Express.js
app.get('/groove', (req, res) => {
    const accessKeyValue = process.env.GROOVE_ACCESS_KEY;
    
    if (!validateGrooveSignature(req, accessKeyValue)) {
        return res.status(401).json({
            code: 401,
            status: "Unauthorized",
            message: "Invalid signature"
        });
    }
    
    // Process valid request
    processTransaction(req, res);
});

Python Implementation

import hmac
import hashlib
import base64
from flask import request, jsonify

def validate_groove_signature(access_key_value):
    # Get the Authorization header
    auth_header = request.headers.get('Authorization', '')
    
    # Extract signature from header
    import re
    match = re.search(r'HMAC-SHA256\s+Signature=(.+)', auth_header)
    if not match:
        return False
    
    provided_signature = match.group(1)
    
    # Decode the secret
    secret = base64.b64decode(access_key_value)
    
    # Build Path-And-Query
    path_and_query = request.full_path
    if path_and_query.endswith('?'):
        path_and_query = path_and_query[:-1]
    
    # Calculate expected signature
    hash_obj = hmac.new(
        secret,
        path_and_query.encode('utf-8'),
        hashlib.sha256
    )
    expected_signature = base64.b64encode(hash_obj.digest()).decode('utf-8')
    
    # Compare signatures (constant-time comparison)
    return hmac.compare_digest(expected_signature, provided_signature)

# Usage in Flask
@app.route('/groove')
def handle_groove_request():
    access_key_value = os.environ.get('GROOVE_ACCESS_KEY')
    
    if not validate_groove_signature(access_key_value):
        return jsonify({
            'code': 401,
            'status': 'Unauthorized',
            'message': 'Invalid signature'
        }), 401
    
    # Process valid request
    return process_transaction()

Testing Signature Validation

Test Example

Given:

  • Access Key Value: dGVzdF9zZWNyZXRfa2V5XzEyMw==
  • Request URL: /groove?request=getbalance&accountid=123
  • Expected Path-And-Query: /groove?request=getbalance&accountid=123

Steps:

  1. Decode secret: base64_decode("dGVzdF9zZWNyZXRfa2V5XzEyMw==")
  2. Calculate HMAC-SHA256 of Path-And-Query with secret
  3. Base64 encode the hash
  4. Compare with provided signature

Security Best Practices

  1. Always validate signatures in production environments
  2. Use constant-time comparison to prevent timing attacks
  3. Store Access Key securely (environment variables, secure vault)
  4. Log validation failures for security monitoring
  5. Reject requests with invalid or missing signatures
  6. Rotate Access Keys periodically as per security policy
  7. Use HTTPS for all communications

Common Issues and Solutions

Issue 1: Signature Mismatch

Cause: Incorrect Path-And-Query construction Solution: Ensure you’re using the exact request URI including all query parameters

Issue 2: Encoding Problems

Cause: Incorrect base64 decoding of Access Key Solution: Verify the Access Key is properly base64 decoded before use

Issue 3: Missing Authorization Header

Cause: Header not properly forwarded by proxy/load balancer Solution: Configure your infrastructure to forward Authorization headers

Issue 4: Query Parameter Order

Cause: Parameters reordered by framework Solution: Use the raw request URI as received, not reconstructed

Response for Invalid Signatures

When signature validation fails, return:

{
    "code": 401,
    "status": "Unauthorized",
    "message": "Invalid signature",
    "apiversion": "1.2"
}

Integration Checklist

  • Receive Access Key Value from Groove
  • Implement signature validation in your chosen language
  • Test with sample requests from Groove
  • Handle both signed and unsigned requests (during transition)
  • Configure proper error responses
  • Set up monitoring for validation failures
  • Document your validation endpoint

Note on Optional Implementation

While signature validation is highly recommended for production environments, it may be optional during initial integration and testing phases. Coordinate with Groove to determine when signature validation should be enabled for your integration.