Horarios del negocio
POST
Actualizar horario
POST /api/schedules/update-schedule
Descripción
Edita un horario reutilizable con sus turnos y excepciones.
Detalles
* Actualiza nombre, descripción, vigencia, turnos y excepciones del horario. * Los turnos y excepciones enviados reemplazan por completo a los anteriores. * Debe quedar definido al menos un turno. * Falla si el horario no existe.
Permisos requeridos
admin.module
Request
| Nombre | Tipo | Requerido | Reglas |
|---|---|---|---|
| name | string | Sí |
min:1
max:100
|
| description | string | No |
max:500
|
| dateStart | string | No |
max:10
|
| dateEnd | string | No |
max:10
|
| periods | array | Sí | — |
| periods[].dayOfWeek | int | Sí |
min_value:1
max_value:7
|
| periods[].isAllDay | bool | No | — |
| periods[].timeStart | string | No |
max:8
|
| periods[].timeEnd | string | No |
max:8
|
| exceptions | array | Sí | — |
| exceptions[].name | string | Sí |
min:1
max:100
|
| exceptions[].dateStart | string | Sí |
max:10
|
| exceptions[].dateEnd | string | Sí |
max:10
|
| exceptions[].isClosed | bool | No | — |
| exceptions[].timeStart | string | No |
max:8
|
| exceptions[].timeEnd | string | No |
max:8
|
| scheduleId | int | Sí |
min_value:1
|
Ejemplo de request
curl -X POST https://restofy.pro/api/schedules/update-schedule \
-H "Content-Type: application/json" \
-H "Authorization: Bearer <accessToken>" \
-H "X-Tenant-Key: <tenantKey>" \
-d '{
"name": "string",
"periods": [
{
"dayOfWeek": 1
}
],
"exceptions": [
{
"name": "string",
"dateStart": "string",
"dateEnd": "string"
}
],
"scheduleId": 1
}'
Los valores son demo: reemplázalos por datos reales del negocio.
Ejemplo de respuesta
Actualizado: 2026-09-08T16:35:34Z
HTTP 200
Request
{
"scheduleId": "8",
"name": "Renombrado 6aa0392963a26",
"periods": [
{
"dayOfWeek": 6,
"timeStart": "10:00:00",
"timeEnd": "23:00:00"
},
{
"dayOfWeek": 7,
"timeStart": "10:00:00",
"timeEnd": "23:00:00"
}
],
"exceptions": []
}
Response
{
"success": true,
"message": "Horario actualizado",
"data": {
"scheduleId": 8
}
}