Skip to content

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 POST and the type === 1.
  • Verify request signature.
  • Verify user token.
  • Check whether the user has enough funds and can place bet with corresponding amount and currency. Perform any other checks required by your system.
  • Debit bet amount from 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:

ParameterTypeDescription
requestIduuidA unique identifier to uniquely identify one particular request sent by our system. Useful for troubleshooting.
type1 | 2 | 3Transaction type.
1 — Place bet (POST method) or Unsettle (PUT method)
2 — Settle (PUT method)
3 — Rollback (PUT method)
transactionIduuidA unique identifier of the placed bet. It will be used to notify about bet result (win, lost, etc) changes in future.
tokenstring
length: 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.
userIdstringUser Id
amountfloatAn 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.
currencystring
length: 3-5
The currency used to place a bet.
he currency code must be specified in ISO 4217 (EUR, USD, RUB, and so on).
coefficientfloatBet (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)
bonusIdint | nullFreebet bonus identificator. More info
bonusTemplateIdint | nullFreebet template of bonus identificator. More info
ticketType'single' | 'express'Ticket type (e.g. single or express)
boosterCoefficientfloatExpress odds multiplier

The following parameters are specific only for Place bet requests:

ParameterTypeDescription
ipstringUser’s IP address of the place bet.
infostringOptional information about the bet (discipline, event, market, and so on).
subPartnerIdstring | nullThis 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.
metadataMetadataItem[]Optional fields that can be supplemented with new data.
bonusAmountfloat | nullFreebet bonus amount. More info

The table below describes the MetadataItem:

ParameterTypeDescription
disciplineIdstringDiscipline ID.
disciplinestringDiscipline name.
tournamentIdstringTournament ID.
tournamentstringTournament name.
tournamentRegionCodestring | nullTournament region code (mainly ISO_3166-1).
eventIdstringEvent ID.
eventstringEvent name.
eventDatestringEvent's start date in ISO 8601 format.
stage1 | 2Information about the betting stage:
1 — Prematch
2 — Live
marketIdstringMarket ID.
marketstringMarket name.
outcomeIdstringOutcome ID.
outcomestringOutcome name.
coefficientfloatOutcome 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:

ParameterTypeDescription
transactionIdstring
length: 10-36
A unique identifier the bet.
transactionTimedatetimeTransaction UTC time in ISO 8601 format.

Place Bet Flow

Place bet flow diagramPlace bet flow diagram