Skip to main content
POST
/
reserve
/
register
Create Reservation
curl --request POST \
  --url https://api.example.com/reserve/register \
  --header 'Content-Type: application/json' \
  --data '
{
  "v_id_reservation": "<string>",
  "v_name": "<string>",
  "v_email": "<string>",
  "v_phone_number": "<string>",
  "v_init_date": "<string>",
  "v_end_date": "<string>",
  "v_pax": 123,
  "v_status": "<string>",
  "v_extras": "<string>",
  "v_amount": 123,
  "v_total_value": 123,
  "v_fk_rate": 123
}
'
{
  "message": "Registro Exitoso"
}
This endpoint allows you to register a new reservation in the system. The user must be authenticated, and the JWT token is automatically obtained from the access_token cookie.

Request

v_id_reservation
string
required
Unique reservation identifier (max 10 characters)Example: "RSV00123"
v_name
string
required
Customer name (minimum 1 character)Example: "Juan Pérez"
v_email
string
required
Customer email address (must be valid email format)Example: "[email protected]"
v_phone_number
string
required
Customer phone number (7-13 characters)Example: "3104567890"
v_init_date
string
required
Reservation start date and time (ISO 8601 format)Example: "2025-06-10T10:00:00Z"
v_end_date
string
required
Reservation end date and time (ISO 8601 format, must be greater than v_init_date)Example: "2025-06-10T15:00:00Z"
v_pax
number
required
Number of people (must be positive integer)Example: 20
v_status
string
required
Reservation status. Must be one of: "EN PROGRESO", "FINALIZADO"Example: "EN PROGRESO"
v_extras
string
required
JSON string containing selected extras. Must be sent as a string, not an object.Valid formats:
  • "[{}]" (empty extras)
  • "[{\"id_extra\":1, \"quantity\":2, \"value_add\":5000}]" (with extras)
Example: "[{\"id_extra\":1, \"quantity\":2, \"value_add\":5000}]"
v_amount
number
required
Base amount (must be non-negative)Example: 85000
v_total_value
number
required
Total value including extras (must be non-negative)Example: 90000
v_fk_rate
number
required
Rate ID associated with the reservation (must be positive integer)Example: 2

Response

message
string
Success message
{
  "message": "Registro Exitoso"
}

Error Responses

400
Bad Request
Validation error in the sent data. Common issues:
  • Invalid email format
  • End date is not greater than start date
  • Missing required fields
  • Invalid data types or constraints
401
Unauthorized
Token not sent or invalid. Ensure you’re authenticated and the access_token cookie is present.
409
Conflict
The selected dates are occupied or not available. Try different dates.
500
Internal Server Error
Internal server error. Contact support if this persists.

Example Request

curl -X POST https://api.demet.com/reserve/register \
  -H "Content-Type: application/json" \
  -b "access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -d '{
    "v_id_reservation": "RSV00123",
    "v_name": "Juan Pérez",
    "v_email": "[email protected]",
    "v_phone_number": "3104567890",
    "v_init_date": "2025-06-10T10:00:00Z",
    "v_end_date": "2025-06-10T15:00:00Z",
    "v_pax": 20,
    "v_status": "EN PROGRESO",
    "v_extras": "[{\\\"id_extra\\\":1, \\\"quantity\\\":2, \\\"value_add\\\":5000}]",
    "v_amount": 85000,
    "v_total_value": 90000,
    "v_fk_rate": 2
  }'

Notes

  • The v_extras field must be sent as a JSON string, not as a JSON object or array
  • The end date must be strictly greater than the start date
  • All numeric fields (v_pax, v_amount, v_total_value, v_fk_rate) must meet their respective constraints
  • The system validates date availability and will return a 409 error if dates are already occupied
  • The authenticated user’s employee ID is automatically associated with the reservation

Build docs developers (and LLMs) love