Trip data and pricing
The bundles the widget shows are configured by Koala, but their prices are calculated for the specific trip. You
provide the trip; Koala prices each configured bundle against it and the widget renders the result. This section
explains that exchange and exactly what to put in window.CTStore.dataSource.
How the exchange works
When the widget starts, or after a restart when calling window.CTStore.koala.restart(), it:
- reads the trip context from
window.CTStore.dataSource, - maps it to a quote request and sends it to Koala,
- receives a price for each bundle configured for your placement,
- renders those bundles as priced options.
What the traveller sees is specific to their booking and shown in their own currency, not a generic rate.
Dates and time zones
This rule applies to every date-time in dataSource: provide it as a local ISO 8601 string with no UTC offset (for
example 2026-07-11T06:25:00), together with the matching IANA timezone. The widget converts these into whatever the
quote API needs, so you never deal with offsets yourself.
If you omit a timezone, the widget falls back to the browser's time zone. That is fine in most cases, but
providing the location's own IANA timezone is more accurate (the traveller's device may be elsewhere), and it matters
most for stays, where the quote needs an exact offset.
The trip context
You populate window.CTStore.dataSource with the trip context. The full field-by-field shape, with example values and
complete payloads to start from, is documented in the reference page Trip context.
Send only what the trip has
Beyond currency and travelers, you include only the parts of the trip that actually exist:
| Trip shape | Include | Leave out |
|---|---|---|
| Flights only | segments (flights) | stays |
| Accommodation only | stays | segments |
| Flight and accommodation | segments, stays | nothing |
| Train, bus, or ferry | segments (generic) | stays |
A single trip can mix modes, for example a flight followed by a train, by listing different segment types in the
segments array. Optional fields (residence, numberOfCheckedBags, stop coordinates, or a full address) can be left
out when you do not have them; baggage cover needs numberOfCheckedBags.
When it re-quotes
The widget quotes once at load. If the trip changes afterwards, for example the dates, travellers, or currency, update
dataSource and call window.CTStore.koala.restart() so the widget re-reads it and re-quotes.
If quoting fails
Two things can go wrong, and each surfaces on its own event:
- The trip context is incomplete or malformed: no quote request is sent, and the widget emits
onErrorwith a message pointing at thedataSourceproperty to fix. This is an integration problem to solve during development. - The quote request fails: the request was sent but Koala could not return quotes (the service rejected the trip or
was unreachable). The widget does not render priced options and emits
onAvailwith statusERRORso your page can respond (hide the section, fall back, or log it).
A quote can also succeed without pricing a single bundle, for example when every bundle is inside its purchase
cutoff. That is not a failure: onAvail fires with status SUCCESS and count: 0, the rejections and their reasons
are in response.data.quotes, and the widget renders nothing.
The events surface is covered in Events and basket state.