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 Segment in a separate tab. To view travel restrictions for each segment, the user can switch between tabs.

See the Segment Model for reference.

12441244

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.

12401240
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.

12441244
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.

12441244
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 no transit
    {
      segmentType: 'RETURN',
      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.


What’s Next
Did this page help you?