Betby Widget & Callback API

Integrate the widget via API and receive all events through callbacks.

GET Widget URL 🔽

Retrieve the iframe URL for embedding the widget for a specific user:

GET /api/widget?user=USER_ID
Headers:
  Authorization: Bearer YOUR_API_KEY

Response:
{
  "status": "success",
  "user": "user123",
  "iframeUrl": "https://{widgeturl}/embed?user=user123&brand={}&jwt={}&vendor_id{}"
}

Embed example:
<iframe src="https://{widgeturl}/embed?user=user123&brand={}&jwt={}&vendor_id{}" width="100%" height="800" frameborder="0"></iframe>
        

Callback: New Bet 🔽

Sent when the user places a new bet in the widget:

POST /webhook/new-bet
Content-Type: application/json

{
  "betId": "B123456",
  "brand": "Brand 1",
  "userId": "user123",
  "stake": 50,
  "selection": "Team A",
  "odds": 2.5,
  "timestamp": "2026-02-10T12:00:00Z"
}

Response:
{
  "status": "received",
  "message": "Callback processed"
}
        

Callback: Bet Result 🔽

Sent when the bet is resolved (win/loss/refund):

POST /webhook/bet-result
Content-Type: application/json

{
  "betId": "B123456",
  "userId": "user123",
  "status": "won",
  "stake": 50,
  "payout": 125,
  "timestamp": "2026-02-10T14:00:00Z"
}

Response:
{
  "status": "received",
  "message": "Callback processed"
}
        

Callback: Daily Settlement 🔽

Sent once per day (or per batch) with all bets settled for the brand:

POST /webhook/settlement
Content-Type: application/json

{
  "date": "2026-02-10",
  "brand": "Brand 1",
  "totalBets": 1250,
  "totalGGR": 250,
  "settledBets": [
    {"betId":"B123456","status":"won","payout":125},
    {"betId":"B123457","status":"lost","payout":0}
  ]
}

Response:
{
  "status": "received",
  "message": "Callback processed"
}
        

Error Codes 🔽

400 - Bad Request (invalid payload)
401 - Unauthorized (invalid API key)
403 - Forbidden (IP not allowed)
404 - Not Found (user or brand does not exist)
500 - Internal Server Error