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 QuickStart

Get up and running in 5 minutes

Introduction

You will learn how to embed and configure the Trip Element on your web page. By integrating the Trip Element with the sherpa SDK, you access a myriad of customizations that help personalize the customer experience on your platform.

You will learn how to pre-fill origin and destination and show content localized for the user.

1. Setup sherpa° sdk

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>

2. Embed Trip Element

Place an empty div element like on your site where you want the Trip Element to appear.

<div id="sherpa-trip-element"></div>

Use the sherpa sdk to create an instance of the Trip Element object and attach it to the DOM of your site by mounting it to a an existing HTML element on your page.

The mount method accepts a valid CSS Selector.

📘

Always include placement

Include a placement attribute when embedding the trip element for engagement and conversion tracking. Without the placement, analytics reports will be limited.

const elementConfig = {
  placement: "discovery"
}
$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-trip-element')

You should see the Trip Element appear on your page.

Personalization

To provide the best user experience, you can pre-fill the Trip Element with the right context.

3. Optional - Itinerary

Show travel restrictions for a specific itinerary. You can preconfigure the trip element to show travel restrictions for simple, one-way flights or complex itineraries with virtual interlining layovers.

Extend the elementConfig object with the itinerary.

Learn more about itineraries.

const elementConfig = {
  placement: "discovery",
  segments: [
    // Outbound Segment
    {
      segmentType: 'OUTBOUND',
      origin: {
        countryCode: 'USA',
      },
      destination: {
        countryCode: 'TUR',
      },
      departureDate: '2021-02-22',
            departureTime: '12:59:00',
      arrivalDate: '2021-02-22',
      arrivalTime: '12:59:00',
    },
    // Return Segment
    {
      segmentType: 'RETURN',
      origin: {
        countryCode: 'TUR',
      },
      destination: {
        countryCode: 'USA',
      },
      departureDate: '2021-02-27',
            departureTime: '12:59:00',
      arrivalDate: '2021-02-27',
      arrivalTime: '12:59:00',
    },
  ],
}
$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-trip-element')

4. Traveller Passport and Vaccination Status

Personalize the experience for the traveller by pre-filling their Passport and showing information for Vaccinated Travellers.

Extend the elementConfig object with information about the traveller. The configuration only supports a single traveller.

📘

What if I don't have this information?

We recommend using the following values:

  1. Vaccination: FULLY_VACCINATED
  2. Nationality: infer from IP or origin

Learn more about Traveller Model

const elementConfig = {
  placement: "discovery",
  travellers: [
    {
      nationality: "USA",
      vaccinations: [
      {
          type: "COVID_19",
          status: "FULLY_VACCINATED"
      }
      ]
    }
  ],
  segments: [
    // Outbound Segment
    {
      segmentType: 'OUTBOUND',
      origin: {
        countryCode: 'USA',
      },
      destination: {
        countryCode: 'TUR',
      },
      departureDate: '2021-02-22',
            departureTime: '12:59:00',
      arrivalDate: '2021-02-22',
      arrivalTime: '12:59:00',
    },
    // Return Segment
    {
      segmentType: 'OUTBOUND',
      origin: {
        countryCode: 'TUR',
      },
      destination: {
        countryCode: 'USA',
      },
      departureDate: '2021-02-27',
            departureTime: '12:59:00',
      arrivalDate: '2021-02-27',
      arrivalTime: '12:59:00',
    }
  ]
}
$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-trip-element')

5. Optional - Analytics

Improve analytics reports by specifying standard UTM tags. These tags will show up in your analytics reports provided by sherpa°.

The utm tags are not manipulated by sherpa°.

Learn more about Analytics.

Extend the elementConfig object with analytics.

const elementConfig = {
  placement: "discovery",
  queryParams: {
    utm_source: "email",
    utm_medium: "newsletter",
    utm_campaign: "summer-return-to-travel"
  },
  travellers: [
    {
            nationality: "USA",
      vaccinations: [
        {
          type: "COVID_19",
          status: "FULLY_VACCINATED"
        }
      ]
    }
  ],
  segments: [
    // Outbound Segment
    {
      segmentType: 'OUTBOUND',
      origin: {
        countryCode: 'USA',
      },
      destination: {
        countryCode: 'TUR',
      },
      departureDate: '2021-02-22',
            departureTime: '12:59:00',
      arrivalDate: '2021-02-22',
      arrivalTime: '12:59:00',
    },
    // Return Segment
    {
      segmentType: 'OUTBOUND',
      origin: {
        countryCode: 'TUR',
      },
      destination: {
        countryCode: 'USA',
      },
      departureDate: '2021-02-27',
            departureTime: '12:59:00',
      arrivalDate: '2021-02-27',
      arrivalTime: '12:59:00',
    }
  ]
}
$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-trip-element')

Updated about a month ago



Trip Element QuickStart


Get up and running in 5 minutes

Suggested Edits are limited on API Reference Pages

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