Skip to content

Show your rooms and prices

This guide uses a publishable key from your website’s pages. The same calls work from your server with a secret key.

const API = 'https://app.book-ah.com/api/partner/v1';
const KEY = 'pk_live_YOUR_KEY';
async function bookah(path, init = {}) {
const response = await fetch(`${API}${path}`, {
...init,
headers: { Authorization: `Bearer ${KEY}`, 'Content-Type': 'application/json' },
});
const body = await response.json();
if (!body.isSuccess) throw new Error(body.message);
return body.data;
}

GET /properties/ returns every active property, with its cover photo and its “from” price for tonight:

const { items } = await bookah('/properties/');

GET /properties/{propertyId}/ returns the property’s photos, features and rooms. Without dates, each room shows its “from” price:

const property = await bookah(`/properties/${id}/`);

Add the guest’s dates and party, and every room carries an offer for that stay, priced by the same rules as your Book-ah site:

const property = await bookah(
`/properties/${id}/?checkIn=2026-12-20&checkOut=2026-12-23&adults=2&children=1`
);
for (const room of property.rooms) {
if (room.offer?.status === 'available') {
// room.offer.boards: one price per board, e.g. { boardType: 'BB', total: '360.00', currency: 'USD' }
}
}

An offer’s status is:

  • available: it can be requested, at the prices in boards. An empty boards means the property quotes this stay itself.
  • sold-out: no room of this type is free.
  • too-small: the party does not fit.
  • restricted: the dates break one of the property’s rules (a minimum stay, say). message explains it in words you can show.

To price one room as the guest changes dates, use POST /quotes/:

const quote = await bookah('/quotes/', {
method: 'POST',
body: JSON.stringify({ roomId, checkIn: '2026-12-20', checkOut: '2026-12-23', adults: 2 }),
});
// quote.problem: why these dates cannot be quoted, or null
// quote.offer: as above

A quote holds nothing. It is a price, not a reservation.

For a date picker, GET /properties/{propertyId}/availability/ lists the nights on which no room is free, between from and to (up to 366 nights):

const { unavailable } = await bookah(
`/properties/${id}/availability/?from=2026-12-01&to=2027-01-01`
);
// [{ start: '2026-12-24', end: '2026-12-27' }]: the nights of the 24th, 25th and 26th

Each range is half open: end is the first night that is free again.