Search and Refer API


Steps 1-3: Selecting a flight and forwarding the user to the supplier's website

The first three steps in the integration process are described in the Search and Book API Specification. Once completed please follow Step 4 as shown below:

Step 4: Selecting a flight and forwarding the user to the supplier's website

Once the end user has decided which flight they would like to book, a ProcessDetails XML request can be made to obtain the Handoff URL. The user can then be directed to this URL in a browser in order to complete their booking. In the following example, notice the HandoffParametersOnly element must be included and set to true, and note that the OutwardId corresponds to the id of the first British Airways outward result in the example CheckRouting response above. In the case of a return journey, a ReturnId must also be submitted after the OutwardId which will identify the chosen return flight (which must be in the same Group as the outward selection). 

ProcessDetails request XML example

<CommandList>
<ProcessDetails>
<XmlLoginId>****</XmlLoginId>
<LoginId>****</LoginId>
<RoutingId>Z1LXGWR0QX1XKAN3</RoutingId>
<OutwardId>N9IPVX2WCO9RV419</OutwardId>
<HandoffParametersOnly>true</HandoffParametersOnly>
</ProcessDetails>
</CommandList>


The response will contain a SupplierHandoffData element. The data contained in this element should be used to build an HTML form with the specified ACTION (Url), submission method (GET/ POST), and the specified parameters and values. The submission of this form will take the user to the supplier's website to complete the booking. For more details, see the Detailed XML Specification. 

ProcessDetails response XML example

<CommandList>
    <ProcessDetails>
        <SupplierHandoffData>
            <Method>POST</Method>
            <Url>http://www.easyjet.com/en/book/step2.asp</Url>
            <ParameterList>
                <Parameter>
                    <Name>txtorigID</Name>
                    <Value>LGW</Value>
                </Parameter>
                <Parameter>
                    <Name>txtdestID</Name>
                    <Value>MAD</Value>
                </Parameter>
                <Parameter>
                    <Name>txtdorig</Name>
                    <Value>27</Value>
                </Parameter>
                <Parameter>
                    <Name>txtddest</Name>
                    <Value>00</Value>
                </Parameter>
                <Parameter>
                    <Name>outFlightVal</Name>
                    <Value>segment117095170</Value>
                </Parameter>
                <Parameter>
                    <Name>orig</Name>
                    <Value>LGW</Value>
                </Parameter>
                <Parameter>
                    <Name>dest</Name>
                    <Value>MAD</Value>
                </Parameter>
                <Parameter>
                    <Name>oDay</Name>
                    <Value>27</Value>
                </Parameter>
                <Parameter>
                    <Name>oMonYear</Name>
                    <Value>062006</Value>
                </Parameter>
            </ParameterList>
        </SupplierHandoffData>
    </ProcessDetails>
</CommandList>


The following HTML shows how the parameters in the example response above can be used to construct a form that will forward the user to the appropriate stage of supplier's website. Note that this is not a working example. It is just supplied to demonstrate how the form should be constructed for a given SupplierHandoffData.

Example HTML

<html>
<body onLoad="testform.submit();">
<form name="testform" action="http://www.easyjet.com/en/book/step2.asp" method="POST">
	<input type="hidden" name="txtorigID" value="LGW"></input>
	<input type="hidden" name="txtdestID" value="MAD"></input>
	<input type="hidden" name="txtdorig" value="27"></input>
	<input type="hidden" name="txtddest" value="00"></input>
	<input type="hidden" name="outFlightVal" value="segment117095170"></input>
	<input type="hidden" name="orig" value="LGW"></input>
	<input type="hidden" name="dest" value="MAD"></input>
	<input type="hidden" name="oDay" value="27"></input>
	<input type="hidden" name="oMonYear" value="062006"></input>
</form>
</body>
</html>