POST /api/v1/loterias
Creates a new loteria (lottery) with optional configuration rules for draw schedules, digits, and REVENTADO settings.Loterias define the game rules and schedules. Individual draws (sorteos) are created separately based on the loteria configuration.
Authentication
Requires authentication. Typically ADMIN role for creation.Request Body
Unique name for the loteria.Examples:
"Lotto", "Tica", "Monazo"Min: 2 charactersConfiguration rules for the loteria.
Whether the loteria is active and available for use.
Response
Indicates if the operation was successful
The created loteria object
Example Request (Simple)
Example Request (With Schedule)
Example Response
Error Responses
Configuration Examples
Draw Schedule Rules
ThedrawSchedule configuration determines when sorteos are automatically created:
Define Times
List all draw times in 24-hour format (Costa Rica timezone).Example:
["12:55", "18:55"] creates 2 draws per day.Optional: Limit Days
Use
daysOfWeek to restrict to specific days.Omit this field for daily draws on all days.REVENTADO Configuration
REVENTADO is an extra multiplier feature that allows additional payouts on specific numbers.
reventadoConfig.enabled: true:
- Sorteos created for this loteria will have
reventadoEnabled: true - Vendedores can sell REVENTADO bets on tickets
- During evaluation, admin can specify an
extraMultiplierIdfor REVENTADO outcomes - REVENTADO bets on the winning number receive extra payouts
Auto-Create Sorteos
TheautoCreateSorteos flag controls automatic sorteo generation:
- Enabled (true)
- Disabled (false)
Automatic Generation
- Sorteos are created by cron job based on
drawSchedule - Runs daily (configurable)
- Creates sorteos for upcoming dates
- Prevents duplicates (idempotent)
Activity Logging
Loteria creation is logged:Next Steps
After creating a loteria:Create Multipliers
Define multiplier values via Create Multiplier.
Preview Schedule
Verify sorteo generation with Preview Schedule.
Seed Sorteos
Generate initial sorteos via Seed Sorteos.
Related Endpoints
List Loterias
Get all loterias
Preview Schedule
Preview generated sorteos
Seed Sorteos
Generate sorteos from schedule
Create Multiplier
Define payout multipliers