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

/betslips

POST
/betslips
Organises the betslip when one or more selections are made. It returns a bet slip structure organised by betting opportunities.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://sandbox.whapi.com/v2/bets/betslips' \
--header 'apiKey;' \
--header 'apiSecret;' \
--header 'Content-Type: application/json' \
--data-raw '{
    "legs": [
        {
            "parts": [
                {
                    "includeInMultiple": true,
                    "priceDen": 0,
                    "priceNum": 0,
                    "priceType": 0,
                    "selectionId": 0
                }
            ],
            "sort": "string",
            "type": "string"
        }
    ]
}'
Response Response Example
{
 "betslip" : [
 {
 number: 1, 
 numLines: 1
 ...
 }
 ]
}

Request

Query Params
expanded
string 
optional
Allows for all bets for given selections to be returned - not just the specified type
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.
Body Params application/json
legs
array[object (leg) {3}] 
optional
parts
array[object (part) {5}] 
required
sort
string 
optional
The leg sort. This element is present for complex bets but not for single bets.
type
string 
required
The leg type. One of the following values: W - Win or E- Each-way. Even though the priceNum and priceDen are required for the bets with type value W (win), it is just optional from the endpoint point of view. There are requests / bets like outcomes with starting price but do not have a specific price. Generally prices can change, so if the type is win you have to resubmit and thus verify the price that the customer saw on the screen initially. The API will check if it matches the current price of William Hill. Note that if you send a wrong / outdated price you will receive the error message - Price changed.
Examples

Responses

🟢200Success
application/json
Body
betslip
array[object (betslipbet) {9}] 
optional
betMultiplier
number 
optional
The total aggregated odds, as a decimal, of the multiple bet placed
freeBets
array[object (freeBetDetail) {9}] 
optional
Free bets that can be used with this bet
legs
array[object (betslipleg) {3}] 
required
maxStake
number <double>
optional
Maximum stake allowable on the bet. For example: 2500.00 (GBP)
minStake
number <double>
optional
Minumum stake allowable on the bet. For example: 0.05 (GBP)
numLines
number 
optional
The number of lines (selections) of a bet
number
integer 
required
The bet number
typeCode
string 
required
The bet type code of the bet. For example: TBL (Treble)
typeName
string 
optional
The TypeCode of the bet. For example: TBL (Treble)
Modified at 2023-08-16 06:51:28
Previous
Places a single bet
Next
Returns available free bets
Built with