Skip to main content

Travel, Airlines, Car Rental

This guide is for companies operating travel sites such as car rentals, flight bookings etc. It shows how Talon.One can be used to provide loyalty programs and discounts. There are two steps to using Talon.One:

  1. Notify the API of assorted customer activities.
  2. Handle the effects returned by the API.

The decision of which effects to return for a given customer activity is controlled by the Talon.One Rule Engine.

1. Send activity notifications

The easiest way to get started is with our SDKs. After the SDK has been installed & configured you will use the following API calls:

Below we show example API calls for different customer activities: viewing flights, updating a booking, and entering a promotional code.

1.1. User views possible flights

Track a custom viewedFlights event with a flights attribute whenever a user views a flight listing:

talon.trackEventV2("customerId1234", "viewedFlights", { flights: "EW8055|FR181|AB0987|" })

This allows campaigns to offer promotions specific to the flights and airlines the user is currently viewing. For example, a response may contain the following effect:

["offerDiscount", "Book your flight with AirBerlin now and get a 10% Discount"]

1.2. User updates their order

Send a session update with the current booking items whenever a user updates their order:

talon.updateCustomerSession("session1234", {
attributes: {
flights: "AB0987"
cartItems: [{
name: "Air Berlin",
price: 2314.90,
attributes: {
PAX: 2,
Airline: "AB",
BookingClass: "B"

This allows campaigns in the Rule Engine to trigger effects based on the cart contents. For example, we can create a campaign that adds a discount when a user orders a flight with total cart value higher than 2000 and with airline attribute of "AB":

["setDiscount", "10% off Air Berlin", 231.49]

1.3. User enters a promo code

Send a session update whenever a user enters a promo code:

talon.updateCustomerSession("session-1234", { coupon: 'Aloha-Hawaii-4XA7E' })

The Talon.One Rule Engine validates the code and returns either an acceptCoupon effect (and other potential effects), or a rejectCoupon effect indicating that the coupon is invalid.

Successful validation:

["acceptCoupon", "Aloha-Hawaii-4XA7E"]
["setDiscount", "$20 off all flights to Hawaii", 20]

Unsuccessful validation:

["rejectCoupon", "Aloha-Hawaii-4XA7E"]

2. Handling effects

The Rule Engine will send back discounts and other actions to take in the form of effects. These are handled in your integration by registering effect handlers:

talon.handleEffect('setDiscount', function (context, label, amount) {
context.order.addOrReplaceDiscount(label, amount)

3. References

  • See Handling effects for more information on the types of effects the Rule Engine might return and their arguments.
  • See Data Model overview for more information on what information you can use in your campaigns to conditionally trigger effects.