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

Javascript SDK

Open the Visa Application experience using the Sherpa SDK.

Please note that we are still adding to this page.

What we are building

1. Add SDK

<script src=”{endUrl}”></script>

<!-- where endURL is defined in the table below -->

Please keep in mind that if your implementation requires a custom endURL we will send it directly to you.

Environment

SDK Url

sandbox

https://sdk-sandbox.joinsherpa.io/v1/integration-script.js

prod

{{sdkUrlProduction}}

The global function defined below is triggered by any event that happens in the SDK.

function onSherpaEvent(event) { console.log(event); }
{type: "sdkLoaded", data: null}
data: null
type: "sdkLoaded"

The below function creates a widget on the page. This function will change for custom implementations.

2. Open Checkout Experience

$sherpa.V1.openCheckout()

//or

$sherpa.V1.openCheckout(checkoutOptions)

Custom parameters will be provided to you as part of your implementation.

Property

Type

Description

affiliateId

string

Unique ID provided to you in order to identify your requests

affiliateContext

Object

Affiliate Context object that persists with the order

currency

enum

(not yet ready)

language

enum

Two letter code.

"de" will load the widget in German. Submissions in additional languages will be made available as added.

selectedProgramId

enum

Active program, on which the widget should open on

travellers[]

Traveller Array

Additional detail below

itinerary[]

ItineraryLeg Array

Itinerary Segments of the trip

Widget Parameters

The parameters that can be passed to the widget are available here. The example below represents how they should be formatted.

{
  "affiliateId": "id",
  "affiliateContext": "ctxtcode",
  "defaultNationalityCountry": "CA",
  "selectedProgramId":"USA_ESTA",
  "finalAirportName": "JFK - John F. Kennedy International Airport",
  "language": "en",
  "currency": "CAN",
  "itinerary": [
    {
      "destinationCountry": "US",
      "arrivalDate": "2019-07-17T00:00:00.000Z"
    }
  ],
  "travellers": [
    {
      "displayName": "Mr. Doe",
      "givenNames": "Jon",
      "surname": "Doe",
      "dateOfBirth": "1985-07-11",
      "countryOfBirth": "AUS",
      "placeOfBirth": "Perth",
      "passportType": "P",
      "passportIssuingCountry": "AUS",
      "passportNumber": "N1231234",
      "passportIssueDate": "2015-07-11",
      "passportExpiryDate": "2025-07-11",
      "passportIssuingAuthority": "Australia",
      "sex": "M",
      "email": "[email protected]",
      "phoneType": "MOBILE",
      "phoneCountryCode": "AU",
      "phoneNumber": "1231231234",
      "residence": {
        "streetNumber": "11",
        "street": "Yonge Street",
        "streetLine2": "building2",
        "unit": "1800",
        "city": "Perth",
        "state": "WA",
        "postalCode": "9999",
        "country": "AUS",
      }      
    }
  ]
}

SDK events:

event.type

description

event.data (optional)

sdkLoaded

SDK javascript is loaded

iframeStartLoading

Integration iframe started loading

iframeSuccess

Iframe loaded successfully

iframeFailure

Iframe loading issue

orderSuccess

User successfully placed an order

orderDecline

User declined the order

modalClose

User closed iframe

Updated about a month ago


Javascript SDK


Open the Visa Application experience using the Sherpa SDK.

Suggested Edits are limited on API Reference Pages

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