Skip to main content

Place Bet

POST https://{PARTNER_API_URL}/payment/bet with type: 1

This request is performed every time a user tries to place a bet. When you receive this request, you should perform the following actions on your side:

  1. Check Method & Type: Verify that the method is POST and the field type === 1.
  2. Verify Signature: Ensure the request comes from our server by verifying the request signature.
  3. Verify Token: Confirm the user session is still valid.
  4. Balance Check: Check whether the user has enough funds and can place a bet with the corresponding amount and currency.
  5. Debit Balance: If all checks pass, debit the bet amount from the user's balance.
  6. Respond: Inform our system about the operation results.

#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:

{
"code": 7,
"message": "Not enough money"
}

Request Example

{
"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:

ParameterTypeValidationDescription
requestIduuid-A unique identifier to uniquely identify one particular request sent by our system. Useful for troubleshooting.
typenumber1 | 2 | 3Transaction type:
1 — Place bet (POST) or Unsettle (PUT)
2 — Settle (PUT)
3 — Rollback (PUT)
transactionIduuid-A unique identifier of the placed bet. Used to notify about bet result (win, lost, etc) changes in future.
tokenstring10-64Session token generated for each user session to identify and authorize user on backend.
userIdstring-Unique User Identifier on the Partner's platform.
amountfloat-Amount with a dot separator. Corresponds to bet, payout, or return amount depending on the request type.
currencystringISO 4217The currency used for the transaction (e.g., EUR, USD, MKD).
coefficientfloat-Bet (payout) coefficient for the whole transaction. For express bets: k1 * k2 * kN.
gameTypeenum-Used to distinguish game types: 'sportsbook' or 'turbogames'.
bonusIdint | null-Freebet bonus identifier.
bonusTemplateIdint | null-Freebet template of bonus identifier.
ticketTypeenum-Ticket type: 'single' or 'express'.
boosterCoefficientfloat-Express odds multiplier.

The following parameters are specific only for Place bet requests:

ParameterTypeValidationDescription
ipstringIP AddressUser’s IP address at the time the bet was placed.
infostring-Optional information about the bet (discipline, event, market, etc.).
subPartnerIdstring | null-Useful for running multiple sites under one Partner key. Distinguishes the source of the bet.
metadataobject[]-Optional metadata fields that can be supplemented with additional data.
bonusAmountfloat | null-Freebet bonus amount, if applicable.

Response examples

{
"transactionId": "b26153f9-ef3a-4768-b6c8-0861acdecb7a",
"transactionTime": "2020-01-16T12:07:23.596Z"
}

The table below describes the response:

ParameterTypeValidationDescription
transactionIdstring10-36A unique identifier for the bet.
transactionTimedatetimeISO 8601Transaction UTC time in ISO 8601 format.