文档中心 > 综合交通-商家对接

qimen.alitrip.rail.ir.search (国际火车票搜索接口)

国际火车票搜索接口

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
from_division_id Number 可选 123456789 出发城市id
from_division_name String 可选 法兰克福市 出发城市名称
from_station_code String 可选 FLANK 出发车站编码
from_station_name String 可选 法兰克福站 出发车站名称
to_division_id Number 可选 123456 到达城市id
to_division_name String 可选 加州 到达城市名称
to_station_code String 可选 JZ 到达车站编码
to_station_name String 可选 加州车站 到达车站名称
dep_date String 可选 2019-11-11 出发日期
dep_time String 可选 01:01 发车时间
adult Number 可选 4 成人数量
child Number 可选 2 儿童数量
old Number 可选 3 老人数量
young Number 可选 3 青年数量
async_key String 可选 qwertyuio 异步轮询key

响应参数

名称 类型 示例值 描述
result RailSolutionRS 仓位信息
  • └ success
  • Boolean
  • true
  • 是否成功
  • └ err_code
  • String
  • 001
  • 错误码
  • └ err_msg
  • String
  • 系统错误
  • 错误描述
  • └ async_key
  • String
  • b4779ce2f0aeb2e44be8076a4de12633
  • 异步轮询key
  • └ has_more
  • String
  • true
  • 是否还有未拉取数据
  • railSolutions
  • RailSolutionDTO []
  • 搜索结果
  • sections
  • RailSectionDTO []
  • Offer/Service的列车
  • trains
  • RailTrainDTO []
  • 列车信息
  • └ arrival
  • String
  • 2019-11-22 12:00
  • 到达时间
  • └ departure
  • String
  • 2019-11-22 02:00
  • 发车时间
  • └ to_station_name
  • String
  • 法兰克福站
  • 出发车站名称
  • └ to_station_code
  • String
  • CLK
  • 到达车站编码
  • └ from_station_name
  • String
  • 加州火车票
  • 出发车站名称
  • └ from_station_code
  • String
  • NSD
  • 出发车站编码
  • └ type
  • String
  • 高等坐席
  • 车型
  • └ number
  • String
  • N101
  • 车次编号
  • services
  • RailServiceDTO []
  • 仓位信息
  • └ booking_type
  • String
  • 成人票全价
  • 购票类型
  • └ booking_code
  • String
  • qwe
  • 购票码
  • └ unit_price
  • Number
  • 10000
  • 单价
  • └ price
  • Number
  • 40000
  • 总价(分)
  • └ stock
  • Number
  • 3
  • 余票
  • └ offer_name
  • String
  • 全价票
  • 票种名
  • └ offer_code
  • String
  • quanj
  • 票种code
  • └ service_name
  • String
  • 经济舱
  • 仓位名
  • └ service_code
  • String
  • jingji
  • 仓位code
  • └ carrier_code
  • String
  • CDALX
  • 铁路公司code
  • └ carrier_name
  • String
  • 捷克铁路
  • 铁路公司名称
  • └ fee_price
  • Number
  • 3000
  • 出票费分
  • └ transfer_times
  • Number
  • 2
  • 中转次数
  • └ duration
  • Number
  • 27
  • 时长分钟
  • └ arrival
  • String
  • 2019-11-22 10:00
  • 到达时间
  • └ departure
  • String
  • 2019-11-22 02:00
  • 出发时间
  • └ to_station_name
  • String
  • 法兰克福站
  • 到达站名称
  • └ to_station_code
  • String
  • flank
  • 到达站编码
  • └ from_station_name
  • String
  • 加州火车站
  • 出发站名称
  • └ from_station_code
  • String
  • calafni
  • 出发站code

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
QimenCloudClient client = new DefaultQimenCloudClient(url, appkey, secret);
AlitripRailIrSearchRequest req = new AlitripRailIrSearchRequest();
req.setFromDivisionId(123456789L);
req.setFromDivisionName("法兰克福市");
req.setFromStationCode("FLANK");
req.setFromStationName("法兰克福站");
req.setToDivisionId(123456L);
req.setToDivisionName("加州");
req.setToStationCode("JZ");
req.setToStationName("加州车站");
req.setDepDate("2019-11-11");
req.setDepTime("01:01");
req.setAdult(4L);
req.setChild(2L);
req.setOld(3L);
req.setYoung(3L);
req.setAsyncKey("qwertyuio");
AlitripRailIrSearchResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<result>
    <success>true</success>
    <err_code>001</err_code>
    <err_msg>系统错误</err_msg>
    <async_key>b4779ce2f0aeb2e44be8076a4de12633</async_key>
    <has_more>true</has_more>
    <railSolutions>
        <rail_solution_d_t_o>
            <sections>
                <rail_section_d_t_o>
                    <trains>
                        <rail_train_d_t_o>
                            <arrival>2019-11-22 12:00</arrival>
                            <departure>2019-11-22 02:00</departure>
                            <to_station_name>法兰克福站</to_station_name>
                            <to_station_code>CLK</to_station_code>
                            <from_station_name>加州火车票</from_station_name>
                            <from_station_code>NSD</from_station_code>
                            <type>高等坐席</type>
                            <number>N101</number>
                        </rail_train_d_t_o>
                    </trains>
                    <services>
                        <rail_service_d_t_o>
                            <booking_type>成人票全价</booking_type>
                            <booking_code>qwe</booking_code>
                            <unit_price>10000</unit_price>
                            <price>40000</price>
                            <stock>3</stock>
                            <offer_name>全价票</offer_name>
                            <offer_code>quanj</offer_code>
                            <service_name>经济舱</service_name>
                            <service_code>jingji</service_code>
                        </rail_service_d_t_o>
                    </services>
                    <carrier_code>CDALX</carrier_code>
                    <carrier_name>捷克铁路</carrier_name>
                </rail_section_d_t_o>
            </sections>
            <fee_price>3000</fee_price>
            <transfer_times>2</transfer_times>
            <duration>27</duration>
            <arrival>2019-11-22 10:00</arrival>
            <departure>2019-11-22 02:00</departure>
            <to_station_name>法兰克福站</to_station_name>
            <to_station_code>flank</to_station_code>
            <from_station_name>加州火车站</from_station_name>
            <from_station_code>calafni</from_station_code>
        </rail_solution_d_t_o>
    </railSolutions>
</result>

异常示例

  • XML示例
  • JSON示例
<error_response>
    <code>50</code>
    <msg>Remote service error</msg>
    <sub_code>isv.invalid-parameter</sub_code>
    <sub_msg>非法参数</sub_msg>
</error_response>

错误码解释

错误码 错误描述 解决方案

API工具

如何获得此API

FAQ

返回
顶部