Open Checkout

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.

EnvironmentSDK Url
sandboxhttps://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.

PropertyTypeDescription
affiliateIdstringUnique ID provided to you in order to identify your requests
affiliateContextObjectAffiliate Context object that persists with the order
currencyenum(not yet ready)
languageenumTwo letter code.

"de" will load the widget in German. Submissions in additional languages will be made available as added.
selectedProgramIdenumActive program, on which the widget should open on
travellers[]Traveller ArrayAdditional detail below
itinerary[]ItineraryLeg ArrayItinerary 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.typedescriptionevent.data (optional)
sdkLoadedSDK javascript is loaded
iframeStartLoadingIntegration iframe started loading
iframeSuccessIframe loaded successfully
iframeFailureIframe loading issue
orderSuccessUser successfully placed an order
orderDeclineUser declined the order
modalCloseUser closed iframe