Skip to main content
POST
/
asistencia
/
finalizar
End Shift
curl --request POST \
  --url https://api.example.com/asistencia/finalizar \
  --header 'Content-Type: application/json' \
  --data '
{
  "empleadoId": 123,
  "unidadId": 123,
  "finDeposito": true,
  "foto": "<string>",
  "unidadAsignadaId": 123,
  "hora": "<string>"
}
'
{
  "success": true,
  "data": null,
  "message": "<string>"
}

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

empleadoId
integer
required
The unique identifier of the employee ending their shift
unidadId
integer
required
The ID of the unit/location where the employee is ending their shift
finDeposito
boolean
Indicates whether the cash deposit has been completed at shift end (optional)
foto
string
Base64-encoded photo of the employee for attendance verification (optional)
unidadAsignadaId
integer
The ID of the employee’s assigned unit (optional)
hora
string
Custom time for shift end in HH:mm:ss format (optional). If not provided, current time is used

Response

success
boolean
Indicates whether the operation was successful
data
null
No data is returned for this endpoint
message
string
Confirmation message: “Jornada finalizada”

Example Request

cURL
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 Response
{
  "success": true,
  "data": null,
  "message": "Jornada finalizada"
}
Error Response
{
  "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

Build docs developers (and LLMs) love