> For the complete documentation index, see [llms.txt](https://docs.sportradar.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sportradar.com/betlink-integration/backend-integration/selection-result-endpoint.md).

# Selection Result Endpoint

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.

{% hint style="info" %}
Both single and multiple bets are to be resulted based on the receipt of results for selections concerning the bet
{% endhint %}

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

<table><thead><tr><th width="178">Parameter</th><th width="216">Type</th><th width="111">Required?</th><th>Example</th></tr></thead><tbody><tr><td>requestId</td><td>String/UUID</td><td>Yes</td><td>92e02ae9-a2a3-48e2-af0e-940aec4bbcfb</td></tr><tr><td>marketId</td><td>String</td><td>Yes</td><td></td></tr><tr><td>selectionId</td><td>String</td><td>Yes</td><td></td></tr><tr><td>stakeReturned</td><td>Decimal/Double</td><td>Yes</td><td>0.0</td></tr><tr><td>payoutReturned</td><td>Decimal/Double</td><td>Yes</td><td>1.0</td></tr><tr><td>timestamp</td><td>String (epoch)</td><td>Yes</td><td>1640995200000</td></tr></tbody></table>

### Response Parameters

accepts: `application/json`

<table><thead><tr><th width="179">Parameter</th><th width="215">Type</th><th width="112">Required?</th><th></th></tr></thead><tbody><tr><td>requestId</td><td>String/UUID</td><td>Yes</td><td>Matches request's requestId</td></tr><tr><td>marketId</td><td>String</td><td>Yes</td><td></td></tr><tr><td>selectionId</td><td>String</td><td>Yes</td><td></td></tr><tr><td>stakeReturned</td><td>Decimal/Double</td><td>Yes</td><td>0.0</td></tr><tr><td>payoutReturned</td><td>Decimal/Double</td><td>Yes</td><td>1.0</td></tr><tr><td>timestamp</td><td>String (epoch)</td><td>Yes</td><td>Response timestamp</td></tr><tr><td>status</td><td>String ("RESULTED")</td><td>Yes</td><td></td></tr></tbody></table>

### Error Response

accepts: `application/json`

| Parameter    | Type                                   | Required? |
| ------------ | -------------------------------------- | --------- |
| status       | String ("FAILURE")                     | Yes       |
| errorCode    | String (enum - see Errors table below) | Yes       |
| errorMessage | String                                 | No        |

#### Errors

| Error Code             | Http Status |
| ---------------------- | ----------- |
| MISSING\_PARAMETER     | 400         |
| AUTHENTICATION\_FAILED | 403         |
| GENERAL\_EXCEPTION     | 500         |
| REQUEST\_TIMED\_OUT    | 503         |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.sportradar.com/betlink-integration/backend-integration/selection-result-endpoint.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
