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.

7a) (Optional) Download certificates

Follow the same instructions as in download tickets for the booking. The certificates are downloaded as PDF files. For this endpoint you will need the transactionId

7b) (Optional) Download certificate

If you wish to get a pdf for a particular gift certificate, You can use the /notifications/pdf-gift-certificate endpoint of the Notification Bucket to download the pdf.

There are different ways to obtain the giftCertifateId, but after creating an order, you will need to look at the response from the successful order and find the transactionSummary object array. Based on the type field being g-cert, you can obtain the _id for the gift certificate, which is what you will used in the call above.