max_stake
Goal: Call max-stake with a nested ticket and receive the sandbox max cash stake. One module covers both regular UF and accumulator nested shapes.
Sandbox module name: max_stake (also case dir max_stake_accumulator for the accumulator golden).
Java example — regular UF
import com.sportradar.mbs.sdk.entities.channel.Channel;
import com.sportradar.mbs.sdk.entities.common.Bet;
import com.sportradar.mbs.sdk.entities.common.TicketContext;
import com.sportradar.mbs.sdk.entities.odds.Odds;
import com.sportradar.mbs.sdk.entities.request.MaxStakeRequest;
import com.sportradar.mbs.sdk.entities.request.TicketRequest;
import com.sportradar.mbs.sdk.entities.response.MaxStakeResponse;
import com.sportradar.mbs.sdk.entities.selection.Selection;
import com.sportradar.mbs.sdk.entities.stake.Stake;
import java.math.BigDecimal;
MaxStakeRequest request = MaxStakeRequest.newBuilder()
.setTicket(TicketRequest.newBuilder()
.setTicketId("tid-ms")
.setContext(TicketContext.newBuilder()
.setLimitId(123L)
.setChannel(Channel.newMobileChannelBuilder()
.setLang("en")
.setIp("127.0.0.1")
.setDeviceId("deviceId123")
.build())
// omit endCustomer
.build())
.setBets(Bet.newBuilder()
.setBetId("bet-1")
.setSelections(Selection.newUfSelectionBuilder()
.setProductId("3")
.setEventId("sr:match:15050881")
.setMarketId("m1")
.setOutcomeId("o1")
.setOdds(Odds.newDecimalOddsBuilder()
.setValue(new BigDecimal("2.0"))
.build())
.build())
.setStake(Stake.newCashStakeBuilder()
.setAmount(new BigDecimal("10"))
.setCurrency("EUR")
.build())
.build())
.build())
.build();
MaxStakeResponse response = mbsSdk.getTicketProtocol().sendMaxStake(request);
// expect: getMessage() == "accepted", first cash stake amount "2872885"Java example — accumulator nested
Wire JSON — regular
Wire JSON — accumulator
Top-level selection "type": "accumulator" with nested UF legs; first leg eventId "sr:match:15050881". Envelope operation / content.type remain "max-stake".
operatorId
9985
Mandatory
integer
Yes
operation
"max-stake"
Mandatory
string
No
content.type
"max-stake"
Mandatory
string
No
content.ticket.context.limitId
123
Mandatory
integer
Yes
content.ticket.context.channel.type
"mobile"
Mandatory
string
Yes
content.ticket.context.endCustomer
(omit)
Optional — omit for this scenario
object
—
content.ticket.bets[].selections[].type
"uf" or "accumulator"
Mandatory
string
No (routing)
content.ticket.bets[].selections[].eventId (UF) / first nested leg
"sr:match:15050881"
Mandatory (sandbox)
string
No (routing)
Stake amount on request
any
Mandatory
string
Yes
Expected responses
Nested shape
getMessage()
Max cash stake (getBets()[0] cash amount)
Regular UF
"accepted"
"2872885" EUR
Accumulator
"accepted;selectionType=accumulator"
"1950000" EUR
Wire JSON example (regular; content type "max-stake-reply"):
Accumulator reply uses the same shape with "message": "accepted;selectionType=accumulator" and "amount": "1950000".
Common mistakes
Wrong / missing eventId (not sr:match:15050881)
Fallback -999 on max-stake-reply
Setting a placement customer id
Ignored for max-stake routing (empty punter facet); still ok if present
Multi-bet nested ticket
Schema / single-bet validation error (not -999)
Expecting placement-style ticket-reply
Reply content type is "max-stake-reply"
See also: Error responses in the parent manual.
Was this helpful?