Travelport / travelport-uapi-tutorial-php

The travelport-uapi-tutorial-php is a PHP project for Universal API that will help you connect and code a standard workflow including Air, Vehicle, and Hotel.
35 stars 47 forks source link

How to get fare details in response ? #149

Open rahulsharma841990 opened 6 years ago

rahulsharma841990 commented 6 years ago

I just want to get all details of fare and commission. My Code is:

`

`
vivekjyotipramanik commented 6 years ago

Hi rahulsharma841990,

AvailabilitySearchReq only provides the availability. After running availability and selecting the segment you have to run AirPriceReq to get the details about Fare. Please find below the link with complete process flow. Thanks.

https://support.travelport.com/webhelp/uapi/uAPI.htm#Air/Air_Shopping_and_Booking.htm%3FTocPath%3DAir%7CAir%2520Shopping%2520and%2520Booking%7C_____0

rahulsharma841990 commented 6 years ago

@vivekjyotipramanik yes i got the fare details and now when i am checking the response xml file its showing 14 FlightDetailsList (FlightDetails) but in FareInfoList (FareInfo) i am getting 56 response, can you please tell me how i can compare which flight is related to which fare?

NirandaG commented 6 years ago

Hi rahulsharma841990, When you do AirPrice and if you send the Booking Class along with the Fare Basis, then you could get single AirPrice Solution. Please see the below example:

<AirPriceReq xmlns="http://www.travelport.com/schema/air_v42_0" TraceId="8d6e22f9-1eb3-4bac-ba4e-361d90725fc5" AuthorizedBy="Travelport" TargetBranch="P3088249">
  <BillingPointOfSaleInfo xmlns="http://www.travelport.com/schema/common_v42_0" OriginApplication="uAPI" />
  <AirItinerary>
    <AirSegment Key="WDWZeQkJ0BKAO9P1vCAAAA==" AvailabilitySource="P" Equipment="73H" AvailabilityDisplayType="Fare Shop/Optimal Shop" Group="0" Carrier="VA" FlightNumber="809" Origin="MEL" Destination="SYD" DepartureTime="2018-09-06T06:45:00.000+10:00" ArrivalTime="2018-09-06T08:10:00.000+10:00" FlightTime="85" Distance="456" ProviderCode="1G" ClassOfService="M" />
    <AirSegment Key="WDWZeQkJ0BKAe9P1vCAAAA==" AvailabilitySource="P" Equipment="73H" AvailabilityDisplayType="Fare Shop/Optimal Shop" Group="1" Carrier="VA" FlightNumber="820" Origin="SYD" Destination="MEL" DepartureTime="2018-09-11T08:30:00.000+10:00" ArrivalTime="2018-09-11T10:05:00.000+10:00" FlightTime="95" Distance="456" ProviderCode="1G" ClassOfService="M" />
  </AirItinerary>
  <AirPricingModifiers InventoryRequestType="DirectAccess">
    <BrandModifiers ModifierType="FareFamilyDisplay" />
  </AirPricingModifiers>
  <SearchPassenger xmlns="http://www.travelport.com/schema/common_v42_0" Code="ADT" BookingTravelerRef="UWNDNUZDZWdENXhMUkFaUg==" Key="UWNDNUZDZWdENXhMUkFaUg==" />
  <AirPricingCommand>
    <AirSegmentPricingModifiers AirSegmentRef="WDWZeQkJ0BKAO9P1vCAAAA==" FareBasisCode="MZGW2A45">
      <PermittedBookingCodes>
        <BookingCode Code="M" />
      </PermittedBookingCodes>
    </AirSegmentPricingModifiers>
    <AirSegmentPricingModifiers AirSegmentRef="WDWZeQkJ0BKAe9P1vCAAAA==" FareBasisCode="MZGW2A45">
      <PermittedBookingCodes>
        <BookingCode Code="M" />
      </PermittedBookingCodes>
    </AirSegmentPricingModifiers>
  </AirPricingCommand>
  <FormOfPayment xmlns="http://www.travelport.com/schema/common_v42_0" Type="Credit" />
