首页 > 解决方案 > 如何使用 OTA_AirPriceRQ API 获取航班票价税

问题描述

我正在使用 OTA_AirAvailRQ API 来获取可用航班的列表。我想获取航班的票价和税收信息,但 OTA_AirPriceRQ API 给了我一个错误。

这是我的要求:

 <OTA_AirPriceRQ Version="2.17.0" xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
        <OriginDestinationInformation>
           <FlightSegment ArrivalDateTime="2019-02-21T17:00" ConnectionInd="O" DepartureDateTime="2019-02-21T15:00" FlightNumber="802" ResBookDesigCode="Y" RPH="1">
                <DestinationLocation LocationCode="KUL"/>
                <MarketingCarrier Code="OD" FlightNumber="802"/>
                <OriginLocation LocationCode="SIN"/>
            </FlightSegment>
        </OriginDestinationInformation>
        <PriceRequestInformation Retain="true">
            <OptionalQualifiers>
                <PricingQualifiers CurrencyCode="USD">
                    <PassengerType Code="ADT" Force="true" Quantity="1"/>
                </PricingQualifiers>
            </OptionalQualifiers>
        </PriceRequestInformation>
    </OTA_AirPriceRQ>

这是 API 的响应:

 <OTA_AirPriceRS xmlns="http://webservices.sabre.com/sabreXML/2011/10" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:stl="http://services.sabre.com/STL/v01" Version="2.17.0">
        <stl:ApplicationResults status="NotProcessed">
            <stl:Error type="BusinessLogic" timeStamp="2019-01-29T02:59:18-06:00">
                <stl:SystemSpecificResults>
                    <stl:Message>FORMAT, CHECK SEGMENT NUMBER-0003</stl:Message>
                    <stl:ShortText>ERR.SWS.HOST.ERROR_IN_RESPONSE</stl:ShortText>
                </stl:SystemSpecificResults>
            </stl:Error>
        </stl:ApplicationResults>
    </OTA_AirPriceRS>

标签: sabre

解决方案


您可能希望删除请求中的 OriginDestination 节点。根据未使用的服务设计:

<!-- Optional -->
<!-- Repeat Factor=0 -->
<!--Please note that this node is reserved for future expansion and is not currently in use.-->

我建议在主请求节点中使用 ReturnHostCommand="true" 属性以返回 WP 格式,并能够查看您发送到本机 Sabre 的格式。


推荐阅读