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.
const elementConfig = {
...
}
$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-widget')
Configuration Model
Attribute | Required | Type | Description | Example |
---|---|---|---|---|
language | Optional | String | default: en-US View supported languages | Localize the Trip Element |
placement | Required | String | Name of booking stage or page the element is embedded on. Used for measuring engagement in analytics reports. Supported values: homePage - Home Pagediscovery - Generic pre-booking marketing pagemmb - Manage My Bookingsearch - SearchbookingConfirmation - Booking ConfirmationdestinationPage - dedicated marketing page for a destinationcovidPage - dedicated page for COVID-19 resources | Basic Discovery Placement |
segments | Optional | Array of Objects | View Segment Model | Return Trip |
travellers | Optional | Array of Objects | View Traveller Model | Defining a Traveller |
features | Optional | Object | View Features Model | |
cookieConsentPreferences | Optional | Array of Strings | An optional list of cookie consent type names that constitute a cookie policy that should apply to this Element (and to all other existing or future Embedded Elements or Application Widgets). See Setting a Cookie Policy for a list of valid cookie consent type names. If no cookie consent preference is specified, the new Element will use the most recently specified cookie policy (set either when creating a previous Embedded Element or Application Widget or by using the setCookiePreferences() method on the SDK). If there is no previously specified cookie policy, a minimal cookie policy will be employed that allows only those cookies that are needed for the Element to function. | Setting a Cookie Policy |
Segment Model
Describe the trip using a set of Segments.
An example of the segment model using the all of the attributes in the table below can be found here.
Attribute | Required | Type | Description |
---|---|---|---|
segmentType | Required | StringOUTBOUND , RETURN | Direction of the flight. |
segmentSubType | Required for connecting flight. | StringTRANSIT | Is this a connecting flight. |
origin | Optional if features.showResults is false ;Required otherwise | Object | View Location Model |
destination | Optional if features.showResults is false ;Required otherwise | Object | View Location Model |
travelMode | Optional | StringAIR | Default: AIR |
flightIATACarrierCode | Required for specific declarations. | String | IATA Code of the carrier |
flightNumber | Required for specific declarations. | String | Flight number |
departureDate | Optional. If omitted, this date will default to the current day for OUTBOUND segmentTypes and to one week from the current day for RETURN segmentTypes. | StringYYYY-MM-DD | Date of departure |
departureTime | Optional | StringHH:MM:SS | Time of departure |
arrivalDate | Optional. If omitted, this date will default to the current day for OUTBOUND segmentTypes and to one week from the current day for RETURN segmentTypes. | StringYYYY-MM-DD | Date of arrival |
arrivalTime | Optional | StringHH:MM:SS | Time of arrival |
Location Model
One of the following attributes is required.
Attribute | Required | Type | Description | Examples |
---|---|---|---|---|
countryCode | Optional, if one other is specified | String | ISO3 Country Code, e.g. CAN for Canada | eVisa Trip Element Pre-Configuration |
airportCode | Optional, if one other is specified | String | IATA Airport Code e.g. YYZ for Pearson International Airport, Toronto, Canada | Using Airport and Region Code |
regionCode | Optional, if one other is specified | String | alpha3 Region Code e.g. US-TX for Texas, USA | Using Airport and Region Code |
Traveller Model
Attribute | Required | Type | Description | Example |
---|---|---|---|---|
nationality | Optional | String | ISO3 Country Code, e.g. CAN for Canada | Defining a Traveller |
passport | Optional | Object | Passport details of the travel | |
vaccinations | Optional | Array of Objects | View Vaccination Model | Defining a Traveller |
Passport Model
Attribute | Required | Type | Description | Example |
---|---|---|---|---|
number | Optional | String | Passport number | NN234567 |
nationality | Optional | String | Passport nationality | CAN |
givenNames | Optional | String | Given names as stated on passport | John Richard |
surname | Optional | String | Surname as stated on passport | Smith |
issueDate | Optional | String | Issue date as stated on passport | 2020-01-30 |
expiryDate | Optional | String | Expiry date as stated on passport | 2030-01-29 |
issuingCountry | Optional | String | Issuing country as stated on passport | CAN |
issuingAuthority | Optional | String | Issuing authority as stated on passport | Gatineau |
dateOfBirth | Optional | String | Date of birth as stated on passport | 1990-12-30 |
gender | Optional | String | Gender as stated on passport | Female |
Vaccination Model
Attribute | Required | Type | Description |
---|---|---|---|
type | Optional | String | Currently only value 'COVID_19' |
status | Optional | StringFULLY_VACCINATED , NOT_VACCINATED | Indication of being fully vaccinated or not |
Features Model
Customize the appearance of the Trip Element by enabling & disabling feature flags.
Attribute | Required | Type | Description | Example |
---|---|---|---|---|
showSegments | Optional | Boolean | Show/hide navigation between segments Default: true | Hide segments |
showTitle | Optional | Boolean | Show/hide title Default: true | Hide title |
enableSegmentEditor | Optional | Boolean | Show/hide the UI to edit a trip, including "Edit my trip" button. | Hide Segment Editor |
showFilterPassport | Optional | Boolean | Show/hide Select Passport UI | Show Filter Passport |
showFilterVaccinated | Optional | Boolean | Show/hide Vaccination Toggle UI | Show Filter Vaccinated |
showResults | Optional | Boolean | Show/hide travel restrictions results on load Default: true | Show Results |
showResults Feature
showResults is
true
by default, if this is true origin and destination has to be specified. Set this tofalse
to load the widget with no destination and origin specified.
Updated about 1 year ago