Bet Settlement

Bet Settlement API Reference

Instantly settle any sports bet — match results, handicaps, totals, both-teams-to-score, and more — with a single POST request. Returns granular per-selection outcomes.

Explore Endpoint Try It Live

Overview

Automate your bet settlement pipeline with a single endpoint that supports all common market types.

Instant Results
Sub-100ms settlement responses
Multi-Market
Settle 100+ market types per game
Batch Support
Up to 200 selections per request
Idempotent
Safe to retry — same result every time
The Settlement API is included in all Bet365Soft plans. No extra configuration needed — your existing API key works out of the box.

Authentication

Pass your API key as a query parameter on every request. Do not expose your key in client-side code.

// Query parameter — required on every call
GET https://w7api.com/sports/settle/result?apikey=YOUR_API_KEY&id=GAME_ID&lid=LEAGUE_ID
Never commit your API key to version control or expose it in frontend JavaScript. Use environment variables or a secure server-side proxy.

Base URL

https://w7api.com/sports
ComponentValueDescription
ProtocolHTTPSTLS 1.2+ required
Hostw7api.comPrimary production host
Prefix/sportsSports data namespace
Directory/settleSettlement sub-directory
Full pathhttps://w7api.com/sports/settle/resultSettlement endpoint

How Settlement Works

1
Game Ends
Match concludes. You receive the final score or outcome via the /resultByEvent endpoint or a webhook.
2
Collect Open Selections
Gather all unsettled bet selections for that game from your database — id, bid, mid, name, and value.
3
POST to /settle/result
Send the batch as a JSON array. Include apikey, id (game ID), and lid (league ID) in the query string.
4
Process Response
Each selection in the response carries a result field — Won, Lost, Refund, or Pending — plus the raw data string for audit trails.
5
Update Your Records
Use the idempotency id in the response to update bet statuses in your system. Safe to retry if a network failure occurs.

Endpoint

POST /settle/result Settlement Settle one or many bet selections for a finished game

Settle one or more bet selections by submitting a JSON body with the data array. Each object in the array represents one selection. Query parameters identify the game and league context.

Query Parameters
ParameterTypeRequiredDescription
apikey string Required Your Bet365Soft authentication key
id string Required Game / Event ID from your sportsbook data
lid string Required League ID associated with the game
This endpoint is idempotent. Sending the same request multiple times with the same id returns an identical response — safe for retry logic.

Full POST request with JSON body — all 4 selections example:

POST https://w7api.com/sports/settle/result?apikey=XXXXXXXXXX&id=XXXXXXXXXXXXXXXX&lid=XXXXX Content-Type: application/json { "appId": f379c902f9f85cc523b71eb6cb98751b, "data": [ { "id": 1, "bid": 1, "mid": 1, "name": "Result", "value": "Aston Villa" }, { "id": 2, "bid": 2, "mid": 7, "name": "Handicap", "value": "Freiburg @ 1" }, { "id": 3, "bid": 19, "mid": 180, "name": "Both Teams To Score", "value": "Yes" }, { "id": 4, "bid": 17, "mid": 9, "name": "Total", "value": "Over 0.5" } ] }

Successful 200 response — each selection contains a result and audit data string:

{ "success": true, "id": "XXXXXXXXXXXXXXXXXXXXX", "data": [ { "id": 1, "bid": 1, "mid": 1, "bet": "Result", "value": "Aston Villa", "data": "Winner Team - Aston Villa", "result": "Won" }, { "id": 2, "bid": 2, "mid": 7, "bet": "Handicap", "value": "Freiburg @ 1", "data": "Winner value - 0 - 3", "result": "Lost" }, { "id": 3, "bid": 19, "mid": 180, "bet": "Both Teams To Score", "value": "Yes", "data": "Winner value - 0 - 3", "result": "Lost" }, { "id": 4, "bid": 17, "mid": 9, "bet": "Total", "value": "Over 0.5", "data": "Winner value - 3", "result": "Won" } ] }

Visual breakdown of the example response above:

idbidmidBet Type Selected ValueOutcome DataResult
111 Result Aston Villa Winner Team - Aston Villa Won
227 Handicap Freiburg @ 1 Winner value - 0 - 3 Lost
319180 Both Teams To Score Yes Winner value - 0 - 3 Lost
4179 Total Over 0.5 Winner value - 3 Won

Request Body Fields

The request body must be a JSON object with a single data key whose value is an array of selection objects. Each object must contain:

FieldTypeRequiredDescription
id integer Required Your internal selection row ID — returned unchanged for mapping
bid integer Required Bet market ID — identifies the market category (e.g. 1 = Result, 2 = Handicap)
mid integer Required Market outcome ID — specific outcome within the market
name string Required Human-readable market name — e.g. "Result", "Handicap", "Total"
value string Required The bettor's selected value — e.g. "Aston Villa", "Over 0.5", "Yes"
You may submit between 1 and 200 selection objects per request. Exceeding 200 selections will return a 422 validation error.

Response Object Fields

