Skip to main content

Overview

Update an existing multiplier. Supports partial updates (only specified fields are modified).

Endpoint

PATCH /api/v1/multipliers/:id
Alternative: PUT /api/v1/multipliers/:id (same behavior) Authorization: ADMIN only

Path Parameters

id
string
required
UUID of the multiplier to update

Request Body

loteriaId
string
UUID of the lottery
name
string
Display name (2-32 characters)
valueX
number
Multiplier value (must be positive)
kind
string
Multiplier type: NUMERO or REVENTADO
appliesToDate
string
ISO 8601 date (or null to remove filter)
appliesToSorteoId
string
Sorteo UUID (or null to remove filter)
isActive
boolean
Enable or disable the multiplier

Soft Delete

To soft delete a multiplier, send a DELETE request:
DELETE /api/v1/multipliers/:id
With body:
{
  "isActive": false
}
Or to re-enable:
{
  "isActive": true
}

Restore

Restore a soft-deleted multiplier:
PATCH /api/v1/multipliers/:id/restore
No request body required.

Response

success
boolean
Indicates if the request was successful
data
object
Updated multiplier (see Get Multiplier for full schema)

Examples

curl -X PATCH "https://api.example.com/api/v1/multipliers/550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "valueX": 85
  }'

Response Example

{
  "success": true,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "loteriaId": "loteria-uuid",
    "name": "Base Actualizado",
    "valueX": 85,
    "kind": "NUMERO",
    "appliesToDate": null,
    "appliesToSorteoId": null,
    "isActive": true,
    "updatedAt": "2025-03-15T14:30:00.000Z"
  }
}

Snapshot Immutability

Changes do not affect existing ticketsMultipliers are frozen (finalMultiplierX) when tickets are created. Updating a multiplier only affects:
  • New tickets created after the update
  • Future sorteo evaluations (for REVENTADO)
Existing tickets retain their original multiplier values.

Best Practices

Deactivate multipliers with isActive: false instead of permanently deleting them.This preserves audit trails and allows restoration if needed.
Before updating production multipliers:
  1. Test in development environment
  2. Review exposure analytics
  3. Communicate changes to operators
  4. Monitor initial sales after update
Keep a changelog of multiplier value changes for compliance and analysis:
2025-03-15: Base 80x -> 85x (promotional period)
2025-03-31: Base 85x -> 80x (end of promotion)

Error Responses

{
  "success": false,
  "error": "Multiplier not found",
  "code": "NOT_FOUND"
}

Get Multiplier

View multiplier details

List Multipliers

View all multipliers

Create Multiplier

Create new multiplier

Implementation Details

From src/api/v1/controllers/multiplier.controller.ts:11-14:
async update(req: AuthenticatedRequest, res: Response) {
  const r = await MultiplierService.update(req.user!.id, req.params.id, req.body);
  return res.json({ success: true, data: r });
}
Soft delete from src/api/v1/controllers/multiplier.controller.ts:16-20:
async softDelete(req: AuthenticatedRequest, res: Response) {
  const enable = req.body?.isActive === true;
  const r = await MultiplierService.softDelete(req.user!.id, req.params.id, enable);
  return res.json({ success: true, data: r });
}
Restore from src/api/v1/controllers/multiplier.controller.ts:22-25:
async restore(req: AuthenticatedRequest, res: Response) {
  const r = await MultiplierService.restore(req.user!.id, req.params.id);
  return res.json({ success: true, data: r });
}

Build docs developers (and LLMs) love