The Bets API methods are used to place single, multiple and complex bets and to retrieve a customer’s bet history. When retrieving a customer’s bet history you can organize the bets from the betting history in terms of date, bet type and whether the bet is settled or not. The Bets API will also generate a bet delay if you’re placing a single/multiple bet in-Play by creating a time margin to negate the effects of major changes to the market (for example goals during a football match). It is used in conjunction with the Betslips API.
Number of selections | Ordered? | Number of place bets in total | Number of legs | Number of parts | |
---|---|---|---|---|---|
Straight forecast (SF) | 2 | yes | 1 | 1 | 2 |
Reverse forecast (RF) | 2 | no | 2 | 1 | 2 |
Combination forecast (CF) | more than 2 | no | more than 6 | 3 | more than 3 |
Straight tricast (ST) | 3 | yes | 1 | 1 | 3 |
Combination (reverse) tricast (CT) | more than 2 | no | more than 6 | 1 | more than 3 |
Method | Name | Description | Resource |
---|---|---|---|
betsHistory | 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. | https://sandbox.whapi.com/v1/bets/me | |
placeSingleBet | 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. Below is an examle call placing an each-way bet. | https://sandbox.whapi.com/v1/bets/me | |
cashin | Allows a trusted application to cash in a bet (take a return on a bet) on behalf of the customer. If the customers monitor bets they can cash in a bet at any point before the event ends. | https://sandbox.whapi.com/v1/bets/me/{betId}/cashIn | |
getFreeBets | Retrieves the current free bets available for a customer. | https://sandbox.whapi.com/v1/bets/me/free | |
placeMultipleBets | Places a multiple or a complex bet. | https://sandbox.whapi.com/v1/bets/me/multiples |
Resources |
betsHistory() |
GET /v1/bets/me?blockSize=5&blockNum=0 HTTP/1.1 Host: sandbox.whapi.com accept: application/xml who-apiKey: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-secret: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-ticket: TGT-619-Ei7EcapNaeKiopvNEYke6PIlPKihKZHYb0lKjrsyDqpJRgEyw3-brsuxxxx
Name | Type | Description |
---|---|---|
who-apiKey | string (required) | A unique identifier of your application that is generated by the API portal and presented in the header. |
who-secret | string (required) | Another unique identifier for your application. The secret must never be sent over HTTP. |
who-ticket | string (required) | The authentication ticket associated with user session. |
accept | string (required) default: application/xml options: application/xml, application/json | The representation of the response. |
Name | Type | Description |
---|---|---|
fromDateTime | dateTime | The start date of the bet history retrieval. Must be a valid date in the following format: YYYY-MM-DD 00:00:00 |
toDateTime | dateTime | The end date of the bet history retrieval. Must be a valid date in the following format: YYYY-MM-DD 00:00:00 |
blockSize | int (required) | The number of bets/transactions per page(block) for bet history retrieval. The maximum number for the blockSize is 100 |
blockNum | int (required) | The page number of the transactions you wish to retrieve. This parameter limits the number of bets/transactions retrieved per call to the number entered in the blockSize. This stops the call retrieving a customer's entire betting history and can be increased until an empty response is obtained. |
sortOrder | string default: A options: A, D | The sort order. Can be one of the following: A - ascending; D - descending |
settled | string default: A options: A, N, Y | What bets you want to include in the response. Can be one of the following: A - Both settled and open bets; N = All open bets; Y = All settled bets |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | bet | Node | - | No | The bet node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | betId | String | - | - | The unique identifier of the bet |
element | betTypeCode | String | - | No | The bet type code of the bet. For example: TBL (Treble) |
element | betTypeName | Node | - | No | The name of the bet type. For example: Double |
element | transDateTime | String | YYYY-MM-DD HH:MM:SS | - | The time the bet was placed |
element | numLines | Integer | - | No | Number of lines of bets |
element | numSelections | Integer | - | No | Number of selections that the bet is made of |
element | receipt | String | - | No | The unique identifier of the receipt for the bet |
element | settled | String | Y|N | No | Whether the bet is settled |
element | stake | Decimal | - | No | The bet stake, which represents the total value of the bet. For example: £ 12.34 |
element | cashinValue | Decimal | - | No | 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 |
element | stakePerLine | Decimal | - | No | The individual stake on each line of the bet. For example: £ 6.17 |
element | status | String | A|S|C | No | The status of the bet. Can be one of the following: A - Active, S - suspended, C - Cashed Out |
element | winnings | Decimal | - | No | Actual value of the returns from this bet |
element | estimatedReturns | Decimal | - | No | 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. |
element | freeBetValue | Decimal | - | No | If a free bet token is used for the bet, this element represents the value |
node | leg | Node | - | No | The leg node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | legType | String | E|W | No | 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 legType 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 legType 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 : 23020 - Price changed. |
element | legNum | Integer | - | No | The leg number of the bet |
element | legSort | String | SC|RF|CF|TC|SC|SF | Yes | The leg sort. This element is present for complex bets but not for single bets. |
node | part | Node | - | No | The part node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | description | String | - | No | Human-friendly description of the bet |
element | eachWayDen | Integer | - | No | When the odds are shown in vulgar fractions this is the denominator of the fraction. For example: 2 in 5/2 |
element | eachWayNum | Integer | - | No | When the odds are shown in vulgar fractions this is the numerator of the fraction. For example: 5 in 5/2 |
element | eachWayPlaces | Integer | - | No | The Each-way places available for the bet |
element | eventDescription | String | - | No | The description of the event |
element | eventId | String | - | No | Unique identifier of the event |
element | eventMarketDescription | String | - | No | The description of the market within an event |
element | eventTypeDescription | String | - | No | The description of type of the event |
element | handicap | Decimal | - | No | Denotes if the bet is part of a handicap market. For example: -1 if the selection starts on -1 goals (in football) |
element | outcomeId | String | - | No | Unique identifier for the outcome |
element | partNum | Integer | - | No | The part number of the bet within the leg |
element | priceDen | Integer | - | No | When the odds are shown in vulgar fractions this is the denominator of the fraction. For example: 2 in 5/2 |
element | priceNum | Integer | - | No | When the odds are shown in vulgar fractions this is the numerator of the fraction. For example: 5 in 5/2 |
element | priceType | String | L|S|G|F|SP|G | No | The price type chosen when the bet was placed. For example: L (Win) |
element | result | String | - | No | The outcome of the bet/event. Can be one of the following values: 'W' - Won; 'L' - Lost; V - Void; '-' Result not yet available |
element | rule4Deductions | Decimal | - | No | The official scale of deductions that apply when a runner is withdrawn |
element | startDateTime | dateTime | YYYY-MM-DD HH:MM:SS | No | Time the event will start. For example: 2013-01-30 11:01:01 |
node | priceFormatted | Node | - | No | The priceFormatted node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | priceFrac | String | - | No | The fractional format of the price or EVS when the price evens. |
element | priceDec | Decimal | - | No | The decimal format of the price |
element | priceAmer | String | - | No | The price in American format |
Responses |
Status: 200 (Ok) - Success - Details obtained |
application/xml | <whoBets> <bet> <betId>797</betId> <betTypeCode>SGL</betTypeCode> <betTypeName>Single</betTypeName> <cashinValue>0.12</cashinValue> <transDateTime>2016-01-05 14:27:58</transDateTime> <estimatedReturns>0.26</estimatedReturns> <leg> <legType>W</legType> <legNum>1</legNum> <part> <description>Swansea</description> <eachWayDen/> <eachWayNum/> <eachWayPlaces/> <eventDescription>Swansea Vs Sunderland</eventDescription> <eventId>3966</eventId> <eventMarketDescription>90 Minutes</eventMarketDescription> <eventTypeDescription>Manchester Senior Cup</eventTypeDescription> <handicap/> <outcomeId>262361</outcomeId> <partNum>1</partNum> <priceDen>1</priceDen> <priceNum>1</priceNum> <priceType>L</priceType> <result>-</result> <startDateTime>2016-01-07 20:00:00</startDateTime> <priceFormatted> <priceFrac>EVS</priceFrac> <priceDec>2</priceDec> <priceAmer>+100</priceAmer> </priceFormatted> </part> </leg> <numLines>1</numLines> <numSelections>1</numSelections> <receipt>O/0001370/0000132/F</receipt> <settled>N</settled> <stake>0.13</stake> <stakePerLine>0.13</stakePerLine> <status>A</status> <freeBetValue>0.00</freeBetValue> </bet> </whoBets> |
application/json | { "whoBets": { "bet": { "betId": "797", "betTypeCode": "SGL", "betTypeName": "Single", "cashinValue": "0.12", "transDateTime": "2016-01-05 14:27:58", "estimatedReturns": "0.26", "leg": { "legType": "W", "legNum": "1", "part": { "description": "Swansea", "eventDescription": "Swansea Vs Sunderland", "eventId": "3966", "eventMarketDescription": "90 Minutes", "eventTypeDescription": "Manchester Senior Cup", "outcomeId": "262361", "partNum": "1", "priceDen": "1", "priceNum": "1", "priceType": "L", "result": "-", "startDateTime": "2016-01-07 20:00:00", "priceFormatted": { "priceFrac": "EVS", "priceDec": "2", "priceAmer": "+100" } } }, "numLines": "1", "numSelections": "1", "receipt": "O/0001370/0000132/F", "settled": "N", "stake": "0.13", "stakePerLine": "0.13", "status": "A", "freeBetValue": "0.00" } } } |
placeSingleBet() |
POST https://sandbox.whapi.com/v1/bets/me HTTP/1.1 who-apiKey: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-secret: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-ticket: TGT-619-Ei7EcapNaeKiopvNEYke6PIlPKihKZHYb0lKjrsyDqpJRgEyw3-brsuxxxx Accept: application/json Content-Type: application/x-www-form-urlencoded Host: sandbox.whapi.com legType=E&stake=1.00&outcomeId=32520777&priceType=L&priceNum=1&priceDen=1
Name | Type | Description |
---|---|---|
who-apiKey | string (required) | A unique identifier of your application that is generated by the API portal and presented in the header. |
who-secret | string (required) | Another unique identifier for your application. The secret must never be sent over HTTP. |
who-ticket | string (required) | The authentication ticket associated with user session. |
accept | string (required) default: application/xml options: application/xml, application/json | The representation of the response. |
Name | Type | Description |
---|---|---|
legType | string (required) options: W, E | The type of bet placed. Can be one of the following: W - Win or E- EachWay |
stake | decimal (required) | The amount of the stake placed on the bet |
outcomeId | int (required) | The unique ID for the outcome of the bet |
priceType | string (required) options: L, S, G | 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 |
priceNum | int | When the odds are shown in vulgar fractions this is the numerator of the fraction. For example: 5 in 5/2 |
priceDen | int | When the odds are shown in vulgar fractions this is the denominator of the fraction. For example: 2 in 5/2 |
freeBetId | string | The ID number of the free bet token if used in conjunction with this bet |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | bet | Node | - | No | The bet node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | betNum | Integer | - | No | The bet number of the delayed bet |
element | delayBetId | String | - | No | The delayed bet identifier |
element | betTypeCode | String | - | No | The bet type code of the bet. For example: TBL (Treble) |
element | stake | Decimal | - | No | The stake of the delayed bet |
node | leg | Node | - | No | The leg node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | legType | String | E|W | No | 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 legType 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 legType 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 : 23020 - Price changed. |
node | part | Node | - | No | The part node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | outcomeId | String | - | No | The outcome identifier |
element | priceType | String | L|S|G|F|SP|G | No | The type of price selected. For example - ‘L’ (Fixed) |
element | priceNum | Integer | - | No | Price numerator - will be ignored for types other than L (Fixed Price) |
element | priceDen | Integer | - | No | Price denominator - will be ignored for types other than L (Fixed Price) |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | bet | Node | - | No | The bet node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | betId | Integer | - | No | The bet id |
element | betReceipt | String | - | No | The unique ID of the bet receipt |
element | placedDateTime | dateTime | - | Yes | The time the bet was placed. For example: 2013-01-30 11:01:01. The value of this element can be replaced with the current timestamp if it was missing. |
element | numLines | Integer | - | No | The number of lines the bet consists of |
element | totalStake | Decimal | - | No | The total amount staked on the bet |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | whoFaults | Node | - | No | The whoFaults node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | fault | Node | - | No | The fault node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | faultCode | String | - | No | The fault code |
element | faultString | String | - | No | The description of the fault |
node | solution | Node | - | Yes | The solution node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | betNum | Integer | - | Yes | The bet number |
element | outcomeId | String | - | Yes | The identifier of the outcome |
element | eventId | String | - | Yes | The identifier of the event |
element | priceNum | Integer | - | Yes | When the odds are shown in vulgar fractions this is the numerator of the fraction. For example: 5 in 5/2 |
element | priceDen | Integer | - | Yes | When the odds are shown in vulgar fractions this is the denominator of the fraction. For example: 2 in 5/2 |
element | handicap | Integer | - | Yes | The updated handicap |
element | handicapPrecision | Integer | - | Yes | The handicap precision |
element | outcomeHandicap | Integer | - | Yes | The outcome handicap |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | betDelayed | Node | - | No | The betDelayed node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | delayPeriod | Integer | - | No | The delay time period of the bet in seconds. The resubmission of the bet has to wait for the length of time (in seconds) returned in the delayPeriod before submitting the second request. |
element | beNum | Integer | - | No | The number of the bet |
element | delayBetId | String | - | No | The unique identifier of the delayed bet. After the initial response is received, containing the delayPeriod and the delayBetId, the request is then resubmitted using the same delayBetId token that came in that initial response. Check the example below to see how to resend a delayed bet payload. |
Responses |
Status: 201 (Created) - Created - Bet Places |
application/xml | <whoBets> <betPlaced> <betId>146169</betId> <betReceipt>O/0052936/0000010/F</betReceipt> <placedDateTime>2011-05-09 17:01:36</placedDateTime> <numLines>2</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | { "whoBets":{ "betPlaced":[ { "betId":"146169", "betReceipt":"O/0052936/0000010/F", "placedDateTime":"2011-05-09 17:01:36", "numLines":"2", "totalStake":"2.00" } ] } }} |
Status: 200 (Ok) - Success - Handicap change fault |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23025</faultCode> <faultString>Handicap has changed</faultString> <solution> <betNum>1</betNum> <outcomeId>734004</outcomeId> <eventId>23457</eventId> <priceNum>12</priceNum> <priceDen>1.72</priceDen> <handicap>100</handicap> <handicapPrecision>2</handicapPrecision> <outcomeHandicap>-100</outcomeHandicap> </solution> </fault> </whoFaults> </whoBets> |
application/json | { "whoBets": { "whoFaults": { "fault": { "faultCode": "23025", "faultString": "Handicap has changed", "solution": { "betNum": "1", "outcomeId": "734004", "eventId": "23457", "priceNum": "12", "priceDen": "1.72", "handicap": "100", "handicapPrecision": "2", "outcomeHandicap": "-100" } } } } } |
Status: 200 (Ok) - Success - Details obtained |
application/xml | <whoBets> <betDelayed> <delayPeriod>5</delayPeriod> <betNum>1</betNum> <delayBetId>SL-BcU/2cS2GwZz5BmryW5ihNR5ER9Wh77iVZDbpwzxMtwNMj9ya0vyzdLFzg81HcnwLXwRA8c9SS8gltCKm+JdAtMrcnO+A4vn8NPtOGlQNMmtlYktIcuaWGBItf94+DP1Fa3peYuN0Om8Dq8/jsp+R8tJ/GAClbn7HrnOHt8kmAx3KoJBE6aK5MmHpuMQU0gU6tnxMIWVqpvUg9wPiwjpgA==</delayBetId> </betDelayed> </whoBets> |
application/json | { "whoBets": { "betDelayed": { "delayPeriod": "5", "betNum": "1", "delayBetId": "SL-BcU/2cS2GwZz5BmryW5ihNR5ER9Wh77iVZDbpwzxMtwNMj9ya0vyzdLFzg81HcnwLXwRA8c9SS8gltCKm+JdAtMrcnO+A4vn8NPtOGlQNMmtlYktIcuaWGBItf94+DP1Fa3peYuN0Om8Dq8/jsp+R8tJ/GAClbn7HrnOHt8kmAx3KoJBE6aK5MmHpuMQU0gU6tnxMIWVqpvUg9wPiwjpgA==" } } } |
Status: 201 (Created) - Success - Resend delayed bet |
Example Request | <whoBets> <bet> <betNum>1</betNum> <delayBetId>SL-noYyf1wbQa+uYvuOgP5sryXhgdsQBjHVd6+LLASPt75glhRX/VWKBB+bdAKEyweGptUiA+imkAAV67Z1aaglEh8b4kDgCZygcw0y5QAz6ozweqKjFS+UjunK5uH8Zo8LclsLnC+VXucL6e5HeWWTszqsnzBIuv+jvj7mbkBtUTjxSuhWn5vgNafEX6K86vrE0dhLacv5dZQJT9BKmKLWeg==</delayBetId> <betTypeCode>SGL</betTypeCode> <stake>0.05</stake> <leg> <legType>W</legType> <part> <outcomeId>21556412</outcomeId> <priceType>L</priceType> <priceNum>732</priceNum> <priceDen>1000</priceDen> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>85899</betId> <betReceipt>O/0006945/0000431/F</betReceipt> <placedDateTime></placedDateTime> <numLines>1</numLines> <totalStake>0.05</totalStake> </betPlaced> </whoBets> |
application/json | { "whoBets": { "betPlaced": { "betId": "85899", "betReceipt": "O/0006945/0000431/F", "numLines": "1", "totalStake": "0.05" } } } |
cashin() |
PUT https://sandbox.whapi.com/v1/bets/me/{betId}/cashin?cashInValue=0.03 HTTP/1.1 Accept-Encoding: gzip,deflate who-apiKey: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-secret: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-ticket: TGT-619-Ei7EcapNaeKiopvNEYke6PIlPKihKZHYb0lKjrsyDqpJRgEyw3-brsuxxxx Accept: application/xml Content-Type: application/xml
Name | Type | Description |
---|---|---|
betId | string (required) | The bet id (a URL resource) |
Name | Type | Description |
---|---|---|
accept | string (required) default: application/xml options: application/xml, application/json | The representation of the response. |
who-apiKey | string (required) | A unique identifier of your application that is generated by the API portal and presented in the header. |
who-secret | string (required) | Another unique identifier for your application. The secret must never be sent over HTTP. |
who-ticket | string (required) | The authentication ticket associated with user session. |
Name | Type | Description |
---|---|---|
cashInValue | string (required) | The cash in value |
cashinBetDelayId | string | The ID of this bet delay |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | cashInSuccess | Boolean | true/false | No | Indicates whether the bet has been cashed-in. |
Responses |
Status: 200 (Ok) - Success - Bet cashed in. |
application/xml | <whoBets> <cashInSuccess>true</cashInSuccess> </whoBets> |
application/json | { "whoBets" : { "cashInSuccess" : true } } |
Status: 200 (Ok) - Fault 23130 - Cashin Value Changed. |
application/xml | <whoBets> <whoFaults> <whoFault> <faultCode>23130</faultCode> <faultString>Cash In value changed</faultString> <solution> <betId>1234</betId> <cashInValue>10.50</cashInValue> </solution> <whoFault> <whoFaults> </whoBets> |
application/json | { "whoBets":{ "whoFaults":[ { "faultCode" : "23130", "faultString" : "Cash In value changed", "solution" : { "betId" : "1234", "cashInValue" : "10.50" } } ] } |
Status: 200 (Ok) - Fault 23132 - Cashin Has Delay. |
application/xml | <whoBets> <whoFaults> <whoFault> <faultCode>23132</faultCode> <faultString>Cash In has a delay</faultString> <solution> <betId>1234</betId> <cashInValue>10.50</cashInValue> <cashInBetDelayId>bb52a421c8e5b41b82d2f89486394</cashInBetDelayId> </solution> <whoFault> <whoFaults> </whoBets> |
application/json | { "whoBets":{ "whoFaults":[ { "faultCode" : "23132", "faultString" : "Cash In has a delay", "solution" : { "betId" : "1234", "cashInValue" : "10.50", "cashInBetDelayId" : "bb52a421c8e5b41b82d2f89486394" } } ] } |
Status: 200 (Ok) - Fault 23133 - Cashin Has Pending Delay. |
application/xml | <whoBets> <whoFaults> <whoFault> <faultCode>23133</faultCode> <faultString>Cash In has a pending delay</faultString> <solution> <betId>1234</betId> <cashInValue>10.50</cashInValue> </solution> <whoFault> <whoFaults> </whoBets> |
application/json | { "whoBets":{ "whoFaults":[ { "faultCode" : "23133", "faultString" : "Cash In has a pending delay", "solution" : { "betId" : "1234", "cashInValue" : "10.50" } } ] } |
Status: 200 (Ok) - Fault 23134 - Cashin Value Too High. |
application/xml | <whoBets> <whoFaults> <whoFault> <faultCode>23134</faultCode> <faultString>Cash In value too high</faultString> <whoFault> <whoFaults> </whoBets> |
application/json | { "whoBets":{ "whoFaults":[ { "faultCode" : "23134", "faultString" : "Cash In value too high" } ] } |
Status: 200 (Ok) - Fault 23135 - Cashin Unavailable. |
application/xml | <whoBets> <whoFaults> <whoFault> <faultCode>23135</faultCode> <faultString>Cash In unavailable</faultString> <whoFault> <whoFaults> </whoBets> |
application/json | { "whoBets":{ "whoFaults":[ { "faultCode" : "23135", "faultString" : "Cash In unavailable" } ] } |
Status: 200 (Ok) - Fault 23136 - Cashin Bet Already Settled. |
application/xml | <whoBets> <whoFaults> <whoFault> <faultCode>23136</faultCode> <faultString>Cash In bet already settled</faultString <whoFault> <whoFaults> </whoBets> |
application/json | { "whoBets":{ "whoFaults":[ { "faultCode" : "23136", "faultString" : "Cash In bet already settled" } ] } |
getFreeBets() |
GET /v1/bets/me/free HTTP/1.1 Host: sandbox.whapi.com Accept: application/xml who-apiKey: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-secret: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-ticket: TGT-619-Ei7EcapNaeKiopvNEYke6PIlPKihKZHYb0lKjrsyDqpJRgEyw3-brsuxxxx
Name | Type | Description |
---|---|---|
accept | string (required) default: application/json options: application/xml, application/json | The representation of the response. |
who-apiKey | string (required) | A unique identifier of your application that is generated by the API portal and presented in the header. |
who-secret | string (required) | Another unique identifier for your application. The secret must never be sent over HTTP. |
who-ticket | string (required) | The authentication ticket associated with the user session. |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | bet | Node | - | No | The bet node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
attribute | id | Integer | - | No | The identifier of the free bet |
element | offerId | Integer | - | No | The identifier of the offer |
element | offerName | String | - | No | The name of the offer that enabled the customer to place a free bet |
element | offerDesc | String | - | No | The description of the offer that enabled the customer to place a free bet |
element | displayText | String | - | No | The message explaining the offer displayed to the customer along with the free bet |
element | value | Decimal | - | No | The value of the free bet |
element | expiryDateTimeZoned | dateTime | - | No | The time the free bet expired. For example 2014-11-013T23:59:10+01:00 |
element | awardedDateTimeZoned | dateTime | - | No | The time the free bet was awarded. For example 2014-11-013T23:59:10+01:00 |
element | startedDateTimeZoned | dateTime | - | No | The time the free bet offer started. For example 2014-11-013T23:59:10+01:00 |
Responses |
Status: 200 (Ok) - Success - List of customer free bets. |
application/xml | <whoBets> <freeBet id="23"> <offerId>1</offerId> <offerName>£10 Freebet on registration</offerName> <offerDesc>Description of offer</offerDesc> <displayText>Free bet</displayText> <value>10.00</value> <expiryDateTimeZoned>2014-11-13T23:59:10+01:00</expiryDateTimeZoned> <awardedDateTimeZoned>2014-11-13T23:59:10+01:00</awardedDateTimeZoned> <startDateTimeZoned>2014-11-13T23:59:10+01:00</startDateTimeZoned> </freeBet> <freeBet id="24"> <offerId>1</offerId> <offerName>£10 Freebet on registration</offerName> <offerDesc>Description of offer</offerDesc> <displayText>Free bet</displayText> <value>10.00</value> <expiryDateTimeZoned>2014-11-13T23:59:10+01:00</expiryDateTimeZoned> <awardedDateTimeZoned>2014-11-13T23:59:10+01:00</awardedDateTimeZoned> <startDateTimeZoned>2014-11-13T23:59:10+01:00</startDateTimeZoned> </freeBet> </whoBets> |
application/json | { "whoBets": { "freeBet": [ { "id": "23", "offerId": "1", "offerName": "£10 Freebet on registration", "offerDesc": "Description of offer", "displayText": "Free bet", "value": "10.00", "expiryDateTimeZoned": "2014-11-13T23:59:10+01:00", "awardedDateTimeZoned": "2014-11-13T23:59:10+01:00", "startDateTimeZoned": "2014-11-13T23:59:10+01:00" }, { "id": "24", "offerId": "1", "offerName": "£10 Freebet on registration", "offerDesc": "Description of offer", "displayText": "Free bet", "value": "10.00", "expiryDateTimeZoned": "2014-11-13T23:59:10+01:00", "awardedDateTimeZoned": "2014-11-13T23:59:10+01:00", "startDateTimeZoned": "2014-11-13T23:59:10+01:00" } ] } } |
Status: 204 (No Content) - Success - When no free bets. |
placeMultipleBets() |
POST /v1/bets/me/multiples HTTP/1.1 Host: sandbox.whapi.com Accept: application/xml Content-Type: application/xml who-apiKey: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-secret: l7xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx who-ticket: TGT-619-Ei7EcapNaeKiopvNEYke6PIlPKihKZHYb0lKjrsyDqpJRgEyw3-brsuxxxx <whoBets> <bet> <betNum>1</betNum> <betTypeCode>DBL</betTypeCode> <stake>20.00</stake> <leg> <legType>W</legType> <part> <outcomeId>16049385</outcomeId> <priceType>L</priceType> <priceNum>3</priceNum> <priceDen>2</priceDen> <includedInMultiple>true</includedInMultiple> </part> </leg> <leg> <legType>W</legType> <part> <outcomeId>16049386</outcomeId> <priceType>L</priceType> <priceNum>5</priceNum> <priceDen>3</priceDen> <includedInMultiple>true</includedInMultiple> </part> </leg> </bet> </whoBets>
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | bet | Node | - | No | The bet node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | betNum | Integer | - | No | The bet number of the bet |
element | betTypeCode | String | - | No | The bet type code of the bet. For example: TBL (Treble) |
element | stake | Decimal | - | No | The bet stake, which represents the total value of the bet. For example: £ 12.34 |
node | leg | Node | - | No | The leg node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | legType | String | - | No | Type of leg that you want to place on the bet, such as Win or Each-way. Even though the priceNum and priceDen are required for the bets with legType 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 legType 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 : 25020 - Price changed. |
node | part | Node | - | No | The part node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | outcomeId | Integer | - | No | The unique identification number of the selection outcome |
element | priceType | Integer | - | No | The type of price selected. For example - ‘L’ (Fixed) |
element | priceNum | Integer | - | No | Price numerator - will be ignored for types other than L (Fixed Price) |
element | priceDen | Integer | - | No | Price denominator - will be ignored for types other than L (Fixed Price) |
element | includeInMultiple | Boolean | true|false | No | Indicates if the bet can be used in a multiple bet |
Name | Type | Description |
---|---|---|
accept | string (required) default: application/json options: application/xml, application/json | The representation of the response. |
who-apiKey | string (required) | A unique identifier of your application that is generated by the API portal and presented in the header. |
who-secret | string (required) | Another unique identifier for your application. The secret must never be sent over HTTP. |
who-ticket | string (required) | The authentication ticket associated with the user session. |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | bet | Node | - | No | The bet node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | betNum | Integer | - | No | The bet number of the delayed bet |
element | delayBetId | String | - | No | The delayed bet identifier |
element | betTypeCode | String | - | No | The bet type code of the bet. For example: TBL (Treble) |
element | stake | Decimal | - | No | The stake of the delayed bet |
node | leg | Node | - | No | The leg node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | legType | String | E|W | No | 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 legType 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 legType 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 : 23020 - Price changed. |
node | part | Node | - | No | The part node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | outcomeId | String | - | No | The outcome identifier |
element | priceType | String | L|S|G|F|SP|G | No | The type of price selected. For example - ‘L’ (Fixed) |
element | priceNum | Integer | - | No | Price numerator - will be ignored for types other than L (Fixed Price) |
element | priceDen | Integer | - | No | Price denominator - will be ignored for types other than L (Fixed Price) |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
node | bet | Node | - | No | The bet node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | betNum | Integer | - | No | The bet number of the straight forecast bet |
element | betTypeCode | String | - | No | The bet type code of the bet. For example: TBL (Treble) |
element | stake | Decimal | - | No | The stake of the bet |
node | leg | Node | - | No | The leg node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | legSort | String | - | Yes | The leg sort. This element is present for complex bets but not for single bets. |
element | legType | String | E|W | No | 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 legType 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 legType 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 : 23020 - Price changed. |
node | part | Node | - | No | The part node |
Object | Name | Type | Constraints | Optional | Description |
---|---|---|---|---|---|
element | priceType | String | L|S|G|F|SP|G | No | The price type |
element | outcomeId | String | - | No | Unique identifier for the outcome |
Responses |
Status: 200 (Ok) - Success - Bet successfully placed |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>1</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "1", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Handicap change fault |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23025</faultCode> <faultString>Handicap has changed</faultString> <solution> <betNum>1</betNum> <outcomeId>734004</outcomeId> <eventId>23457</eventId> <priceNum>12</priceNum> <priceDen>1.72</priceDen> <handicap>100</handicap> <handicapPrecision>2</handicapPrecision> <outcomeHandicap>-100</outcomeHandicap> </solution> </fault> </whoFaults> </whoBets> |
application/json | { "whoBets": { "whoFaults": { "fault": { "faultCode": "23025", "faultString": "Handicap has changed", "solution": { "betNum": "1", "outcomeId": "734004", "eventId": "23457", "priceNum": "12", "priceDen": "1.72", "handicap": "100", "handicapPrecision": "2", "outcomeHandicap": "-100" } } } } } |
Status: 200 (Ok) - Success - Price change fault |
application/xml | <whoBetslips> <whoFaults> <fault> <faultCode>25021</faultCode> <faultString>Market suspended</faultString> <solution> <betNum>1</betNum> <eventId>399729</eventId> <outcomeId>14619822</outcomeId> </solution> </fault> </whoFaults> <bet> <betMultiplier>2.0</betMultiplier> <betNum>1</betNum> <betNumOfLines>1</betNumOfLines> <betTypeCode>SGL</betTypeCode> <betTypeName>Single</betTypeName> <maxStake>2500.50</maxStake> <minStake>0.03</minStake> <leg> <legType>W</legType> <part> <ewAvailable>false</ewAvailable> <includeInMultiple>true</includeInMultiple> <priceChanged>false</priceChanged> <priceDen>12</priceDen> <priceNum>1</priceNum> <priceType>L</priceType> <outcomeId>14619822</outcomeId> <singleAvailable>true</singleAvailable> <spAvailable>false</spAvailable> <status>S</status> <statusChanged>true</statusChanged> </part> </leg> </bet> </whoBetslips> |
application/json | { "whoBetslips": { "whoFaults": { "fault": { "faultCode": "25021", "faultString": "Market suspended", "solution": { "betNum": "1", "eventId": "399729", "outcomeId": "14619822" } } }, "bet": { "betMultiplier": "2.0", "betNum": "1", "betNumOfLines": "1", "betTypeCode": "SGL", "betTypeName": "Single", "maxStake": "2500.50", "minStake": "0.03", "leg": { "legType": "W", "part": { "ewAvailable": "false", "includeInMultiple": "true", "priceChanged": "false", "priceDen": "12", "priceNum": "1", "priceType": "L", "outcomeId": "14619822", "singleAvailable": "true", "spAvailable": "false", "status": "S", "statusChanged": "true" } } } } } |
Status: 200 (Ok) - Success - Straight Forecast placed |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>1</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "1", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Wrong number of parts for leg sort |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23031</faultCode> <faultString>Wrong number of parts for leg sort</faultString> <solution> <betNum>1</betNum> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23031", "faultString": "Wrong number of parts for leg sort", "solution": {"betNum": "1"} }}}} |
Status: 200 (Ok) - Success - Outcomes cannot be combined |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261999</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23050</faultCode> <faultString>Outcomes cannot be combined</faultString> <solution> <betNum>1</betNum> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23050", "faultString": "Outcomes cannot be combined", "solution": {"betNum": "1"} }}}} |
Status: 200 (Ok) - Success - Duplicate outcomes in leg |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23051</faultCode> <faultString>Duplicate outcomes in leg</faultString> <faultName>priceType</faultName> <solution> <betNum>1</betNum> <outcomeId>11261286</outcomeId> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23051", "faultString": "Duplicate outcomes in leg", "faultName": "priceType", "solution": { "betNum": "1", "outcomeId": "11261286" } }}}} |
Status: 200 (Ok) - Success - Cannot have unnamed favourite in cast |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261290</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23033</faultCode> <faultString>Cannot have unnamed favourite in cast</faultString> <solution> <betNum>1</betNum> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23033", "faultString": "Cannot have unnamed favourite in cast", "solution": {"betNum": "1"} }}}} |
Status: 200 (Ok) - Success - Leg sort not available for these outcomes (Forecasts not allowed - ie. two horse race) |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23034</faultCode> <faultString>Leg sort not available for these outcomes</faultString> <solution> <betNum>1</betNum> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23034", "faultString": "Leg sort not available for these outcomes", "solution": {"betNum": "1"} }}}} |
Status: 200 (Ok) - Success - Event, Market or Outcome Suspended |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23021</faultCode> <faultString>Market suspended</faultString> <solution> <betNum>1</betNum> <eventId>237266</eventId> <stauts>S</stauts> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23021", "faultString": "Market suspended", "solution": { "betNum": "1", "eventId": "237266", "stauts": "S" } }}}} |
Status: 200 (Ok) - Success - Selection Started |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23024</faultCode> <faultString>Selection started</faultString> <solution> <betNum>1</betNum> <eventId>237266</eventId> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23024", "faultString": "Selection started", "solution": { "betNum": "1", "eventId": "237266" } }}}} |
Status: 200 (Ok) - Success - All other unhappy paths |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23023</faultCode> <faultString>Unexpected bet error</faultString> <solution> <betNum>1</betNum> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23023", "faultString": "Unexpected bet error", "solution": {"betNum": "1"} }}}} |
Status: 200 (Ok) - Success - Reverse Forecast |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>1</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "1", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Combination Forecast with 8 selections |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>0.10</stake> <leg> <legSort>CF</legSort> <legType>W</legType> <part> <outcomeId>3780502</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780503</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780504</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780505</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780506</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780507</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780508</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780509</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>8</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "8", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Wrong number of selections for a forecast combo forecast (must have 3 or more) |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>0.10</stake> <leg> <legSort>CF</legSort> <legType>W</legType> <part> <outcomeId>3780502</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780503</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <whoFaults> <fault> <faultCode>23031</faultCode> <faultString>Wrong number of parts for leg sort</faultString> <solution> <betNum>1</betNum> </solution> </fault> </whoFaults> </whoBets> |
application/json | {"whoBets": {"whoFaults": {"fault": { "faultCode": "23031", "faultString": "Wrong number of parts for leg sort", "solution": {"betNum": "1"} }}}} |
Status: 200 (Ok) - Success - Straight Forecast - Doubles |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betNumOfLines>4</betNumOfLines> <betTypeCode>DBL</betTypeCode> <betTypeName>Double</betTypeName> <stake>2.00</stake> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261296</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261294</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>4</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "4", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Straight Forecast - Trebles |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betNumOfLines>1</betNumOfLines> <betTypeCode>TBL</betTypeCode> <betTypeName>Treble</betTypeName> <stake>2.00</stake> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261296</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261294</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261276</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261274</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>1</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "1", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Reverse Forecast - Doubles |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betNumOfLines>4</betNumOfLines> <betTypeCode>DBL</betTypeCode> <betTypeName>Double</betTypeName> <stake>2.00</stake> <leg> <legSort>RF</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> <leg> <legSort>RF</legSort> <legType>W</legType> <part> <outcomeId>11261296</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261294</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>4</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "4", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Reverse Forecast - Trebles |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betNumOfLines>8</betNumOfLines> <betTypeCode>TBL</betTypeCode> <betTypeName>Treble</betTypeName> <stake>2.00</stake> <leg> <legSort>RF</legSort> <legType>W</legType> <part> <outcomeId>11261286</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261284</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> <leg> <legSort>RF</legSort> <legType>W</legType> <part> <outcomeId>11261296</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261294</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> <leg> <legSort>SF</legSort> <legType>W</legType> <part> <outcomeId>11261276</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> <part> <outcomeId>11261274</outcomeId> <priceType>D</priceType> <status>A</status> <statusChanged>false</statusChanged> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>8</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "8", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - 3 Selections - for Straight Tricast |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>TC</legSort> <legType>W</legType> <part> <outcomeId>3780503</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780504</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780505</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>1</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "1", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - 3 Selections - for Combination Tricast |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>2.00</stake> <leg> <legSort>CT</legSort> <legType>W</legType> <part> <outcomeId>3780503</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780504</outcomeId> <priceType>D</priceType> </part> <part> <outcomeId>3780505</outcomeId> <priceType>D</priceType> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>6</numLines> <totalStake>2.00</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "6", "totalStake": "2.00" }}} |
Status: 200 (Ok) - Success - Score Cast |
Example Request | <whoBets> <bet> <betNum>1</betNum> <betTypeCode>SGL</betTypeCode> <stake>0.50</stake> <leg> <legSort>SC</legSort> <legType>W</legType> <part> <outcomeId>49182</outcomeId> <priceType>L</priceType> <priceNum>1</priceNum> <priceDen>1</priceDen> </part> <part> <outcomeId>49184</outcomeId> <priceType>L</priceType> <priceNum>11</priceNum> <priceDen>2</priceDen> </part> </leg> </bet> </whoBets> |
application/xml | <whoBets> <betPlaced> <betId>51097</betId> <betReceipt>O/0013333/0000109/F</betReceipt> <placedDateTime/> <numLines>1</numLines> <totalStake>0.50</totalStake> </betPlaced> </whoBets> |
application/json | {"whoBets": {"betPlaced": { "betId": "51097", "betReceipt": "O/0013333/0000109/F", "placedDateTime": "", "numLines": "1", "totalStake": "0.50" }}} |
Where the elements can be defined as the following:
- Fault code - A unique William Hill identifier for the error
- Fault string - A unique William Hill text string to enable you to identify the error (in English only)
- HTTP code - the standard HTTP status code for the error
- HTTP response - the standard HTTP response for the error
Note: A Fault name may also be generated in order to pinpoint the exact parameter where a request has failed.
The error codes are supplied in the following representations:
- XML
- JSON
The response body will contain the unique William Hill fault
code and fault string appropriate to the corresponding error.
The response will be sent according to the
representation type governed by the accept parameter
within the original request. The default representation is for
application/xml and this representation will be returned if
either the accept header is absent or if the
accept header is set to application/xml.
Click here to view the complete list of William Hill error codes for the APIs.
Error code | Fault string | HTTP code | HTTP response |
---|---|---|---|
23010 | Insufficient funds | 200 | Ok |
23011 | Stake too low | 200 | Ok |
23012 | Stake too high | 200 | Ok |
23020 | Price changed | 200 | Ok |
23021 | Market suspended | 200 | Ok |
23022 | Live prices not available | 200 | Ok |
23023 | Unexpected bet failure | 200 | Ok |
23024 | Selection started | 200 | Ok |
23025 | Handicap has changed | 200 | Ok |
23031 | Wrong number of parts for leg sort | 200 | Ok |
23100 | Invalid price type | 200 | Ok |
25108 | Invalid leg sort | 200 | Ok |
23101 | Forecasts not available | 200 | Ok |
23102 | Invalid stake | 200 | Ok |
23103 | Invalid markets | 200 | Ok |
23104 | Invalid bet type | 200 | Ok |
23105 | Invalid leg type | 200 | Ok |
23106 | Invalid scorecast parameters | 200 | Ok |
23107 | Each way not available | 200 | Ok |
23108 | Best price not available | 200 | Ok |
23109 | Forecasts not available | 200 | Ok |
23110 | Tricast not available | 200 | Ok |
23111 | First show not available | 200 | Ok |
23112 | Second show not available | 200 | Ok |
23113 | Starting price not available | 200 | Ok |
23114 | Next price not available | 200 | Ok |
23115 | Scorecast not available | 200 | Ok |
23116 | No price available | 200 | Ok |
23118 | Eachway terms have changed | 200 | Ok |
23119 | Maximum payout too high | 200 | Ok |
23130 | Cash In value changed | 200 | Ok |
23131 | Cash In has a delay | 200 | Ok |
23132 | Cash In has a delay | 200 | Ok |
23133 | Cash In has a pending delay | 200 | Ok |
23134 | Cash In value too high | 200 | Ok |
23135 | Cash In unavailable | 200 | Ok |
23136 | Cash In bet already settled | 200 | Ok |
23200 | No results. Check block size? | 200 | Ok |
For more information about how William Hill uses HTTP status codes with their APIs, click here.