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

Customize Itinerary

Show travel restrictions for a specific itinerary

Introduction

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.

Describing a Trip

Trip element displays travel restrictions for each SegmentSegment - A part of a trip between two successive stops. A return trip consists of two segments. in a separate tab. To view travel restrictions for each segment, the user can switch between tabs.

See the Segment Model for reference.

Each flight is displayed at the top of the element, with a divider separating the outbound and return.

One Way

Show travel restrictions for a one way trip from Canada to USA.

const elementConfig = {
  placement: "mmb",
  segments: [{
      segmentType: 'OUTBOUND',
      origin: {
        countryCode: 'CAN',
      },
      destination: {
        countryCode: 'USA',
      },
      departureDate: '2021-02-22',
            departureTime: '12:59:00',
      arrivalDate: '2021-02-22',
      arrivalTime: '12:59:00',
    }    
  ]

}

$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-widget')

Return

Show travel restrictions for a return trip from USA to Turkey.

const elementConfig = {
  placement: "mmb",
  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-widget')

Layover

Show travel restrictions for a trip from Canada to Mexico, with a layover in United States.

const elementConfig = {
  placement: "mmb",
  segments: [
    // First Segment
    {
      segmentType: 'OUTBOUND',
      segmentSubType: 'TRANSIT', // Add TRANSIT for layovers
      origin: {
        countryCode: 'CAN',
      },
      destination: {
        countryCode: 'USA',
      },
      departureDate: '2021-02-22',
      arrivalDate: '2021-02-22',
    },
    // Second Segment
    {
      segmentType: 'OUTBOUND',      
      origin: {
        countryCode: 'USA',
      },
      destination: {
        countryCode: 'MEX',
      },
      departureDate: '2021-02-22',
      arrivalDate: '2021-02-22',
    },
    // Return Segment
    {
      segmentType: 'RETURN',
      segmentSubType: 'TRANSIT',
      origin: {
        countryCode: 'MEX',
      },
      destination: {
        countryCode: 'CAN',
      },
      travelMode: 'AIR',
      departureDate: '2021-03-22',
      arrivalDate: '2021-03-22',
    },
  ],

}

$sherpa.V2.createElement('trip', elementConfig).mount('#sherpa-widget')

Virtual Interlining Layover

For virtual interlining connections, do not include the segmentSubType:TRANSIT attribute in the segment.

See the Segment Model for reference.

Updated 19 days ago



Customize Itinerary


Show travel restrictions for a specific itinerary

Suggested Edits are limited on API Reference Pages

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