Type: hotel_bookings POST
Insert a hotel booking into TOWeRS.
Endpoint: POST /manager/hotel_bookings
Headers:
Authorization: ApiKey YOUR_API_KEYContent-Type: application/jsonRequest fields:
{})If remarks is provided, every remark item must include all remark attributes listed above.
Note: actor and login fields are extracted from API key context.
Request example:
{
"hotel_booking": {
"hotel": 12345,
"checkin": "2024-02-12",
"checkout": "2024-02-14",
"currency": "EUR",
"sell_currency": "EUR",
"customerreference": "HOT-20240101-001",
"supplierreference": "SUPP-98765",
"supplier": "Best Hotels Ltd",
"suppliercode": "BHL",
"status": "CNF",
"roombasis": "RO",
"mealbasis": "BB",
"configuration": {
"notes": "Early check-in request"
},
"accommodation": [
{
"type": "DBL",
"num": 1,
"prices": {
"nett": 150.0,
"gross": 180.0
},
"paxes": [
{
"initial": "Mario",
"surname": "Rossi",
"title": "Mr"
},
{
"initial": "Anna",
"surname": "Rossi",
"title": "Ms"
}
]
}
],
"remarks": [
{
"code": null,
"when": "2024-01-31T10:56:00",
"text": "Guest requests non-smoking room",
"visibility": ["customers", "suppliers"],
"from": "customers",
"target": ["booking"],
"checked": true
}
]
}
}
Success response:
{
"name": "H012B456",
"status": "CNF",
"dossier": "D012B456",
"customerreference": "HOT-20240101-001",
"__metadata__": {
"app_server": "ns001tow:6002",
"timestamp": "2024-01-31T10:56:27",
"request_id": "8bae9fc8-2f9c-4791-911e-237b324b34cc"
}
}
Error response (invalid status):
{
"error": "Cannot parse request",
"debug_info": "Attribute status does not validate to its defined type: validate_status - invalid literal for int() with base 10: 'INVALID'",
"__metadata__": {
"app_server": "ns001tow:6002",
"timestamp": "2024-01-31T10:56:27",
"request_id": "8bae9fc8-2f9c-4791-911e-237b324b34cc"
}
}
Type: hotel_bookings PUT
Modify an existing hotel booking.
Endpoint: PUT /manager/hotel_bookings/{book_name}
Headers:
Authorization: ApiKey YOUR_API_KEYContent-Type: application/jsonPath parameters:
Request body fields:
Request example:
{
"hotel_booking": {
"checkout": "2024-02-15",
"status": "CNF",
"remarks": [
{
"code": null,
"when": "2024-02-01T14:00:00",
"text": "Late checkout approved",
"visibility": ["customers", "suppliers"],
"from": "customers",
"target": ["booking"],
"checked": true
}
]
}
}
Success response:
{
"name": "H012B456",
"status": "CNF",
"dossier": "D012B456",
"customerreference": "HOT-20240101-001",
"__metadata__": {
"app_server": "ns001tow:6002",
"timestamp": "2024-01-31T10:57:15",
"request_id": "8bae9fc8-2f9c-4791-911e-237b324b34cc"
}
}
Type: hotel_bookings DELETE
Cancel an existing hotel booking.
Endpoint: DELETE /manager/hotel_bookings/{book_name}
Headers:
Authorization: ApiKey YOUR_API_KEYPath parameters:
Success response:
{
"name": "H012B456",
"status": "CXL",
"dossier": "D012B456",
"customerreference": "HOT-20240101-001",
"__metadata__": {
"app_server": "ns001tow:6002",
"timestamp": "2024-01-31T10:58:00",
"request_id": "8bae9fc8-2f9c-4791-911e-237b324b34cc"
}
}
Type: hotel_bookings GET
Search for hotel bookings by modification date range.
Endpoint: GET /manager/hotel_bookings?modified_from=TIMESTAMP_FROM_YYYYMMDDHHMMSS&modified_to=TIMESTAMP_TO_YYYYMMDDHHMMSS
Headers:
Authorization: ApiKey YOUR_API_KEYQuery parameters:
Request example:
GET /manager/hotel_bookings?modified_from=20240101000000&modified_to=20240131235959
Authorization: ApiKey your-api-key
Success response:
[
{
"name": "H012B456",
"status": "CNF",
"dossier": "D012B456"
},
{
"name": "H012B457",
"status": "CNF",
"dossier": "D012B456"
}
]
Type: hotel_bookings GET
Retrieve details of a specific hotel booking.
Endpoint: GET /manager/hotel_bookings/{book_name}
Headers:
Authorization: ApiKey YOUR_API_KEYPath parameters:
Request example:
GET /manager/hotel_bookings/H012B456
Authorization: ApiKey your-api-key
Success response:
{
"name": "H012B456",
"status": "CNF",
"dossier": "D012B456",
"__metadata__": {
"app_server": "ns001tow:6002",
"timestamp": "2024-01-31T10:56:27",
"request_id": "8bae9fc8-2f9c-4791-911e-237b324b34cc"
}
}