flightsQuoteWithHttpInfo method

Future<Response> flightsQuoteWithHttpInfo({
  1. FlightOrderRequest? flightOrderRequest,
  2. Future<void>? abortTrigger,
})

Quote flights

Prices flight fares again with the airline, without placing an order. Takes the same body as order: { currency, referenceId, items[] } with 1 to 5 items, each { publicId, quantity, inputs } and quantity 1. inputs may be left out: the quote then prices the fare alone. Inputs that are sent are checked as the order checks them, and their paid extras are added to the price. Prices are in currency, or in the API key's currency when it is omitted. Nothing is charged or held. Returns { currency, items, total }. Each item has a new publicId: order with it before details.expiresAt. It keeps the fare's price, which caps an order without inputs.maxPrice. details carries the fare's conditions, included baggage and price breakdown, hasSeatMaps, the paid extras (availableServices) that can be sent in the order's inputs.selectedServices, and fareOptions: the fares for the same flights and airline, cheapest first and including the quoted one, each with its own publicId that can be quoted or ordered. A higher airline price is returned with 200; only inputs.maxPrice stops a quote. Each item is checked completely, its inputs, its publicId and its price, before the next one, and the first failure names its item: an invalid input or a quantity other than 1 gives 400 / 10001 at its path under items[i]; a price above inputs.maxPrice 409 / 11002 at items[i].inputs.maxPrice; an offer the airline no longer sells 409 / 11003 at items[i]; an unknown, expired or another partner's publicId, or a search itinerary id, 400 / 11004 at items[i]. An unsupported currency gives 404 / 10004.

Note: This method returns the HTTP Response.

Parameters:

Implementation

Future<Response> flightsQuoteWithHttpInfo({ FlightOrderRequest? flightOrderRequest, Future<void>? abortTrigger, }) async {
  // ignore: prefer_const_declarations
  final path = r'/api/v1/b2b/flights/quote';

  // ignore: prefer_final_locals
  Object? postBody = flightOrderRequest;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  const contentTypes = <String>['application/json', 'text/json', 'application/*+json'];


  return apiClient.invokeAPI(
    path,
    'POST',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
    abortTrigger: abortTrigger,
  );
}