Skip to main content
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.

HotelSearchInput

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.

HotelSearchResult

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.
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.

ResolvedRoom

The actual response type returned by GET /api/query. Every element of the response array conforms to this interface.

ModifierType

A union of the rate modifier categories the pricing engine supports. These strings appear in ResolvedRoom.applied_modifiers.
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.

AdjustmentType

Specifies whether a modifier’s adjustment_value is a fixed currency amount or a percentage of the subtotal.