
The Copy Bet functionality allows you to implement betslip copying for your users. While the backend handles the core count logic, you have complete control over what happens when a user clicks the button. This is managed through the onAction callback.
To enable the Copy Bet Button within your Virtual Stadium widget, set the enableCopyBetButton property to true during widget initialization:
enableCopyBetButton boolean optional
Enables the Copy Bet Button functionality.
Enable Copy Bet Button:
SIR('addWidget', '#sr-vs-widget', 'virtualStadium', {
enableCopyBetButton: true,
// ... other configuration
});When a user clicks on a copy bet button, an action is triggered. This action invokes the onAction callback and returns the following data structure:
onAction (type: string, data: object) => void optional
Callback function triggered when specific events occur in the widget.
Parameters:
type string required
Action type: "CopyBet".
data object required
Action data containing bet information.
data.betslip BetSlip required
The complete betslip data to be copied.
Handling Copy Bet Actions:
function onAction(type, data) {
switch (type) {
case 'CopyBet': {
// Transform the data as needed
console.log('Copied BetSlip:', data);
// Additional logic here
break;
}
default: {
console.log('Unhandled action type:', type);
}
}
}
SIR('addWidget', '#sr-vs-widget', 'virtualStadium', {
copyBetButton: true,
onAction: onAction,
// ... other configuration
});Representation of a betting ticket that contains one or more individual bets. Users can share these tickets in chat, allowing others to copy and place the same bets.
A ticket containing one individual bet on a single market.

