文档中心 > API类目 > 汽车票API

taobao.bus.numbers.update (汽车票车次更新服务)

用于汽车票车次信息的新增、更新和逻辑删除

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param_top_bus_number_update_r_q TopBusNumberUpdateRq 必须 请求参数
  • numbers
  • BusNumberDto []
  • 必须
  • 车次列表
  • └ agent_from_city_id
  • String
  • 必须
  • 12345
  • 始发城市ID
  • └ agent_from_station_id
  • String
  • 必须
  • 45678
  • 始发车站ID
  • └ arrive_time
  • String
  • 可选
  • 2018-02-10 10:00
  • 到达时间(格式:yyyy-MM-dd HH:mm)
  • └ attribute
  • String
  • 可选
  • {"busshortname":"枋湖客运中心","departstationcode":"350200FHZX","hashid":"-1001410211266152181","iscansell":"1","seattype":"普通","stationid":"8030112600505084541","stationname":"顺昌","stationorgid":"901120000001738","vehicletype":"0"}
  • 其他非格式化属性合并成一个json格式字符串,对接时明确约定
  • └ biz_type
  • Number
  • 必须
  • 0
  • 业务类型(0:普通汽车票;1:机场巴士;2:景区巴士,默认为0)
  • └ book_limit_time
  • Number
  • 可选
  • 15
  • 发车前多少分钟停止售票(单位:分钟)
  • └ bus_number
  • String
  • 必须
  • A123
  • 客车车次
  • └ bus_type
  • String
  • 可选
  • 大型
  • 客车车型
  • └ depart_time
  • String
  • 必须
  • 2018-02-10 09:00
  • 出发时间(格式:yyyy-MM-dd HH:mm)
  • └ destination_name
  • String
  • 必须
  • 大柳树
  • 目的地名称
  • └ distance
  • Number
  • 可选
  • 90
  • 里程(单位:km)
  • └ extra_schedule
  • Number
  • 必须
  • 0
  • 是否加班车(1是,0否)
  • └ from_city_name
  • String
  • 必须
  • 北京
  • 始发城市名
  • └ from_station_name
  • String
  • 必须
  • 八王坟客运站
  • 始发车站名
  • └ full_price
  • Number
  • 必须
  • 100
  • 全票价,单位分
  • └ half_price
  • Number
  • 可选
  • 50
  • 半票价,单位分
  • └ is_refund
  • Number
  • 必须
  • 1
  • 是否可退票(1是,0否)
  • └ last_schedule
  • String
  • 可选
  • 19:00
  • 最晚发车时间(格式:HH:mm)
  • └ remain_seats
  • Number
  • 必须
  • 20
  • 余票数
  • └ run_time
  • Number
  • 可选
  • 60
  • 运行时长(单位:分钟)
  • └ schedule_id
  • String
  • 必须
  • 123456789
  • 车次ID,需保持唯一
  • └ service_price
  • Number
  • 可选
  • 100
  • 服务费,单位分
  • └ shift_type
  • Number
  • 必须
  • 0
  • 班次类型(0固定班,1流水班)
  • └ status
  • Number
  • 必须
  • 1
  • 车次状态(1可售;0停售)
  • └ ticket_wicket
  • String
  • 可选
  • W3
  • 检票口
  • └ to_city_name
  • String
  • 可选
  • 济南
  • 目的地城市
  • └ to_province_name
  • String
  • 可选
  • 山东省
  • 目的地省份
  • └ to_station_name
  • String
  • 可选
  • 大柳树车站
  • 目的地所属车站
  • └ total_seats
  • Number
  • 可选
  • 42
  • 总座位数
  • └ via_station
  • String
  • 可选
  • 北京,天津
  • 途经站

响应参数

名称 类型 示例值 描述
result_code String SYSTEM_ERROR 错误码
result_msg String 系统错误 错误描述
succ_count Number 100 成功数量
is_success Boolean true 是否成功

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
BusNumbersUpdateRequest req = new BusNumbersUpdateRequest();
BusNumbersUpdateRequest.TopBusNumberUpdateRq obj1 = new BusNumbersUpdateRequest.TopBusNumberUpdateRq();
List<BusNumbersUpdateRequest.BusNumberDto> list3 = new ArrayList<BusNumbersUpdateRequest.BusNumberDto>();
BusNumbersUpdateRequest.BusNumberDto obj4 = new BusNumbersUpdateRequest.BusNumberDto();
list3.add(obj4);
obj4.setAgentFromCityId("12345");
obj4.setAgentFromStationId("45678");
obj4.setArriveTime("2018-02-10 10:00");
obj4.setAttribute("{\"busshortname\":\"枋湖客运中心\",\"departstationcode\":\"350200FHZX\",\"hashid\":\"-1001410211266152181\",\"iscansell\":\"1\",\"seattype\":\"普通\",\"stationid\":\"8030112600505084541\",\"stationname\":\"顺昌\",\"stationorgid\":\"901120000001738\",\"vehicletype\":\"0\"}");
obj4.setBizType(0L);
obj4.setBookLimitTime(15L);
obj4.setBusNumber("A123");
obj4.setBusType("大型");
obj4.setDepartTime("2018-02-10 09:00");
obj4.setDestinationName("大柳树");
obj4.setDistance(90L);
obj4.setExtraSchedule(0L);
obj4.setFromCityName("北京");
obj4.setFromStationName("八王坟客运站");
obj4.setFullPrice(100L);
obj4.setHalfPrice(50L);
obj4.setIsRefund(1L);
obj4.setLastSchedule("19:00");
obj4.setRemainSeats(20L);
obj4.setRunTime(60L);
obj4.setScheduleId("123456789");
obj4.setServicePrice(100L);
obj4.setShiftType(0L);
obj4.setStatus(1L);
obj4.setTicketWicket("W3");
obj4.setToCityName("济南");
obj4.setToProvinceName("山东省");
obj4.setToStationName("大柳树车站");
obj4.setTotalSeats(42L);
obj4.setViaStation("北京,天津");
obj1.setNumbers(list3);
req.setParamTopBusNumberUpdateRQ(obj1);
BusNumbersUpdateResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<bus_numbers_update_response>
    <result_code>SYSTEM_ERROR</result_code>
    <result_msg>系统错误</result_msg>
    <succ_count>100</succ_count>
    <is_success>true</is_success>
</bus_numbers_update_response>

异常示例

  • 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

返回
顶部