Skip to content

For AI agents

These docs are written to be read by a coding agent. This page is the brief: read it first, then open only the pages your task needs.

Machine-readable docs

Address What it is
/llms.txt The index: what this is and where everything is.
/llms-full.txt Every page as one Markdown file. Read this when you can afford it: it is the whole truth.
/llms-small.txt The same, shortened, for a small context window.

What you need from the human

Ask once, before writing code. Do not invent any of these.

  1. The property number — nine digits, from Tape Chart Link → Booking engine. It goes into data-property.
  2. Whether the site’s address is on the hotel’s list of allowed origins (Booking engine → Firewall), including http://localhost:PORT for development. Without it the script loads and every request is refused by the browser — nothing you write can fix that.
  3. Room type and rate plan ids, only if the task names a specific room or plan (data-room, data-rooms, data-plan). They are UUIDs listed in Tape Chart Link → Booking engine → Components.

The rules

  1. One script tag is the whole integration. No npm package, no SDK, no API key, no server code. Never call the API behind the script yourself and never copy the script into the site.
  2. The script goes in <head>, once, with defer, on every page that shows a component or uses a data-pms-* attribute.
  3. The site needs two pages: a booking page (default /booking) that carries <div data-pms-booking="window"></div> and an account page (default /account) that carries <div data-pms-booking="portal"></div>. Other paths are named with data-booking-path and data-account-path on the script tag.
  4. The booking window and the guest area cannot be rebuilt. The booking window is drawn by the script on the page, except its details-and-payment step, which is a frame of ours; the guest area is a frame of ours. The guest’s details, the card payment and the account live in those frames. Place the two boxes and style them with variables; do not try to recreate or reach into them.
  5. Everything else is better in the site’s own HTML. A search form, book links, room cards and price lines are written in the site’s own markup with data-pms-* attributes. Use a ready component only when the site has no design for that piece.
  6. Style with --pms-* CSS variables on :root, in the site’s own stylesheet. Exactly three selectors of yours may name an element of ours, and each is documented: [data-pms-theme="dark"], to give a variable a value for the dark look; [data-pms-booking-overlay]::part(name), to style a listed piece of the calendar or the guests panel — both open in that one element at the end of <body>, for the site’s own form and for the ready search form alike, never inside a component’s box; and the two together, [data-pms-booking-overlay][data-pms-theme="dark"]::part(name), for a piece in the dark look. No other selector reaches inside a component, with or without !important. Never put the variables on our <div>, and never set a property on the overlay element itself. See How a part rule works.
  7. Write real fallback text inside every live element. <span data-pms-text="price" …>from €95</span> shows your text until the live value arrives, and again whenever there is no value for the stay it asks for: the answer on its way, a failed request, a room that cannot be sold.
  8. Never write the state attributes yourself — data-pms-ready, data-pms-filled, data-pms-loading, data-pms-open, data-pms-has-dates, data-pms-nights, data-pms-item, data-pms-available, data-pms-bound, data-pms-field. The script sets them; your CSS reads them.
  9. Dates are YYYY-MM-DD; check-out is the day of departure. A fixed date in markup goes stale — prefer data-stay="weekend" or data-stay="tomorrow" unless the task gives dates. A party with children is data-adults plus data-child-ages="6,9" (ages, comma-separated), wherever data-adults is accepted; a child is priced by its real age, so never invent ages. A list counts only whole: one entry that is not an age, or one child older than the property books as a child, drops every child and the price is for the adults alone, with no warning — see Children. Ask the human for the property’s highest child age if the task names children.
  10. In a framework (React, Next.js, Vue, Astro): load the script once in the document head, not inside a component. Boxes and data-pms-* elements added later are picked up by themselves. Room cards: prefer pmsBooking.rooms() drawn in the framework’s own components. A <template data-pms-each> rendered by a framework is read too, but its cards are added as siblings the framework did not create, so use one only where the framework will not draw that part of the page again; in JSX write the braces as text, {'{{name}}'} — see From JavaScript. Code that calls window.pmsBooking waits for it — see When it is ready.
  11. Use only what these docs name. An attribute, field, method, event or variable that is not in the reference does not exist. Do not guess one from a similar name.
  12. Leave the promo-code field out of a ready search form with data-promo="off": it is not wired to anything yet.
  13. A price beside a search form follows it. On a page that has a search form, a price, a room card or a book link that should answer the guest’s dates carries data-stay="search". It is priced only for a complete search — both dates, an age for every child — so its fallback text must read well before that: “pick your dates”, not a number. A price that is about a fixed offer keeps its own data-stay or dates.
  14. A line that shows only when rooms are free starts hidden. data-pms-if outside a template sets and removes hidden, and only on a definite answer: write hidden on what should appear on a yes, so nothing is claimed while the answer is on its way or after an error. Make sure no rule of the site sets display on that element, or add [hidden] { display: none !important; } to the stylesheet. Inside a <template data-pms-each> it is the opposite: the element is removed, so do not write hidden there. The comparison is written without quotes: data-pms-if="reasonKind=min-stay".
  15. Never compute a price. price is the total the booking page charges; vatAdded and cityTax are already inside it — never add them to it. Do not subtract deposit to print a balance, do not divide by the guests or convert the currency, and do not build “from” prices out of calendar(). Print the fields; what the script does not give is listed under What is not available.
  16. Say why a room cannot be booked with reason, the booking window’s own sentence, not with words of your own; use reasonKind for CSS and for data-pms-if.

