Skip to main content

GET /api/v1/sorteos/:id

Retrieves detailed information about a specific sorteo (lottery draw) by its UUID.

Authentication

Requires authentication. Available to all roles.

Path Parameters

id
string
required
UUID of the sorteo to retrieve

Response

success
boolean
Indicates if the operation was successful
data
object
The sorteo object with full details

Example Request

curl https://api.example.com/api/v1/sorteos/7c9e6679-7425-40de-944b-e07fc1f90ae7 \
  -H "Authorization: Bearer YOUR_TOKEN"

Example Response

{
  "success": true,
  "data": {
    "id": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "loteriaId": "550e8400-e29b-41d4-a716-446655440000",
    "scheduledAt": "2025-03-03T12:55:00-06:00",
    "name": "Lotto 12:55 PM",
    "status": "EVALUATED",
    "digits": 2,
    "isActive": true,
    "reventadoEnabled": true,
    "winningNumber": "42",
    "hasWinner": true,
    "extraMultiplierId": "a1b2c3d4-e5f6-4a5b-9c8d-1e2f3a4b5c6d",
    "extraMultiplierX": 5,
    "extraOutcomeCode": "REVENTADO x5",
    "loteria": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Lotto",
      "rulesJson": {
        "digits": 2,
        "drawSchedule": {
          "frequency": "diario",
          "times": ["12:55", "18:55"]
        },
        "reventadoConfig": {
          "enabled": true
        }
      }
    },
    "extraMultiplier": {
      "id": "a1b2c3d4-e5f6-4a5b-9c8d-1e2f3a4b5c6d",
      "name": "REVENTADO x5",
      "valueX": 5
    },
    "createdAt": "2025-03-03T10:00:00-06:00",
    "updatedAt": "2025-03-03T13:00:00-06:00"
  }
}

Error Responses

{
  "success": false,
  "error": "Sorteo no encontrado"
}

Understanding Sorteo Status

The status field indicates the current lifecycle state:
Sorteo is created and waiting to be opened. No ticket sales yet.Allowed Operations:
  • Update sorteo details
  • Open sorteo
  • Delete/deactivate sorteo
Sorteo is accepting ticket sales. Vendedores can create tickets.Allowed Operations:
  • Create tickets
  • Close sorteo
  • Evaluate sorteo (set winning number)
Winning number has been set. Winners have been identified.Allowed Operations:
  • Pay winning tickets
  • Close sorteo
  • Revert evaluation (admin only)
Sorteo is permanently closed. No further operations allowed.Terminal State - Cannot be reopened.

REVENTADO Multipliers

REVENTADO is an extra multiplier feature that can apply additional winnings to specific numbers.
When a sorteo has reventadoEnabled: true:
  • The loteria has REVENTADO multipliers configured
  • During evaluation, an optional extraMultiplierId can be specified
  • Tickets with REVENTADO bets on the winning number get extra payouts
Example flow:
1

Sorteo Created

Sorteo is created with reventadoEnabled: true (inherited from loteria)
2

Tickets Sold

Vendedores sell tickets with NUMERO and REVENTADO bets
3

Evaluation

Admin evaluates sorteo with winningNumber: "42" and extraMultiplierId: "xxx"
4

Winners Calculated

  • NUMERO bets on “42” win with normal multiplier
  • REVENTADO bets on “42” win with extra multiplier (e.g., x5)

List Sorteos

Get all sorteos with filtering

Update Sorteo

Update sorteo details

Evaluate Sorteo

Set winning number

Multipliers Guide

Learn about multiplier system

Build docs developers (and LLMs) love