FieldTypeSourceDescription
success boolean Response true if settlement processed, false on error
id string Response Unique idempotency token for this settlement request
data[].id integer Echoed Your original selection id — unchanged for easy mapping
data[].bid integer Echoed Market ID echoed from request
data[].mid integer Echoed Outcome ID echoed from request
data[].bet string Response Market name (maps to name field in request)
data[].value string Echoed Selected value echoed from request
data[].data string Response Human-readable audit string — actual outcome data for the market
data[].result string Response Won | Lost | Refund | Pending

Supported Market Types

Match Markets
bidMarketExample Value
1Match Result (1X2)"Aston Villa" / "Draw"
2Asian Handicap"Freiburg @ 1"
9Total Goals O/U"Over 0.5"
17Total (lines)"Over 2.5"
19Both Teams Score"Yes" / "No"
52Double Chance"1 or X"
Half / Period Markets
bidMarketExample Value
601st Half Result"Home Win"
611st Half Total"Under 1.5"
622nd Half Result"Away Win"
180Race To (half)"1 Goal"
200Correct Score"2-1"
210First Goalscorer"O. Watkins"
210Total Even/Odd"Odd"
The full list of 150+ bid values and their exact value format strings is available in your dashboard under Market Reference once you log in.

Try It Live

POST Interactive Settlement Test
RESPONSE

Error Handling

All errors return a JSON body with success: false and a descriptive error message.

{ "success": false, "error": "Invalid API key" }
HTTP CodeErrorCauseResolution
400 Bad Request Missing or malformed JSON body Ensure Content-Type: application/json and valid JSON
401 Unauthorized Invalid or missing apikey Check your API key in the dashboard
404 Not Found Game ID or League ID not found Verify id and lid against your sportsbook data
422 Unprocessable Validation failed on selection fields Check all required fields: id, bid, mid, name, value
429 Rate Limited Too many requests Implement exponential backoff; check plan limits
500 Server Error Internal processing failure Retry with backoff; contact support if persistent

Code Examples

// JavaScript — fetch API const apiKey = 'YOUR_API_KEY'; const gameId = 'XXXXXXXXXXXXXXXX'; const leagueId = 'XXXXX'; const selections = { data: [ { id: 1, bid: 1, mid: 1, name: 'Result', value: 'Aston Villa' }, { id: 2, bid: 2, mid: 7, name: 'Handicap', value: 'Freiburg @ 1' }, ] }; const res = await fetch( `https://w7api.com/sports/settle/result?apikey=${apiKey}&id=${gameId}&lid=${leagueId}`, { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(selections) } ); const json = await res.json(); console.log(json);
<?php // PHP — cURL $apiKey = 'YOUR_API_KEY'; $gameId = 'XXXXXXXXXXXXXXXX'; $leagueId= 'XXXXX'; $url = "https://w7api.com/sports/settle/result?apikey={$apiKey}&id={$gameId}&lid={$leagueId}"; $payload = json_encode(['data' => [ ['id'=>1, 'bid'=>1, 'mid'=>1, 'name'=>'Result', 'value'=>'Aston Villa'], ['id'=>2, 'bid'=>2, 'mid'=>7, 'name'=>'Handicap', 'value'=>'Freiburg @ 1'], ]]); $ch = curl_init($url); curl_setopt_array($ch, [ CURLOPT_POST => true, CURLOPT_POSTFIELDS => $payload, CURLOPT_RETURNTRANSFER=> true, CURLOPT_HTTPHEADER => ['Content-Type: application/json'], ]); $resp = json_decode(curl_exec($ch), true); curl_close($ch); print_r($resp);
# Python — requests library import requests API_KEY = 'YOUR_API_KEY' GAME_ID = 'XXXXXXXXXXXXXXXX' LEAGUE_ID= 'XXXXX' url = f'https://w7api.com/sports/settle/result' params = {'apikey': API_KEY, 'id': GAME_ID, 'lid': LEAGUE_ID} payload = { 'data': [ {'id': 1, 'bid': 1, 'mid': 1, 'name': 'Result', 'value': 'Aston Villa'}, {'id': 2, 'bid': 2, 'mid': 7, 'name': 'Handicap', 'value': 'Freiburg @ 1'}, ] } response = requests.post(url, params=params, json=payload) data = response.json() print(data)
# cURL curl -X POST \ 'https://w7api.com/sports/settle/result?apikey=YOUR_API_KEY&id=XXXXXXXXXXXXXXXX&lid=XXXXX' \ -H 'Content-Type: application/json' \ -d '{ "data": [ {"id": 1, "bid": 1, "mid": 1, "name": "Result", "value": "Aston Villa"}, {"id": 2, "bid": 2, "mid": 7, "name": "Handicap", "value": "Freiburg @ 1"}, {"id": 3, "bid": 19, "mid": 180, "name": "Both Teams To Score", "value": "Yes"}, {"id": 4, "bid": 17, "mid": 9, "name": "Total", "value": "Over 0.5"} ] }'

Ready to start settling bets?

Sign up for free and get your API key in under 2 minutes.