OB Fees Request with Amadeus Fare_PricePnrWithBookingClass

227 Views Asked by At

Have been stuck for quite a while, anyone please help me to send the OB Fees (Airline Fees) and amount with the Fare_PricePnrWithBookingClass request. Here’s the XML request:

<Fare_PricePNRWithBookingClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://xml.amadeus.com/TPCBRQ_16_1_1A">
<pricingOptionGroup xmlns="http://xml.amadeus.com/TPCBRQ_16_1_1A">
<pricingOptionKey><pricingOptionKey>RW</pricingOptionKey>
</pricingOptionKey>
<optionDetail>
<criteriaDetails><attributeType>GOVSR123</attributeType>
</criteriaDetails>
</optionDetail></pricingOptionGroup><pricingOptionGroup xmlns="http://xml.amadeus.com/TPCBRQ_16_1_1A">
<pricingOptionKey>
<pricingOptionKey>FCO</pricingOptionKey>
</pricingOptionKey>
<currency>
<firstCurrencyDetails><currencyQualifier>FCO</currencyQualifier>
<currencyIsoCode>SAR</currencyIsoCode>
</firstCurrencyDetails>
</currency>
</pricingOptionGroup>
</Fare_PricePNRWithBookingClass>

Thanks a lot

2

There are 2 best solutions below

0
On

Use xml linq :

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Xml.Linq;

namespace ConsoleApplication1
{
    class Program
    {
        const string FILENAME = @"c:\temp\test.xml";
        static void Main(string[] args)
        {
            XDocument doc = XDocument.Load(FILENAME);

            List<XElement> pricingOptionGroups = doc.Descendants().Where(x => x.Name.LocalName == "pricingOptionGroup").ToList();
            XNamespace ns = pricingOptionGroups.First().GetDefaultNamespace();

            List<PricingOptionGroup> groups = pricingOptionGroups.Select(x => new PricingOptionGroup()
            {
                key = (string)x.Descendants(ns + "pricingOptionKey").FirstOrDefault(),
                attributeType = (string)x.Descendants(ns + "attributeType").FirstOrDefault(),
                currencyQualifier = (string)x.Descendants(ns + "currencyQualifier").FirstOrDefault(),
                currencyIsoCode = (string)x.Descendants(ns + "currencyIsoCode").FirstOrDefault()
            }).ToList();


        }
    }
    public class PricingOptionGroup
    {
        public string key { get; set; }
        public string attributeType { get; set; }
        public string currencyQualifier { get; set; }
        public string currencyIsoCode { get; set; }
    }

}
6
On

You may try to use <pricingOptionKey>OBF</pricingOptionKey> to include or exclude your OB fees.

To make TST 1 updated with additional OB fee sub-code OT1 of 50 USD you may try something like follows:


            <ns1:pricingOptionGroup>
                <ns1:pricingOptionKey>
                    <ns1:pricingOptionKey>OBF</ns1:pricingOptionKey>
                </ns1:pricingOptionKey>
                <ns1:penDisInformation>
                    <ns1:discountPenaltyQualifier>OBF</ns1:discountPenaltyQualifier>
                    <ns1:discountPenaltyDetails>
                        <ns1:function>INF</ns1:function>
                        <ns1:amountType>707</ns1:amountType>
                        <ns1:amount>50</ns1:amount>
                        <ns1:rate>OT1</ns1:rate>
                        <ns1:currency>USD</ns1:currency>
                    </ns1:discountPenaltyDetails>
                </ns1:penDisInformation>
                <ns1:paxSegTstReference>
                    <ns1:referenceDetails>
                        <ns1:type>P</ns1:type>
                        <ns1:value>1</ns1:value>
                    </ns1:referenceDetails>
                </ns1:paxSegTstReference>
            </ns1:pricingOptionGroup>

where INF stands for inclusion, and 707 means that you use fixed amount, paxSegTstReference is for referencing a TST record.

Hope it helps.