Messages
The following are examples of JSON messages that can be received from web socket. We currently only send messages as JSON.
Messages include an header called x-message-type, matching the type of messaged received. This can be helpful if using tools to deserialize the message payload for processing within the receiving application
Bet¶
Placement¶
After a bet is sent to the API, it can be either Accepted, Rejected or Fail to be placed due to a system error.
BetAccepted¶
{
"MessageType": "BetAccepted",
"BetId": "f8dd4ab924fa4ab19acf8f37f176f3d0",
"CustomerBetId": "customer-bet-1"
}
BetRejected¶
{
"MessageType": "BetRejected",
"BetId": "2c14a75b0f8c483197cbdf37910ccd03",
"CustomerBetId": "customer-bet-1",
"Reason": "Product was not open"
}
BetFailed¶
{
"MessageType": "BetFailed",
"BetId": "af0fc513a53d4cc7acc3e00416abf056",
"CustomerBetId": "customer-bet-1",
"Reason": "Product was not open"
}
Settlement¶
Once a bet is successful placed, then can be resulted as win/loss with a return amount, then settled to indicate it has been paid out. A bet could also be cancelled.
BetCancelled¶
BetResulted¶
BetSettled¶
Product¶
ProductStatusChanged¶
When a products changes between its status such as open, closed, settled
{
"MessageType": "ProductStatusChanged",
"ProductId": "0b315e3d-3e0b-4c76-9f9e-762555aad6bb",
"Status": "CLOSED"
}
SelectionStatusChanged¶
{
"MessageType": "SelectionStatusChanged",
"LegId": "37f298fb-2913-4dde-b167-8e4c15438173",
"SelectionId": "a5d1e23b-0520-401a-bcac-1e325277919e",
"ProductId": "0b315e3d-3e0b-4c76-9f9e-762555aad6bb",
"Status": "Active"
}
Pool¶
Pool specific messages such as when the total is changed, or dividends are declared or updated.
PoolTotalChanged¶
{
"MessageType": "PoolTotalChanged",
"ProductId": "c2edd582-ce72-4178-a511-377a4837d122",
"IsFinalized": false,
"Total": {
"GrossAmounts": [
{
"DecimalAmount": 6645.4,
"Currency": {
"Code": "GBP"
}
}
],
"NetAmounts": [
{
"DecimalAmount": 4917.6,
"Currency": {
"Code": "GBP"
}
}
]
},
"Guarantee": {
"GrossAmounts": [
{
"DecimalAmount": 0,
"Currency": {
"Code": "GBP"
}
}
],
"NetAmounts": [
{
"DecimalAmount": 0,
"Currency": {
"Code": "GBP"
}
}
]
},
"CarryIn": {
"GrossAmounts": [
{
"DecimalAmount": 0,
"Currency": {
"Code": "GBP"
}
}
],
"NetAmounts": [
{
"DecimalAmount": 0,
"Currency": {
"Code": "GBP"
}
}
]
},
"Funds": []
}
PoolDividendChanged¶
{
"MessageType": "PoolDividendChanged",
"ProductId": "137e68f7-2536-46cd-b578-2f35c976dc20",
"Dividends": [
{
"Dividend": {
"Name": "Base",
"Type": 1,
"Status": 1,
"Amounts": [
{
"DecimalAmount": 17.5,
"Currency": {
"Code": "GBP"
}
}
]
},
"Legs": [
{
"LegId": "e2ffb3b6-67d3-4147-b056-6a19ae0c6526",
"Selections": [
{
"Id": "5db02c74-9f91-42ad-9920-500146df96e3",
"FinishingPosition": null
}
]
}
]
}
]
}
Event¶
When an event status or result changes.
EventResultChanged¶
{
"MessageType": "EventResultChanged",
"EventId": "HORSERACING-NEWCASTLE-GB-2024-01-02-1545",
"CompetitorResults": [
{
"CompetitorId": "HORSERACING-NEWCASTLE-GB-2024-01-02-1545-BRUNELLO-BREEZE",
"FinishingPosition": "1",
"Status": "Final"
}
]
}
EventStatusChanged¶
{
"MessageType": "EventStatusChanged",
"EventId": "HORSERACING-NEWCASTLE-GB-2024-01-02-1545",
"Status": "Finished"
}