Making a purchase with a promo

This guide will lead you to buy a product and apply the promo once it is into the cart. We assume you have a promo configured properly for being applied to the product you bought.

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

Prerequisites

You will need an X-API-KEY and a username and password to authenticate.

Steps to complete a purchase

Follow steps 1 to 7 on making a reservation purchase

8) Find a promo to apply

Find a promo that contains a rule that could be applied for your selected product, fares, origin, destination, and travel date(s).

From the results, select a single promo and remember it's name that is going to be used in the next step.

9) Add the promo to the cart

Apply the promo to the cart. The cart returned should contains the given promo applied to the item added on step 6.

9) Complete purchase

Continue with steps 8 to 11 from making a reservation purchase.

13) Postman resources

If you would like to use Postman to test the API, we have included a collection you can use as a starting point below.

This collection is designed to allow you to purchase a reservation and then apply a promo. In order to use it successfully, you will need your x-api-key, a valid promo for your product, and valid stations and routes set up. In this example, we create a customer, but you can use an existing customer if you prefer.

After importing the collection, and the environment, make sure your collection is using the new environment, and that you have set the values. Variables that start with "YOUR_" will need to be replaced with a value specific to your situation. If you are going to be using our API in sandbox, please change the {{basePath}} environment variable to https://sandbox-api.betterez.com.

Postman Collection

Postman Environment