Bets API
Overview

Bets API


Version: 2.0.0

The Bets API methods are used to place single, multiple and complex bets and to retrieve a customer\u2019s bet history. When retrieving a customer\u2019s 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. You can also specify what fields to be included/excluded or return a list of all default fields the method returns.

The Bets API will also generate a bet delay if you\u2019re 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). Note that in version 2 of our APIs, Bets API contains the functionality of both Bets API v1 and the Betslips API v1.
Summary
Method Name Description Resource
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/v2/bets/{betId}/cashin
getBetHistory Retrieves the customer\u2019s 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/v2/bets/history
getFreeBets Retrieves the current free bets available for a customer. https://sandbox.whapi.com/v2/bets/freebets
placeComplexBet Places a multiple or a complex bet. https://sandbox.whapi.com/v2/bets/bet/complex
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. A delayedBetId will be recieved that can be used to resubmit the bet. https://sandbox.whapi.com/v2/bets/bet/single
validateBetslip Organises the betslip when one or more selections are made. It returns a bet slip structure organised by betting opportunities. https://sandbox.whapi.com/v2/bets/betslips
Resources Expand All Collapse All
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.
Request Example
put https://sandbox.whapi.com/v2/bets/{betId}/cashin?cashInValue=20&cashinBetDelayId=GGGfffEEE HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Request Parameters
path parameters
Name Description
betId*
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
query parameters
Name Description
cashInValue*
cashinBetDelayId*
Responses Expand All Collapse All
getBetHistory()
Retrieves the customer\u2019s 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 Example
get https://sandbox.whapi.com/v2/bets/history?dateFrom=2013-09-25T13:34:20&dateTo=2013-09-25T13:34:20&fields=&include=FieldName&exclude=&page=10&pageSize=15&sort=transDateTime,desc&settled=true HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
query parameters
Name Description
dateFrom*
dateTo*
fields
include
exclude
page
pageSize
sort
settled
Responses Expand All Collapse All
getFreeBets()
Retrieves the current free bets available for a customer.
Request Example
get https://sandbox.whapi.com/v2/bets/freebets?fields=&include=FieldName&exclude= HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
query parameters
Name Description
fields
include
exclude
Responses Expand All Collapse All
placeComplexBet()
Places a multiple or a complex bet.
Request Example
post https://sandbox.whapi.com/v2/bets/bet/complex?fields=&include=FieldName&exclude= HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Payload:     
Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
body parameters
Name Description
body *
query parameters
Name Description
fields
include
exclude
Responses Expand All Collapse All
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. A delayedBetId will be recieved that can be used to resubmit the bet.
Request Example
post https://sandbox.whapi.com/v2/bets/bet/single?fields=&include=FieldName&exclude= HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx
apiTicket: TGT-1920-Cl7l4e0hzFWK9aoKeiggDexuWcmAMf9brh6IFpVdsQxxxxxxxx-brsux349

Payload:     
Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
apiTicket*
body parameters
Name Description
body *
query parameters
Name Description
fields
include
exclude
Responses Expand All Collapse All
validateBetslip()
Organises the betslip when one or more selections are made. It returns a bet slip structure organised by betting opportunities.
Request Example
post https://sandbox.whapi.com/v2/bets/betslips?expanded= HTTP/1.1
Host: sandbox.whapi.com
Accept: application/json
apiKey: l7xxa54460c573b5497c9b24b505xxxxxxxx
apiSecret: 355b1e522c544222ab4ff318xxxxxxxx

Payload:     
Request Parameters
header parameters
Name Description
apiKey*
apiSecret*
body parameters
Name Description
body *
query parameters
Name Description
expanded
Responses Expand All Collapse All
HEAD and OPTIONS
You can call the following idempotent REST methods on all version 2 APIs:

HEAD

Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content. The metainformation contained in the HTTP headers in response to a HEAD request is identical to the information sent in response to a GET request. This method is often used for testing hypertext links for validity, accessibility, and recent modification. The response to a HEAD request may be cacheable in the sense that the information contained in the response can be used to update a previously cached entity from that resource. If the new field values indicate that the cached entity differs from the current entity (as would be indicated by a change in Content-Length, Content-MD5, ETag or Last-Modified), then the cache treats the cache entry as stale.

OPTIONS

The OPTIONS method represents a request for information about the communication options available on the request/response chain identified by the Request-URI. This method allows you to determine the options and/or requirements associated with a resource without implying a resource action or initiating a resource retrieval. Responses to this method are not cacheable. The response includes any header fields that indicate optional features. The response body also includes information about the communication options.



Copyright (c) WHG (International) Limited 2016
Generated Date: 2020-06-06T11:01:00.162+01:00
Use of this document is subject to the William Hill Partner Developer Portal Terms and Conditions.