From quote to order
A purchase is two calls. Quote first, then create the order.
1. Quote the itinerary
Send the itinerary and the number of passengers to POST /quote. The itinerary has an outbound bound and, for a return trip, a homebound bound; leave homebound out for a one-way trip. Each bound lists its flights in chronological order, each departing from the airport where the previous one landed. Departure and arrival are local times at their airport, without a UTC offset. Infants on lap are not counted as passengers.
Which product applies depends on the itinerary:
- TravelSure (
travel_sure) for one-way and return trips with only direct flights. - ConnectSure (
protected) for one-way and return trips with connections, including a return where only one bound connects. Each bound may have at most one connection, and every connection must be at least 60 minutes. - Nothing for any other itinerary, such as an open jaw, where the homebound leaves from or lands at a different airport than the outbound arrived at or left from.
The response holds at most one product with its price. An empty products array means no protection is available for that itinerary, and there is nothing to sell.
2. Create the order
Send the same itinerary to POST /order together with the product_code and the quoted_price you received, plus the purchaser's contact details. The API checks the quoted price against the current price before creating the order, so a stale quote is not silently repriced. If the price no longer matches, request a new quote.
Every POST /order needs an idempotency-key header of your own choosing, at least 16 characters long. If the request times out or fails on your side, send it again with the same key and you get the same order back instead of a duplicate.
3. Follow the order
The order is booked as soon as it is created: the protection is in force and the order is settled on your invoice. The response, and GET /order/{order_id}, return the order.
The product on an order is the product as priced when the order was created.