id string required
Unique identifier for the ticket.
betSlipId string optional
Client-specific identifier for matching to existing bet slips.
betType string optional
Type of bet slip. Possible values: "single" for a single bet on one market, "multi" for a multi-bet across different events, "sameGameMulti" for multiple bets on the same event (also known as a bet builder).
currency string optional
Currency code (e.g., "USD", "EUR").
combinedOdds Odds optional
Combined odds for the entire bet slip.
stake object optional
The amount of money wagered on the bet slip.
payout object optional
Potential payout amount for the bet slip.
bets Bet[] required
Array of individual bets within the bet slip.
id string required
Unique identifier for the individual bet.
betType string optional
Type of the individual bet.
event Event optional
Event information including teams, date, and venue. See Event object for details.
markets Market[] optional
Array of markets for this bet. See Market object for details.
odds Odds optional
Odds for this individual bet. See Odds object for details.
Single Bet Example:
{
"id": "sr:bet-share-event:single",
"betSlipId": "sr:bet-share-event:single",
"betType": "single",
"currency": "USD",
"combinedOdds": {
"decimalValue": 2.55,
"displayValue": "2.55"
},
"stake": {
"value": "50.00"
},
"payout": {
"value": "127.50"
},
"bets": [
{
"id": "bet-123",
"betType": "single",
"event": {
"id": "event-456",
"name": "Manchester United vs Liverpool",
"date": "2024-01-15T15:00:00Z",
"isLive": false,
"teams": [
{ "name": "Manchester United" },
{ "name": "Liverpool" }
]
},
"markets": [
{
"id": "market-789",
"name": "Total Goals",
"outcomes": [
{
"id": "outcome-101",
"name": "Under 2.5",
"odds": "1.85"
}
]
}
],
"odds": {
"decimalValue": 1.85,
"displayValue": "1.85"
}
}
]
}The Odds represents odds information for markets and bets.
decimalValue number optional
Numeric EU representation of odds (decimal number) displayed on market outcome.
displayValue string optional
String representation of odds displayed on UI as is, meaning NO FORMATTING.
Odds Example:
{
"decimalValue": 2.55,
"displayValue": "2.55"
}Represents a single sporting event (e.g., match, race, or stage).
id string required
Unique identifier for the event. This must match the event IDs used in your bet data.
srEventId string | number optional
Sportradar event identifier.
externalId string | number optional
Your external system identifier for the event.
date string optional
Scheduled date and time of the event as will be displayed.
sport Sport optional
Sport information. See Sport object for details.
category Category optional
Geographical or organizational grouping for sports events. (e.g., country or region). See Category object for details.
tournament Tournament optional
Tournament or competition information. See Tournament object for details.
name string optional
Display name of the event. If not provided, it will be generated from team names.
teams [Team, Team] optional
The home team followed by the away team. See Team object for details.
isLive boolean optional
Whether the event is currently live.
liveCurrentTime string | number optional
Current time in the live event, displayed as text (e.g., '1st Quarter').
result1 Result optional
Primary result information. For soccer, this represents the full-time score (e.g., home and away goals). For basketball, this is the final score. For tennis, this is the final set scores.
result2 Result optional
Secondary result information. For soccer, this represents the half-time score. For basketball, this is the score at the end of the first half. For tennis, this is the current set score.
result3 Result optional
Tertiary result information. For soccer, this may represent extra-time score if applicable. For basketball, this is the score at the end of the third quarter. For tennis, this is the previous set score.
Event Example:
{
"id": "sr:event:98765",
"srEventId": "sr:match:123456",
"externalId": "ext-789",
"date": "2024-01-15T15:00:00Z",
"sport": {
"id": "sr:sport:1",
"name": "Football",
"icon": "https://example.com/football-icon.png"
},
"category": {
"id": "sr:category:1",
"name": "England",
"cc": {
"a2": "EN"
}
},
"tournament": {
"id": "sr:tournament:1",
"name": "Premier League"
},
"name": "Manchester United vs Liverpool",
"teams": [
{
"id": "sr:team:42",
"name": "Manchester United"
},
{
"id": "sr:team:43",
"name": "Liverpool"
}
],
"isLive": false
}The Market object represents a betting market within individual bets.
id string | number required
Unique identifier for the market.
externalId string | number optional
Your external system identifier for the market.
status MarketStatus optional
Current status of the market. See MarketStatus object for details.
name string required
Display name of the market.
specifier object optional
The specifier object defines the specific parameters or conditions for the market in the Unified Odds Feed (UOF), such as the threshold value in over/under markets (e.g., "2.5" for Over/Under 2.5 Goals). For more information see UOF documentation.
outcomes Outcome[] required
Array of possible outcomes for this market. See Outcome object for details.
srMarket SRMarket optional
Sportradar representation of the Market object. See Market object for details.
odds Odds optional
Sportradar representation of the Odds object. See Odds object for details.
Market Example:
{
"id": "market-789",
"externalId": "ext-market-789",
"status": "active",
"name": "Total Goals",
"specifier": {
"total": "2.5"
},
"outcomes": [
{
"id": "outcome-101",
"name": "Under 2.5",
"odds": "1.85"
}
],
"srMarket": {
"id": "sr:market:789",
"specifiers": "total=2.5"
},
"odds": {
"decimalValue": 1.85,
"displayValue": "1.85"
}
}Sportradar representation of the Market object. See Market object for details.
id string required
Unique Sportradar identifier for the market.
specifiers string optional
Additional specifiers for the market (e.g., specific conditions or parameters).
SRMarket Example:
{
"id": "sr:market:789",
"specifiers": "total=2.5"
}The Sport object represents a sporting discipline or category.
id string optional
The unique SR identifier.
name string optional
The name of the sport.
icon string optional
URL where icon is located.
Sport Example:
{
"id": "sr:sport:1",
"name": "Football",
"icon": "https://example.com/football-icon.png"
}The Category object represents a geographical or organizational grouping for sports events.
id string optional
The unique identifier assigned to the category.
name string optional
The name of the category.
cc object optional
Country code object with a2 property containing ISO 3166-1-alpha-2 country codes. Supports both uppercase and lowercase variants of all standard ISO codes plus non-standard codes for UK countries. Supported values include:
Standard ISO 3166-1-alpha-2 codes: AF, AX, AL, DZ, AS, AD, AO, AI, AQ, AG, AR, AM, AW, AU, AT, AZ, BS, BH, BD, BB, BY, BE, BZ, BJ, BM, BT, BO, BQ, BA, BW, BV, BR, IO, BN, BG, BF, BI, KH, CM, CA, CV, KY, CF, TD, CL, CN, CX, CC, CO, KM, CG, CD, CK, CR, CI, HR, CU, CW, CY, CZ, DK, DJ, DM, DO, EC, EG, SV, GQ, ER, EE, ET, FK, FO, FJ, FI, FR, GF, PF, TF, GA, GM, GE, DE, GH, GI, GR, GL, GD, GP, GU, GT, GG, GN, GW, GY, HT, HM, VA, HN, HK, HU, IS, IN, ID, IR, IQ, IE, IM, IL, IT, JM, JP, JE, JO, KZ, KE, KI, KR, KP, KW, KG, LA, LV, LB, LS, LR, LY, LI, LT, LU, MO, MK, MG, MW, MY, MV, ML, MT, MH, MQ, MR, MU, YT, MX, FM, MD, MC, MN, ME, MS, MA, MZ, MM, NA, NR, NP, NL, NC, NZ, NI, NE, NG, NU, NF, MP, NO, OM, PK, PW, PS, PA, PG, PY, PE, PH, PN, PL, PT, PR, QA, RE, RO, RU, RW, BL, SH, KN, LC, MF, PM, VC, WS, SM, ST, SA, SN, RS, SC, SL, SG, SX, SK, SI, SB, SO, ZA, GS, SS, ES, LK, SD, SR, SJ, SZ, SE, CH, SY, TW, TJ, TZ, TH, TL, TG, TK, TO, TT, TN, TR, TM, TC, TV, UG, UA, AE, GB, US, UM, UY, UZ, VU, VE, VN, VG, VI, WF, EH, YE, ZM, ZW
Non-standard codes: GB-ENG, GB-NIR, GB-SCT, GB-WLS
Category Example:
{
"id": "sr:category:1",
"name": "England",
"cc": {
"a2": "EN"
}
}The Tournament object represents a competition or league.
id string optional
The unique identifier assigned to the tournament.
externalId string | number optional
Your unique identifier for the tournament.
name string optional
The name of the tournament.
Tournament Example:
{
"id": "sr:tournament:1",
"name": "Premier League"
}The Team object represents a sports team or competitor.
id string optional
The unique SR identifier assigned to the team.
name string required
The name of the team.
Team Example:
{
"id": "sr:team:42",
"name": "Manchester United"
}The Result object represents the score or outcome of an event.
result Array<number | string> required
The result of the event.
label string optional
Optional label for the result.
Result Example:
{
"result": [2, 1],
"label": "Final Score"
}The Outcome object represents a possible result or selection within a market.
id string | number required
Unique identifier for the outcome.
externalId string | number optional
Your external system identifier for the outcome.
name string optional
Display name of the outcome.
odds number | string optional
Odds for this outcome.
oddsDecimal number optional
Decimal representation of odds for displaying odds change indicator.
competitor string optional
A competitor associated with the outcome.
status OutcomeStatus optional
Current status of the outcome. See OutcomeStatus object for details.
isSelected boolean optional
Whether the outcome is currently selected.
srOutcomeId string optional
Sportradar outcome identifier.
isRecommended boolean optional
Whether the outcome is recommended.
Outcome Example:
{
"id": "outcome-101",
"name": "Under 2.5",
"odds": "1.85",
"oddsDecimal": 1.85,
"status": {
"isActive": true
},
"isSelected": false,
"isRecommended": true
}The OutcomeStatus object represents the status of an outcome.
isActive boolean required
Whether the outcome is currently active and available for betting.
OutcomeStatus Example:
{
"isActive": true
}