Skip to main content

Betting API — REST API

Place Bet

PropertyValue
Endpoint/api/v1/bets/place
MethodPOST
DescriptionAllows the customer to place a new bet on an event.

Request Headers

Authorization: Bearer YOUR_API_TOKEN
Content-Type: application/json

Request Body Example

{
"sportId": "2",
"marketId": "9.1223445",
"runnerId": 100123,
"priceIndex": 0,
"size": 50,
"memberSize": 50,
"odds": 100,
"line": 10,
"side": "BACK",
"memberCode": "member_code",
"currency": "HKD",
"ipAddress": "member_ip_address",
"requestId": "123456789" // optional
}

Response — Success (201 Created)

{
"id": 3,
"requestId": "123456789",
"memberCode": "member_code",
"status": "PENDING",
"side": "BACK",
"size": 5,
"memberSize": 5,
"odds": 100,
"line": 10,
"version": 1727702890748
}

Response — Error (4xx)

[
{
"error_code": "some_error_code",
"errorMessage": "Member code is missing",
"version": "2024-10-10T12:21:00.995612Z"
}
]

Note: All successful bet responses will be returned with PENDING status. After the provider processing, the bet placement results (placed or not) will be provided in the RabbitMQ queue.


PlaceBetRequest

FieldTypeDescriptionRequired
sportIdStringSport identifierYes
providerIdStringUnique identifier for the betting provider.Yes
marketIdStringIdentifier for the specific market within an event.Yes
runnerIdLongIdentifier for the specific runner within a market.Yes
priceIndexIntegerThe index of the price level on the price ladder within the selection. For example, if a selection had prices 1.91 and 1.90 then a price_level_index of '0' would be 1.91 and '1' would be for 1.90.No
sizeBigDecimalBet size requested for placementYes
memberSizeBigDecimalBet size initially requested by the member (before PT)Yes
oddsBigDecimalBet odds requested for placementYes
lineIntegerBet line, for line fancy markets onlyNo
sideSideSide enum. One of: BACK - selection occurrence side selection; LAY - selection non-occurrence side selectionYes
memberCodeStringCode identifying the member placing the bet.Yes
ipAddressStringIP address of the client placing the bet.Yes
currencyStringCurrency code (e.g., "USD")No
requestIdStringA unique identifier can be generated on the customer side for the request to ensure idempotency.No

PlaceBetResponse

FieldTypeDescription
betIdLongUnique identifier for the placed bet
requestIdStringA request unique identifier
memberCodeStringCode identifying the member placing the bet
statusBetStatusBet status enum. One of: PENDING - the bet placement is pending; FAILED - the bet placement has failed; PLACED - the bet is successfully placed; VOIDED - the bet is voided
sideSideSide enum. One of: BACK - selection occurrence side selection; LAY - selection non-occurrence side selection
sizeBigDecimalBet size requested for placement
oddsBigDecimalBet odds requested for placement
lineIntegerBet line requested for placement
versionlongTimestamp when the bet was placed (UTC)

PlaceBetErrorResponse

FieldTypeDescription
errorCodeStringCode representing the type of error
errorMessageStringHuman-readable message describing the error
versionStringTimestamp when the bet was placed (UTC)