Authentication
Requires authentication. Available to roles:VENDEDOR, VENTANA, ADMIN.
Query Parameters
Page number for pagination.
Number of tickets per page.
Filter scope based on user role:
mine: User’s own tickets (VENDEDOR: their tickets, VENTANA: their ventana’s tickets)all: All tickets (ADMIN only)
Date filter preset. Options:
today: Today’s tickets (Costa Rica timezone)yesterday: Yesterday’s ticketsthisWeek: Current weekthisMonth: Current monthlastWeek: Previous weeklastMonth: Previous month
fromDate or toDate are provided.Start date for custom range (ISO 8601 format). When provided, overrides
date parameter.End date for custom range (ISO 8601 format). When provided, overrides
date parameter.Filter by ticket number (e.g., “T260303-00042A-15”).
Filter by lottery winning number (shows tickets with jugadas matching this number).
Filter by sorteo scheduled time.
Filter by active status.
true: Only active ticketsfalse: Only inactive tickets
Filter to show only winning tickets.
true: Only tickets withisWinner=truefalse: Only non-winning tickets
Filter by lottery UUID.
Filter by sorteo UUID. When provided without explicit date range, date filters are skipped.
Filter by ventana UUID. Subject to RBAC validation:
- VENDEDOR: Cannot specify (always filtered to their ventana)
- VENTANA: Cannot specify other ventanas
- ADMIN: Can specify any ventana
Filter by vendedor UUID (maps to
userId internally). Subject to RBAC validation:- VENDEDOR: Cannot specify (always filtered to themselves)
- VENTANA: Can only specify vendedores in their ventana
- ADMIN: Can specify any vendedor
Filter by multiplier UUID (shows tickets with jugadas using this multiplier).
Filter by ticket status. Options:
ACTIVE: Active ticketsCANCELLED: Cancelled ticketsEVALUATED: Evaluated tickets (sorteo completed)PAID: Paid winning ticketsEXCLUDED: Excluded from reports
Response Fields
Array of ticket objects.
Pagination metadata.
RBAC Filtering
The endpoint automatically applies role-based filters:VENDEDOR
- Automatically filters to tickets where
vendedorId = user.id - Cannot see tickets from other vendedores
scopeis alwaysmine
VENTANA
- Automatically filters to tickets where
ventanaId = user.ventanaId - Can see all vendedores in their ventana
scopeis alwaysmine- If
ventanaIdis not in JWT, it’s fetched from database
ADMIN
- Can use
scope=allto see all tickets - Can use
scope=mineto see tickets from their assigned ventana - Can filter by any
ventanaIdorvendedorId
Date Range Resolution
Special Rule: sorteoId with No Explicit Dates
WhensorteoId is provided without fromDate or toDate, date filters are skipped to show all tickets for that sorteo regardless of when they were created.
Normal Date Resolution
When nosorteoId is provided, or when explicit dates are given:
- Explicit Range:
fromDateandtoDatetake precedence - Date Preset: Uses
dateparameter (e.g., “today”, “thisWeek”) - Default: “today” if nothing is specified
Example Requests
Get Today’s Tickets (VENDEDOR)
Get Tickets for Specific Sorteo (ADMIN)
Get Winners Only with Custom Date Range
Get Tickets by Number
Example Response
Error Responses
403 Forbidden
Notes
- Results are automatically filtered based on user role and permissions
- The
vendedorIdquery parameter is mapped touserIdinternally for repository compatibility - Date filters use Costa Rica timezone for business date calculations
- When filtering by
sorteoIdwithout explicit dates, all tickets for that sorteo are returned regardless of creation date - Activity logs track all list queries for audit purposes