API Documentation
System Integration for Bet and Coupon Calculation
This system is designed for sports betting operators, bookmakers, and platform developers who aim to automate the process of bet calculation and coupon management. It allows for quick integration of result calculations, providing accurate data on coupon statuses (win, loss, or refund), and simplifies the interaction between the operator’s server and the calculation system.
POST /v1/coupon json
{
"coupon_id": "A7F3K9",
"type": "express",
"events": [
{ "id": 88213, "pick": "1", "odds": 2.10, "result": "win" },
{ "id": 88150, "pick": "over_2_5", "odds": 1.80, "result": "win" }
],
"total_odds": 3.78, "status": "won"
} How does the system work?
User authorization
Error response json
"errorCode":1,
"fullErrorCode":99,
"errorMessage":"Invalid access level" Example of sending a request (use the data provided by the manager):
POST {APIHOST}/WebServices/BCService.asmx/LogIn/ python
import requests
import json
url = "https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/"
payload = json.dumps({
"login": "[email protected]",
"password": "demo-password"
})
headers = {
'Content-Type': 'application/json'
}
print(response.text) POST {APIHOST}/WebServices/BCService.asmx/LogIn/ php
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS =>'{
"login":"[email protected]",
"password":"demo-password"
}',
CURLOPT_HTTPHEADER => array(
'Content-Type: application/json'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response; POST {APIHOST}/WebServices/BCService.asmx/LogIn/ js
const myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
const raw = JSON.stringify({
"login": "[email protected]",
"password": "demo-password"
});
const requestOptions = {
method: "POST",
headers: myHeaders,
body: raw,
redirect: "follow"
};
fetch("https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/", requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error)); POST {APIHOST}/WebServices/BCService.asmx/LogIn/ java
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\r\n \"login\":\"[email protected]\",\r\n \"password\":\"demo-password\"\r\n}");
Request request = new Request.Builder()
.url("https://example-domain-calc.com/WebServices/BCService.asmx/LogIn/")
.method("POST", body)
.addHeader("Content-Type", "application/json")
.build();
Response response = client.newCall(request).execute(); Bet or coupon submission method
Example body payload json
{
"data":{
"list_bets":[
"line#586464528|17|954|2.5#4.27", "live#586464528|87|4|0#1.12"
],
"realAmount":"2",
"currency":"USD",
"lang":"en",
"remote_host":"https://mysites.com",
"rate_mode":"reject"
}
} remote_host & rate_mode parameters
Response fields & error description
Successful operation
Successful operation json
{
"errorCode": 0,
"fullErrorCode": 0,
"errorMessage": ""
} Error codes
General error json
{
"errorCode": 1,
"fullErrorCode": [ERROR_CODE],
"errorMessage": "[ERROR_DESCRIPTION]"
} Recommendations for handling errors when odds have changed
Recommendations for handling errors when odds have changed json
{
"errorCode":1,
"fullErrorCode":2,
"errorMessage":"Odds have changed",
"rate_mode":"reject",
"changed":[
{
"gid":"586464528", // match ID
"rb":2.15, // odds in your coupon
"rg":"2.27", // current real odds
"rt":0 // status of change. 0 - decreased, 1 - increased
}
]
} Sending calculation results
Example data for a single coupon json
{
"remote_host": "https://mysite.com",
"Heads": [{
"KeyHead": {
"Id": "344143",
"BarCode": "x9c52i8411"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 11130,
"DateReceive": "1597075782"
}]
} Example data for multiple coupons
Example data for multiple coupons json
{
"remote_host": "https://mysite.com",
"Heads": [{
"KeyHead": {
"Id": "313",
"BarCode": "75vz48t935"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 19.85,
"DateReceive": "1592937968"
}, {
"KeyHead": {
"Id": "312",
"BarCode": "77i0r6e15t"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 12.51,
"DateReceive": "1592937280"
}]
}