Deep linking

Please make sure you read the Conventions before continuing with this guide.

Requirements.

You will need an X-API-KEY.

You can generate deep links to you websales cart to move part of the flow to your own UI, send promotional links for a particular trip or product or some other need.

Below there is a list of all the available deep links into cart. You will find the base url, the HTTP method (GET or POST) and the data to be send in the query string or as form pair.

Query string data should be properly URL encoded https://urlencode.org/ Form data should be properly encoded as well using application/x-www-form-urlencoded

The [baseUrl] for all the links is https://[subdomain].betterez.com/cart/{{providerId}}

Restrictions

Some links have restrictions and/or limitations. A list is provided below.

Restriction Description
Capacity The results may vary depending on available capacity
Cutoff Similar to time but specific to cutoff sales times for a given account
Date The url depends on dates, usually means that dates in the pass may not work
Time The results are time bound, usually means that there is a time out on how long this results may be valid and varies from account to account

For a list of values and what API can be used to find those see below the table.

Link to URL METHOD QS Formdata Restrictions
Product [baseUrl]/{{productFamily}}/{{productId}} GET N/A
Trips [baseUrl]/trip-results GET [Trips qs] Capacity Cutoff Date Time
Passengers [baseUrl]/{{productFamily}}/{{productId}}/passengers POST [Passengers qs] [Passengers form data] Capacity Cutoff Date Time
Shopping cart [baseUrl]/cart POST [Shopping cart qs] [Shopping cart from data]

Trips qs

The Query string needs the following properties and values:

  productFamily
  productId
  type
  channel
  departureDate
  returnDate
  from
  to
  fares

Passengers qs

The Query string needs the following properties and values:

  productFamily
  productId
  type
  channel
  departureDate
  returnDate (ignore for type oneway)
  from
  to
  fares
  hasAirlines
  hasSeatmaps
  iOpId

Passengers form data

json: {
  "productFamily": "string",
  "productId": "string",
  "type": "string"
  "channel": "string",
  "departureDate": "string"
  "returnDate": "string"  (ignore for type oneway)
  "from": "string"
  "to": "string"
  "fares": "string"
  "hasAirlines": "string"
  "hasSeatmaps: "string"
  "departureTrip": "string"
  "returnTrip": "string" (ignore for type oneway)
  }

Shopping cart qs

productFamily
productId
type
channel
departureDate
returnDate
from
to
fares
hasAirlines
hasSeatmaps
passengers[0][fareId] 52fa96bbc5e9c64a0400001b
passengers[0][fare]  
passengers[0][ssrs] 588aaf64ae9d9dd30a001778:1
passengers[0][firstName]
passengers[0][lastName] 
passengers[0][email]

Shopping cart form data

productFamily
productId
type
channel websales
departureDate
returnDate
from
to
fares
hasAirlines
hasSeatmaps
departureTrip
returnTrip
passengers[0][fareId]
passengers[0][fare]
passengers[0][ssrs] 588aaf64ae9d9dd30a001778:1
passengers[0][firstName]
passengers[0][lastName]
passengers[0][email]

Relevant apis and where to get the data from

key API result path description
productFamily /inventory/products product.family
productId /inventory/products product._id
type N/A "oneway" or "roundtrip" The type of trip
channel N/A "websales" The channel used to complete the purchase
departureDate N/A Date in the format yyyy-mm-dd Date you depart for your the trip
returnDate N/A Date in the format yyyy-mm-dd Date you returns from your the trip (ignore if type=oneway)
from /inventory/stations station._id The station you depart from
to /inventory/stations station._id The station you are going to
fares /inventory/fares fare._id A comma separated list of fareIds and qty formatted as {{fareId}}:{{qty}}, where qty is the number of passengers for that fare
hasAirlines /inventory/fares fare.hasAirline True or False
hasSeatmaps /inventory-trips/trips trip.hasSeatMap True or False
departureTrip /inventory-trips/trips trip.tripId
returnTrip /inventory-trips/trips trip.tripId (ignore if type=oneway)
passengers[index][fareId] /inventory/fares fare._id The fare._id for the passenger
passengers[index][fare] /inventory/fares fare.name The name of the fare for the passenger
passengers[index][ssrs] 588aaf64ae9d9dd30a001778:1 /inventory/ssrs ssr._id A comma separated list of ssrIds and qty formatted as {{ssrId}}
passengers[index][firstName] N/A Passenger firstName
passengers[index][lastName] N/A Passenger lastName
passengers[index][email] N/A Passenger email (mandatory for the first passenger only [index 0])
iOpId N/A UUID Generated by the client