TypeScript interface definitions for the OpenBookings API: HotelSearchInput, HotelSearchResult, ResolvedRoom, ModifierType, and AdjustmentType.
This page documents the TypeScript types you can use when integrating the OpenBookings API in a TypeScript project. Copy them directly into your codebase or import them from a shared types package. ResolvedRoom is the authoritative shape of every object in the array returned by GET /api/query.
The parameter object that maps to the query string of GET /api/query. Use this type to build and validate your search request before sending it to the API.
A simplified type that represents a basic room result. The live API returns ResolvedRoom objects, not HotelSearchResult objects. This type is retained for reference but you should use ResolvedRoom when typing API responses.
/** Simplified room result — use ResolvedRoom for live API responses */export interface HotelSearchResult { property_id: string; property_name: string; city: string; country: string; room_id: string; room_name: string; room_description: string; price_per_night: number; total_price: number; currency: string;}
HotelSearchResult is a simplified type. The live GET /api/query endpoint returns ResolvedRoom objects, which include pricing detail, modifier fields, rate plan data, and occupancy constraints not present here.
Surcharge applied to nights that fall on specific days of the week
length_of_stay
Discount for stays that meet a minimum night threshold
early_bird
Discount for bookings made a set number of days before arrival
last_minute
Adjustment applied when booking close to the arrival date
extra_guest
Per-night surcharge for each guest above base_occupancy
Only one discount modifier (length_of_stay or early_bird) can fire per room. The eligible modifier with the lowest configured sort_order takes precedence. Surcharge modifiers can all fire simultaneously.