</AirPriceReq>

But if you send without the AirPricing modifiers, and that will return multiple fare options depending on the booking classes. Rgds, Niranda

rahulsharma841990 commented 6 years ago

can you please add the changes in my existing xml code:


   <soapenv:Header/>
   <soapenv:Body>
      <air:AvailabilitySearchReq TraceId="trace" AuthorizedBy="user" TargetBranch="$TARGETBRANCH" xmlns:air="http://www.travelport.com/schema/air_v41_0" xmlns:com="http://www.travelport.com/schema/common_v41_0">
         <com:BillingPointOfSaleInfo OriginApplication="UAPI"/>
         <air:SearchAirLeg>
            <air:SearchOrigin>
               <com:Airport Code="ATQ"/>
            </air:SearchOrigin>
            <air:SearchDestination>
               <com:Airport Code="DEL"/>
            </air:SearchDestination>
            <air:SearchDepTime PreferredTime="2018-07-15">
            </air:SearchDepTime>            
         </air:SearchAirLeg>
         <air:AirSearchModifiers>
            <air:PreferredProviders>
               <com:Provider Code="$Provider"/>
            </air:PreferredProviders>
            <air:PermittedCabins>    
                <com:CabinClass Type="Business"/>
            </air:PermittedCabins>
         </air:AirSearchModifiers>
      </air:AvailabilitySearchReq>
   </soapenv:Body>
