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

qimen.alitrip.bus.product.querynumber (查询班次接口)

汽车票查询班次

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
fromCityCode String 可选 C001 出发城市编码
fromCityName String 可选 北京 出发城市名称
toStationCode String 可选 S001 到达港口编码
toStationName String 可选 古北水镇 到达港口名称
departDate String 可选 2018-08-08 出发日期

响应参数

名称 类型 示例值 描述
retCode String 0 错误码(是必填)
retDesc String 成功 错误描述(必填)
numberList NumberInfo [] 班次列表(必填)
  • └ agentFromStationId
  • String
  • A0001
  • 代理商车站id
  • └ busNumber
  • String
  • AP6A6A70
  • 班次号(是必填)
  • └ fullPrice
  • Number
  • 12000
  • 价格,单位分(是必填)
  • └ busType
  • String
  • 景区巴士
  • 路线类型(1)景区巴士(出发或目的地为景点),2)机场巴士(出发或目的地为机场),3)跨城巴士(城市A到城市B跨城移动),4)市内班线(城市A内的a地到b地之间移动) 【需要按线路维度接入,必须以上的4选1】)
  • └ maxSellNum
  • Number
  • 5
  • 一单最大乘车人数
  • └ halfPrice
  • Number
  • 60000
  • 半价,单位分
  • └ fromCityCode
  • String
  • 110100
  • 上车点城市编号 选(code定位时必填)
  • └ fromCityName
  • String
  • 北京
  • 上车点城市名称(name定位必填)
  • └ fromStationCode
  • String
  • 001
  • 上车点编码(code定位必填)
  • └ fromStationName
  • String
  • 六里桥
  • 上车点名称(name定位必填)
  • └ departTime
  • String
  • 2018-11-30 05:00
  • 发车时间(是必填)
  • └ arriveTime
  • String
  • 2018-11-30 11:30
  • 到达时间
  • └ distance
  • Number
  • 380
  • 里程(是必填)
  • └ totalSeats
  • Number
  • 55
  • 总座位数
  • └ scheduleId
  • String
  • A1K001_AP6A6A70_2366_201811301520
  • 班次id(是必填)
  • └ toCityName
  • String
  • 北京
  • 下车点归属城市(是必填)
  • └ toProvinceName
  • String
  • 北京市
  • 下车点所属省份
  • └ shiftType
  • Number
  • 1
  • 班次类型0:固定班 1:流水班2:加班班次(是必填)
  • └ lastSchedule
  • String
  • 18:00
  • 最晚发车时间 mm:ss 流水班返回(是必填)
  • └ realNameGrade
  • String
  • 2|3
  • 实名校验规则
  • └ isRefund
  • Boolean
  • true
  • 是否会允许退票(可空,为空时以查询车站接口出参中的isRefund字段为准)
  • └ refundTime
  • Number
  • 30
  • 发车前允许退票时间,分钟。发车前允许退票时间,分钟,为空以车站接口同字段为准
  • └ isOrderRefund
  • Boolean
  • true
  • 是否按照整个订单退款为空以车站接口返回为准
  • └ refundType
  • String
  • 1
  • 退票类型1:在线退票 2:不可在线退票 3:不可退票(是必填)
  • └ refundMsg
  • String
  • 本产品可在线退票,退票手续费3元
  • 退票提示文案
  • └ presellTime
  • Number
  • 120
  • 班次发车前可售时间为空以车站接口返回为准
  • └ toStationCode
  • String
  • 111
  • 下车点区域code(code定位时必传)
  • └ toStationName
  • String
  • 古北水镇
  • 下车点名称(name定位时必传)
  • └ serviceInfo
  • String
  • 发票说明,温馨提示
  • 服务须知
  • └ productInfo
  • String
  • 本产品可领取上车礼,可能根据预订人数升级车型
  • 产品信息
  • └ supportEticket
  • Boolean
  • true
  • 是否支持电子票true:表示支持,false:表示不支持
  • └ destLongitude
  • String
  • 100.12456004
  • 目的地经度(是必填)
  • └ destLatitude
  • String
  • 25.12456004
  • 目的地维度(是必填)
  • └ status
  • String
  • 1:可售 0:不可售 不填默认为1
  • 是否暂停售票,不填默认为1
  • obtainTicket
  • ObtainTicket
  • 取票信息(如需乘客?取票是必填)
  • └ address
  • String
  • 四惠汽车站对面
  • 取票详细地址(是必填)
  • └ invoice
  • Boolean
  • true
  • 是否可以作为发票凭证
  • └ voucher
  • String
  • 凭预订短信验证码取票
  • 取票凭证描述(是必填)
  • └ longitude
  • String
  • 25.62456004
  • 取票地址经度(是必填)
  • └ latitude
  • String
  • 100.12456004
  • 取票地址纬度(是必填)
  • └ ticketTel
  • String
  • 4000535411
  • 取票电话
  • parkingPoints
  • ParkingPoints []
  • 游玩点(如中途停车游玩必填)
  • └ name
  • String
  • 卧佛寺
  • 游玩点名称(是必填)
  • └ desc
  • String
  • 植物园停车游玩一小时
  • 游玩点详细说明(是必填)
  • └ parkingMinutes
  • Number
  • 60
  • 游玩时间(是必填)
  • transferPoints
  • TransferPoints []
  • 换乘信息,中途需要换乘的填写
  • └ name
  • String
  • 长城附件公交站
  • 换车点名称(是必填)
  • └ desc
  • String
  • 换什么车
  • 换乘说明(是必填)
  • numberGoods
  • NumberGoods []
  • 商品goods(必填)
  • └ goodsId
  • String
  • 0001
  • 商品id(是必填)
  • └ price
  • Number
  • 125
  • 价格(是必填)
  • └ originPrice
  • Number
  • 200
  • 原始价格(是必填)
  • └ stock
  • String
  • 38
  • 库存(是必填)
  • └ goodsType
  • String
  • 2|4|5
  • 商品类型1:单程票 2:门票套餐 3:当日往返票 4:次日往返票 5:上车礼 6:酒店 7:其他 如是多个类型组合则用'|'分隔 eg:1|2|5 表示单程票+门票套餐+上车礼(是必填),如果此字段有往返票(包含3,4)则返程出发到达站信息必填
  • └ goodsName
  • String
  • 三等B
  • 商品名称(是必填)
  • └ goodsDesc
  • String
  • 8人间
  • 商品描述(是必填)
  • └ fromStationAddress
  • String
  • 某某地址
  • 返程出发车站地址
  • └ fromStationCode
  • String
  • 231422
  • 返程出发车站编码
  • └ fromStationLatitude
  • String
  • 38.123215345
  • 返程出发车站纬度
  • └ fromStationLongitude
  • String
  • 118.98781
  • 返程出发车站经度
  • └ fromStationName
  • String
  • 六里桥
  • 返程出发车站名称
  • └ fromTime
  • String
  • 2018-11-30 05:00
  • 出发时间
  • └ toStationAddress
  • String
  • 七里庄路20号
  • 返程到达车站地址
  • └ toStationCode
  • String
  • 876823
  • 返程到达车站编码
  • └ toStationLatitude
  • String
  • 32.34284
  • 返程到达站纬度
  • └ toStationLongitude
  • String
  • 118.231312
  • 返程到达站经度
  • └ toStationName
  • String
  • 杭州客运中心站
  • 返程到达站名称
  • └ toTime
  • String
  • 2018-11-30 05:00
  • 到达时间
  • └ servicePrice
  • Number
  • 100
  • 服务费 单位(分)
  • └ attribute
  • String
  • {"param":"param"}
  • 扩展属性 json格式
  • └ busBizType
  • String
  • 1
  • 0:普通汽车票(从客运站始发的班线);1:景区巴士(出发或目的地为景点的班线,可市内可跨城);2:船票;3:机场巴士(出发或目的地为机场的班线,可市内可跨城);4:跨城巴士(城市A到城市B跨城移动的班线,如广州XX地铁口-深圳XX人才市场);5: 市内班线(同城市内的a地到b地之间移动,如郑州市XX地铁口-XX医院);6:高铁班线(出发或目的地为火车站/高铁站的班线,可市内可跨城;如机场到高铁,两个都标记);
  • └ refundStructuredInfo
  • String
  • "[{"key":"发车前4-6小时","seq":"1","value":"不收取退票手续费"},{"ext":"如有紧急情况请联系车站","key":"发车前2-4小时","seq":"2","value":"收取5%手续费"},{"key":"发车前1-2小时","seq":"3","value":"收取10%手续费"}]"
  • 退票提示文案结构化展示文案,数据为json列表
