3. Booking

Poll Request
<request version="4.0">
  <auth>
    <username>example</username>
    <password>example</password>
    <agent>example</agent>
  </auth>
  <trains-book session="dv.UpX7Bz0osA" clientRef="12345" customerCountryCode="IL">
    <customer>
      <title>Mr.</title>
      <firstName>Test Firstname</firstName>
      <lastName>Test Lastname</lastName>
      <phone type="home">044-772344066</phone>
      <phone type="mobile">044-545966911</phone>
      <email>user@example.com</email>
      <address>123 main st.</address>
      <postCode>70906</postCode>
      <city>Someville</city>
      <countryCode>GB</countryCode>
    </customer>
    <special-request-fields>
        <field code="ASD">edf234f</field>
    </special-request-fields>
        <result token="dv.1210273893" tokenInbound="dv.205723157788">
      <connections>
        <outbound id="0"/>
        <inbound id="0"/>
      </connections>
      <pax-group>
        <pax>
          <title>M</title>
          <firstName>John</firstName>
          <lastName>Smith</lastName>
          <dateOfBirth>1977-08-17</dateOfBirth>
        </pax>
        <pax>
          <title>F</title>
          <firstName>Jane</firstName>
          <lastName>Smith</lastName>
          <dateOfBirth>1975-01-30</dateOfBirth>
        </pax>
        <pax>
          <title>C</title>
          <firstName>Bob</firstName>
          <lastName>Smooth</lastName>
          <dateOfBirth>2009-10-25</dateOfBirth>
        </pax>
      </pax-group>
    </result>
  </trains-book>
</request>

Parameter Type Comments
trains-book @sessionstringthe session id of the requested search
trains-book @clientRefstringthe identifier you wish to give to this booking
trains-book @customerCountryCodecountry code2 letter ISO country code of the country the customer have a passport from
customernode customer details, pretty self explanatory 
special-request-fieldsnode the special request fields required in the "rules" response 
result @tokenstring the token of the result you wish to book 
result @tokenInboundstring in case there is an inbound trip as well 
result/connections/outbound @idintthe outbound id of the trip connection
result/connections/inbound @idintthe inbound id of the trip connection 
pax-group/paxnode travelling pax details
pax-group/pax/titletitle see lookups for title codes 
pax-group/pax/dateOfBirthdateformat: YYYY-MM-DD

Booking Response
<?xml version="1.0" encoding="UTF-8"?>
<response success="1" time="2017-07-18 09:30:29" session="dv.2057234148117629">
  <reservation id="dv.32011342111" status="partially confirmed" clientReference="12345">
    <item id="1" status="partially confirmed" token="">
      <source provider="Trains">
        <reference>43212052</reference>
      </source>
      <booking billable="0">
        <price amount="820" currency="EUR"/>
      </booking>
      <train>
        <paxgroup>
          <pax id="0">
            <title>F</title>
            <firstName>Firstname</firstName>
            <lastName>Lastname</lastName>
            <age>32</age>
            <dateOfBirth>1985-01-01</dateOfBirth>
          </pax>
          <pax id="1">
            <title>M</title>
            <firstName>FirstnameOne</firstName>
            <lastName>LastnameParent</lastName>
            <age>32</age>
            <dateOfBirth>1985-01-01</dateOfBirth>
          </pax>
          <pax id="2">
            <title>C</title>
            <firstName>FirstnameTwo</firstName>
            <lastName>LastnameParent</lastName>
            <age>3</age>
            <dateOfBirth>20140101</dateOfBirth>
          </pax>
        </paxgroup>
        <outbound>
          <segments>
            <segment>
              <tripNumber/>
              <carrierCode>TH(TH)</carrierCode>
              <class/>
              <bookingClass/>
              <operatingCarrierCode/>
              <departure terminal="AMSTERDAM CS(AMSTERDAM)" dateTime="2017-07-30 06:17"/>
              <arrival terminal="PARIS NORD(PARIS)" dateTime="2017-07-30 09:44"/>
            </segment>
          </segments>
        </outbound>
        <inbound>
          <segments>
            <segment>
              <tripNumber>9337</tripNumber>
              <carrierCode>TH(TH)</carrierCode>
              <class/>
              <bookingClass/>
              <operatingCarrierCode/>
              <departure terminal="PARIS NORD(PARIS)" dateTime="2017-08-07 11:55"/>
              <arrival terminal="BRUXELLES MIDI(BRUSSELS)" dateTime="2017-08-07 13:17"/>
            </segment>
            <segment>
              <tripNumber>9126</tripNumber>
              <carrierCode>ES(ES)</carrierCode>
              <class/>
              <bookingClass/>
              <operatingCarrierCode/>
              <departure terminal="BRUXELLES MIDI(BRUSSELS)" dateTime="2017-08-07 14:02"/>
              <arrival terminal="AMSTERDAM CS(AMSTERDAM)" dateTime="2017-08-07 15:54"/>
            </segment>
          </segments>
        </inbound>
      </train>
    </item>
  </reservation>
</response>
Parameter Type Comments
reservation @idstringthe reservation id of the booking
reservation @statusstringthe status of the booking
reservation @clientReferencestringyour reference as passed to the booking request
reservation/item @idint the item id being booked
reservation/item @statusstring the status of each item in the booking
item/source @providerstringwho is the provider of the product
item/source/referencestringthe booking reference on the provider system
item/booking @billableboolean is the booking made on a direct provider
booking/price @amountdoublethe price payable for this booking
booking/price @currencycurrency code3 letter currency ISO code
item/trainnode the summary of the booked train trip 
item/train/outboundnode summary of the booked outbound trip
item/train/outbound node summary of the booked inbound trip (if applicable) 

Note: It is mandatory to validate each item status in case some items are not confirmed
Comments