Placing a bet by the player
Overview
| Request type | URL |
|---|---|
| POST | <server-partner>/bet |
This method allows the player to place a bet.
Notice
The request is executed by the provider.
Parameters
Request
Optional fields are excluded from hash calculations.
Optional* fields are included in hash calculations only if they are provided.
| Name | Type | Description | |
|---|---|---|---|
| amount | string | Transaction amount | |
| currency | string | The currency in which the game will be played | |
| partnerId | bigint | Unique partner identifier | |
| playerId | string | Unique player identifier in the partner’s system | |
| gameId | bigint | Unique identifier of the game | |
| roundId | bigint | Unique identifier of the betting round | |
| transactionId | bigint | Unique identifier of the provider's betting transaction | |
| sessionId | string | optional* | Unique game session identifier in the partner's system |
| hash | string | Signature (sha256 from encryption string) | |
| isBonusBuy | boolean | optional | Flag indicating whether the round was played using the bonus buy feature |
If /bet/win per free spin setting is applied:
| isFreespinBet | boolean | optional | Flag indicating whether the round was played within a freespin campaign |
| campaignExtId | string | optional | Unique identifier of the campaign in the partner’s system |
| leftSpins | bigint | optional | Amount of freespin rounds still available to the player after the current round has been played |
| spinCount | bigint | optional | Total number of freespin rounds |
| currentSpins | bigint | optional | Number of freespin rounds that have already been played |
String to hash
"bet" + amount + currency + partnerId + playerId + gameId + roundId + transactionId + sessionId* + apiKey
Response
| Name | Type | Description |
|---|---|---|
| balance | string | Player's current balance |
| transactionId | string | Unique identifier of the betting transaction in the partner’s system. |
Example
Request
js
{
amount: '10.00',
currency: 'USD',
partnerId: 1,
playerId: '432',
gameId: 3,
roundId: 7665,
transactionId: 35,
sessionId: '123',
isBonusBuy: false,
hash: '433e73d9de350fdae70a85634de4eedb2923868ea09f8e35423b25ec2b0a3762'
}Response
js
{
status: 'success'
data: {
balance: '10113.63',
transactionId: '1333882828'
}
}Errors
Possible error messages:
| Message | Description |
|---|---|
| RequiredParamsNotFound | Incorrect number of parameters in the request |
| InvalidParamType | Incorrect parameter type |
| PlayerLowBalance | Insufficient funds on player's balance |
| CurrencyNotFound | Currency with such code not found |
| IncorrectHash | Incorrectly calculated hash |
| ServerError | Server error |
In case of a PlayerLowBalance error, the /refund request will not be sent.