</soapenv:Envelope>```
NirandaG commented 6 years ago

Hi, This is Availability Request. You need to choose which itinerary segments you need to pass as AirPricing. For that you need to select the itinerary (air segments) from the Availbility Response. Using those segments you need to pass for AirPrice request. Please refer the following help page for getting AirPrice from Availability: https://support.travelport.com/webhelp/uapi/uAPI.htm#SampleWeb/Kelvin/AirWorkflows/Kel_001-1G_AirAvailability_MinimumData.htm Rgds, Niranda

NirandaG commented 6 years ago

Also I would like to recommend to do LowFareSearch and do AirPrice rather than AirAvailability > AirPrice. In place of Air Availability and Air Pricing, Low Fare Shopping combines both availability and fares in a single response. Air Availability/AirPricing is typically used for schedule-driven searches, while Low Fare Shopping is typically used for price-driven searches. Rgds, Niranda

rahulsharma841990 commented 6 years ago

OK fine, can you please give me the sample request link ? where i can get all the details regarding flight and fare and commission in single request !

NirandaG commented 6 years ago

This would have the LowFareSearch sample request and also the AirPrice using the returned data from LowFare response. https://support.travelport.com/webhelp/uapi/uAPI.htm#SampleWeb/Kelvin/AirWorkflows/Kel_012-1P_Air_LFS_MinimumData.htm Rgds, Niranda

NirandaG commented 6 years ago

You might need to amend the following based on the response for the AirPrice:

    <AirSegmentPricingModifiers AirSegmentRef="WDWZeQkJ0BKAO9P1vCAAAA==" FareBasisCode="MZGW2A45">
      <PermittedBookingCodes>
        <BookingCode Code="M" />
      </PermittedBookingCodes>
    </AirSegmentPricingModifiers>
    <AirSegmentPricingModifiers AirSegmentRef="WDWZeQkJ0BKAe9P1vCAAAA==" FareBasisCode="MZGW2A45">
      <PermittedBookingCodes>
        <BookingCode Code="M" />
      </PermittedBookingCodes>
    </AirSegmentPricingModifiers>
  </AirPricingCommand>

This would return a single pricing solution if the Booking Code is being returned from you LowFare response. Rgds, Niranda

rahulsharma841990 commented 6 years ago

Fare details are again 50 :(

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header/>
<soapenv:Body>
<air:LowFareSearchReq xmlns:air="http://www.travelport.com/schema/air_v41_0" xmlns:com="http://www.travelport.com/schema/common_v41_0" AuthorizedBy="user" SolutionResult="true" TargetBranch="$TARGETBRANCH" TraceId="trace">
<com:BillingPointOfSaleInfo OriginApplication="UAPI"/>
<air:SearchAirLeg>
<air:SearchOrigin>
<com:Airport Code="ATQ"/>
</air:SearchOrigin>
<air:SearchDestination>
<com:Airport Code="DEL"/>
</air:SearchDestination>
<air:SearchDepTime PreferredTime="2018-07-15"/>
</air:SearchAirLeg>
<air:AirSearchModifiers>
<air:PreferredProviders>
<com:Provider Code="ACH"/>
</air:PreferredProviders>
</air:AirSearchModifiers>
<com:SearchPassenger BookingTravelerRef="gr8AVWGCR064r57Jt0+8bA==" Code="ADT"/>

</air:LowFareSearchReq>
</soapenv:Body>
</soapenv:Envelope>
NirandaG commented 6 years ago

That is because the LowFare request returns all the fares for the requested origin and desination. From the response you need to pass the AirPrice request as follows: This is a sample.

<AirPriceReq xmlns="http://www.travelport.com/schema/air_v42_0" TraceId="044bd440-ad80-49e4-867f-ce3d55e628f1" AuthorizedBy="Travelport" TargetBranch="P3088249">
  <BillingPointOfSaleInfo xmlns="http://www.travelport.com/schema/common_v42_0" OriginApplication="uAPI" />
  <AirItinerary>
    <AirSegment Key="WDWZeQkJ0BKALK1kyCAAAA==" AvailabilitySource="P" Equipment="73H" AvailabilityDisplayType="Fare Shop/Optimal Shop" Group="0" Carrier="VA" FlightNumber="813" Origin="MEL" Destination="SYD" DepartureTime="2018-10-12T07:15:00.000+11:00" ArrivalTime="2018-10-12T08:40:00.000+11:00" FlightTime="85" Distance="456" ProviderCode="1G" ClassOfService="M" />
    <AirSegment Key="WDWZeQkJ0BKARK1kyCAAAA==" AvailabilitySource="P" Equipment="73H" AvailabilityDisplayType="Fare Shop/Optimal Shop" Group="1" Carrier="VA" FlightNumber="820" Origin="SYD" Destination="MEL" DepartureTime="2018-10-17T08:30:00.000+11:00" ArrivalTime="2018-10-17T10:05:00.000+11:00" FlightTime="95" Distance="456" ProviderCode="1G" ClassOfService="M" />
  </AirItinerary>
  <AirPricingModifiers InventoryRequestType="DirectAccess">
    <BrandModifiers ModifierType="FareFamilyDisplay" />
  </AirPricingModifiers>
  <SearchPassenger xmlns="http://www.travelport.com/schema/common_v42_0" Code="ADT" BookingTravelerRef="eE5SUElSZ1NRaFY0VlVzTQ==" Key="eE5SUElSZ1NRaFY0VlVzTQ==" />
  <AirPricingCommand>
    <AirSegmentPricingModifiers AirSegmentRef="WDWZeQkJ0BKALK1kyCAAAA==" FareBasisCode="MZGW2A45">
      <PermittedBookingCodes>
        <BookingCode Code="M" />
      </PermittedBookingCodes>
    </AirSegmentPricingModifiers>
    <AirSegmentPricingModifiers AirSegmentRef="WDWZeQkJ0BKARK1kyCAAAA==" FareBasisCode="MZGW2A45">
      <PermittedBookingCodes>
        <BookingCode Code="M" />
      </PermittedBookingCodes>
    </AirSegmentPricingModifiers>
  </AirPricingCommand>
  <FormOfPayment xmlns="http://www.travelport.com/schema/common_v42_0" Type="Credit" />
</AirPriceReq>

Rgds, Niranda