Configuration Model

Customize Trip Element for your needs

Configure Trip Element

The Trip Element can be customized through a configuration object that is included at the time of element creation.

index.html
const elementConfig = {...}

$sherpa.V2.createElement("trip", elementConfig).mount("#sherpa-trip-element")

Configuration Model

AttributeRequiredTypeDescription
languageOptionalStringDefault en-US. View supported languages
placementRequiredStringName of booking stage or page the element is embedded on. Used for measuring engagement in analytics reports. Supported values: discovery, booking, confirmation, mmb, covidPage, destinationPage, homePage, search, bookingConfirmation
segmentsOptionalArray of ObjectsView Segment Model
travellersOptionalArray of ObjectsView Traveller Model
featuresOptionalObjectView Features Model

Segment Model

Describe the trip using a set of Segments.

AttributeRequiredTypeDescription
segmentTypeRequiredString, Supported values: OUTBOUND, `RETURNDirection of the flight.`
segmentSubTypeRequired for connecting flight.String. Supported values: AIR, TRANSITIs this a connecting flight.
originOptional if features.showResults is false; Required otherwiseObjectView Location Model
destinationOptional if features.showResults is false; Required otherwiseObjectView Location Model
travelModeOptionalString. Default: AIR

Location Model

One of the following attributes is required.

AttributeRequiredTypeDescriptionExample
countryCodeOptional, if one other is specifiedStringISO3 Country Code e.g. CAN for CanadaeVisa Trip Element Pre-Configuration
airportCodeOptional, if one other is specifiedStringIATA Airport Code e.g. YYZ for Pearson International Airport, Toronto, CanadaUsing Airport and Region Code
regionCodeOptional, if one other is specifiedStringalpha3 Region Code e.g. US-TX for Texas, USAUsing Airport and Region Code

Traveller Model

AttributeRequiredTypeDescriptionExample
nationalityOptionalStringISO3 Country Code e.g. CAN for CanadaDefining a Traveller
passportOptionalObjectPassport details of the travel

Passport Model

AttributeRequiredTypeDescriptionExample
numberOptionalStringPassport numberNN234567
nationalityOptionalStringPassport nationalityCAN
givenNamesOptionalStringGiven names as stated on passportJohn Richard
surnameOptionalStringSurname as stated on passportSmith
issueDateOptionalStringIssue date as stated on passport2020-01-30

Vaccination Model

AttributeRequiredTypeDescription
typeOptionalStringCurrently only value COVID_19
statusOptionalStringCurrently only value FULLY_VACCINATED or NOT_VACCINATED

Features Model

Customize the appearance of the Trip Element by enabling & disabling feature flags.

AttributeRequiredTypeDescription
showSegmentsOptionalBooleanShow/hide navigation between segments. Default: true
showTitleOptionalBooleanShow/hide title. Default: true
enableSegmentEditorOptionalBooleanShow/hide the UI to edit a trip, including "Edit my trip" button.
showResultsOptionalBooleanShow/hide travel restrictions results on load. Default: true
❗️ showResults Feature

showResults is true by default, if this is true origin and destination has to be specified. Set this to false to load the widget with no destination and origin specified.