• 257
  • 64
  • 53

火车票抢票

聚合数据 企业专用

根据乘客的车次与座席要求快速订票出票,业务特殊需要请联系在线客服

  • 按实际订单计费

¥ *** 价格详情请联系客服

  • API文档
  • 错误码参照
  • 示例代码
  • 联系我们
立即调用
接口地址:http://v.juhe.cn/grabTicket/action/addCallbackUrl.php
返回格式:json
请求方式:get post
请求示例:http://v.juhe.cn/grabTicket/action/addCallbackUrl.php?url=xxxx&type=1&key=您申请的key
接口备注:配置回调地址,如果出票失败,可以通过订单详情查看失败原因

请求参数说明:

名称 必填 类型 说明
  key string 在个人中心->我的数据,接口名称上方查看
  url string 回调地址
  type string 回调类型(1:占座和出票结果合并推送(包含成功和失败); 2:退票退款推送 ;3:抢票过期推送 )

返回参数说明:

名称 类型 说明
  见json示例

JSON返回示例:

配置成功json示例:
----------------------------------------
{
    "error_code": 0,
    "reason": "success",
    "data": null
}



出票成功推送示例:
----------------------------------------
{
    "orderNo": "TFT583U7D552101629055112720",
    "outOrderNo": "2016113006",
    "msgCode": "100",//详见下方字段说明
    "msgInfo": "出票成功",
    "fromStationCode": "226",
    "toStationCode": "226",
    "departureTime": "2016-12-29 02:29:00",//发车时间
    "arrivalTime": "2016-12-29 02:53:00",//到达时间
    "trainNo": "Z175",
    "ticketNo": "E566781381",//票号
    "orderAmount": "9.00",//订单价格
    "fromStation": "苏州",
    "toStation": "昆山",
    "issueTime": "2016-11-30 15:21:53",//出票时间
    "mailCharge": "0.00",//邮寄费用,可忽略
    "msgDetail": null,//msgDetail有值时表示该失败原因针对这些乘客,格式:姓名|证件号,姓名|证件号 
    "passengers": [
        {
            "passengerName": "奥巴马",
            "passengerType": "1",
            "cardType": "1",
            "cardNo": "xxxxxxxxxxxxxxx",
            "passengerId": "615151438",
            "seatClass": "1",
            "seatNo": "02车厢,007号",
            "price": "9.00",
            "pTicketNo": "E5667813811020007",
            "serviceCharge": "0",
            "insuranceCharge": "0.00"
        }
    ],
    "isChangedOrder": "0",
    "originalOrderNo": "",
    "changedType": "",
    "serviceCharge": "",
    "changePriceDiff": "",
    "juheServiceFee": "8"
}

出票失败推送示例:
----------------------------------------
{
    "orderNo": "TFT583U752U210D284004800356",
    "outOrderNo": "2016113001",
    "msgCode": "101",//详见下方
    "msgInfo": "出票失败",
    "fromStationCode": null,
    "toStationCode": null,
    "departureTime": null,
    "arrivalTime": null,
    "trainNo": null,
    "ticketNo": null,
    "orderAmount": null,
    "fromStation": null,
    "toStation": null,
    "issueTime": "",
    "mailCharge": null,
    "msgDetail": null,
    "passengers": [
        {
            "passengerName": "张三",
            "passengerType": "1",
            "cardType": "1",
            "cardNo": "XXXXXXXXXX",
            "passengerId": "123",//退票时候需要此字段
            "seatClass": "1",
            "seatNo": "",
            "price": "100.00",
            "pTicketNo": "",
            "serviceCharge": "0",
            "insuranceCharge": "0.00"
        }
    ],
    "isChangedOrder": "0",
    "originalOrderNo": "",
    "changedType": "",
    "serviceCharge": "",
    "changePriceDiff": "",
    "juheServiceFee": "0"
}

订单过期推送示例:
----------------------------------------
{
    "msgCode": "101",
    "msgInfo": "抢票单过期",
    "orderNo": "TFT583U7C4921011A3062532520",
    "outOrderNo": "2016113005"
}

退款成功推送示例:
----------------------------------------
{
    "orderNo": "TFT583U7D552101629055112720",
    "outOrderNo": "2016113006",
    "refundTime": "2016-11-30 15:32:00",
    "refundPrice": "9.00",
    "refundType": "online",
    "passengers": [
        {
            "passengerId": "615151438",
            "pTicketNo": "E5667813811020007",
            "passengerName": "奥巴马",
            "passengerType": "1",
            "cardType": "1",
            "cardNo": "",
            "refundPrice": "9.00"
        }
    ],
    "msgCode": "100",
    "msgInfo": "线上退票成功"
}

退款失败推送示例:
----------------------------------------
{
    "msgCode": "101",
    "msgInfo": "参数无效",
    "orderNo": "FT123456789",
    "outOrderNo": "XXXXXX",
    "refundTime": "2016-06-22 09:56:16",
    "refundPrice": "0.00",
    "refundType": "online",
    "passengers": [
        {
            "passengerId": "123",
            "passengerName": "张三",
            "passengerType": "1",
            "cardType": "1",
            "cardNo": "",
            "refundPrice": "0.00",
            "pTicketNo": "E1234567890001"
        }
    ]
}

服务级错误码参照(error_code):

  错误码 说明
  225700 网络繁忙,请稍后重试
  225701 供应商错误信息提示,具体看接口返回
  225702 订单号不存在
  225703 订单号已经存在
  225704 各种参数错误,具体看接口返回

系统级错误码参照:

  错误码 说明 旧版本(resultcode)
  10001 错误的请求KEY 101
  10002 该KEY无请求权限 102
  10003 KEY过期 103
  10004 错误的OPENID 104
  10005 应用未审核超时,请提交认证 105
  10007 未知的请求源 107
  10008 被禁止的IP 108
  10009 被禁止的KEY 109
  10011 当前IP请求超过限制 111
  10012 请求超过次数限制 112
  10013 测试KEY超过请求限制 113
  10014 系统内部异常(调用充值类业务时,请务必联系客服或通过订单查询接口检测订单,避免造成损失) 114
  10020 接口维护 120
  10021 接口停用 121

错误码格式说明(示例:200201):

  2 002 01
  服务级错误(1为系统级错误) 服务模块代码(即数据ID) 具体错误代码

完整教学代码示例:

  语言 标题 提供者 时间

常见问题:

  内容 详细
  常见问题: http://www.juhe.cn/qa/index/1534555375

联系我们

  内容 详细
  接口测试: API测试工具
  技术支持: info@juhe.cn
  联系电话: 400-8827-715
  在线客服QQ: 800076065

猜你喜欢

现在注册,百款接口免费测试

免费注册