Skip to content

BookingsAPI

hmwrapper.bookings.BookingsAPI

Interface to Hallmaster booking endpoints.

check_availability(room_ids, start, end, **extra)

Check room availability for a time slot.

Parameters:

Name Type Description Default
room_ids list[int]

List of room IDs to check.

required
start str

Start datetime string.

required
end str

End datetime string.

required

confirm_changes(booking_id)

Confirm pending changes on a booking.

create_booking(name, start, end, room_ids, customer_id, activity_type_id, price_rate_id, status='Requested', send_emails=False, **extra)

Create a new booking.

Fetches the create form for the anti-forgery token and room list, then submits with browser-compatible field encoding.

Parameters:

Name Type Description Default
name str

Booking name/title.

required
start str

Start datetime (ISO format, e.g. "2026-03-22T14:00:00").

required
end str

End datetime (ISO format).

required
room_ids list[int]

List of room IDs to book.

required
customer_id str

Customer GUID.

required
activity_type_id int

Activity type ID.

required
price_rate_id int

Price rate ID.

required
status str

Booking status — "Requested" or "Confirmed".

'Requested'
send_emails bool

Whether to send notification emails.

False
**extra Any

Additional form fields (e.g. Description, AdminNotes).

{}

delete_booking(booking_id)

Delete a booking. Returns the response HTML.

edit_booking(booking_id, updates)

Edit an existing booking.

Fetches the current form values, merges in updates, and submits with browser-compatible encoding to avoid WAF rejection.

Parameters:

Name Type Description Default
booking_id int

ID of the booking to edit.

required
updates dict

Dict of fields to change (e.g. Name, StartDate, EndDate, BookingStatusId). Unspecified fields keep their current values.

required

get_booking_counts(timerange=0)

Get booking count summary.

get_cost(room_ids, start, end, price_rate_id, **extra)

Calculate the hire cost for a booking.

Parameters:

Name Type Description Default
room_ids list[int]

List of room IDs.

required
start str

Start datetime.

required
end str

End datetime.

required
price_rate_id int

Price rate ID to apply.

required

get_create_form()

Fetch the booking creation form and return hidden field values.

get_edit_form(booking_id)

Fetch the booking edit form and return current field values.

get_recurring_children(booking_id)

Get child bookings of a recurring series.

get_requested_count()

Get count of bookings pending approval.

get_time_range_counts()

Get booking counts per time range.

has_pending_changes()

Check if there are pending booking change requests.

list_bookings(status='All', timerange=5, year=None, start_date_from=None, start_date_to=None)

List bookings from the hall grid.

Parameters:

Name Type Description Default
status str

Filter — All, Requested, Confirmed, Cancelled, NotCancelled, HasPending.

'All'
timerange int

0=Today, 1=Last7Days, 2=LastMonth, 3=Last3Months, 4=LastYear, 5=All.

5
year Optional[int]

Optional year filter.

None
start_date_from Optional[str]

Optional start date lower bound (YYYY/MM/DDT00:00:00).

None
start_date_to Optional[str]

Optional start date upper bound.

None

preview_email(data)

Preview the notification email content.

request_changes(booking_id)

Request changes on a booking.

view_booking(booking_id)

Get the read-only booking view HTML.