Transactions

THNDR calls this endpoint to notify the Operator of a transaction request, instructing them to either debit or credit the player’s balance.

Endpoint

POST {operatorURL}/thndr/transactions

Bet Transaction

The BET Transaction is sent by THNDR to notify the Operator of a wager placed by a player.

The Operator must process this request to debit the player’s balance (and optionally record a potential reward).

{
   "type": "WIN",
   "transactionId": "a395479b-7d31-406e-abab-2dd66a61d5ee-WIN",
   "requestedAt": "2025-08-21T14:30:00.123Z",
   "userId": "{USER_ID}",
   "sessionId": "{SESSION_ID}",
   "roundId": "a395479b-7d31-406e-abab-2dd66a61d5ee",
   "amount": 200,
   "gameId": "solitaire",
   "roomId": "{ROOM_ID}"
}
  • transactionId - Unique transaction identifier. Must be persisted by the Operator for idempotency and rollback handling.

  • requestedAt - The date and time when the request was initially made, in ISO 8601 format (e.g., 2025-08-21T14:30:00.123Z).

  • userId - Player identifier on the Operator’s platform.

  • sessionId - The session identifier provided by the Operator when the game was launched.

  • roundId - Identifier of the game round this transaction belongs to.

  • amount - Win amount, in cents (e.g., 120 = $1.20).

  • gameId - Game identifier. Possible values: solitaire, blocks, twentyone, blackjack, slots.

  • roomId - Identifier for the game room. Players sharing the same roomId are participating in the same PvP match.

Lose Transaction

The LOSE transaction is sent by THNDR to notify the Operator that a player has lost a round.

The Operator might process this request to record a loss.

{
   "type": "LOSE",
   "transactionId": "a395479b-7d31-406e-abab-2dd66a61d5ee-LOSE",
   "requestedAt": "2025-08-21T14:30:00.123Z",
   "userId": "{USER_ID}",
   "sessionId": "{SESSION_ID}",
   "roundId": "a395479b-7d31-406e-abab-2dd66a61d5ee",
   "gameId": "solitaire",
   "roomId": "{ROOM_ID}"
}
  • transactionId - Unique transaction identifier. Must be persisted by the Operator for idempotency.

  • requestedAt - The date and time when the request was initially made, in ISO 8601 format (e.g., 2025-08-21T14:30:00.123Z).

  • userId - Player identifier on the Operator’s platform.

  • sessionId - The session identifier provided by the Operator when the game was launched.

  • roundId - Identifier of the game round this transaction belongs to.

  • gameId - Game identifier. Possible values: solitaire, blocks, twentyone, blackjack, slots.

  • roomId - Identifier for the game room. Players sharing the same roomId are participating in the same PvP match.

Draw Transaction

The DRAW transaction is sent by THNDR to notify the Operator that a player has tied a round.

The Operator must process this request to credit the player’s balance.

{
   "type": "DRAW",
   "transactionId": "a395479b-7d31-406e-abab-2dd66a61d5ee-DRAW",
   "requestedAt": "2025-08-21T14:30:00.123Z",
   "userId": "{USER_ID}",
   "sessionId": "{SESSION_ID}",
   "roundId": "a395479b-7d31-406e-abab-2dd66a61d5ee",
   "amount": 200,
   "gameId": "solitaire",
   "roomId": "{ROOM_ID}"
}
  • transactionId - Unique transaction identifier. Must be persisted by the Operator for idempotency and rollback handling.

  • requestedAt - The date and time when the request was initially made, in ISO 8601 format (e.g., 2025-08-21T14:30:00.123Z).

  • userId - Player identifier on the Operator’s platform.

  • sessionId - The session identifier provided by the Operator when the game was launched.

  • roundId - Identifier of the game round this transaction belongs to.

  • amount - Win amount, in cents (e.g., 120 = $1.20).

  • gameId - Game identifier. Possible values: solitaire, blocks, twentyone, blackjack, slots.

  • roomId - Identifier for the game room. Players sharing the same roomId are participating in the same PvP match.

Rollback Transaction

The ROLLBACK transaction is sent by THNDR to request the Operator to reverse a previously processed transaction, such as a BET or WIN, in cases of error, cancellation, or game rollback.

The Operator must ensure that the original transaction is undone and the player’s balance is correctly updated.

{
   "type": "ROLLBACK",
   "transactionId": "a395479b-7d31-406e-abab-2dd66a61d5ee-ROLLBACK",
   "requestedAt": "2025-08-21T14:30:00.123Z",
   "originalTransactionId": "a395479b-7d31-406e-abab-2dd66a61d5ee-BET",
   "userId": "{USER_ID}",
   "sessionId": "{SESSION_ID}",
   "roundId": "a395479b-7d31-406e-abab-2dd66a61d5ee",
   "gameId": "solitaire"
}

  • transactionId - Unique transaction identifier. Must be persisted by the Operator for idempotency.

  • requestedAt - The date and time when the request was initially made, in ISO 8601 format (e.g., 2025-08-21T14:30:00Z).

  • originalTransactionId - The transactionId of the original BET transaction being rolled back.

  • userId - Player identifier on the Operator’s platform.

  • sessionId - The session identifier provided by the Operator when the game was launched.

  • roundId - Identifier of the game round this transaction belongs to.

  • gameId - Game identifier. Possible values: solitaire, blocks, twentyone, blackjack, slots.

Signature Verification

Verify the request signature using raw request body as the request payload. More in the Request Signing section.

Last updated