<bagsToCheckin>1</bagsToCheckin> <!-- (Optional) The value cannot be higher than the number of passengers. Indicates how many passengers are checking in a bag -->

<currency>GBP</currency><!-- defines the currency in which all results should be returned. If omitted, the currency will be that returned by the supplier -->
</GetFlightsRequest>

Response

<GetFlightsResponse sid="ZWSRH3EBfLees7rr"> <!-- ‘supplierConnections’ is the number of data connections to suppliers, ‘completeConnections’ indicates how many supplier have responded so far, ‘totalResults' is the number of bookable offers that have been found so far -->

<!-- systemInfo: 'suppliers' gives the total number of suppliers that are active for your account. -->

<systemInfo suppliers="10"/>

</resultInfo>

<results>

<flightOffer id="1"><supplier>flybe</supplier>

<billingPrice currency="EUR" luggageCharge="26.00">61.99</billingPrice> <!-- The billingPrice is the exact price in the currency that will be billed. The luggageCharge will only be included if 'bagsToCheckin' is specified in the request and has value great than 0 -->

<price currency="GBP" luggageCharge="26.00">41.99</price><!-- This is the billing price converted to the requested currency using TF's conversion rates. The luggageCharge will only be included if 'bagsToCheckin' is specified in the request and has value great than 0 -->

Polling

IMPORTANT: The above call will always respond immediately, and will return the best offers received from suppliers so far (therefore the first response will contain no offers at all). If the completeConnections is less than the supplierConnections, then the request below can be submitted to receive any new offers that have been returned by the various suppliers. You should not submit this 'polling' request more often that every 3 seconds, and you should always stop polling when all results have been returned or when a certain timeout is reached (e.g. after 1 minute). Polling only applies to requests that depend upon live connections to 3rd parties and therefore are 'slow'. This currently is only 'GetFlightsRequest' and 'GetHotelsRequest'

<GetFlightsRequestsid="ZWSRH3EBfLees7rr">

</GetFlightsRequest>

By default, the best 10 offers are returned. This can be changed by submitting the ‘paging’ element described below.

Paging

The sid must be submitted when to modifying the results of a
previous search, for example to request a different page of results, or adjust the number of results per page:

<GetFlightsRequest sid="ZWSRH3EBfLees7rr">

<paging>

<pageNumber>2</pageNumber><!-- Requests the second page of
results -->

<offersPerPage>5</offersPerPage><!-- Specifies the number of offers on
each page -->

</paging>

</GetFlightsRequest>

Travelfusion may not support 'page-skipping'. i.e. you will not be able to view page 2 without viewing page 1 first. The end user should only be offered 'next' and 'previous' buttons, not a list of page numbers.

Each of the parameters
is optional. They initially have default values as above. Weights must be
between 0 and 1 and indicate the relative importance of each feature of the
offers. Offers are then ranked according to these weights and features.

Filtering results

Any of the 3
requests above (polling, paging and ranking) can be combined into a single request where needed. For example,
to launch a new search and set the timeWeight to 0 and priceWeight to 1, the
following could be submitted:

<GetFlightsRequest>

<from>98019283019</from>

<to>MAD</to>

<going>2011-06-16</going>

<returning>2011-07-20</returning>

<parameters>

<timeWeight>0.5</timeWeight>

<priceWeight>1.0</priceWeight>

</parameters>

</GetFlightsRequest>

Note that all
parameters and paging is remembered in the session, so if the request below is then submitted, the results to the above search will be re-ranked, considering the
new timeWeight (but preserving the previously specified priceWeight), and the
2nd page of 5 offers will be returned.

<GetFlightsRequestsid="ZWSRH3EBfLees7rr">

<paging>

<pageNumber>2</pageNumber>

<offersPerPage>5</offersPerPage>

</paging>

<parameters>

<timeWeight>0.5</timeWeight>

</parameters>

</GetFlightsRequest>

The API has been
designed to represent the pages of a typical mobile or widget user-interface,
and the behaviour of a typical user – i.e. submitting a search and then paging
or filtering the results based on various criteria.

It supports some
advanced weighted ranking functions that could be offered to the user in many
simple formats or hidden completely. These are designed to help identify a very
small set of the most useful results from a very large set of options, without
the user needing to page through hundreds of offers and compare them by memory.

Booking (Get Booking Ids For Offer)

In order to book a flight offer, you will first need to obtain the 'booking ids' for the offer. You can do this as follows: