Appearance
Place bet
POST https://{PARTNER_API_URL}/payment/bet with type: 1
This request will be performed every time a user tries to place a bet. When you receive a request you should perform the following actions on your side:
- Check that the method is
POSTand thetype === 1. - Verify request signature.
- Verify user token.
- Check whether the user has enough funds and can place bet with corresponding
amountandcurrency. Perform any other checks required by your system. - Debit bet
amountfrom the user balance. - Respond to a request informing us about operation results.
You must respond with error response in case there was errors performing any of the steps listed above.
Insufficient funds and other errors
If during user balance check appears that the user is out of funds, you should respond with HTTP status code 400 and the following JSON body:
json
{
"code": 7,
"message": "Not enough money"
}There are more useful codes on the error codes page.
Self-exclusion support
If your product offers a self-exclusion program you can easily enable this feature by responding with corresponding error codes.
Request examples
json
{
"token": "5caa4cabce523c2f7610c50ce9819bfb",
"transactionId": "b26153f9-ef3a-4768-b6c8-0861acdecb7a",
"currency": "USD",
"amount": 12.12,
"userId": "1999",
"info": "bet info",
"type": 1,
"coefficient": 1.2,
"ip": "35.168.110.10",
"subPartnerId": null,
"requestId": "d9195aef-9492-43dd-88d0-dc1732a37f4e",
"bonusId": null,
"bonusTemplateId": null,
"bonusAmount": null,
"gameType": "sportsbook",
"ticketType": "single",
"boosterCoefficient": 1,
"metadata": [
{
"disciplineId": "fifa",
"discipline": "Fifa",
"tournamentId": "3971",
"tournament": "Championship of League",
"tournamentRegionCode": "GB",
"eventId": "5663102",
"event": "Club Black and Club White",
"eventDate": "2021-03-05 11:08:00",
"marketId": "5fa4e904d043dea8811a5f98",
"market": "Match Winner",
"outcomeId": "111",
"outcome": "Club Black",
"coefficient": 1.2,
"stage": 1
}
]
}The table below describes common parameters for Place bet, Settle, Unsettle, Rollback requests:
| Parameter | Type | Description |
|---|---|---|
requestId | uuid | A unique identifier to uniquely identify one particular request sent by our system. Useful for troubleshooting. |
type | 1 | 2 | 3 | Transaction type.1 — Place bet (POST method) or Unsettle (PUT method)2 — Settle (PUT method)3 — Rollback (PUT method) |
transactionId | uuid | A unique identifier of the placed bet. It will be used to notify about bet result (win, lost, etc) changes in future. |
token | stringlength: 10-64 | A string that you generating for each user session to be able to identify and authorize user on backend. The string is passed during frame initialization in the SDK parameters. |
userId | string | User Id |
amount | float | An amount with a dot separator. For place bet, rollback requests it corresponds to a bet amount. For settle it equals to a payout amount (the award the user should receive). For unsettle it equals the amount that should be returned to a user. |
currency | stringlength: 3-5 | The currency used to place a bet. he currency code must be specified in ISO 4217 (EUR, USD, RUB, and so on). |
coefficient | float | Bet (payout) coefficient for the whole transaction. For express (combo) bets the total coefficient is calculated as k1 * k2 * kN. |
gameType | 'sportsbook' | 'turbogames' | Game type is used to distinguish between types of games (e.g. sportsbook and turbogames) |
bonusId | int | null | Freebet bonus identificator. More info |
bonusTemplateId | int | null | Freebet template of bonus identificator. More info |
ticketType | 'single' | 'express' | Ticket type (e.g. single or express) |
boosterCoefficient | float | Express odds multiplier |
The following parameters are specific only for Place bet requests:
| Parameter | Type | Description |
|---|---|---|
ip | string | User’s IP address of the place bet. |
info | string | Optional information about the bet (discipline, event, market, and so on). |
subPartnerId | string | null | This is is useful when you run several sites/projects under the same Partner key. Using subPartnerId you can distinguish the source the bet comes from. Read frontend integration for more info. |
metadata | MetadataItem[] | Optional fields that can be supplemented with new data. |
bonusAmount | float | null | Freebet bonus amount. More info |
The table below describes the MetadataItem:
| Parameter | Type | Description |
|---|---|---|
disciplineId | string | Discipline ID. |
discipline | string | Discipline name. |
tournamentId | string | Tournament ID. |
tournament | string | Tournament name. |
tournamentRegionCode | string | null | Tournament region code (mainly ISO_3166-1). |
eventId | string | Event ID. |
event | string | Event name. |
eventDate | string | Event's start date in ISO 8601 format. |
stage | 1 | 2 | Information about the betting stage:1 — Prematch2 — Live |
marketId | string | Market ID. |
market | string | Market name. |
outcomeId | string | Outcome ID. |
outcome | string | Outcome name. |
coefficient | float | Outcome coefficient. |
Response examples
WARNING
If you respond with a HTTP status code other than 200 or 400 or if we won't get any response within a timeout (~5 seconds). We will initiate Rollback procedure.
json
{
"transactionId": "b26153f9-ef3a-4768-b6c8-0861acdecb7a",
"transactionTime": "2020-01-16T12:07:23.596Z"
}The table below describes the response:
| Parameter | Type | Description |
|---|---|---|
transactionId | stringlength: 10-36 | A unique identifier the bet. |
transactionTime | datetime | Transaction UTC time in ISO 8601 format. |