# Best Practice

## Displaying a match in your pre-match & live section <a href="#title-text" id="title-text"></a>

**Example:** Life cycle of an Ice Hockey match which goes to overtime:\
\
In order to determine how long a specific match should be displayed in your pre-match section: Listen to the product attribute (which will change at the handover from pre-match to live)

* product=3 (pre-match)
* product=1 (live odds)

In order to determine how long a specific match should be displayed in your live section: Listen to the match\_status attribute. If one of the following "final statuses" appear in Ice Hockey, consider to remove the match from the live section:

* \<match\_status id="100" description="Ended">
* \<match\_status id="110" description="AET"> "After Extratime"
* \<match\_status id="120" description="AP"> "After penalties"
* \<match\_status id="90" description="Abandoned">

Please note: If a fixture\_change message with change\_type="5" is sent, we also recommend to remove the match from your live section as the match can be considered as removed from our Live Odds program.

<details>

<summary>Excerpt from the logs of sr:match:23053813</summary>

Within Ctrl templates you can configure for pre-match when a match should be offered and based on that config, an odds\_change message is delivered followed by a fixture\_change message from product 3.\
\
Please note:\
\
match\_status=0 within the sport\_event\_status element reflects "Not started" and all possible match statuses can be fetched from:

[api.betradar.com/v1/descriptions/en/match\_status.xml](http://api.betradar.com/v1/descriptions/en/match_status.xml)

* \<match\_status id="0" description="Not started">

```xml
<odds_change product="3" event_id="sr:match:23053813" timestamp="1597213333394">
  <sport_event_status status="0" match_status="0"/>
  <odds>
    <market status="1" id="1">
      <outcome id="1" odds="1.77" probabilities="0.531381" active="1"/>
      <outcome id="2" odds="4.1" probabilities="0.218318" active="1"/>
      <outcome id="3" odds="3.65" probabilities="0.250305" active="1"/>
    </market>
  </odds>
</odds_change>
```

```xml

<fixture_change change_type="1" start_time="1597354200000" product="3" event_id="sr:match:23053813" timestamp="1597213333394"/>
```

Until the match is handed over to product 1 (LO) several odds\_change messages will be delivered as well as potentially fixture\_change messages from product 1 and/or product 3.

Please note: Fixture\_change messages from product 1 are delivered if:

* The match is added to our Live Odds program
* The match is booked from customer side
* The starting time of the fixture is changed
* The match is removed from our Live Odds program<br>

```xml
<fixture_change start_time="1597354200000" product="1" event_id="sr:match:23053813" timestamp="1597087749176"/>
```

(In the current example the first fixture\_change message for product 1 was triggered before the first fixture\_change message from product 3 was delivered)

<br>

When the goal is scored to decide the match the following sequence of messages will be delivered:

* bet\_stop message
* odds\_change messages with suspended and finally deactivated markets

```xml
<bet_stop groups="all" product="1" event_id="sr:match:23053813" timestamp="1597365272799"/>
```

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597365272872">
  <sport_event_status status="1" reporting="1" match_status="40" home_score="3" away_score="3" home_suspend="0" away_suspend="0">
    <clock match_time="67:12" remaining_time="12:48" remaining_time_in_period="12:48" stopped="false"/>
    <period_scores>
      <period_score match_status_code="1" number="1" home_score="2" away_score="0"/>
      <period_score match_status_code="2" number="2" home_score="1" away_score="3"/>
      <period_score match_status_code="3" number="3" home_score="0" away_score="0"/>
      <period_score match_status_code="40" number="4" home_score="0" away_score="0"/>
    </period_scores>
    <results>
      <result match_status_code="100" home_score="3" away_score="3"/>
    </results>
  </sport_event_status>
  <odds betstop_reason="4">
    <market favourite="1" status="-1" id="406">
      <outcome id="4" odds="1.6" probabilities="0.5843847261" active="1"/>
      <outcome id="5" odds="2.2" probabilities="0.4156152739" active="1"/>
    </market>
  </odds>
</odds_change>
```

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597365328073">
  <sport_event_status status="1" reporting="1" match_status="40" home_score="3" away_score="3" home_suspend="0" away_suspend="0">
    <clock match_time="67:12" remaining_time="12:48" remaining_time_in_period="12:48" stopped="true"/>
    <period_scores>
      <period_score match_status_code="1" number="1" home_score="2" away_score="0"/>
      <period_score match_status_code="2" number="2" home_score="1" away_score="3"/>
      <period_score match_status_code="3" number="3" home_score="0" away_score="0"/>
      <period_score match_status_code="40" number="4" home_score="0" away_score="0"/>
    </period_scores>
    <results>
      <result match_status_code="100" home_score="3" away_score="3"/>
    </results>
  </sport_event_status>
  <odds betstop_reason="4">
...
    <market favourite="1" status="0" id="406"/>
...
  </odds>
</odds_change>
```

\
Towards the end of the 3rd period all markets are getting deactivated.\
Please note: The market deactivation can be configured with the Ctrl embedded LO configuration system.

From now on a customer system need to listen the match\_status in order to determine when the match can be considered as finished.

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597363528233">
  <sport_event_status status="1" reporting="1" match_status="3" home_score="3" away_score="3" home_suspend="0" away_suspend="0">
    <clock match_time="57:01" remaining_time="2:59" remaining_time_in_period="2:59" stopped="false"/>
    <period_scores>
      <period_score match_status_code="1" number="1" home_score="2" away_score="0"/>
      <period_score match_status_code="2" number="2" home_score="1" away_score="3"/>
      <period_score match_status_code="3" number="3" home_score="0" away_score="0"/>
    </period_scores>
  </sport_event_status>
  <odds>
...
    <market favourite="1" status="0" id="1"/>
...
  </odds>
</odds_change>
```

The Live Odds offer will start again during the break between regular time and overtime (and of course all regular time related markets will be settled).

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597363777108">
  <sport_event_status status="1" reporting="1" match_status="32" home_score="3" away_score="3" home_suspend="0" away_suspend="0">
    <period_scores>
      <period_score match_status_code="1" number="1" home_score="2" away_score="0"/>
      <period_score match_status_code="2" number="2" home_score="1" away_score="3"/>
      <period_score match_status_code="3" number="3" home_score="0" away_score="0"/>
    </period_scores>
    <results>
      <result match_status_code="100" home_score="3" away_score="3"/>
    </results>
  </sport_event_status>
  <odds>
    <market favourite="1" status="1" id="406">
      <outcome id="4" odds="1.6" probabilities="0.5818597328" active="1"/>
      <outcome id="5" odds="2.2" probabilities="0.4181402672" active="1"/>
    </market>
  </odds>
</odds_change>
```

Once the overtime starts the match\_status is again adjusted to the following one:

* match\_status="40"\
  `<match_status id="40" description="Overtime">`

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597364701048">
  <sport_event_status status="1" reporting="1" match_status="40" home_score="3" away_score="3" home_suspend="0" away_suspend="0">
    <clock match_time="60:00" remaining_time="20:00" remaining_time_in_period="20:00" stopped="false"/>
    <period_scores>
      <period_score match_status_code="1" number="1" home_score="2" away_score="0"/>
      <period_score match_status_code="2" number="2" home_score="1" away_score="3"/>
      <period_score match_status_code="3" number="3" home_score="0" away_score="0"/>
      <period_score match_status_code="40" number="4" home_score="0" away_score="0"/>
    </period_scores>
    <results>
      <result match_status_code="100" home_score="3" away_score="3"/>
    </results>
  </sport_event_status>
  <odds>
    <market favourite="1" status="0" id="115" specifiers="goalnr=1" extended_specifiers="score=0:0"/>
    <market favourite="1" status="1" id="406">
      <outcome id="4" odds="1.6" probabilities="0.5818597328" active="1"/>
      <outcome id="5" odds="2.2" probabilities="0.4181402672" active="1"/>
    </market>
  </odds>
</odds_change>
```

It can be configured within the Feed Options Live (<https://config.betradar.com/feed-options>) when the so called "handover" should happen.\
\
As configured the first odds\_change message from product 1 (LO) will be delivered and on customer side the match can be taken down from the pre-match section and shall be shown on the live section from now on.

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597353342394">
  <sport_event_status status="0" match_status="0" home_suspend="0" away_suspend="0"/>
  <odds>
...
    <market favourite="1" status="1" id="1">
      <outcome id="1" odds="1.75" probabilities="0.5451603028" active="1"/>
      <outcome id="2" odds="4.2" probabilities="0.2072910005" active="1"/>
      <outcome id="3" odds="3.7" probabilities="0.2475486967" active="1"/>
    </market>
...
  </odds>
</odds_change>
```

The last odds\_change message from product 3 will be delivered directly after the first odds\_change message from product 1: This odds\_change message will indicate which markets have to be deactivated (market status=0) and which\
markets will be directly offered in LO and which as a consequence should be "handed over" to product 1 (market status=-2).&#x20;

```xml
<odds_change product="3" event_id="sr:match:23053813" timestamp="1597353343072">
  <sport_event_status status="0" match_status="0"/>
  <odds>
    <market status="-2" id="1"/>
...
    <market status="0" id="220"/>
...
  </odds>
</odds_change>
```

\| <p>From now on the following message types will/might be delivered from product 1 (LO):</p><ul><li>odds\_change</li><li>bet\_settlement: once a live market is decided</li></ul><p><br>Potentially also to be delivered in case of errors:</p><ul><li>bet\_cancel: indicates if a market should be voided for a specific timeframe</li><li>rollback\_bet\_cancel: in order to undo the message mentioned above</li><li>rollback\_bet\_settlement: in order to undo a settlement</li></ul><p><br></p><p>Once the match starts the match status will be changed accordingly in the following order:<br><br></p><ul><li><p>match\_status="1"<br></p><pre><code>\<match\_status id="0" description="Not started"> </code></pre></li><li><p>match\_status="301"<br></p><pre><code>\<match\_status id="301" description="First break"> </code></pre></li><li><p>match\_status="2"<br></p><pre><code>\<match\_status id="2" description="2nd period" period\_number="2"> </code></pre></li><li><p>match\_status="302"<br></p><pre><code>\<match\_status id="302" description="Second break"> </code></pre></li><li><p>match\_status="3"<br></p><pre><code>\<match\_status id="3" description="3rd period" period\_number="3">

| </code></pre></li></ul><p><br></p>                                                                                                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| <p><br></p><p>Even though no markets are provided anymore in the 3rd period from now on, an odds\_changes will be sent once the match status is changed.<br><br>In our example the match will go to overtime and therefore the following status is:</p><ul><li><p>match\_status="32"<br></p><pre><code>\<match\_status id="32" description="Awaiting extra time">  |
| </code></pre></li></ul><p><br>In case the match\_status 32 is sent and you have activated markets which depend on the overtime or penalty score (e.g. "Winner (incl. overtime and penalties)", we recommend to keep the match still in your live section in order to continue with the Live Odds offer and to keep punters up to date in regards of the score.</p> |

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597363765838">
  <sport_event_status status="1" reporting="1" match_status="32" home_score="3" away_score="3" home_suspend="0" away_suspend="0">
    <period_scores>
      <period_score match_status_code="1" number="1" home_score="2" away_score="0"/>
      <period_score match_status_code="2" number="2" home_score="1" away_score="3"/>
      <period_score match_status_code="3" number="3" home_score="0" away_score="0"/>
    </period_scores>
  </sport_event_status>
</odds_change>
```

*Side note:*\
\
\&#xNAN;*If a match would end after regular time an odds\_change message is delivered with match\_status="100". This status can be considered as a "final status" and as a consequence the match should be taken off the live section.*\
\
\&#xNAN;*The final score is indicated in the home\_score and away\_score attributes as well as period scores are provided.*<br>

* *match\_status="100"*<br>

  ```
  <match_status id="100" description="Ended">
  ```

</details>

Before the final bet\_settlement messages will be sent for product 1 and 3, odds\_change messages will be delivered in order to indicate again the status change and to provide the final score.

Final match\_status="110"

`<match_status id="110" description="AET">`

```xml
<odds_change product="1" event_id="sr:match:23053813" timestamp="1597365374422">
  <sport_event_status status="3" match_status="110" home_score="4" away_score="3" home_suspend="0" away_suspend="0">
    <period_scores>
      <period_score match_status_code="1" number="1" home_score="2" away_score="0"/>
      <period_score match_status_code="2" number="2" home_score="1" away_score="3"/>
      <period_score match_status_code="3" number="3" home_score="0" away_score="0"/>
      <period_score match_status_code="40" number="4" home_score="1" away_score="0"/>
    </period_scores>
    <results>
      <result match_status_code="100" home_score="3" away_score="3"/>
      <result match_status_code="110" home_score="4" away_score="3"/>
    </results>
  </sport_event_status>
</odds_change>
```

<br>
