2. Rules

Before making the booking, you will need to make sure that the user is aware of all details regarding this booking and the booked property. This is why you MUST perform the trains-rules request and display the information received to your customer PRIOR to making the booking. The information received from this request is the same information that must be displayed on the voucher.

Train Rules Request
<request version="4.0">
   <auth>
      <username>example</username>
      <password>example</password>
      <agent>example</agent>
   </auth>
   <trains-rules session="dv.1234">
         <result token="dv.1210273893">
            <connections>
                <outbound id="0"/>
                <inbound id="1"/>
            </connections>
         </result>
   </trains-rules>
</request>
Parameter Type Comments
trains-rules @session stringthe session id as returned by the search  response
trains-rules/result @token stringthe result token you wish to book

connections/outbound @id intthe id of the outbound connection from the search results
connections/inbound @id intthe id of the inbound connection from the search results (in case this is a round trip)

Train Rules Response
<response success="1" time="2017-07-18 08:59:23" session="dv.1234">
  <bookingoptions count="0"/>
  <rules token="dv.20572315774" count="8">
    <rule>
RULES FOR: AMSTERDAM CS(AMSTERDAM) &gt; PARIS NORD(PARIS)
</rule>
    <rule>SALE RULES: Child between 4 and 11 inclusive</rule>
    <rule>
AFTER SALE RULES: *Paper Tickets* 100% refundable up to 3 days before train departure date, then 50% refundable up to 60 days after train departure date. Thereafter, no refund allowed. Can be exchanged prior to departure or in Thalys station up to 1 hour after train departure. *Print at Home/Print at Station Tickets* 100% refundable up to train departure date, or in Thalys station up to 1 hour after train departure, then 50% refundable up to 60 days after train departure date. Can be exchanged prior to departure or in Thalys station up to 1 hour after train departure. Cancellation can take place via the original points of sales or on www.refundmyeticket.com within the time frame allowed. Refunds/Exchanges may be subject to an administrative fee from Rail Europe.
</rule>
    <rule>
WEB SALES CONDITIONS: Accommodation: Travel in "Comfort 1" Class on Thalys and enjoy a handful of services included in the price of your ticket:// Purchase Conditions: Child must be aged between 4 and 11 inclusive on date of travel. Children under 4 travel for free if separate seat is not required
</rule>
    <rule>
RULES FOR: AMSTERDAM CS(AMSTERDAM) &gt; PARIS NORD(PARIS)
</rule>
    <rule>SALE RULES: Subject to availability</rule>
    <rule>
AFTER SALE RULES: If ticket not used, subject to a fixed fee of EUR15 and 50% refundable up to 3 days before train departure date. Thereafter, no refund allowed. Subject to administrative charges in country of purchase. Refunds/Exchanges may be subject to an administrative fee from Rail Europe.
</rule>
    <rule>
WEB SALES CONDITIONS: Accommodation: Travel in "Comfort 1" Class on Thalys and enjoy a handful of services included in the price of your ticket:// Purchase Conditions: Reduced fare (advance purchase). No purchase condition apply
</rule>
  </rules>
  <special-request-fields>
    <field code="RESIDENT_COUNTRY" isPerPax="0">
      <title>RESIDENT COUNTRY</title>
      <description>Passenger's Country Of Residence</description>
    </field>
  </special-request-fields>
</response>
Parameter Type Comments
rules/rule nodelong text blob
special-request-fieldsnode 
special-request-fields/field @codestring the field name to be used in the booking request
special-request-fields/field @isPerPax boolean should this field be sent per pax or once for everyone 
special-request-fields/field/titlestring the caption of the field that should be displayed to the user 
special-request-fields/field/descriptionstring explanation of what this field is 
Note: 
  1. It is mandatory to display the ENTIRE text node to you users prior to making the booking. it is also mandatory to include the entire text node on the booking confirmation document displayed and sent to the user.
  2. the special request fields MUST be shown to the user and MUST be sent back to the server in the booking phase
Comments