Koala Smartblock docs

This section is not public yet. Enter the password you received from Koala.

Skip to main content

Trip context

The trip context is what you populate window.CTStore.dataSource with. The widget reads it once at page load and prices every configured bundle against it; how that exchange works is explained in the concepts page Trip data and pricing.

Every date-time is a local ISO 8601 string with no UTC offset (for example 2026-07-11T06:25:00), paired with an IANA timezone (see Dates and time zones).

Click a property to see an example value and, for object properties, the shape they expect. The examples at the bottom of the table are complete payloads you can start from.

DataSource

The trip context you provide on window.CTStore.dataSource.

  • Example'EUR'
  • Example'en-GB'
  • Example'IE'
  • custom
    • Example'checkout'
  • A flight.

    • mode'FLIGHT'requiredIdentifies the segment as a flight.
    • Example'FR'
    • Example'22'
    • Example'DUB'
    • Example'BGY'
    • Example'2026-07-11T06:25:00'
    • Example'2026-07-11T09:50:00'
    • Example'Europe/Dublin'
    • Example'Europe/Rome'
  • Stay

    An accommodation stay.

    • Example'Catalonia Ramblas'
    • Example'2026-07-11T15:00:00'
    • Example'2026-07-18T11:00:00'
    • Example'Europe/Madrid'
    • The minimal address: only the country.

      • Example'ES'
  • Example640
  • Traveler

    A traveller on the trip.

    • Example'ADULT'
    • Example1
Examples
window.CTStore.dataSource = {
currency: 'EUR',
language: 'en-GB',
residence: 'IE',
custom: { context: 'checkout' },
tripPrice: 640,
segments: [
{
mode: 'FLIGHT',
airlineIata: 'FR',
number: '22',
departureAirportIata: 'DUB',
arrivalAirportIata: 'BGY',
departureDate: '2026-07-11T06:25:00',
departureTimezone: 'Europe/Dublin',
arrivalDate: '2026-07-11T09:50:00',
arrivalTimezone: 'Europe/Rome',
},
{
mode: 'FLIGHT',
airlineIata: 'FR',
number: '29',
departureAirportIata: 'BGY',
arrivalAirportIata: 'DUB',
departureDate: '2026-07-18T22:45:00',
departureTimezone: 'Europe/Rome',
arrivalDate: '2026-07-18T23:20:00',
arrivalTimezone: 'Europe/Dublin',
},
],
travelers: [
{ ageRange: 'ADULT', numberOfCheckedBags: 1 },
{ ageRange: 'CHILD', numberOfCheckedBags: 1 },
],
};
note

On pages that already run the CarTrawler car-rental Smartblock, dataSource already exists and Koala derives the trip from the fields the car-rental widget populates. What Koala reads in that case is covered in Alongside the car-rental Smartblock.