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.
Integration with our bet and coupon calculation system consists of three key stages:
In the first stage, you need to authorize in the system. This is done by performing a POST request with user credentials (login and password). Successful authorization returns a session represented as a cookie, which must be saved. These cookies are required for all subsequent requests as they are used to identify the user's session in the system.
At this stage, a bet code is sent to our system containing:
When submitting data, the cookies obtained during authorization must be included. This ensures proper user identification and bet processing.
After the outcomes or coupons are calculated, our system sends POST requests to the specified remote_host
. This request includes:
Results are sent as soon as the outcome is determined. For example:
Now review each step individually. We have described the requests, parameters, and API responses in detail.
Login, password, and the host for sending requests can be obtained from the manager.
Request URL:
{APIHOST}/WebServices/BCService.asmx/LogIn/
Data Submission Type: POST
Submitted Data:
Parameter | Description |
---|---|
login | User login |
password | User password |
Important!
Recommendations for easier integration:
login
field is passed as a string.Cookies are valid for 3 months. However, they may be reset if the server is restarted. Therefore, you need to reauthorize if you encounter an error while saving a coupon.
"errorCode":1,
"fullErrorCode":99,
"errorMessage":"Invalid access level"
Example of Sending a Request:
Use the data provided to you by the manager:
Example Response:
Successful:
{"d":{"UserId":"36557"}}
Unsuccessful:
{"d":{}}
Response Fields Description:
Field | Description |
---|---|
UserId | Unique user identifier |
d | Root object of the response |
General Recommendations:
Cookies must be saved and sent with subsequent requests.
To submit a bet, you must use the cookies obtained during the authorization stage. These data are required to identify your session and process requests.
Request URL:
{HOST_API}/bet/place/
{
"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"
}
}
Parameter | Description |
---|---|
list_bets | Bet code and odds. Format: "event_type#match_ID|bet_code#odds". Example: "live#579216393|1|1|0#2.1" |
realAmount | Bet amount. Must be passed as a string, e.g., "150". |
currency | Coupon currency. |
lang | The language in which the bet and coupon are saved. For example: "en", "ru", or "tr". |
remote_host | The URL to send the coupon calculation results to. Do not include a trailing slash. |
rate_mode | Option for handling coupon acceptance when odds change: "reject" (reject on changes) or "accept" (accept regardless of changes). Default: "accept". |
Note: Ensure that parameters are passed in the correct format. For example, list_bets
must be an array, even if there is only one bet.
We do not validate the bet amount. You can submit either the actual bet amount or any arbitrary value. This is to ensure the confidentiality of your financial data. Our task is to provide calculation results. You are responsible for crediting winnings to your players.
Other parameters should also be sent, but they are optional and can be used for your convenience.
remote_host is the address of your server where we send requests with the results of bet calculations. This host must be configured to accept requests from our server. Below are examples of possible values and specific details about working with this parameter.
You can specify various options for remote_host:
https://mysites.com
https://mysites.com:78665
https://mysites.com/request/sportapi/sender
https://mysites.com/request.php?action=webhook
Important: When sending a request, our system automatically appends the string /api/bet/result
to the specified remote_host
.
Thus, the final address for receiving requests is formed as remote_host + "/api/bet/result"
. Ensure that your server is configured to receive data at this path.
remote_host = https://mysites.com
. We send requests to: https://mysites.com/api/bet/result
.remote_host = https://mysites.com/request.php?action=webhook
. We send requests to: https://mysites.com/request.php?action=webhook/api/bet/result
.Technical Details:
POST
method.Ensure that your server correctly processes the specified path and requests. The next section provides an example of the data structure sent by our server.
The rate_mode parameter defines the system's behavior when odds change. It can take two values:
accept
mode, the system saves the coupon with the new odds without notifying your system.Choose the mode that best suits your business processes and provides convenience for your users.
errorCode = 1
is returned.Parameter | Description |
---|---|
betCode | Unique bet number in our system |
errorCode | Main status of the request result |
fullErrorCode | Error details |
errorMessage | System error text messages |
AmountOut | Potential win amount |
CountEvents | Number of bets in the coupon |
Coef | Outcome coefficients |
IsLive | Bet type: live or pre-match (true/false) |
LinesId | Match ID |
EventDate | Match date |
Various errors may occur when submitting a bet. The server response contains three key fields:
If the bet is successfully accepted, the server returns:
{
"errorCode": 0,
"fullErrorCode": 0,
"errorMessage": ""
}
Description: The coupon has been accepted, and there are no errors.
If an error occurs, the server returns:
{
"errorCode": 1,
"fullErrorCode": [ERROR_CODE],
"errorMessage": "[ERROR_DESCRIPTION]"
}
Description: One of the possible errors occurred. Below are the error codes and messages.
Error Code (fullErrorCode) | Error Message (errorMessage) | Description |
---|---|---|
1 | error_wrong_bet_data | Incorrect bet data. Check the list_bets parameter and other required fields. |
1 | error_block_bet_data | The bet is temporarily blocked and cannot be accepted. |
1 | error_repeat_bet_data | Duplicate bets on the same outcome from one match are not allowed. |
2 | label_change_rate | The odds have changed. The coupon was rejected due to a mismatch between the specified and current odds. |
3 | error_exist_bet | The specified bet outcome no longer exists. Check the data for accuracy. |
99 | Invalid access level | The user does not have the rights to perform this operation. Most likely, reauthorization is required, cookies are missing, or the account is blocked. |
99 | Error exist remote host! | The remote_host parameter is incorrect or missing. Check your server settings. |
{
"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
}
]
}
list_bets
and the presence of all mandatory fields.rate_mode = reject
is used, handle errors related to odds changes (label_change_rate
).remote_host
parameter.errorCode
, fullErrorCode
, errorMessage
) to simplify debugging and interaction with support.99
errors, check access rights and API configurations on your side.When a bet is added to our system and calculated, we send the coupon results to your server. These can include:
Requests are sent to the address you specified in the remote_host
parameter. The string /api/bet/result
is automatically appended to this address. Ensure that your server is configured to receive data at this path.
Example of the Final Address:
If you specified: remote_host = https://mysite.com
, we will send data to: https://mysite.com/api/bet/result
.
{
"remote_host": "https://mysite.com",
"Heads": [{
"KeyHead": {
"Id": "344143",
"BarCode": "x9c52i8411"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 11130,
"DateReceive": "1597075782"
}]
}
{
"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"
}]
}
Field | Description |
---|---|
remote_host | The address of your server where data is sent. |
Id | Unique identifier of the bet in our system. Ignored in most cases. |
BarCode | Unique coupon number. |
Status | Current status of the coupon. Possible values: 2 — win, 4 — loss. |
ExtStatus | Additional status in case of a refund: 0 — no changes, 1 — one or more outcomes were calculated with a changed coefficient. |
AmountOut | Win amount (if the coupon won). |
DateReceive | The time and date when the coupon was calculated. |
remote_host + /api/bet/result
.