Bet
Bet is a sum of money that a player bets on a result of a sport event. On the technical side, in addition to the amount of money, the bet includes a number of other fields, which are described in detail in the Swagger - Schemas section: PlayerBet.
Types of bets
There are three types of bets. Each bet contains a set of outcomes with fixed odds (selections a player makes):
- Single is a bet on one sport event.
- Express (also referred as combo) is a bet on simultaneous forecast of the outcome of two or more independent events.
- System is a bet which consists of three or more combo bets. It enumerates all the possible combos of equal size from the fixed set of the selected outcomes. The same bet amount is placed on each combo (each system option).
Calculation logic
The logic of calculating winnings depends on the type of bet.
Bet type | Calculation logic |
---|---|
Single | The amount of winnings for single bets is calculated by multiplying the bet amount by the odds for the given outcome of the event. |
Express | A combo bet (also called combo) wins if all the selected outcomes of sport events are predicted correctly. An incorrect prediction for at least one event means the combo is lost. The minimum number of events in a combo is two, and the maximum is unlimited, but the winning sum cannot exceed 50,000 euros. Combo winnings are calculated by multiplying the odds of all included outcomes by the bet amount, then the resulting value is rounded to three decimal places. Combo odds are shown for convenience, they are rounded to two decimal places, and they are not the final odds for calculating winnings. |
System | A system bet type implies that the same bet amount is placed on each combo (each system option) and the number of outcomes is the same in each combo. The system winnings are the sum of the winnings of the combos that make up the system. |
Lifecycle
The bet lifecycle can be described as a complicated process that consists of certain steps and actions. Some of the steps are obligatory and some could be optional.
Details
- Forming a bet
- A player forms a bet and clicks the Place Bet button.
- An initiated after clicking the button request contains information about the player's Odds acceptance strategy:
- when changing the odds of an outcome, a slight deviation from the original value is allowed, or any change in the odds is forbidden (depending on the bet validator);
- the coefficients can only be changed to a higher level;
- any changes in the odds are allowed;
- A request to reserve the bet amount on the player's balance is sent from the Betting platform to the integrated platform, to which the player is assigned. The money MUST be held (temporarily frozen) NOT withdrawn from the player's balance (refer to /bet/place section).
- The bet processing begins once the funds successfully held.
- If holding funds on the player's balance is impossible, the bet gets the Place Error status (error in bet placement). This means that the integrated platform's limits or player's balance restrictions have been applied.
- Accepting a bet
- According to the validation result, if the bet is placed, it gets the Accept status, if the bet is forbidden, it gets the Decline status.
- If a bet receives the Decline status, its life cycle ends. It cannot go to another status from this point, and it is displayed in the player's bets history as declined (refer to /bet/decline section).
- If a bet receives the Accept status, the player is notified that the bet has been successfully accepted. The bet is awaiting calculation (refer to /bet/accept section).
- Calculating a bet
- If a bet has been calculated successfully, it receives the Settle status. The Betting platform calculates winnings according to the bet type (refer to /bet/settle section).
- If a bet has been calculated, but the calculation has been cancelled and the bet is waiting for recalculation, it receives the UnSettle status. (refer to /bet/unsettle section)
This means that the outcomes have changed in a way that prevents a bet from being calculated.
For example, there could be a trader's error or a goal call-off. The cycle of a bet status change (Settle →UnSettle) can repeat unlimited number of times (the bet must get the Settle status eventually).
Important
A calculated bet is a bet with all the outcomes calculated (the selection value is not Not result). If a bet is accepted, it will certainly be calculated. If a bet wins but the outcome is subsequently cancelled, the winnings are withdrawn from the player's balance. If a bet contains more than one outcome, the winnings are recalculated.
Restrictions
Throughout the lifecycle of a bet, it could be declined for various reasons related to its processing. Such reasons are encompassed by restrictions that arise during the checking and processing of the bet.
A restriction includes the type and context of an error or problem. Some restrictions are specific to the player, while others are not. Currently, the following bet restriction types are supported:
max_bet
bet_type
bet_interval
selection_value
sport_event_status
sport_event_existence
sport_event_bet_stop
market_status
market_existence
market_defective
odd_status
odd_existence
player_limit
freebet_not_applicable
freebet_status
freebet_amount
insurance_not_applicable
insurance_status
insurance_value
internal_error
min_bet
not_enough_balance
wl_defined
For more details, please refer to BetRestriction schema.
Callback API
Note
You can find the basic implementation of the callback server written in Node.js in our GitHub repository at databet-cloud/callback-server-example.
Idempotency
Please ensure that all callbacks are processed idempotently. Due to our at-least once guarantee, it's possible for a callback to be delivered to the server more than once. Always use the request_id
to distinguish and manage each callback appropriately. If a request is duplicated, it is crucial to respond with the same response code and content as the initial response. Consistency in handling and responding to repeated requests ensures seamless operation.
Redirects
To ensure data consistency and enforce security policies, our system does not support redirects in callbacks. Redirects can pose risks such as Server-Side Request Forgery (SSRF) and lead to increased processing time. To prevent potential data exposure or integrity issues, all callbacks must return a direct response without redirection.
Bet callbacks MUST be implemented on the integration side. Each callback must return status code of 204 with an empty body for success and 400 with an error body for errors. If any callback except for /bet/place
, returns an error, the Betting platform will continue to retry until it succeeds. For the /bet/place
callback, the Betting platform checks the error code and retries only if an unsupported code is received in response. After several retry attempts, the Betting platform will set the bet status to 11 - force_decline
.
cURL examples
You can download callback examples that are described bellow as a postman collection - bets-callback-postman-collection.json. Replace the {callback-api-server}
with your callback API server URL and run the following commands to test bet callbacks:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
|
1 2 3 4 5 6 7 8 9 10 11 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 |
|