success Boolean true 业务是否成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
QimenCloudClient client = new DefaultQimenCloudClient(url, appkey, secret);
AlitripBusProductQuerynumberRequest req = new AlitripBusProductQuerynumberRequest();
req.setFromCityCode("C001");
req.setFromCityName("北京");
req.setToStationCode("S001");
req.setToStationName("古北水镇");
req.setDepartDate("2018-08-08");
AlitripBusProductQuerynumberResponse rsp = client.execute(req);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<retCode>0</retCode>
<retDesc>成功</retDesc>
<numberList>
    <number_info>
        <agentFromStationId>A0001</agentFromStationId>
        <busNumber>AP6A6A70</busNumber>
        <fullPrice>12000</fullPrice>
        <busType>景区巴士</busType>
        <maxSellNum>5</maxSellNum>
        <halfPrice>60000</halfPrice>
        <fromCityCode>110100</fromCityCode>
        <fromCityName>北京</fromCityName>
        <fromStationCode>001</fromStationCode>
        <fromStationName>六里桥</fromStationName>
        <departTime>2018-11-30 05:00</departTime>
        <arriveTime>2018-11-30 11:30</arriveTime>
        <distance>380</distance>
        <totalSeats>55</totalSeats>
        <scheduleId>A1K001_AP6A6A70_2366_201811301520</scheduleId>
        <toCityName>北京</toCityName>
        <toProvinceName>北京市</toProvinceName>
        <shiftType>1</shiftType>
        <lastSchedule>18:00</lastSchedule>
        <realNameGrade>2|3</realNameGrade>
        <isRefund>true</isRefund>
        <refundTime>30</refundTime>
        <isOrderRefund>true</isOrderRefund>
        <refundType>1</refundType>
        <refundMsg>本产品可在线退票,退票手续费3元</refundMsg>
        <presellTime>120</presellTime>
        <toStationCode>111</toStationCode>
        <toStationName>古北水镇</toStationName>
        <serviceInfo>发票说明,温馨提示</serviceInfo>
        <productInfo>本产品可领取上车礼,可能根据预订人数升级车型</productInfo>
        <supportEticket>true</supportEticket>
        <destLongitude>100.12456004</destLongitude>
        <destLatitude>25.12456004</destLatitude>
        <status>1:可售 0:不可售 不填默认为1</status>
        <obtainTicket>
            <address>四惠汽车站对面</address>
            <invoice>true</invoice>
            <voucher>凭预订短信验证码取票</voucher>
            <longitude>25.62456004</longitude>
            <latitude>100.12456004</latitude>
            <ticketTel>4000535411</ticketTel>
        </obtainTicket>
        <parkingPoints>
            <parking_points>
                <name>卧佛寺</name>
                <desc>植物园停车游玩一小时</desc>
                <parkingMinutes>60</parkingMinutes>
            </parking_points>
        </parkingPoints>
        <transferPoints>
            <transfer_points>
                <name>长城附件公交站</name>
                <desc>换什么车</desc>
            </transfer_points>
        </transferPoints>
        <numberGoods>
            <number_goods>
                <goodsId>0001</goodsId>
                <price>125</price>
                <originPrice>200</originPrice>
                <stock>38</stock>
                <goodsType>2|4|5</goodsType>
                <goodsName>三等B</goodsName>
                <goodsDesc>8人间</goodsDesc>
                <fromStationAddress>某某地址</fromStationAddress>
                <fromStationCode>231422</fromStationCode>
                <fromStationLatitude>38.123215345</fromStationLatitude>
                <fromStationLongitude>118.98781</fromStationLongitude>
                <fromStationName>六里桥</fromStationName>
                <fromTime>2018-11-30 05:00</fromTime>
                <toStationAddress>七里庄路20号</toStationAddress>
                <toStationCode>876823</toStationCode>
                <toStationLatitude>32.34284</toStationLatitude>
                <toStationLongitude>118.231312</toStationLongitude>
                <toStationName>杭州客运中心站</toStationName>
                <toTime>2018-11-30 05:00</toTime>
            </number_goods>
        </numberGoods>
        <servicePrice>100</servicePrice>
        <attribute>{&quot;param&quot;:&quot;param&quot;}</attribute>
        <busBizType>1</busBizType>
        <refundStructuredInfo>&quot;[{&quot;key&quot;:&quot;发车前4-6小时&quot;,&quot;seq&quot;:&quot;1&quot;,&quot;value&quot;:&quot;不收取退票手续费&quot;},{&quot;ext&quot;:&quot;如有紧急情况请联系车站&quot;,&quot;key&quot;:&quot;发车前2-4小时&quot;,&quot;seq&quot;:&quot;2&quot;,&quot;value&quot;:&quot;收取5%手续费&quot;},{&quot;key&quot;:&quot;发车前1-2小时&quot;,&quot;seq&quot;:&quot;3&quot;,&quot;value&quot;:&quot;收取10%手续费&quot;}]&quot;</refundStructuredInfo>
    </number_info>
</numberList>
<success>true</success>

异常示例

  • 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

返回
顶部