1. Idempotency check

Description: Duplicate transaction received by operator (same transactionId)

Expectation: In case operator receives the same transaction more than one time the duplicates should not be processed

StepEventPathTypeDescription
1Place bet/placebet-Bet details: amount: 10.00, odds: 3.30. Player’s balance -10.00
2Settlement as won/settlementBET_PAIDSettlement as won. Player’s balance +33.00
3Settlement as won/settlementBET_PAIDSettlement as won with the same transactionId. Player’s balance unchanged. Balance returned
4Unsettlement/unsettlementBET_UNPAIDSettlement as BET_UNPAID to revert previous settlement. Player’s balance -33.00
5Unsettlement/unsettlementBET_UNPAIDSettlement as lost with the same transactionId as previous unsettlement. The player’s balance remains unchanged

2. Authentication succeeds

Description: The Sportsbook platform attempts to authenticate player with valid authToken.

Expectation: The operator receives the authToken which is verified. Operator returns player details and sessionId.

StepEventPathTypeDescription
1Authenticate player/authenticate-Authenticate with valid authToken. Player details and valid sessionId is returned

3. Authentication fails due to reused authToken

Description: The Sportsbook platform attempts to reuse one-time authToken.

Expectation: The operator receives the authToken and verifies it. The operator then returns the player details and sessionId. Subsequently, the Sportsbook platform attempts to re-authenticate the player with the same authToken, but this should fail because the authToken should have been invalidated after its first use.

StepEventPathTypeDescription
1Authenticate player/authenticate-Authenticate with valid authToken. Player details and valid sessionId is returned
2Authenticate player/authenticate-Authenticate with the same authToken. 403 - FORBIDDEN response with INVALID_TOKEN error code is returned

4. Placebet times out or unexpected error occurs

Description: Placebet request times out or unexpected error response is returned. The Sportsbook platform sends rollbackbet to make sure the player’s balance was not deducted.

Expectation: Player’s balance remains unchanged or if the bet amount was already deducted, that should be credited back to the player’s balance.

StepEventPathTypeDescription
1Place bet/placebet-Bet details: amount: 20.00, odds: 2.20. Player’s balance -20.00 or unchanged. Unexpected error occurs, error response returned
2Rollback bet/rollbackbet-Sportsbook platform attempts to rollback bet. Player’s balance +20.00 or unchanged
----If rollbackbet response is not 200 - OK, rollbackbet request will be resent until it succeeds

5. Place bet fails due to insufficient funds on player’s balance

Description: Placebet request fails due to insufficient funds.

Expectation: Player’s balance cannot cover bet amount, Operator’s PAM need to return INSUFFICIENT_FUNDS error without changing the player’s balance

StepEventPathTypeDescription
----Player’s balance is 100.00
1Place bet/placebet-Bet details: amount: 120.00, odds: 2.20. Return 402 - PAYMENT REQUIRED with INSUFFICIENT_FUNDS error. The player’s balance remains unchanged
2Balance request/balance-Balance request details: valid playerId and sessionId. Player’s balance is still 100.00

6. Bet voided

Description: Bet event voided after bet placed. The Sportsbook platform send settlement with VOIDED

Expectation: Player’s balance needs to be credited with the initial bet bet amount

StepEventPathTypeDescription
1Place bet/placebet-Bet details: amount: 100.00, odds: 2.20. Player’s balance -100.00
2Settlement as voided/settlementVOIDEDSettlement as voided with amount of 100.00. Player’s balance +100.00

7. Player cashes out bet

Description: Player decides to cash out bet to secure winning. The Sportsbook platform sends a settlement with CASHOT type and amount.

Expectation: Player’s balance needs to be credited with the settlement amount

StepEventPathTypeDescription
1Place bet/placebet-Bet details: amount: 50.00, odds: 2.00. Player’s balance -50.00
2Settlement as cashout/settlementCASHOUTSettlement with type CASHOUT, amount: 80.00. Player’s balance +80.00

8. Settlement retried after error response returned

Description: Settlement of a bet fails at PAM end due to unexpected error, e.g. temporary outage of the Operator’s PAM system or timeout. The Sportsbook platform resends the same settlement request using the same transactionId until is succeeds.

Expectation: Once PAM system becomes available, settlement request is processed.

StepEventPathTypeDescription
1Place bet/placebet-Bet details: amount: 150.00, odds: 1.80. Player’s balance -150.00
2Settlement as won/settlementBET_PAIDSettlement as BET_PAID with amount of 270.00. An error response is returned, or the request fails to reach the Operator’s system
3Settlement as won/settlementBET_PAIDSettlement as BET_PAID with amount of 270.00. An error response is returned, or the request fails to reach the Operator’s system
4Settlement as won/settlementBET_PAIDSettlement as BET_PAID with amount of 270.00. An error response is returned, or the request fails to reach the Operator’s system
----The Operator’s PAM system becomes available and can process settlement requests
5Settlement as won/settlementBET_PAIDSettlement as BET_PAID with amount of 270.00. Player’s balance +270.00. Player’s balance is credited only one time.

9. Settlement and Unsettlement back and forth

Description: Player won the bet and then unsettled as lost then settled as won again

Expectation: Player’s balance changes accordingly

StepEventPathTypeDescription
1Place bet/placebet-Bet details: amount: 20.00, odds: 2.20. Player’s balance -20.00
2Settlement as lost/settlementBET_PAIDSettlement as lost with amount of 0.00. The player’s balance remains unchanged
3Unsettlement/unsettlementBET_UNPAIDUnsettlement with amount 0.00. The player’s balance remains unchanged
4Settlement as won/settlementBET_PAIDSettlement as won. Player’s balance +44.00

10. Unsettlement fails due to insufficitent funds

Description: Player’s bet settled as won, then unsettled. Unsettlement amount cannot be deducted from player’s balance due to unsufficient funds.

Expectation: Player’s balance increased at settlement. Then fails when unsettlement sent as player has already withdrawn funds between settlement and unsettlement.

StepEventPathTypeDescription
1Place bet/placebet-Bet details: amount: 20.00, odds: 2.00. Player’s balance -20.00
2Settlement as won/settlementBET_PAIDSettlement as won with amount of 40.00. Player’s balance +40.00
----The player withdraws all or part of the funds from their account or places another bet. Player’s balance is less than 40.00
3Unsettlement/unsettlementBET_UNPAIDUnsettlement with amount 40.00. Return 402 - PAYMENT REQUIRED with INSUFFICIENT_FUNDS error. The player’s balance remains unchanged.

11. Balance request results the player’s current balance

Description: The Sportsbook platform request for the player’s current balance using a valid sessionId.

Expectation: PAM system should process balance request and return the player’s current balance.

StepEventPathTypeDescription
1Balance request/balance-Balance request details: valid playerId and valid sessionId for the same player. Player’s balance is returned

12. Balance request fails due to sessionId mismatch

Description: The Sportsbook platform request for the player’s current balance using a sessionId which is not valid for the current player

Expectation: PAM system should return INVALID_SESSION_TOKEN error.

StepEventPathTypeDescription
1Balance request/balance-Balance request details: valid playerId and invalid sessionId for the player. 400 - BAD REQUEST with INVALID_SESSION_TOKEN error returned