Making a purchase of a gift-certificate

Making the purchase orf a gift certificate involves the following 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 purchase

1) Get the Gift certificates information

This will return an array of gift certificates.

Select the one you want to purchase. You will need the _id to add it to the cart.

2) 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.

3) Add the gift certificate to the cart

The certDefId is the _id of the Gift certificate definition selected in step (1).

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

4) Select a payment type

To complete the order, first retrieve the available payment types and select one. Remember the method field.

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

Create an order (pay for the items in the cart) using the information from the previous steps.

Once the payment is accepted, the booking is complete. Take note of the transactionIds if you need to perform further actions, like downloading the certificates.

11) (Optional) Download certificates

Follow the same instructions as in download tickets for the booking. The certificates are downloaded as PDF files.