Bet placement async
NOTE:
A full list of supported bet types with examples is available here.
IMPORTANT:
The ticketId supplied on each request must be unique. This is used for idempotency checks to ensure that the customers account is only debited once if the request is sent multiple times, which could happen due to network issues. In such an event, no bet will be placed as a result of the duplicate request, but the response will be the same as the original request with the exception of the
Idempotentfield; which can be used to identify that the request was considered a duplicate.Similarly, each betId should be unique for the customer, if a ticket contains a betId that is not unique for the customer; the entire ticket will be rejected.
From the response above, we can see the ProductId is 97f60c59-5540-4fd4-8863-52b80c0d9e89 and that it is a Win product. There is one leg, with an Id of 5ff0aae6-29a1-4f6a-98c0-190b06aa1300, and there are 5 selections to pick from.
If we wanted to place a £1.50 bet on "Miss Dolly Rocker", which has the Id 51f45b63-55ea-4550-bdcf-bfa7827dc1c2 and £2.00 on "The Famous Mrs B", which has the Id "0d35f4ab-e618-44bf-9d80-d6d40ab3e540". We would send the following request.
mutation PlaceBetsAsync {
placeBetsAsync(
input: {
ticketId: "ticket-42acb0ae-5e1c-4d48-b412-644c9c4a56a0"
bets: [
{
betId: "bet-win-42acb0ae-5e1c-4d48-b412-644c9c4a56a0"
productId: "97f60c59-5540-4fd4-8863-52b80c0d9e89"
stake: { currencyCode: GBP, totalAmount: 1.50 }
legs: [
{
productLegId: "5ff0aae6-29a1-4f6a-98c0-190b06aa1300"
selections: [{ productLegSelectionID: "51f45b63-55ea-4550-bdcf-bfa7827dc1c2" }]
}
]
},
{
betId: "bet-win-44af934d-6823-4fd7-9a39-11edd4be3ccf"
productId: "97f60c59-5540-4fd4-8863-52b80c0d9e89"
stake: { currencyCode: GBP, totalAmount: 2.00 }
legs: [
{
productLegId: "5ff0aae6-29a1-4f6a-98c0-190b06aa1300"
selections: [{ productLegSelectionID: "0d35f4ab-e618-44bf-9d80-d6d40ab3e540" }]
}
]
}
]
}
) {
ticket {
id
toteId
bets {
nodes {
id
toteId
placement {
status
}
}
}
idempotent
}
}
}
{
"data": {
"placeBets": {
"ticket": {
"id": "ticket-42acb0ae-5e1c-4d48-b412-644c9c4a56a0",
"toteId": "6ff21d98-1e0c-453f-8b66-3cd301d3e529",
"bets": {
"nodes": [
{
"id": "bet-win-42acb0ae-5e1c-4d48-b412-644c9c4a56a0",
"toteId": "8779011e10f4462988f6b9b5364e9a00",
"placement": {
"status": "PLACED"
}
},
{
"id": "bet-win-44af934d-6823-4fd7-9a39-11edd4be3ccf",
"toteId": "dde8b00ed0c340a9b445f00f705299be",
"placement": {
"status": "PLACED"
}
}
]
},
"idempotent": false
}
}
}
}