Skip to main content
PUT
/
reserve
/
update
Update Reservation
curl --request PUT \
  --url https://api.example.com/reserve/update \
  --header 'Content-Type: application/json' \
  --data '
{
  "v_id_reservation": "<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": "Update Exitoso"
}
This endpoint allows you to update the information of an existing reservation. You can modify customer data, dates, pax, rate, values, and the list of extras. The user must be authenticated, and the JWT token is automatically obtained from the access_token cookie.

Request

v_id_reservation
string
required
Reservation ID to update (max 10 characters)Example: "RSV00123"
v_email
string
required
Updated customer email address (must be valid email format)Example: "[email protected]"
v_phone_number
string
required
Updated customer phone number (7-13 characters)Example: "3119876543"
v_init_date
string
required
Updated reservation start date and time (ISO 8601 format)Example: "2025-07-10T09:00:00Z"
v_end_date
string
required
Updated reservation end date and time (ISO 8601 format, must be greater than v_init_date)Example: "2025-07-10T14:00:00Z"
v_pax
number
required
Updated number of people (must be positive integer)Example: 25
v_status
string
required
Updated reservation status. Must be one of: "EN PROGRESO", "FINALIZADO"Example: "EN PROGRESO"
v_extras
string
required
Updated JSON string containing selected extras. Must be sent as a string, not an object.Valid formats:
  • "[{}]" (empty extras)
  • "[{\"id_extra\":1, \"quantity\":1, \"value_add\":3000}]" (with extras)
Example: "[{\"id_extra\":1, \"quantity\":1, \"value_add\":3000}]"
v_amount
number
required
Updated base amount (must be non-negative)Example: 95000
v_total_value
number
required
Updated total value including extras (must be non-negative)Example: 100000
v_fk_rate
number
required
Updated rate ID associated with the reservation (must be positive integer)Example: 4

Response

message
string
Success message
{
  "message": "Update 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.
404
Not Found
No reservation exists with the provided ID.
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 PUT https://api.demet.com/reserve/update \
  -H "Content-Type: application/json" \
  -b "access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..." \
  -d '{
    "v_id_reservation": "RSV00123",
    "v_email": "[email protected]",
    "v_phone_number": "3119876543",
    "v_init_date": "2025-07-10T09:00:00Z",
    "v_end_date": "2025-07-10T14:00:00Z",
    "v_pax": 25,
    "v_status": "EN PROGRESO",
    "v_extras": "[{\\\"id_extra\\\":1, \\\"quantity\\\":1, \\\"value_add\\\":3000}]",
    "v_amount": 95000,
    "v_total_value": 100000,
    "v_fk_rate": 4
  }'

Notes

  • The v_id_reservation field is required to identify which reservation to update
  • The v_name field cannot be updated (it’s not included in the update schema)
  • 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
  • The system validates date availability and will return a 409 error if the new dates are already occupied
  • The authenticated user’s employee ID is automatically associated with the update operation

What Can’t Be Updated

The following fields from the original reservation cannot be updated:
  • v_name - Customer name remains unchanged
If you need to change the customer name, you may need to delete and recreate the reservation.

Build docs developers (and LLMs) love