Restaurant - Attendance Record
AttendanceRecordController_registerAttendance
const url = 'https://api.inspow.tech/api/v1/restaurant/attendance-record/register';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"userId":"60d0fe4f5311236168a109ca","beneficiaryId":"60d0fe4f5311236168a109cb","mealType":"LUNCH","entryMethod":"MANUAL","methodMeta":{"qrPayload":"user123_lunch_2024-09-28","deviceId":"terminal_001"},"requestId":"req_123456789","serviceDate":"2025-10-04T12:30:00.000Z","timezoneOffset":300}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.inspow.tech/api/v1/restaurant/attendance-record/register \ --header 'Content-Type: application/json' \ --data '{ "userId": "60d0fe4f5311236168a109ca", "beneficiaryId": "60d0fe4f5311236168a109cb", "mealType": "LUNCH", "entryMethod": "MANUAL", "methodMeta": { "qrPayload": "user123_lunch_2024-09-28", "deviceId": "terminal_001" }, "requestId": "req_123456789", "serviceDate": "2025-10-04T12:30:00.000Z", "timezoneOffset": 300 }'Request Body required
Sección titulada «Request Body required »object
ID del usuario (pagador) - requerido si no se proporciona beneficiaryId
Example
60d0fe4f5311236168a109caID del beneficiario - requerido si no se proporciona userId
Example
60d0fe4f5311236168a109cbTipo de servicio a registrar (dinámico según vertical del tenant). Restaurant: BREAKFAST, LUNCH, DINNER, SNACK, DESSERT. Gym: GYM_ACCESS, CLASS_SESSION, PERSONAL_TRAINING, SPA_ACCESS. Academy: COURSE_SESSION, WORKSHOP, TUTORING, CERTIFICATION. Coworking: DESK_ACCESS, MEETING_ROOM, EVENT_SPACE, LOCKER. Club: CLUB_ACCESS, FACILITY_BOOKING, EVENT_ATTENDANCE. Clinic: CONSULTATION, THERAPY_SESSION, CHECKUP, TREATMENT.
Example
LUNCHMétodo de entrada
Example
QRMetadatos específicos del método de registro
object
Example
{ "qrPayload": "user123_lunch_2024-09-28", "deviceId": "terminal_001"}ID de request para idempotencia
Example
req_123456789Fecha del servicio (formato ISO 8601). Si no se proporciona, se usa la fecha actual del servidor.
Example
2025-10-04T12:30:00.000ZTimezone offset del cliente en minutos (e.g., 300 para UTC-5, -60 para UTC+1). Usado para determinar el día local para validación de duplicados.
Example
300Responses
Sección titulada « Responses »Registra asistencia por userId o beneficiaryId + mealType
object
The ID of the subscription this invoice covers.
Type of meal for this attendance record.
Date when the service was provided.
Method of entry registration.
Metadata specific to the entry method.
object
Unique request ID for idempotency.
The timestamp when the attendance record was created.
The timestamp when the attendance record was last updated.
The user who created the attendance record.
The user who last updated the attendance record.
Example
{ "subscription": "645cc3d3f8a9c9a2b88a22f1", "mealType": "BREAKFAST", "serviceDate": "2025-05-01T12:00:00.000Z", "entryMethod": "MANUAL", "methodMeta": { "qrPayload": "subscription_123_meal_lunch_date_2024-08-24", "deviceId": "scanner_001", "locationId": "cafeteria_main", "capturedAt": "2024-08-24T12:00:00.000Z" }, "requestId": "req_lunch_2024-08-24_abc123", "createdAt": "2024-08-24T12:00:00.000Z", "updatedAt": "2024-08-24T12:05:00.000Z", "createdBy": "645cc3d3f8a9c9a2b88a22c1", "updatedBy": "645cc3d3f8a9c9a2b88a22c2"}