Bets API
  1. Bets
Bets API
  • Bets
    • Places a multiple or a complex bet.
      POST
    • Places a single bet
      POST
    • /betslips
      POST
    • Returns available free bets
      GET
    • Retrieves the customer’s bet history.
      GET
    • Allows a trusted application to cash in a bet (take a return on a bet) on behalf of the customer
      PUT
  1. Bets

Retrieves the customer’s bet history.

GET
/history
Retrieves the customer’s bet history. Options are available to organise the history in terms of date, bet type and settled and unsettled bets. The maximum number of bets and bet history pages retrieved can also be set.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request GET 'https://sandbox.whapi.com/v2/bets/history?dateFrom=&dateTo=' \
--header 'apiKey;' \
--header 'apiSecret;' \
--header 'apiTicket;'
Response Response Example
200 - response
{
 bets:
 [
 {
 id:"797",
 typeCode:"SGL",
 typeName:"Single",
 transDateTime:"2016-01-05 14:27:58",
 settled:false,
 stake:0.12,
 status:"N",
 winnings:0.26,
 estimatedReturns:0.26
 },
 {
 id:"798",
 typeCode:"SGL",
 typeName:"Single",
 transDateTime:"2016-01-05 15:27:58",
 numLines:5,
 numSelections:5,
 receipt:"O/0001370/0000132/F",
 settled:false,
 stake:0.13,
 cashinValue:0.12,
 stakePerLine:0.13,
 status:"A",
 winnings:0.26,
 estimatedReturns:0.26,
 freeBetValue:0.00,
 legs: 
 [
 {
 type:"W",
 number:1,
 parts:
 [
 {
 number:1,
 description:"Swansea",
 eventId:"OB_EV3966",
 eventDescription:"Swansea Vs Sunderland",
 priceDen:1,
 priceNum:1,
 priceType:"L",
 result:"-",
 startDateTime:"2016-01-07 20:00:00"
 },
 {
 number:1,
 description:"Swansea",
 eachWayNum:1,
 eachWayDen:1,
 eachWayPlaces:1
 eventId:"OB_EV3966",
 eventDescription:"Swansea Vs Sunderland",
 eventMarketDescription:"90 Minutes",
 eventTypeDescription:"Manchester Senior Cup",
 handicap:0.1,
 selectionId:"OB_OU00001",
 priceDen:1,
 priceNum:1,
 priceType:"L",
 result:"-",
 startDateTime:"2016-01-07 20:00:00",
 rule4Deductions:0.1,
 priceFormatted:
 {
 fractional:"EVS",
 decimal:2,
 american:"+100"
 } 
 }
 ]
 }
 ]
 }
 ]
}

Request

Query Params
dateFrom
string 
required
The UTC FROM datetime from bets to be returned. (yyyy-MM-ddTHH:mm:ss)
dateTo
string 
required
The UTC TO datetime for bets to be returned. (yyyy-MM-ddTHH:mm:ss)
fields
array[string]
optional
Specify an absolute field list to return (Comma Separated List)
include
array[string]
optional
Specify fields in addition to the default to return (Comma Separated List)
exclude
array[string]
optional
Specify fields from the default to exclude (Comma Separated List)
page
number 
optional
The index of the page to return
pageSize
number 
optional
The number of results per page
sort
string 
optional
The order the response will be retuned by. i.e. transDateTime,desc. Only transDateTime can be used currently
settled
string 
optional
Filter by settled bets. If omitted, both settled and unsettled will be returned.
Header Params
apiKey
string 
required
A unique identifier of your application that is generated by the API portal.
apiSecret
string 
required
Another unique identifier for your application.
apiTicket
string 
required
The ticket obtained from the sessions API

Responses

🟢200Success
application/json
Body
bets
array[object (placedBet) {16}] 
optional
cashinValue
number <double>
optional
The cash in value of the bet. For example £0.88. When no value is given or no value is present, no cash in is available
estimatedReturns
number <double>
required
The estimated value of the returns if the bet is successful. Note: when an estimated return isn’t available, as in the case of a bet placed on a horse at SP (starting price) where the actual price is unknown when the bet is placed, ‘NOT_AVAILABLE’ will appear in the response field.
freeBetValue
number <double>
optional
If a free bet token is used for the bet, this element represents the value
id
string 
required
The unique identifier of the bet
legs
array[object (placedBetLeg) {4}] 
optional
numLines
integer 
optional
Number of lines of bets
numSelections
integer 
optional
Number of selections that the bet is made of
receipt
string 
optional
The unique identifier of the receipt for the bet
settled
boolean 
required
Whether the bet is settled
stake
number <double>
required
The bet stake, which represents the total value of the bet. For example: £ 12.34
stakePerLine
number <double>
optional
The individual stake on each line of the bet. For example: £ 6.17
status
string 
required
The status of the bet. Can be one of the following: A - Active, S - suspended, C - Cashed Out
transDateTime
string 
required
The time the bet was placed
typeCode
string 
required
The bet type code of the bet. For example: TBL (Treble)
typeName
string 
required
The name of the bet type. For example: Double
winnings
number <double>
required
Actual value of the returns from this bet
🟠404Error
Modified at 2023-08-16 06:51:28
Previous
Returns available free bets
Next
Allows a trusted application to cash in a bet (take a return on a bet) on behalf of the customer
Built with