Selection Result Endpoint
Path: {operator-env-url}/result
The Selection Result endpoint is for sending results for individual market selections as their related events unfold during play or at the end of an event. There will be a request made for every market selection with one or more bets placed against it with the operator. This request will not be user specific. It's the responsibility of the operator to find and result/settle the n pending bets against this specific market selection (N.B. important to note that for efficiency BetLink will not result/settle at the market level and so any market selections without a bet placed against them will not be settled).
On receipt of a selection result request, the operator should:
look up all pending user bets for that selection and market ID
for each bet, payout the user by resulting/settling the bets according to the stakeReturned and payoutReturned fields as follows:
payout = (stake * stakeReturned) + (potentialPayout * payoutReturned)
The potentialPayout
should have been calculated alongside each bet as per the bet placement endpoint specification. Here is a brief explanation of how the fields function:
When a selection has lost, both stakeReturned and payoutReturned will be 0.0 so nothing will be paid out to the user
When some stake needs to be returned to the user (e.g. if the market was declared null and void) the stakeReturned parameter will show a factor of the stake to return of <= 1 and the user should be paid stake * stakeReturned
When the bet has won, the payoutReturned parameter will show a factor of the payout to return of <=1 (usually 1.0 but some result scenarios such as dead heats can return fractional payouts) and the user should be paid potential payout * payoutReturned.
For more detail on market and selection definitions, see the 'Markets and Selections' section.
Both single and multiple bets are to be resulted based on the receipt of results for selections concerning the bet
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 the 'Idempotency' section for more detail.
requestId
String/UUID
Yes
92e02ae9-a2a3-48e2-af0e-940aec4bbcfb
marketId
String
Yes
selectionId
String
Yes
stakeReturned
Decimal/Double
Yes
0.0
payoutReturned
Decimal/Double
Yes
1.0
timestamp
String (epoch)
Yes
1640995200000
Response Parameters
accepts: application/json
requestId
String/UUID
Yes
Matches request's requestId
marketId
String
Yes
selectionId
String
Yes
stakeReturned
Decimal/Double
Yes
0.0
payoutReturned
Decimal/Double
Yes
1.0
timestamp
String (epoch)
Yes
Response timestamp
status
String ("RESULTED")
Yes
Error Response
accepts: application/json
status
String ("FAILURE")
Yes
errorCode
String (enum - see Errors table below)
Yes
errorMessage
String
No
Errors
MISSING_PARAMETER
400
AUTHENTICATION_FAILED
403
GENERAL_EXCEPTION
500
REQUEST_TIMED_OUT
503
Last updated