Property Descriptions
Table of Contents
SDK Initialisation Parameters
- style
- An optional CTStyle object, used to set the fonts as well as the primary, secondary, and accent colors in the SDK.
- customParameters
- A dictionary of custom parameters, it may contain:
- orderID: A String value that represents the Order ID for a Flight PNR or Booking Reference, Example: IE1234 (limited to 32 characters)
- flightNumberRequired: A boolean key to enable Flight Number as a required field in the Payment Form. Default: 0 (optional field)
- orderID: A String value that represents the Order ID for a Flight PNR or Booking Reference, Example: IE1234 (limited to 32 characters)
- 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 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.
- flightNumber
- A flight number string to pre populate the equivalent field on driver details screen.
- passengers
- An array of passengers, the first one will be the main passenger.
- delegate
- A delegate to receive reservation details after the payment, as well as other callbacks.
- loyaltyRegex
- A regular expression used to validate the loyalty number field.
- customCashTreatment
- A boolean used in the SDK as the main toggle to display enhanced cash voucher merchandising throughout the booking flow.
- promotionCode
- A string used by the SDK to toggle the display of and prepopulate the promotion code field on the search form.
- supplierBenefitAutoApplied
- A boolean that allows Partners to initialise the SDK and opt in to apply ALL automatic codes that can be applied for suppliers.
- clientUserIdentifier
- A string token of a logged in user that allows the SDK to fetch the user loyalty details and points.
- settingsIconType
- An enum used to set the icon used for the landing and search page settings buttons.
For the promotionCode
property: To display the field and prepopulate it, please provide a string. To display the field without a prepopulated code please provide an empty string.
Initialising CTContext for the Standalone flow with Pickup & Drop Off
This is a variant on the standalone flow whereby the vehicle list is shown based on the pick-up and drop-off properties, rather than the regular initial search screen. Optionally, if a vehicle refId is provided, the vehicle it belongs to will be pinned to the top of the vehicle list. If the user navigates back from the vehicle list in this flow variant, they will be brought to the search screen.
If the pick-up and drop-off dates are invalid, out-of-date, or not present the SDK will fallback to regular standalone search.
If the vehicle refId is invalid or out-of-date, the list will be shown without the vehicle being pinned.
If the pick-up and drop-off properties are valid but no search results are returned by the CarTrawler system, the SDK will fallback to the regular standalone search.
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 language code to switch between languages. The language associated with the device’s system region is used by default.
- flightNumber
- A flight number string to pre populate the equivalent field on driver details screen.
- pickupDate
- [Required] The pick-up Date.
- dropOffDate
- [Required] The Drop-off Date.
- pickupLocation
- An IATA code for pick-up location.
- Note: If this is set, the pickupLocationID and dropOffLocationID properties will not be used.
- pickupLocationID
- [Required (if pickupLocation is not set)] An OTA Location ID for pick-up location.
- dropOffLocationID
- An OTA Location ID for drop-off location.
- pinnedVehicleID
- A refId to highlight and pin a vehicle to the top of the list. Returned by the abandonment deep link.
- passengers
- An Array of Passengers, the first one will be the main passenger.
- delegate
- A delegate to receive reservation details after the payment, as well as other callbacks.
- loyaltyRegex
- A regular expression to validate loyalty number field. Example: ^[A-Za-z0-9]{6, }$
- customCashTreatment
- A boolean used in the SDK as the main toggle to display enhanced cash voucher merchandising throughout the booking flow.
- promotionCode
- A string used by the SDK to toggle the display of and prepopulate the promotion code field on the search form.
- supplierBenefitAutoApplied
- A boolean that allows Partners to initialise the SDK and opt in to apply ALL automatic codes that can be applied for suppliers.
- Note: To display the field and prepopulate it, please provide a string. To display the field without a pre-populated code please provide an empty string.
- clientUserIdentifier
- A string token of a logged in user that allows the SDK to fetch the user loyalty details and points.
- settingsIconType
- An enum used to set the icon used for the landing and search page settings buttons.
Initialising CTContext for Standalone with a Recent Search
This is a variant on the standalone flow whereby the vehicle list is shown based on the recent search parameter, rather than the regular initial search screen. If a user backs out of the list, it will exit the standalone flow.
If the recent search is unavailable or invalid, the SDK will fallback to the regular standalone search.
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 language code to switch between languages. The language associated with the device’s system region is used by default.
- passengers
- An array of Passengers, the first one will be the main passenger.
- delegate
- A delegate to receive reservation details after the payment.
- loyaltyRegex
- A regular expression to validate loyalty number field. Example: ^[A-Za-z0-9]{6, }$
- customCashTreatment
- A boolean used in the SDK as the main toggle to display enhanced cash voucher merchandising throughout the booking flow.
- promotionCode
- A string used by the SDK to toggle the display of and prepopulate the promotion code field on the search form.
- recentSearch
- A CTRecentSearch object used to open the SDK on the vehicle list page and bypass the search screen.
CTPassenger
The Driver Details screen can by prepopulated by creating a CTPassenger
object and setting the passengers
property on your CTContext
.
- firstName
- The customer's first name.
- lastName
- The customer's surname.
- addressLine1
- The customer's first line of address.
- addressLine2
- The customer's second line of address.
- city
- The customer's city.
- postCode
- The customer's postcode.
- 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.
- The customer's email.
- phone
- The customer's phone number.
- phoneCountryPrefix
- The customer's country phone prefix.
- loyaltyProgramNumber
- The customer's loyalty program number.
//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: "ryan.oconnor@cartrawler.com",
phone: "0838880000",
phoneCountryPrefix: "353",
loyaltyProgramNumber: "1234")
let context = CTContext(implementationID: "your implementation ID",
clientID: "your client ID",
flow: .standAlone)
context.passengers = [passenger]