Skip to main content
All endpoints require session authentication. Check for usuario in req.session.

Beverage Permits

Endpoints for managing alcoholic beverage sales permits (/venta_de_bebidas).

GET /venta_de_bebidas

List all beverage permits. Authentication Required: Active session Response: Renders view with all permits from permisos_bebidas table

POST /venta_de_bebidas/get

Get a single permit by ID. Request Body
id
number
required
Permit ID
Response
result
object
Permit object with all fields
usuario
object
Session user information

POST /venta_de_bebidas/search

Search permits with filters. Request Body
estado
string
required
Filter by status: “Todos”, “Emitido”, or “No Emitido”
busqueda
string
Search query (matches code, name, document, phone, sector)
Response
plantilla
string
HTML template with filtered and highlighted results

POST /venta_de_bebidas/add

Create a new beverage permit. Authentication Required: Active session Content-Type: multipart/form-data (supports file upload) Request Body
habilitacion
date
required
Start date (YYYY-MM-DD)
vencimiento
date
required
Expiration date (YYYY-MM-DD)
horario
string
required
Permitted hours
nombre
string
required
Applicant first name
apellido
string
required
Applicant last name
idDocument
string
required
ID document number
tlf
string
required
Phone number
habitacion
string
required
Residence/address
sector
string
required
Permitted sector/area
comprobante
file
Payment receipt upload (optional)
today
date
required
Current date for validation (YYYY-MM-DD)
Response
success
string
Success message: “¡Se ha registrado correctamente el permiso!”
permiso
string
Generated permit code (format: YYYY-NNN)
Example Request
curl -X POST http://localhost/venta_de_bebidas/add \
  -H "Content-Type: multipart/form-data" \
  --cookie "connect.sid=SESSION_ID" \
  -F "nombre=Juan" \
  -F "apellido=Pérez" \
  -F "idDocument=12345678" \
  -F "tlf=04141234567" \
  -F "habitacion=Av. Principal #123" \
  -F "sector=Centro" \
  -F "habilitacion=2026-03-01" \
  -F "vencimiento=2026-12-31" \
  -F "horario=8:00 AM - 10:00 PM" \
  -F "today=2026-03-04" \
  -F "[email protected]"

POST /venta_de_bebidas/edit

Update an existing permit. Request Body: Same as /add plus:
permiso
number
required
Permit ID to edit
needPermiso
boolean
required
Whether payment receipt is included (“true” or “false”)
Response
success
string
“¡Se ha editado correctamente el permiso!”

POST /venta_de_bebidas/aprobate

Approve a permit (upload authorized permit file). Authentication Required: Active session Content-Type: multipart/form-data Request Body
permiso
number
required
Permit ID to approve
permiso_aprobado
file
required
Authorized permit document
Response
success
string
“¡Se ha aprobado correctamente el permiso!”

POST /venta_de_bebidas/cancel

Cancel a permit with observation. Request Body
permiso
number
required
Permit ID to cancel
observacion
string
required
Reason for cancellation
Response
success
string
“¡Se ha cancelado la emisión del permiso correctamente!”

DELETE /venta_de_bebidas

Delete a permit (admin/developer only). Authentication Required: Administrador or Desarrollador role Request Body
id
number
required
Permit ID to delete
Response
message
string
Success or error message
Status Codes:
  • 200: Permit deleted successfully
  • 404: Permit not found
  • 409: Cannot delete (already approved or approved permits exist after this one)
  • 500: Server error

GET /venta_de_bebidas/permiso/:permiso

Generate PDF permit document. Authentication Required: Active session URL Parameters
permiso
string
required
Permit identifier (format: bebidas-alcoholicas_YYYY-NNN)
Response: PDF document with permit details Example Request
curl http://localhost/venta_de_bebidas/permiso/bebidas-alcoholicas_2026-001 \
  --cookie "connect.sid=SESSION_ID" \
  -o permit.pdf

GET /venta_de_bebidas/reporte

Generate complete report of all beverage permits. Response: PDF report with statistics and permit listings

Advertising Permits

Endpoints for advertising and propaganda permits (/publicidad_y_propaganda). All endpoints follow the same structure as beverage permits with additional fields: Additional Fields for Add/Edit:
publicidad_volantes
boolean
Flyers included
publicidad_afiches
boolean
Posters included
publicidad_pendones
boolean
Banners included
publicidad_habladores
boolean
Shelf talkers included
publicidad_stands
boolean
Stands included
publicidad_calcomanias
boolean
Stickers included
publicidad_banderolas
boolean
Flag banners included
publicidad_otros
boolean
Other types included
publicidad_otros_descripcion
string
Description of other advertising types
comentarios
string
Additional comments

Endpoints

  • GET /publicidad_y_propaganda - List all
  • POST /publicidad_y_propaganda/get - Get by ID
  • POST /publicidad_y_propaganda/search - Search
  • POST /publicidad_y_propaganda/add - Create
  • POST /publicidad_y_propaganda/edit - Update
  • POST /publicidad_y_propaganda/aprobate - Approve
  • POST /publicidad_y_propaganda/cancel - Cancel
  • DELETE /publicidad_y_propaganda - Delete (admin only)
  • GET /publicidad_y_propaganda/permiso/publicidad-y-propaganda_YYYY-NNN - Generate PDF
  • GET /publicidad_y_propaganda/reporte - Generate report

Special Events Permits

Endpoints for special events permits (/eventos_especiales). All endpoints follow the same structure as beverage permits with additional fields: Additional Fields for Add/Edit:
nombre_evento
string
required
Event name
tipo_evento
string
required
Event type: “Deportivo”, “Cultural”, “Benefico”, “Educativo”, “Religioso”, or custom
servicio_comida
boolean
Food service included
servicio_bebidas
boolean
Beverage service included
servicio_confiteria
boolean
Confectionery service included
servicio_varios
boolean
Various items service included
servicio_heladeria
boolean
Ice cream service included
servicio_otros
string
Other services description

Endpoints

  • GET /eventos_especiales - List all
  • POST /eventos_especiales/get - Get by ID
  • POST /eventos_especiales/search - Search
  • POST /eventos_especiales/add - Create
  • POST /eventos_especiales/edit - Update
  • POST /eventos_especiales/aprobate - Approve
  • POST /eventos_especiales/cancel - Cancel
  • DELETE /eventos_especiales - Delete (admin only)
  • GET /eventos_especiales/permiso/eventos-especiales_YYYY-NNN - Generate PDF
  • GET /eventos_especiales/reporte - Generate report

Build docs developers (and LLMs) love