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

Places a single bet

POST
/bet/single
Places a single bet. When placing a single bet using live inplay bets, the system might generate a bet delay to allow a time margin to negate the effects of major changes (for example, goals) to the market. Note that the amount of bet delay will vary by category and event type. A delayedBetId will be recieved that can be used to resubmit the bet.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://sandbox.whapi.com/v2/bets/bet/single' \
--header 'apiKey;' \
--header 'apiSecret;' \
--header 'apiTicket;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "delayedBetId": "string",
    "freeBetId": "string",
    "priceDen": 0,
    "priceNum": 0,
    "priceType": "string",
    "selectionId": "string",
    "stake": 0,
    "type": "string"
}'
Response Response Example
200 - response
{
 "placedBets" : [
 {
 "id" : 51097,
 "receipt" : "O/0013333/0000109/F", 
 "numLines" : 1, 
 "totalStake" : 2.50, 
 "placedDateTime" : "2015-12-12T00:11:00"
 }
 ]
}

Request

Query Params
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)
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
Body Params application/json
delayedBetId
string 
optional
The delayed bet identifier
freeBetId
string 
optional
The ID number of the free bet token if used in conjunction with this bet
priceDen
integer 
optional
When the odds are shown in vulgar fractions this is the denominator of the fraction. For example: 2 in 5/2
priceNum
integer 
optional
When the odds are shown in vulgar fractions this is the numerator of the fraction. For example: 5 in 5/2
priceType
string 
required
The type of price taken by the customer when the bet is made. Can be one of the following: L - Live Fixed price, S - Starting price - Horse and Greyhound racing or G - Guaranteed best price.
Match pattern:
^(L|S|G)$
selectionId
string 
required
The unique ID for the selection of the bet
Match pattern:
^(OB_OU\d+)$
stake
number <double>
required
The amount of the stake placed on the bet
type
string 
required
The type of bet placed. Can be one of the following: W - Win or E- EachWay
Match pattern:
^(W|E)$
Examples

Responses

🟢200Success
application/json
Body
array of:
id
string 
optional
The bet id
numLines
integer 
optional
The number of lines the bet consists of
number
number 
optional
Number of the bet if this is part of a multiple bet
placedDateTime
string 
optional
The time the bet was placed. For example: 2013-01-30TT13:34:20. The value of this element can be replaced with the current timestamp if it was missing.
receipt
string 
required
The unique ID of the bet receipt
totalStake
number <double>
optional
The total amount staked on the bet
🟢202Delayed
🟠400Errors
Modified at 2023-08-16 06:51:28
Previous
Places a multiple or a complex bet.
Next
/betslips
Built with