Skip to main content
The Reservations API allows you to manage reservations in the DEMET system. This includes creating new reservations, retrieving existing ones, updating reservation details, and deleting reservations.

Authentication

All reservations endpoints require authentication via JWT token stored in the access_token cookie. The token is automatically obtained when a user logs in and must be included in all requests.

Base URL

/reserve

Available Endpoints

Create Reservation

Register a new reservation in the system

List Reservations

Get all registered reservations

Update Reservation

Update an existing reservation

Delete Reservation

Delete a reservation from the system

Reservation Status

Reservations can have one of the following statuses:
  • EN PROGRESO - Reservation is in progress
  • FINALIZADO - Reservation is completed

v_extras Format

The v_extras field is a critical part of the reservations API. It must be sent as a JSON string (not a JSON object) representing an array of extra items.

Valid Formats

// Empty extras
"[{}]"

// Single extra
"[{\"id_extra\":1, \"quantity\":2, \"value_add\":5000}]"

// Multiple extras
"[{\"id_extra\":1, \"quantity\":2, \"value_add\":5000}, {\"id_extra\":3, \"quantity\":1, \"value_add\":3000}]"

Extra Object Structure

id_extra
number
required
The ID of the extra item
quantity
number
required
The quantity of the extra item
value_add
number
required
The additional value/cost of the extra item

Common Response Codes

200
Success
Request completed successfully
400
Bad Request
Validation error in the sent data
401
Unauthorized
Token not sent or invalid
404
Not Found
Reservation not found
409
Conflict
Dates are occupied or not available
500
Internal Server Error
Internal server error

Date Validation

All reservation endpoints enforce that the end date (v_end_date) must be greater than the start date (v_init_date). Requests that violate this rule will be rejected with a 400 error.

Build docs developers (and LLMs) love