On Add to bet slip, Bet Finder fires one onAction with every addable leg of the multi. Treat the list as a single accumulator, not as separate singles. After the action, the widget returns to the setup screen.
After receiving the payload, re-validate availability and take authoritative odds from your platform before accepting the bet. See Handling Selections and Odds.
{
type: 'AddSelectionsToBetSlip',
data: {
selections: [
{
type: 'uf',
event: 'sr:match:12345678',
market: '18',
specifiers: 'total=2.5',
outcome: '12',
odds: { type: 'decimal', value: '2.10' }
}
// one object per addable leg
],
markets: [ /* adapter Market objects, same order as selections */ ],
events: [ /* adapter Event objects, same order as selections, when available */ ]
}
}| Field | Meaning |
|---|---|
selections | UOF identifiers plus the decimal odds last shown in the widget. specifiers is present for line markets (totals, handicaps), odds when a price was available. Map these onto your bet slip. |
markets | The adapter market objects for the same legs, in the same order. Use externalMetadata on these if you stored native IDs there. |
events | The adapter event objects for the same legs, in the same order. Sent only when the event details of every leg were loaded. If any are missing, the field is omitted. |
Stake is not part of the action. The widget uses stake only to show expected payout; your bet slip applies its own stake.
Legs that cannot be placed (suspended, or with an inactive market or outcome) are left out. If any were left out, the widget tells the punter. Legs already on the bet slip (reported through betSlipSelection) are not added again.
Implement the adapter's betSlipSelection endpoint so legs reflect the current bet slip. Store the callback, push { selection: … } whenever the bet slip changes, and return an unsubscribe function.
let betslipCallback;
let betslipState = [];
SIR('registerAdapter', '{ADAPTER_NAME}', {
config: {},
endpoints: {
betSlipSelection: (args, callback
Summary:
betSlipSelection – The widget subscribes on mount. Call callback(undefined, { selection }) with the current list and return a cleanup function.onAction – On AddSelectionsToBetSlip, append event.data.selections to your bet slip, then notify the stored callback so legs already on the slip stay marked.For widget properties and adapter endpoints, see Bet Finder. For styling, see Theming customization.