The order of work

  1. Read Install the script, How it is drawn and Prices and availability.
  2. Add the script tag to the site’s shared head.
  3. Create the booking page and the account page.
  4. Put a search form on the home page — the site’s own form with our pickers: Search form.
  5. Wire the site’s existing “Book” buttons and room pages: Book button, Offer prices.
  6. Wherever the site states a price or says that rooms are free, make it live: Prices and availability. Next to a search form, let it follow the form (rule 13); a “rooms free” line starts hidden (rule 14).
  7. Match the site’s look with a short block of variables: Styling. Read the site’s own colours, corners and fonts and map them; start from a recipe.
  8. If the site has a dark mode or more than one language, connect them: Theme icon, Language icon.
  9. If the site tracks conversions, listen for pms-booking-step and pms-booking-purchase — see Events. Add both listeners in a script before our script tag, on the booking page itself: the events are not fired again for a late listener — see The booking window’s events, in practice.
  10. If the site sends a Content Security Policy, enforces Trusted Types or has a consent banner, see What your site must allow and Consent.

Definition of done

Check each one in a browser, not from the code.

  • The console shows no warning from the script.
  • <html> carries data-pms-ready, and window.pmsBooking is an object.
  • The home page’s search opens the calendar with prices; picking two dates and pressing Search lands on the booking page with check_in and check_out in the address and a list of rooms.
  • A book link on a room page opens the booking page with that room chosen.
  • The booking page shows the booking window at the site’s full content width, under the site’s own header.
  • The account page shows the sign-in.
  • The components wear the site’s colours, corners and fonts — in the frames too.
  • Every live element still reads sensibly with the script blocked.
  • A price that follows the search form shows its fallback before dates are picked, and a price after; changing the dates changes it.
  • A line with data-pms-if is not visible when the page loads, and not visible with the script blocked, unless it was meant to be.
  • On a phone-width screen nothing overflows.

If requests fail with a CORS error, stop and tell the human: the site’s address is not on the hotel’s allowed origins.

What to tell the human when you finish

  • Which pages carry the script, the booking window and the guest area.
  • That the hotel should set the account page’s address in Tape Chart Link (Booking engine → Configuration) so that sign-in links in emails open on the site.
  • That the production address must be on the allowed origins before going live.
  • Anything you could not verify.