api.reservations.price_total
Table of Contents
- Arguments
- Return value and included prices
- Examples
- Total prices for one resource
- Total prices for an account over a date range
- Leave out a booking
Quickly get the total sum of reservation prices that match your filters. Use api.reservations.price_total when your script needs one total, such as the cost of reservations for a resource, user, or account number over a date range.
This is more efficient than calling api.reservations.fetch and adding up each reservation's price. Use fetch when you need individual reservation details, or api.reservations.count when you need the number of reservations.
Arguments
All arguments are optional. Results are limited to the site where the script runs.
def api.reservations.price_total(
account_number: str = None, # Account number set on the reservation
end: datetime = None, # End of the time filter
exclude_reservation_id: str = None, # Reservation or multi-resource group to leave out
include_cancelled: bool = False, # Include cancelled reservations
include_checked_in: bool = True, # Include checked-in reservations
include_filtered_user_if_guest: bool = True, # Also match the filtered user as a guest
include_not_checked_in: bool = True, # Include reservations not checked in
include_templates: bool = True, # Include template reservations
only_late_checkouts: bool = False, # Only include reservations with late checkouts
rate_meta_data_query: str = None, # Value to match in rate metadata
rate_meta_data_query_path: list of str = None, # Path to that value in rate metadata
reservable_id: str = None, # Resource ID
start: datetime = None, # Start of the time filter
supervisor_id: str = None, # Supervisor user ID, or self if no supervisor is assigned
tags: list of str = None, # Resource tags (case insensitive)
user_id: str = None, # User ID
usergroup_name: str = None, # User group name (case insensitive)
):
Use start and end to select reservations that overlap a time window. Either bound can be used on its own. The total includes the full price of each matching reservation; it does not prorate prices to the portion inside the window. Without either bound, there is no date restriction.
Return value and included prices
Returns one decimal (dec) value in currency units, for example 63.65, rather than cents or a total per resource. Returns 0 when no priced reservations match.
- Prices include the reservation's rate, duration, units, and applicable rate adjustments. Taxes and invoice-item charges from custom forms are not included.
- Cancelled reservations are excluded unless
include_cancelled=True. Reservations without a rate add nothing to the total. - For multi-resource bookings, matching resources contribute their own prices without counting the parent booking again. Requests attached to a matching booking are also included when they satisfy the other filters; they follow the booking's time window. Standalone requests are not included.
As with the other reservation API functions, a reservation being made is already present from the script's database perspective and is included if it matches the filters. To leave it out, pass its ID as exclude_reservation_id. For a multi-resource booking, either a parent or child ID excludes the whole group. An ID that cannot be found in the current site raises an error.
Examples
Total prices for one resource
Replace "resource-id" with the resource's ID.
total = api.reservations.price_total(reservable_id="resource-id")
Total prices for an account over a date range
This totals reservations charged to account LAB-001 that overlap the chosen window. Change the account number and dates to suit your script.
period_start = datetime.from_date_and_time(year=2026, month=11, day=1)
period_end = datetime.from_date_and_time(year=2026, month=11, day=30, hour=23, minute=59, second=59)
total = api.reservations.price_total(
account_number="LAB-001",
start=period_start,
end=period_end,
)
Leave out a booking
Replace "reservation-id" with the booking to exclude. This is useful when comparing other reservation costs with a budget before adding the current booking's price separately.
other_total = api.reservations.price_total(
account_number="LAB-001",
exclude_reservation_id="reservation-id",
)