Redeeming a redeemable item

Making a purchase involves several steps.

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

Prerequisites

You will need an X-API-KEY and a Basic Access Authentication token generated from your username and password.

Steps to complete a redemption (purchase)

1) Get the RI information

2) Select a trip based on the RI information

From the RI returned in the call above choose the productId, fareId (qty should always be 1), originId and destinationId. You will need a travel Date.

Once you get all that information you can find trips that can be redeemed with the RI.

From the results, select a single departure trip. Remember the trip id, a long hash that will look something like this:

{
  "id": "eyJhY2NvdW50SWQiOiI1OTEwY2ZiYWZhMWI5MDRkMGMwMDAwMTUiLCJwcm9kdWN0SWQiOiI1OTEwY2ZiYWZhMWI5MDRkMGMwMDAwMTYiLCJvcmlnaW5JZCI6IjU5MjQ1OTBlOTk4MmNmMjA3YzBkZjQwMCIsImRlc3RpbmF0aW9uSWQiOiI1OTI0NTkyODk5ODJjZjIwN2MwZGY0MDEiLCJmYXJlSWRzIjoiNTkyNDViNTc5OTgyY2YyMDdjMGRmNDAyOjEiLCJkZXBhcnR1cmVEYXRlIjoiMjAxNy0xMC0yOCIsImRlcGFydHVyZVRpbWUiOiIwOTowMCIsImNoYW5uZWwiOiJ3ZWJzYWxlcyIsInNlZ21lbnRzIjpbeyJyb3V0ZUlkIjoiNTkyNDU5NDE1MDJjYzcxMDcyMDAwMDFlIiwic2NoZWR1bGVJZCI6IjU0MGZkNWQ5LThiZDEtNGIxNS05ZDZlLTJiNzk3ZmFhYWM1NyIsIm9yaWdpbiI6IkJlcmxpbiBDZW50cmFsIGJ1cyBzdGF0aW9uIChaT0IpIiwiZGVzdGluYXRpb24iOiJXYXJzYXcgV2VzdCBidXMgc3RhdGlvbiJ9XSwidGlja2V0VHlwZSI6Im9uZXdheSJ9"
}

If Fare Classes are being used, you will need to select the passenger's desired Fare Class for their outbound and return trip. Select one Fare Class from the departure trip, and remember it's id. If you searched for a round trip, also select a Fare Class from the return trip, and remember its id. These Fare Class ids will need to be specified when adding the item to the shopping cart. (You can learn more about working with fare classes here).

3) Authenticate

You are almost ready to add the trip into the shopping cart. First, you must authenticate.

Store the shortToken from the authentication response, so that you can use it in subsequent API calls.

4) Add the trip to the cart

Remember the cartId and the total from the response. You will need this information to complete the order.

Add a redeemableItemId in the passengers where a redeemable item should be applied.

5) Select country and province info for the customer

Get our list of country and province information, and remember the result.

You will need a valid ISO code of a country and a province (if it applies) to complete the customer information when paying for the order, in the next step.

6) Create the order

With the information from the cart the country and the customer information from the original RI complete the order.

7) (Optional) Download tickets

In some cases you may want to download tickets for the booking. The tickets are downloaded as PDF files.