Skip to main content
GET
/
api
/
v1
/
admin
/
dashboard
/
exposure
Exposure Analysis
curl --request GET \
  --url https://api.example.com/api/v1/admin/dashboard/exposure
{
  "byNumber": [
    {
      "number": "<string>",
      "totalBets": 123,
      "potentialPayout": 123,
      "riskLevel": "<string>",
      "ticketCount": 123
    }
  ],
  "byLoteria": [
    {}
  ],
  "totals": {
    "totalExposure": 123,
    "maxSingleExposure": 123,
    "highRiskCount": 123
  }
}

Overview

Calculates financial exposure (potential payouts) grouped by numbers, lotteries, or bet types. Identifies high-risk concentrations.

Authentication

Requires JWT authentication. VENDEDOR role is not authorized.

Query Parameters

date
enum
default:"today"
Date range preset: today, yesterday, week, month, year, range
fromDate
string
Start date in YYYY-MM-DD (required if date=range)
toDate
string
End date in YYYY-MM-DD (required if date=range)
ventanaId
string
Filter by ventana
loteriaId
string
Filter by lottery
betType
string
Filter by bet type
top
number
default:"10"
Number of top results to return

Response

byNumber
array
Exposure by number (top N)
byLoteria
array
Exposure by lottery
totals
object
Overall exposure totals

Risk Levels

  • low: Exposure < 50,000
  • medium: 50,000 ≤ Exposure < 100,000
  • high: 100,000 ≤ Exposure < 200,000
  • critical: Exposure ≥ 200,000

Example Request

GET /api/v1/admin/dashboard/exposure?date=today&top=20

Example Response

{
  "success": true,
  "data": {
    "byNumber": [
      {
        "number": "25",
        "totalBets": 150000,
        "potentialPayout": 750000,
        "riskLevel": "critical",
        "ticketCount": 45
      },
      {
        "number": "07",
        "totalBets": 80000,
        "potentialPayout": 400000,
        "riskLevel": "high",
        "ticketCount": 28
      }
    ],
    "totals": {
      "totalExposure": 2500000,
      "maxSingleExposure": 750000,
      "highRiskCount": 5
    }
  },
  "meta": {
    "range": {
      "fromAt": "2024-03-15T06:00:00.000Z",
      "toAt": "2024-03-16T05:59:59.999Z"
    },
    "generatedAt": "2024-03-15T12:00:00.000Z"
  }
}

Build docs developers (and LLMs) love