Best Practice

Displaying a match in your pre-match & live section

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.

Excerpt from the logs of sr:match:23053813

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

  • <match_status id="0" description="Not started">

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


<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

<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)

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

<bet_stop groups="all" product="1" event_id="sr:match:23053813" timestamp="1597365272799"/>
<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>

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

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

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

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

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

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

From now on the following message types will/might be delivered from product 1 (LO):

  • odds_change

  • bet_settlement: once a live market is decided

Potentially also to be delivered in case of errors:

  • bet_cancel: indicates if a market should be voided for a specific timeframe

  • rollback_bet_cancel: in order to undo the message mentioned above

  • rollback_bet_settlement: in order to undo a settlement

Once the match starts the match status will be changed accordingly in the following order:

  • match_status="1"

    <match_status id="0" description="Not started">
  • match_status="301"

    <match_status id="301" description="First break">
  • match_status="2"

    <match_status id="2" description="2nd period" period_number="2">
  • match_status="302"

    <match_status id="302" description="Second break">
  • match_status="3"

    <match_status id="3" description="3rd period" period_number="3">

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. In our example the match will go to overtime and therefore the following status is:

  • match_status="32"

    <match_status id="32" description="Awaiting extra time">

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.

<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: 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. The final score is indicated in the home_score and away_score attributes as well as period scores are provided.

  • match_status="100"

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

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

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

Last updated

Was this helpful?