Skip to main content

Overview

Create multipliers that determine payout amounts for winning bets. Multipliers can be configured for standard NUMERO bets or special REVENTADO payouts.

Endpoint

POST /api/v1/multipliers
Authorization: ADMIN only

Request Body

loteriaId
string
required
UUID of the lottery this multiplier belongs to
name
string
required
Display name for the multiplier (2-32 characters)Examples:
  • “Base” (for default multiplier)
  • “Base 80x”
  • “REVENTADO Especial”
  • “Promoción Fin de Semana”
valueX
number
required
Multiplier value (must be positive)Common values:
  • Standard: 70-95
  • REVENTADO: 300-1000
Formula: Payout = Bet Amount × valueX
kind
string
default:"NUMERO"
Multiplier type:
  • NUMERO: Standard bet multiplier
  • REVENTADO: Extra multiplier for matching REVENTADO bets
appliesToDate
string
ISO 8601 date for date-specific multipliers (null = applies always)Use case: Special multipliers for specific dates
appliesToSorteoId
string
UUID of specific sorteo (null = applies to all sorteos)Use case: REVENTADO multipliers for specific draws
isActive
boolean
default:"true"
Whether the multiplier is active and can be used

Multiplier Types

Base Multiplier (NUMERO)

Standard multiplier used for all NUMERO bets in the lottery.
{
  "loteriaId": "loteria-uuid",
  "name": "Base",
  "valueX": 80,
  "kind": "NUMERO",
  "isActive": true
}
Resolution priority: Base multipliers are resolved using a 5-level hierarchy:
  1. User multiplier override
  2. Banca loteria setting
  3. Loteria multiplier with name="Base"
  4. Loteria rulesJson.baseMultiplierX
  5. System default (env variable)

REVENTADO Multiplier

Extra multiplier for winning REVENTADO bets (matching number + color).
{
  "loteriaId": "loteria-uuid",
  "name": "REVENTADO Alto",
  "valueX": 500,
  "kind": "REVENTADO",
  "isActive": true
}

Sorteo-Specific REVENTADO

REVENTADO multiplier for a specific draw.
{
  "loteriaId": "loteria-uuid",
  "name": "REVENTADO Especial - Sorteo 12:55",
  "valueX": 600,
  "kind": "REVENTADO",
  "appliesToSorteoId": "sorteo-uuid",
  "isActive": true
}

Date-Specific Multiplier

Special multiplier for a specific date.
{
  "loteriaId": "loteria-uuid",
  "name": "Promoción Navidad",
  "valueX": 85,
  "kind": "NUMERO",
  "appliesToDate": "2025-12-25T00:00:00.000Z",
  "isActive": true
}

Response

success
boolean
Indicates if the request was successful
data
object
Created multiplier

Examples

curl -X POST "https://api.example.com/api/v1/multipliers" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "loteriaId": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Base",
    "valueX": 80,
    "kind": "NUMERO",
    "isActive": true
  }'

Response Example

{
  "success": true,
  "data": {
    "id": "multiplier-uuid",
    "loteriaId": "550e8400-e29b-41d4-a716-446655440000",
    "name": "Base",
    "valueX": 80,
    "kind": "NUMERO",
    "appliesToDate": null,
    "appliesToSorteoId": null,
    "isActive": true,
    "createdAt": "2025-03-15T10:00:00.000Z",
    "updatedAt": "2025-03-15T10:00:00.000Z",
    "createdBy": {
      "id": "admin-uuid",
      "name": "Admin User",
      "username": "admin"
    }
  }
}

Best Practices

Every lottery should have at least one multiplier with name="Base" and kind="NUMERO" to serve as the default payout multiplier.This ensures consistent behavior and avoids falling back to environment defaults.
Good names help identify multipliers quickly:
  • Base multipliers: “Base”, “Base 80x”, “Estándar”
  • REVENTADO: “REVENTADO Alto”, “REVENTADO 500x”, “REVENTADO Especial”
  • Promotional: “Promoción Fin de Semana”, “Navidad 2025”
For special draws, create REVENTADO multipliers with appliesToSorteoId to ensure they only apply to specific sorteos.This prevents accidental application to the wrong draw.
Higher multipliers increase payout risk. Before creating high-value multipliers:
  1. Review current exposure for the lottery
  2. Set appropriate restriction rules
  3. Monitor sales patterns

Snapshot Immutability

Multipliers are frozen at ticket creationWhen a ticket is created, the finalMultiplierX value is captured and stored in each jugada. Updating or deleting a multiplier does not affect existing tickets.Only new tickets created after the change will use the updated multiplier.

Error Responses

{
  "success": false,
  "error": "Validation failed",
  "issues": [
    {
      "path": ["valueX"],
      "message": "valueX must be positive"
    }
  ]
}

List Multipliers

View all multipliers

Update Multiplier

Modify existing multiplier

Multiplier Overrides

Create user-specific overrides

Implementation Details

From src/api/v1/controllers/multiplier.controller.ts:6-9:
async create(req: AuthenticatedRequest, res: Response) {
  const r = await MultiplierService.create(req.user!.id, req.body);
  return res.status(201).json({ success: true, data: r });
}

Build docs developers (and LLMs) love