> ## Documentation Index
> Fetch the complete documentation index at: https://demo-travel.webbinghub.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# LiteAPI integration: rules, flow and mapping

> The LiteAPI rules Omnibeds follows: two hosts, a prebook before every booking, the per-second pace, outdated-offer codes, holder-only name changes and how rates map to ours.

Omnibeds connects to LiteAPI (by Nuitee) version 3 over REST and JSON. LiteAPI's flow is chained: a search returns an `offerId`, a prebook turns it into a `prebookId`, and the booking uses that. In the sandbox, bookings paid with `ACC_CREDIT_CARD` are simulated and nothing is charged. The adapter is in `lib/suppliers/liteapi/`.

## At a glance

| | |
| - | - |
| Hosts | Search and hotel data on `api.liteapi.travel/v3.0`; prebook, booking and booking management on `book.liteapi.travel/v3.0` |
| Authentication | An API key, server side only; a `sand_` key is the sandbox |
| How it keeps state | Chained: `offerId`, then `prebookId`, then `bookingId` |
| Offer validity | Not stated by LiteAPI. We assume 30 minutes and label it "our estimate" |
| Pace | The sandbox allows 5 requests a second per key; we stay at 4, measured across every server |
| Daily calls | Our own safety cap of 300 a day (LiteAPI states none for the sandbox) |
| Search time limit | 12 s, because its sandbox search usually takes 7 to 8 s |
| Presenter mode | Not a confidential supplier; live calls need presenter mode like every real supplier |

## Their flow and ours

| Our step | LiteAPI call | What Omnibeds does with it |
| - | - | - |
| Search | `POST /hotels/rates` | Groups each hotel's rates into rooms and normalises them |
| Price check | `POST /rates/prebook?timeout=30` with the `offerId` | LiteAPI's price check is the prebook: we read its price and compare |
| Book | A fresh prebook, then `POST /rates/book?timeout=30` with the `prebookId` | `CONFIRMED` is confirmed; anything else is pending for reconciliation |
| Live view and reconciliation | `GET /bookings/{bookingId}` | HTTP 204 or 404 means LiteAPI has no such booking |
| Traveller change | `PUT /bookings/{bookingId}/amend` | Only the holder (room 1's lead guest) can change; LiteAPI may answer pending |
| Cancel | `PUT /bookings/{bookingId}` | Cancelled when its status starts with `CANCEL` |

## Must do

**1. Prebook before every booking**

LiteAPI always wants a prebook first. Omnibeds prebooks again at booking time, so the booking always uses a fresh `prebookId`.

**2. Search with the guests' residence**

Every search sends `guestNationality`: the search's residence field, else the agency's default residence, else its country.

**3. Describe the place one way**

One of: the hotels by id, a known city by country code and city name, or a circle around any place (latitude, longitude, radius in metres). Each search asks for up to 20 hotels and 8 rates per hotel, in EUR, with an 8 s timeout.

**4. Give an email per room**

LiteAPI wants a holder email and a guest per room. Omnibeds uses the agency's contact email and the holder's name for each room.

**5. Keep the pace**

Every live call waits for its turn under 4 a second and passes the daily cap. When LiteAPI still throttles, Omnibeds waits as asked (at most 2 s) and tries once more.

## Never do

> [!WARNING]
>
> * Never spend the key on a health check: health makes no call.
> * Never let Replay call LiteAPI. Replay answers from recordings kept on this machine, outside git; without a recording the call fails and says so.
> * Never change other guests' names or who travels through `amend`: it only changes the holder.

## How its data becomes ours

| LiteAPI | Omnibeds |
| - | - |
| One room type (`offerId`) covering every room of the stay | One offer. Its `rates[]` are the rooms, one per occupancy, so prices, taxes and penalties are added up across them |
| Refundability per room | Refundable only when every room is |
| Board codes | Our five boards. Dinner only, lunch only and the two-meal codes count as half board, the closest of our five; LiteAPI's own name stays on the room |
| Times like `2026-12-08 09:00:00` (GMT) | ISO dates |
| A hotel without static data in the answer | Left out: there would be no name or position to show |
| A hotel without coordinates | Still offered; its position is found later or marked unknown |

## When something goes wrong

| LiteAPI answers | Omnibeds |
| - | - |
| Error code 2001, 4002, 4040, 4012 or 4016, or HTTP 408 or 410, at prebook | The offer is outdated: Omnibeds searches the hotel again and the agent confirms the current price |
| Code 2001 in particular | Despite its "no availability found" wording, it means the provider's price now exceeds the locked selling price: the room is there at a new price |
| Any other error | Shown with LiteAPI's own description and a link to the log |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.