Auto-Settlement & Real-Time Webhooks API
Base URL: https://api.superwin365.tech/api/v1 · Real Matches Only (Virtual Filtered) · CORS & Mobile Ready
Centralized & Automatic Bet Settlement API
Register open bets from your site or poll our Settlements feed. Whenever a real match finishes (Automatic Cron Engine) or Admin declares a market result in /admin/settlements, all matching open bets settle together atomically and push instant signed webhooks to your server.
| Method | Endpoint | Purpose |
|---|---|---|
| POST | /api/v1/settlements/register | Register an open client bet for synchronized auto-settlement |
| GET | /api/v1/settlements?eventId=... | Fetch all declared market settlements (Match Odds, Bookmaker, Fancy) |
| GET | /api/v1/settlements/entries?status=settled | Fetch your settled bet entries with exact payout & profit/loss |
| GET | /api/v1/results?sport=cricket | Fetch completed real matches with official winners |
POST /api/v1/settlements/register (Register Open Bet)
curl -X POST "https://api.superwin365.tech/api/v1/settlements/register" \
-H "X-API-Key: sk_live_YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"external_bet_ref": "BET-98412",
"event_id": "33491821",
"sport": "cricket",
"event_name": "New Zealand v India",
"market_type": "match_odds",
"market_name": "Match Odds",
"selection_name": "India",
"bet_side": "BACK",
"odds_rate": 2.20,
"stake_amount": 1000
}'
PHP Webhook Signature Verification (HMAC-SHA256)
<?php
$rawBody = file_get_contents("php://input");
$signature = $_SERVER["HTTP_X_SPORTPULSE_SIGNATURE"] ?? "";
$secret = "whsec_YOUR_SIGNING_SECRET"; // from /dashboard/webhooks
$expected = hash_hmac("sha256", $rawBody, $secret);
if (!hash_equals($expected, $signature)) {
http_response_code(401);
exit("Invalid signature");
}
$event = json_decode($rawBody, true);
if (($event["event"] ?? "") === "settlement.declared") {
// Automatically settle all matching bets on your site!
$data = $event["data"];
}
http_response_code(200);
echo json_encode(["ok" => true]);