Overview
This endpoint registers the end of an employee’s work shift. It captures the employee’s photo, location, and timestamp to mark the completion of their workday. Optionally includes a flag for cash deposit completion.
Request Body
The unique identifier of the employee ending their shift
The ID of the unit/location where the employee is ending their shift
Indicates whether the cash deposit has been completed at shift end (optional)
Base64-encoded photo of the employee for attendance verification (optional)
The ID of the employee’s assigned unit (optional)
Custom time for shift end in HH:mm:ss format (optional). If not provided, current time is used
Response
Indicates whether the operation was successful
No data is returned for this endpoint
Confirmation message: “Jornada finalizada”
Example Request
curl -X POST https://api.integra.com/asistencia/finalizar \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"empleadoId": 123,
"unidadId": 5,
"finDeposito": true,
"foto": "data:image/jpeg;base64,/9j/4AAQSkZJRg...",
"unidadAsignadaId": 5,
"hora": "17:30:00"
}'
Response Example
{
"success": true,
"data": null,
"message": "Jornada finalizada"
}
{
"success": false,
"message": "No hay jornada activa para finalizar"
}
Business Rules
- An employee must have an active shift in progress to finalize it
- The
empleadoId and unidadId are mandatory fields
- The
finDeposito flag is important for cash-handling positions to track deposit completion
- If
hora is not provided, the system uses the current server time
- The shift end time must be after the shift start time
- Unit validation ensures the employee is ending their shift at a valid location