GET /api/v1/sorteos
Retrieves a list of sorteos (lottery draws) with support for pagination, filtering, and grouping.For VENDEDOR role, results are automatically filtered based on their commission policy. Only sorteos with applicable commission rules are shown.
Authentication
Requires authentication. Available to all roles with different access levels:- ADMIN: See all sorteos
- VENTANA: See all sorteos
- VENDEDOR: See only sorteos matching their commission policy
Query Parameters
Page number for pagination (min: 1)
Number of items per page (min: 1, max: 100)
Filter by loteria UUID. Returns only sorteos for the specified loteria.
Filter by sorteo status.Values:
SCHEDULED, OPEN, EVALUATED, CLOSEDFilter by active status.
true: Show only active sorteosfalse: Show only inactive sorteos- Omit: Show all sorteos
Search by sorteo name or winning number (min: 1, max: 100 characters)
Preset date range filter.Values:
today, yesterday, week, month, year, rangeWhen using range, also provide fromDate and toDate.Start date for custom range filter (format:
YYYY-MM-DD)Example: 2025-03-01End date for custom range filter (format:
YYYY-MM-DD)Example: 2025-03-31Group sorteos by specific criteria.Values:
hour: Group by scheduled hour onlyloteria-hour: Group by loteria + scheduled hour
Response
Indicates if the operation was successful
Array of sorteo objects
Pagination metadata
Example Request
Example Response (Paginated)
Example Response (Grouped by Hour)
Example Response (Grouped by Loteria + Hour)
Commission Policy Filtering (VENDEDOR)
The filtering logic:- Retrieves the vendedor’s commission policy
- Gets all active multipliers for each sorteo’s loteria
- Checks if any multiplier has a specific commission rule (not just
defaultPercent) - Only shows sorteos where at least one multiplier matches a commission rule
Date Range Presets
Grouping Modes
Group by Hour
Groups sorteos by their scheduled hour, useful for displaying all loterias at the same time:Group by Loteria + Hour
Groups sorteos by both loteria and hour, useful for showing recurring schedules:Related Endpoints
Get Sorteo
Get a single sorteo by ID
Create Sorteo
Create a new sorteo
Filter by Loteria
Get loteria details
Commission Policy
Understand commission filtering