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

taobao.train.agent.order.lock (锁单)

锁单

公共参数

请求参数

名称 类型 是否必须 示例值 更多限制 描述
param LockOrderRQ 必须 入参
  • tickets
  • TicketDTO []
  • 必须
  • 票信息
  • └ from_station_name
  • String
  • 必须
  • 武威
  • 出发站名称
  • └ inter_change_station_telecode
  • String
  • 可选
  • BJG
  • 中转站编码
  • └ inter_change_station_name
  • String
  • 可选
  • 北京
  • 中转站名称
  • └ train_code
  • String
  • 必须
  • Z42
  • 车次编码
  • └ ttp_order_id
  • Number
  • 必须
  • 1234
  • 主单号
  • └ seat_type_code
  • String
  • 必须
  • 1
  • 坐席编码
  • └ seat_type_name
  • String
  • 必须
  • 硬座
  • 座席名称
  • └ real_ticket_price
  • Number
  • 必须
  • 13100
  • 真实票价
  • └ to_station_name
  • String
  • 必须
  • 乌鲁木齐
  • 到达站名称
  • └ from_station_telecode
  • String
  • 必须
  • WUJ
  • 出发站编码
  • └ vip_custom_type
  • Number
  • 可选
  • 1
  • 定制票类型(0:不指定坐席 1:下铺 2:下铺or中铺 3:过道 4:靠窗)
  • └ sub_order_id
  • Number
  • 必须
  • 12345
  • 子单号
  • └ train_date
  • String
  • 必须
  • 2021-12-25
  • 车次日期
  • └ segment_id
  • Number
  • 可选
  • 1434
  • 程ID
  • └ from_time
  • String
  • 必须
  • 4:04
  • 出发时间
  • └ segment_index
  • Number
  • 可选
  • 1
  • 程 序号
  • └ seat_no
  • String
  • 必须
  • 11号
  • 座席号
  • └ to_station_telecode
  • String
  • 必须
  • WAR
  • 到达站编码
  • └ to_time
  • String
  • 必须
  • 9:01
  • 到达时间
  • └ sequence_no
  • String
  • 可选
  • E4253453
  • 12306订单号
  • └ batch_no
  • String
  • 可选
  • 1
  • 批次号
  • └ coach_no
  • String
  • 必须
  • 09
  • 车厢号
  • └ ticket_type_code
  • String
  • 必须
  • 1
  • 票类型(1 成人票 2 儿童 3 学生 4 残、军)
  • └ ttp_order_id
  • Number
  • 必须
  • 1234
  • 主单号

响应参数

名称 类型 示例值 描述
result TapResult rs
  • └ success
  • Boolean
  • false
  • success
  • module
  • LockOrderRS
  • 锁单rs
  • └ lock_last_time
  • String
  • 2021-12-11 12:00:00
  • 锁单最晚有效时间
  • ticket_infos
  • TicketInfoDTO []
  • 票信息
  • └ passenger_name
  • String
  • 言煜
  • 乘车人姓名
  • └ passenger_type_code
  • String
  • 1
  • 乘车人类型编码(1 成人 2 儿童 3 学生 4 残、军)
  • └ certificate_type_code
  • String
  • 1
  • 证件类型(1 身份证 C 港澳通行证 G 台胞证 B 护照)
  • └ certificate_no
  • String
  • 555555444422224444
  • 证件号
  • └ ttp_sub_order_id
  • Number
  • 3242432423
  • ttp子单号
  • └ contact_mobile_no
  • String
  • 15643431920
  • 乘车人余留联系方式
  • └ error_code
  • Number
  • -1
  • 返回code
  • └ error_msg
  • String
  • 系统错误
  • 返回msg

请求示例

  • JAVA
  • .NET
  • PHP
  • CURL
  • Python
  • C/C++
  • NodeJS
TaobaoClient client = new DefaultTaobaoClient(url, appkey, secret);
TrainAgentOrderLockRequest req = new TrainAgentOrderLockRequest();
TrainAgentOrderLockRequest.LockOrderRQ obj1 = new TrainAgentOrderLockRequest.LockOrderRQ();
List<TrainAgentOrderLockRequest.TicketDTO> list3 = new ArrayList<TrainAgentOrderLockRequest.TicketDTO>();
TrainAgentOrderLockRequest.TicketDTO obj4 = new TrainAgentOrderLockRequest.TicketDTO();
list3.add(obj4);
obj4.setFromStationName("武威");
obj4.setInterChangeStationTelecode("BJG");
obj4.setInterChangeStationName("北京");
obj4.setTrainCode("Z42");
obj4.setTtpOrderId(1234L);
obj4.setSeatTypeCode("1");
obj4.setSeatTypeName("硬座");
obj4.setRealTicketPrice(13100L);
obj4.setToStationName("乌鲁木齐");
obj4.setFromStationTelecode("WUJ");
obj4.setVipCustomType(1L);
obj4.setSubOrderId(12345L);
obj4.setTrainDate("2021-12-25");
obj4.setSegmentId(1434L);
obj4.setFromTime("4:04");
obj4.setSegmentIndex(1L);
obj4.setSeatNo("11号");
obj4.setToStationTelecode("WAR");
obj4.setToTime("9:01");
obj4.setSequenceNo("E4253453");
obj4.setBatchNo("1");
obj4.setCoachNo("09");
obj4.setTicketTypeCode("1");
obj1.setTickets(list3);
obj1.setTtpOrderId(1234L);
req.setParam(obj1);
TrainAgentOrderLockResponse rsp = client.execute(req, sessionKey);
System.out.println(rsp.getBody());

响应示例

  • XML示例
  • JSON示例
<train_agent_order_lock_response>
    <result>
        <success>false</success>
        <module>
            <lock_last_time>2021-12-11 12:00:00</lock_last_time>
            <ticket_infos>
                <ticket_info_d_t_o>
                    <passenger_name>言煜</passenger_name>
                    <passenger_type_code>1</passenger_type_code>
                    <certificate_type_code>1</certificate_type_code>
                    <certificate_no>555555444422224444</certificate_no>
                    <ttp_sub_order_id>3242432423</ttp_sub_order_id>
                </ticket_info_d_t_o>
            </ticket_infos>
            <contact_mobile_no>15643431920</contact_mobile_no>
        </module>
        <error_code>-1</error_code>
        <error_msg>系统错误</error_msg>
    </result>
</train_agent_order_lock_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

返回
顶部