API Documentation
System Integration for Bet and Coupon Calculation
Built for betting operators, bookmakers and platform developers who want bet settlement and coupon handling to run by themselves. It plugs result settlement in quickly, reports coupon status accurately — won, lost or refunded — and keeps the traffic between the operator’s server and the settlement system simple.
REST over HTTPSJSON onlyPackage header authapi.sportapi.net
POST /v1/couponjson
{
"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"
}01 — How the system works
02 — User authorization
Error responsejson
"errorCode":1,
"fullErrorCode":99,
"errorMessage":"Invalid access level"03 — 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": "demo-login@demosportapi.net",
"password": "demo-password"
})
headers = {
'Content-Type': 'application/json'
}
print(response.text)04 — The method for submitting a bet or coupon
Example body payloadjson
{
"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"
}
}05 — remote_host & rate_mode parameters
06 — Response fields & error description
07 — Successful operation
Successful operationjson
{
"errorCode": 0,
"fullErrorCode": 0,
"errorMessage": ""
}08 — Error codes
General errorjson
{
"errorCode": 1,
"fullErrorCode": [ERROR_CODE],
"errorMessage": "[ERROR_DESCRIPTION]"
}09 — What to do when the odds have moved
What to do when the odds have movedjson
{
"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
}
]
}10 — Sending calculation results
Sample payload: one couponjson
{
"remote_host": "https://mysite.com",
"Heads": [{
"KeyHead": {
"Id": "344143",
"BarCode": "x9c52i8411"
},
"Status": 2,
"ExtStatus": 0,
"AmountOut": 11130,
"DateReceive": "1597075782"
}]
}11 — Sample payload: several coupons
Sample payload: several couponsjson
{
"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"
}]
}