Sherpa - Visa and Travel Restrictions API

Sherpa Developer Hub

Welcome to the Sherpa developer hub. We offer a suite of solutions that guides travellers from planning to a safe return home. Take a look at the integration guides, specific use cases and an interactive API Reference. Ready? Let's go.

Guides    API Reference

πŸ†• Trip Element

Personalized travel restrictions and visa requirements for your trip.

Introduction

Embed a Trip Element on your web platform using the sherpaΒ° SDK. Trip element provides personalized travel restrictions and visa requirements for travellers based on their itinerary.

The Element can be embedded on your web page with just a few lines of code. To see some ways you can use the Trip Element, check out our examples and the JS Fiddle.

Embed Trip Element

🚧

App Id is required

You will receive a unique APP_ID during onboarding.

You need to include the sherpaΒ° SDK by adding the script tag to the head of your HTML file and include your personalized APP_ID.

<script src="https://sdk.joinsherpa.io/widget.js?appId=<<APP_ID>"></script>

Next create an instance of the Map Element object and attach it to the DOM of your site by mounting it to a an existing HTML element on your page.

We recommend to place an empty div element like <div id="sherpa-trip-element"></div> on your site.

The element.mount accepts a valid CSS Selector.

$sherpa.V2.createElement('trip').mount('#sherpa-trip-element')

Configure Trip Element

πŸ“˜

Examples

View configuration examples

The Trip Element can also be customized through an optional configuration object.

Attribute

Required

Type

Description

language

Optional

String

default: en-US
View supported languages

defaultNationality

Optional

String

ISO3 Country CodeISO3 Country Code - A country code in an ISO3 Format. For example, `USA`, `CAN`, `DEU`., e.g. CAN for Canada
or browser to determine nationality based on the language settings of the browser.

placement

Required

String

Name of booking stage or page the element is embedded on. Used for measuring engagement in analytics reports.
Suggested values in camelCase:
homePage - Home Page
discovery - Generic pre-booking marketing page
mmb - Manage My Booking
search - Search
bookingConfirmation - Booking Confirmation
destinationPage - dedicated marketing page for a destination
covidPage - dedicated page for COVID-19 resources

segments

Optional

Array of Objects

View Segment Model

travellers

Optional

Array of Objects

View Traveller Model

queryParams

Optional

Object

View Analytics Model

features

Optional

Object

View Features Model

Segment Model

Describe the trip using a set of SegmentSegment - A part of a trip between two successive stops. A return trip consists of two segments.s.

Attribute

Required

Type

Description

segmentType

Required

String
OUTBOUND, RETURN

Direction of the flight.

segmentSubType

Required for connecting flight.

String
TRANSIT

Is this a connecting flight.

origin

Required

Object

View Location Model

destination

Required

Object

View Location Model

travelMode

Optional

String
LAND, AIR, SEA

Default: AIR

departureDate

Required

String
YYYY-MM-DD

Date of departure

departureTime

Optional

String
HH:MM:SS

Time of departure

arrivalDate

Required

String
YYYY-MM-DD

Date of arrival

arrivalTime

Optional

String
HH:MM:SS

Time of arrival

Location Model

One of the following attributes is required.

Attribute

Required

Type

Description

countryCode

Optional, if one other is specified

String

ISO3 Country CodeISO3 Country Code - A country code in an ISO3 Format. For example, `USA`, `CAN`, `DEU`., e.g. CAN for Canada

airportCode

Optional, if one other is specified

String

IATA Airport Code e.g. YYZ for Pearson International Airport, Toronto, Canada

regionCode

Optional, if one other is specified

String

alpha3 Region CodeRegion Code - ISO 3166-2 region code e.g. US-TX for Texas, USA

Traveller Model

Attribute

Required

Type

Description

nationality

Optional

String

ISO3 Country CodeISO3 Country Code - A country code in an ISO3 Format. For example, `USA`, `CAN`, `DEU`., e.g. CAN for Canada

vaccinations

Optional

Object

View Location Model

Vaccination Model

Attribute

Required

Type

Description

type

Optional

String

Currently only value 'COVID_19'

status

Optional

String
FULLY_VACCINATED, NOT_VACCINATED

Indication of being fully vaccinated or not

Analytics Model

Pass analytics attributes to the segment element. The parameters will be appended to the iFrame url where the Trip Element is rendered, and appear in your reports.

Attribute

Required

Type

Description

utm_source

Optional

String

UTM source. Example: email

utm_medium

Optional

String

UTM medium. Example: newsletter

utm_campaign

Optional

String

UTM campaign. Example: summer-return-to-travel

Features Model

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

Attribute

Required

Type

Description

showSegments

Optional

Boolean

Show or hide navigation between segments
Default: true

showTitle

Optional

Boolean

Show or hide title
Default: true

Updated a day ago



πŸ†• Trip Element


Personalized travel restrictions and visa requirements for your trip.

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.