Link Search Menu Expand Document

Property Descriptions

Table of Contents
  1. SDK Initialisation Parameters
  2. Initialising CTContext for Standalone
    1. Pick Up & Drop Off Location parameters

SDK Initialisation Parameters

style
An optional CTStyle object, used to set the fonts as well as the primary, secondary, and accent colors of the SDK screens.
customParameters
An optional dictionary of custom parameters. Pass nil unless CarTrawler has given you values to use.
production
A boolean for switching between endpoints. Set to true for production and false for dev.

Please ensure any custom fonts used are included in your main bundle.


Initialising CTContext for Standalone


To initialise the standalone flow, it is necessary to instantiate a CTContext object and set the context in the SDK. The values below are used by the SDK or forwarded to the CarTrawler web booking flow.

The countryCode property refers to the country of residency, and this is used when we make search requests.

implementationID
[Required] An implementation ID, provided by CarTrawler and required to fetch the partner configuration.
clientID
[Required] Your client ID, required to use the CarTrawler API.
flow
[Required] The flow to be launched. Must be .standAlone.
countryCode
A country code, such as "US". Default is the device location if not provided.
currencyCode
A currency code, based on the ISO standard currency codes e.g "USD". The currency associated with the device’s system region is used by default.
languageCode
A code for setting the language. The language associated with the device’s system region is used by default.
passenger
The main driver. Its age and countryCode are used for the search, see CTPassenger.
delegate
A delegate to receive reservation details after the booking, as well as other callbacks.
loyaltyToken
An optional token passed through to supported web flows so customer details can be prepopulated. The SDK forwards this value only and does not decode, validate, or transform it.
orderID
A String value that represents the Order ID for a Flight PNR or Booking Reference, example: IE1234 (limited to 64 characters). If it is more than 32 characters, it will be split in the following format when retrieving this data: {first32characters}.{remainingCharacters}.
flightDetails
Optional flight data forwarded to the web booking flow, see Adding Flight Information.
utmParameters
Optional UTM tracking data sent with the SDK analytics events, see Adding UTM tracking data.

Initialising CTContext for the Standalone flow with Pickup & Drop Off


This is a variant on the standalone flow whereby the web booking flow opens on the search results based on the pick-up and drop-off properties, rather than on its search page. Optionally, if a vehicle refId is provided, the vehicle it belongs to will be highlighted in the results.

Pick Up & Drop Off Location parameters

Pick up location can be passed as a IATA, coordinates or OTA Location ID. Priority is IATA > coordinates > OTA location id

  • ‘pickupLocation’ and ‘dropOffLocation’: It takes a three-letter code that represents airports worldwide. E.g ‘DUB’ for Dublin.

  • ‘pickupLocationCoordinate’ and ‘dropOffLocationCoordinate’:
    context.pickupLocationCoordinate = CLLocationCoordinate2DMake(53.3333, -6.2408989)
    context.dropOffLocationCoordinate = CLLocationCoordinate2DMake(51.903614, -8.468399)
    
  • ‘pickupLocationID’ and ‘dropOffLocationID’: It takes a string OTA Location ID for pickup location, e.g “11” for Dublin.

If the pick-up and drop-off dates or the pick-up location are not present, the SDK opens the web search page instead.
If the vehicle refId is invalid or out-of-date, the results will be shown without the vehicle being highlighted.
The countryCode property refers to the country of residency, and this is used when we make search requests.

In addition to the Standalone properties above:

pickupDate
[Required] The pick-up Date.
dropOffDate
[Required] The drop-off Date.
pickupLocation
[Required for search by IATA]An IATA code for pick-up location.
dropOffLocation
An IATA code for drop-up location. Fallback to pickupLocation if is not set.
pickupLocationID
[Required for search by location ID] An OTA Location ID for pick-up location.
dropOffLocationID
An OTA Location ID for drop-off location. Fallback to pickupLocationID if is not set.
pickupLocationCoordinate
[Required for search by coordinates] A CLLocationCoordinate2D for pick-up coordinates.
dropOffLocationCoordinate
A CLLocationCoordinate2D for drop-off coordinates. Fallback to pickupLocationCoordinate if is not set.
pinnedVehicleID
A refId to highlight a vehicle in the results. Returned by the abandonment deep link or the Vehicles API.

CTPassenger

The driver age and country of residence used for the search can be set by creating a CTPassenger object and setting the passenger property on your CTContext. The following values are forwarded to the web booking flow:

countryCode
The customer's countryCode.
Note: CTPassenger's countryCode takes priority over CTContext's countryCode property when we make search requests.
age
The customer's age. Default age is 30.
//Passenger object
let passenger = CTPassenger(firstName: "Ryan",
                            lastName: "O'Connor",
                            addressLine1: "DunDrum",
                            addressLine2: "Dublin 14",
                            city: "Dublin",
                            postcode: "Dublin 14",
                            countryCode: "IE",
                            age: 25,
                            email: "john.doe@example.com",
                            phone: "0838880000",
                            phoneCountryPrefix: "353",
                            loyaltyProgramNumber: "1234")

let context = CTContext(implementationID: "your implementation ID",
                                clientID: "your client ID",
                                    flow: .standAlone)
context.passenger = passenger

Properties kept for compatibility

The following CTContext properties are still available so existing integrations compile, but they configured screens that are no longer part of the SDK and have no effect on the web booking flow:

flightNumber, loyaltyRegex, customCashTreatment, promotionCode, supplierBenefitAutoApplied, clientUserIdentifier, settingsIconType and recentSearch. The flightNumberRequired custom parameter has no effect either.

Promotion codes, CarTrawler Cash, supplier benefits and loyalty are configured for your partner in the web booking flow; please contact your CarTrawler representative to change them. To start from a recent search, copy its location and dates into the pick-up and drop-off properties.