Get a price from the API
Now that you know what a bundle is, it is time for you to understand how to display a price in your purchase funnel.
What is a Quote?โ
Quote
is the endpoint that you will use to obtain the price of Koala products (in the form of bundles now that you are
an expert!).
Every time that you need to know how much a Koala product costs, you will call the Quote
API and send us the
traveler's trip details. Our Quote engine will then compute the price of all the possible bundles for the given trip
details.
You will receive from us one price per bundle.
For one customer session in your purchase funnel, the Quote API can be called several times if the traveler decides to make changes to his booking details (choose a new flight, add or remove a traveler, add options included in the compensation, change dates, etc...).
By default, a Quote will be valid for 72 hours (if you need us to extend this validity period, please let us know at support@hikoala.co).
Example of Quote inputโ
This is an example of a payload to provide to the Quotes service for a trip containing only a Journey
:
{
"data": {
"currency": "EUR",
"trips": [
{
"price": {
"amount": 590.97,
"currency": "EUR"
},
"journeys": [
{
"flights": [
{
"airlineIata": "AF",
"number": "65",
"departureAirportIata": "LAX",
"arrivalAirportIata": "CDG",
"departureDate": "2021-08-03T09:50:00Z",
"arrivalDate": "2021-08-04T11:50:00Z"
}
]
}
],
"travelers": [
{
"ageRange": "ADULT"
}
]
}
]
}
}
Possible Quote outputsโ
Our Quote API will give you different responses:
201
: The Quote is valid and respects the expected format. Inside this response, you will find a reference that will be required for the Subscriptions (pay close attention to the quote validity). Keep this reference warm ๐ ยป400
: The Quote is invalid. You may have forgotten one mandatory field or made a mistake with one format401
: The Quote cannot be send because you are experimenting an issue with your token.
Only Quotes with a 201
response and a valid body can be displayed in your purchase funnel.
Valid payload but inability to sell the bundleโ
Each product and, by extension, each bundle can come with a set of limitations of sales (Example: A product can sometimes be sold only up to a certain time before departure.).
If you send a payload in the right format but that ends up in breach with one of the sales limitation, you will receive
a valid 201
response from the server. However, your Quote
will have a false
validity, meaning that we can not
sell the bundle to the given trip.
Invalid Quotes come with reasons
to help you understand why we cannot cover the given trip.
You must only display valid Quotes in your purchase funnel.
Example: If you are selling 2 products, you may receive the following response:
{
"data": [
{
"quotes": [
{
"valid": true,
"bundle": "silver",
"price": {
"amount": 590.97,
"currency": "EUR"
},
"reference": "<QUOTE_REFERENCE>",
"date": "2021-06-03T14:49:07.790+02:00",
"expirationDate": "2021-06-04T14:49:07.790+02:00"
},
{
"valid": false,
"bundle": "gold",
"reasons": [
"One of the flights is too close in the future (cannot cover flights departing before '2021-08-02T12:50:00Z+03:00' and journeys.0.flights.0.departure_date is '2021-08-03T12:50:00.000+03:00')"
],
"date": "2021-06-03T14:49:07.790+02:00"
}
]
}
]
}
Here, you will be able to sell the silver
bundle but not the gold
one.