Multiples Bet Placement Endpoint

Path: {operator-env-url}/bet/multiple

Request

Multiples bet placement involves the submission of a betslip that contains one or more accumulator bets. As visible in the Request Parameters table below:

  • An array of multiple bets exists in the 'bets' parameter.

  • An array of selections exists in the 'selections' parameter. Within a bet there is a list of 'betSelections' which contain an identifier for each selection present in the bet. These selections within the bet should be extracted from the 'selections' list in the betslip level

When multiple bet placement calls are made to this endpoint, the operator needs to perform the following validations and checks:

  • Validate the user session by looking up the user session based on userId and sessionToken and ensuring that session details are correct and not expired

  • Confirm that the user has a sufficient balance to cover the sum total of all the individual bet stakes

  • Confirm that the user is able to place each multiple bet in light of any regulatory restrictions (could be cool down periods, max stakes, max liability per market type etc.)

Upon successfully completing all relevant checks:

  • Store all bet information for each bet in the bets array against the userId

  • Store all selections and associate them with betIds based on the betSelections identifiers list (for display and resulting)

  • Assign status equivalent to 'pending' to indicate that the bet is awaiting result.

  • A potentialPayout amount should be calculated by multiplying the decimalPrice field by the stake. This should be saved alongside the bet to facilitate bet resulting. Here is the formula for clarity:

potentialPayout = (stake * decimalPrice) 

Response

Successfully placed: Respond with a response matching the 'Response Parameters' schema as detailed below or alternatively

Not placed: After failing a check or experiencing an error store none of the bets in the bet placement call and respond with a relevant error response, as detailed below


Request Parameters

type: POST content-type: application/json

Idempotency

Request will contain a header X-Idempotency-Key in the form of a UUID string. See 'Idempotency' section for more information.

Parameter
Type
Required?
Example

requestId

String/UUID

Yes

92e02ae9-a2a3-48e2-af0e-940aec4bbcfb

userId

String

Yes

user123

sessionToken

String

Yes

0bJV7oLNI0iMFl3rlomqQQ==

timestamp

String (epoch)

Yes

1640995200000

betSlipId

String/UUID

Yes

92e02ae9-a2a3-48e2-af0e-940aec4bbcfc

bets

Array <BetDetails>

Yes

selections

Array <SelectionDetails>

Yes

Response Parameters

accepts: application/json

Parameter
Type
Required?

requestId

String/UUID

Yes

Matches request's requestId

userId

String

Yes

sessionToken

String

Yes

Original or refreshed

timestamp

String (epoch)

Yes

Response timestamp

status

String ("PLACED")

Yes

betSlipId

String/UUID

Yes

Matches requests betSlipId

processedBets

Array <ProcessedBet>

Yes

Error Response

accepts: application/json

Parameter
Type
Required?

status

String ("FAILURE")

Yes

errorCode

String

Yes

errorMessage

String

No

errorBetDetails

Array <ErrorBetDetail>

No (Except for INVALID_BET errors)

Errors

Error Code
Http Status

INVALID_USER

400

INVALID_BET

400

INSUFFICIENT_FUNDS

400

USER_BLOCKED

400

MISSING_PARAMETER

400

INVALID_SESSION

401

AUTHENTICATION_FAILED

403

GENERAL_EXCEPTION

500

REQUEST_TIMED_OUT

503

ErrorBetDetail

Parameter
Type
Required?

betId

String/UUID

Yes

detailReason

ErrorBetDetailReason

Yes

stake

Decimal/Double

Only for INVALID_MAX_STAKE and INVALID_MIN_STAKE

the stake value returned with ErrorBetDetail should be the value of the limit breached

ErrorBetDetailReason

Parameter Value

INVALID_BET_TYPE

INVALID_MAX_STAKE

INVALID_MIN_STAKE

The above are listed in order of priority. If a single bet is both an invalid type and violates a stake value, only invalid bet should be returned.

Model Definitions

BetDetails

Parameter
Type
Required?

betId

String/UUID

Yes

betType

String/BetType

Yes

betStage

String

Yes

decimalPrice

Decimal/Double

Yes

stake

Decimal/Double

Yes

betSelections

Array <SelectionIdentifiers>

Yes

SelectionIdentifiers

Parameter
Type
Required?

selectionId

String

Yes

marketId

String

Yes

SelectionDetails

Parameter
Type
Required?

sportId

String

Yes

sportName

String

Yes

sportDisplayName

String

Yes

eventId

String

Yes

eventAltId

String

No

eventName

String

Yes

eventDisplayName

String

Yes

eventStage

String/Stage

Yes

competitionId

String

Yes

competitionName

String

Yes

competitionDisplayName

String

Yes

marketTypeId

String

Yes

marketTypeName

String

Yes

marketId

String

Yes

marketName

String

Yes

marketDisplayName

String

Yes

marketStage

String/Stage

Yes

selectionId

String

Yes

selectionName

String

Yes

selectionDisplayName

String

Yes

decimalPrice

Decimal/Double

Yes

eventAltId is an optional field that may contain an alternate eventId (eg a DDE id for golf bets)

ProcessedBet

Parameter
Type
Required?
Note

betId

String/UUID

Yes

the betId from BetDetails

transactionId

String/UUID

Yes

a unique id for the bet in the operators system

BetType

Parameter Value

FIFTEEN_FOLD

FOURTEEN_FOLD

THIRTEEN_FOLD

TWELVE_FOLD

ELEVEN_FOLD

TEN_FOLD

NINE_FOLD

EIGHT_FOLD

SEVEN_FOLD

SIX_FOLD

FIVE_FOLD

FOUR_FOLD

TREBLE

DOUBLE

SINGLE

Stage

Parameter Value

IN_PLAY

PRE_PLAY

Last updated