Tourmind Flight Distribution API (1.0)
下载 Swagger 规范: 下载
这是 Tourmind Flight Distribution API(途灵机票分销接口)的开发文档。
概述
- 这是Tourmind Flight Distribution API的规范。
- 从代理到Tourmind Flight Distribution API的所有通信均通过HTTP发布。
- 请求有效载荷的格式基于JSON。
- 所有请求都包含公共请求标头,其中包括身份验证信息。
更新日志
| 版本 | 日期 | 说明 |
|---|---|---|
| v1.0.1 | 2025.01.07 | 接口文档v1 |
| v1.0.2 | 2025.02.21 | 新增签名用例 |
| v1.0.3 | 2025.04.09 | 新增JavaScript签名用例,调整签名算法 |
| v1.0.4 | 2025.04.16 | 新增凭证类型;修正价格字段为decimal字符串类型 |
| v1.0.5 | 2025.07.15 | 调整签名算法;修正下单、支付接口返回数据结构 |
| v1.0.6 | 2025.08.14 | 新增售前辅营接口;新增航变推送接口 |
| v1.0.7 | 2025.09.25 | 新增错误码文档 |
| v1.0.8 | 2026.06.08 | 新增婴儿类型参数、说明 |
错误码
搜价错误码 (101xx)
| code | message | 错误描述 |
|---|---|---|
| 10101 | look2book error | 差定比超出 |
| 10102 | currency not same | 币种不一致 |
| 10103 | parse supplier resp | 解析供应商返回失败 |
| 10104 | search time invalid | 搜索时间无效 |
| 10105 | iata code invalid | IATA 代码无效 |
| 10106 | there should be at least one adult | 至少需要一名成人 |
| 10107 | the number of infant passengers can not exceed the number of adult passengers | 婴儿人数不能超过成人人数 |
| 10108 | the maximum number of passengers with seat is 9 | 有座乘客最多9 |
| 10109 | can not find the related data | 未找到相关数据 |
| 10110 | shopping failed from upstream | 上游搜价失败 |
验价错误码 (201xx)
| code | message | 错误描述 |
|---|---|---|
| 20101 | verify error | 验价失败 |
| 20102 | verify price change | 变价 |
| 20103 | verify no seat | 无座 |
| 20104 | verify no solution | 无对应报价 |
| 20105 | verify permission denied | 验价权限不足 |
| 20106 | flight near take-off | 航班临近起飞 |
| 20107 | can not find any price for this flight | 未找到该航班价格 |
| 20108 | can not find any supplier for current search | 当前搜索未找到供应商 |
下单错误码 (301xx)
| code | message | 错误描述 |
|---|---|---|
| 30101 | booking error | 下单失败 |
| 30102 | booking price change | 变价 |
| 30103 | booking params error | 参数错误 |
| 30104 | booking no seat | 无座 |
| 30105 | booking passenger info error | 乘客信息异常 |
| 30106 | too late booking | 验价后下单超时 |
| 30107 | session id expired | session id 过期 |
| 30108 | solution not found | 未找到报价方案 |
| 30109 | ancillary not found | 未找到辅营 |
| 30110 | permission denied | 下单权限不足 |
| 30111 | need card info | 需要证件信息 |
| 30113 | duplicate reservation | 重复预订 |
| 30114 | flight re-schedule | 航班可能改期 |
| 30115 | airline pnr missing | 缺少航司 PNR |
| 30116 | create failed from gds | GDS 创建订单失败 |
| 30117 | retrieve pnr failed | GDS 提取 PNR 失败 |
| 30118 | save price failed from gds | GDS 保存价格失败 |
| 30119 | airline or flight restriction | 航司或航班限制 |
| 30120 | last ticketing time not enough | 最晚出票时间不足 |
| 30121 | segment status invalid | 航段状态无效 |
| 30122 | saved booking failed | 保存订单失败 |
| 30123 | infant type error | 婴儿乘客类型错误 |
| 30124 | associatedIndex required for infant | 婴儿缺少关联乘客索引 |
| 30125 | passenger name too long | 乘客姓名过长 |
| 30126 | adult age error | 成人年龄错误 |
| 30127 | verify data expired | 验价数据过期 |
| 30128 | flight invalid, please select other flight options | 航班无效,请选择其他航班 |
| 30129 | fare unavailable, please select other flight options | 运价不可用,请选择其他航班 |
| 30130 | children age error | 儿童年龄错误 |
| 30131 | passenger name illegal | 乘客姓名非法 |
| 30132 | passenger doc required | 缺少乘客证件信息 |
| 30133 | passenger age limitation | 乘客年龄限制 |
| 30134 | lack of passenger index | 缺少乘客索引 |
| 30135 | duplicate baggages | 重复行李 |
| 30136 | multiple seat selection | 重复选座 |
支付前校验错误码 (401xx)
| code | message | 错误描述 |
|---|---|---|
| 40101 | pay valid error | 支付前校验失败 |
| 40102 | pay valid timeout | 超过支付时效 |
| 40103 | pay valid order status error | 订单状态错误 |
| 40104 | no airline pnr exist | 航司 PNR 不存在 |
| 40105 | pnr status invalid | PNR 状态无效 |
| 40106 | price changed | 价格变化 |
| 40107 | latest ticketing time expired | 最晚出票时间已过期 |
| 40108 | flight changed | 航班变化 |
| 40109 | order not found | 订单不存在 |
| 40110 | supplier status is invalid | 供应商状态无效 |
| 40111 | flight status invalid | 航班状态无效 |
| 40112 | fare is not guaranteed | 运价未保障 |
| 40113 | no price | 无价格 |
| 40114 | order pricing failed, please try again | 订单计价失败,请重试 |
| 40115 | no seat | 无座 |
支付错误码 (501xx)
| code | message | 错误描述 |
|---|---|---|
| 50101 | pay error | 支付失败 |
| 50102 | pay order cancel | 订单已取消 |
| 50103 | pay duplicate | 重复支付 |
| 50104 | pay balance not enough | 余额不足 |
| 50105 | pay deadline expired | 支付期限已过期 |
| 50106 | pay deadline expired | 订单号不存在 |
| 50107 | pay order status invalid | 支付订单状态无效 |
辅营错误码 (601xx)
| code | message | 错误描述 |
|---|---|---|
| 60101 | ancillary not support | 不支持辅营 |
| 60102 | ancillary search failed | 辅营查询失败 |
| 60103 | ssr count seg count not same | 辅营结果与航段数量不一致 |
搜索错误码 (701xx)
| code | message | 错误描述 |
|---|---|---|
| 70101 | query error | 搜索失败 |
改签错误码 (801xx)
| code | message | 错误描述 |
|---|---|---|
| 80101 | change not support | 不支持改签 |
| 80102 | change exists change | 存在进行中的改签 |
| 80103 | miss required data | 缺少必填参数 |
| 80104 | amount error | 金额错误 |
退票错误码 (901xx)
| code | message | 错误描述 |
|---|---|---|
| 90101 | refund not support | 不支持退票 |
| 90102 | refund exists refund | 存在进行中的退票 |
| 90103 | miss required data | 缺少必填参数 |
废票错误码 (1001xx)
| code | message | 错误描述 |
|---|---|---|
| 100101 | void not support | 不支持废票 |
| 100102 | void exists void | 存在进行中的废票 |
| 100103 | miss required data | 缺少必填参数 |
错误码分类说明
- 101xx: 搜价相关错误
- 201xx: 验价相关错误
- 301xx: 下单相关错误
- 401xx: 支付前校验错误
- 501xx: 支付相关错误
- 601xx: 辅营相关错误
- 701xx: 搜索相关错误
- 801xx: 改签相关错误
- 901xx: 退票相关错误
- 1001xx: 废票相关错误
API调用流程
图例:

接口调用流程:

生成签名
用于生成 API 请求签名的代码示例。secretKey将由Tourmind提供。
为了保证API请求的安全性,所有请求需在请求头中加入签名信息: X-Key为appKey(可选项), X-Timestamp为时间戳,X-Signature为签名。
签名算法如下:
- 定义一个字符串,格式为:body×tamp
- 使用 secretKey 作为密钥,对该字符串进行 HMAC-SHA256 加密
- HMAC-SHA256 加密后的结果转换为十六进制字符串。
- 对十六进制字符串进行 Base64 编码。
以下是生成签名的示例:
secretKey: 3bdba1ec69824e1f
body: `{
"key":"g6xTdXBwbGllckNvZGWjRElEqVNlYXJjaEtledmXU2VhcmNoOmg2aFVjbWx3Vkhsd1pRR3FSbXhwWjJoMFZIbHdaUUNxUTJGaWFXNURiR0Z6YzZDbVFXUjFiSFJ6QWFoRGFHbHNaSEpsYmdDblNXNW1ZVzUwY3dDa1RHVm5jNUdEbzBSbGNLTkRSMHVuUkdWd1JHRjBaYW95TURJMUxUQTBMVEl5bzBGeWNxTlRVa2M9OkRJRKpTZWdtZW50S2V52SA4YzMxZjRhMWY1YjFjZGY0YTZiY2ViNWY1ZWIxOGYyOQ==",
"adults":1
}`
timestamp: 1682068743
sign: ZDM2NGJjMWQ2ODQ1MTk3MDcxYTEyOWU2YTg3ODdmZTM2NjVhNzdiOWIyNTlkOGNhZmVjMDg2MGEyOGM2Y2VlNg==以下是 PHP、Java 和 Go 语言的示例代码:
php
<?php
function getSign(string $secretKey, string $requestBody, string $timestamp): string {
$str2Sign = $requestBody . "&" . $timestamp;
$hmacSha256 = hash_hmac('sha256', $str2Sign, $secretKey, true);
$hexString = bin2hex($hmacSha256);
return base64_encode($hexString);
}
// Example usage
$secretKey = "your_secret_key";
$requestBody = "your_request_body";
$timestamp = time();
$signature = getSign($secretKey, $requestBody, $timestamp);
echo "Signature: " . $signature . PHP_EOL;
?>java
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.util.Base64;
import java.nio.charset.StandardCharsets;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
public class SignatureGenerator {
public static String getSign(String secretKey, String requestBody, String timestamp)
throws NoSuchAlgorithmException, InvalidKeyException {
String str2Sign = requestBody + "&" + timestamp;
SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), "HmacSHA256");
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(secretKeySpec);
byte[] hmacSha256Bytes = mac.doFinal(str2Sign.getBytes(StandardCharsets.UTF_8));
String hexString = bytesToHex(hmacSha256Bytes);
return Base64.getEncoder().encodeToString(hexString.getBytes(StandardCharsets.UTF_8));
}
private static String bytesToHex(byte[] bytes) {
StringBuilder sb = new StringBuilder();
for (byte b : bytes) {
sb.append(String.format("%02x", b));
}
return sb.toString();
}
public static void main(String[] args) throws Exception {
String secretKey = "your_secret_key";
String requestBody = "your_request_body";
String timestamp = String.valueOf(System.currentTimeMillis() / 1000);
String signature = getSign(secretKey, requestBody, timestamp);
System.out.println("Signature: " + signature);
}
}go
package main
import (
"crypto/hmac"
"crypto/sha256"
"encoding/base64"
"encoding/hex"
"fmt"
"strconv"
"time"
)
func getSign(secretKey, requestBody string, timestamp string) string {
str2Sign := fmt.Sprintf("%s&%s", requestBody, timestamp)
hmacSha256 := hmac.New(sha256.New, []byte(secretKey))
hmacSha256.Write([]byte(str2Sign))
hashBytes := hmacSha256.Sum(nil)
hexString := hex.EncodeToString(hashBytes)
return base64.StdEncoding.EncodeToString([]byte(hexString))
}
func main() {
secretKey := "your_secret_key"
requestBody := "your_request_body"
timestamp := fmt.Sprintf("%d", time.Now().Unix())
signature := getSign(secretKey, requestBody, timestamp)
fmt.Println("Signature:", signature)
}js
const CryptoJS = require('crypto-js');
function getSign(secretKey, requestBody, timestamp) {
const str2Sign = `${requestBody}&${timestamp}`;
const hmacSha256 = CryptoJS.HmacSHA256(str2Sign, secretKey);
const hexString = hmacSha256.toString(CryptoJS.enc.Hex);
return CryptoJS.enc.Base64.stringify(
CryptoJS.enc.Utf8.parse(hexString)
);
}
const secretKey = pm.environment.get('secretKey');
const requestBody = pm.request.body.raw;
const timestamp = Math.floor(Date.now() / 1000);
const signature = getSign(secretKey, requestBody, timestamp);
pm.request.headers.add({
key: 'X-Signature',
value: signature
});
pm.request.headers.add({
key: 'X-Key',
value: pm.environment.get('appKey')
});
pm.request.headers.add({
key: 'X-Timestamp',
value: timestamp.toString()
});
console.log("secretKey:", secretKey)
console.log("body:", requestBody)
console.log("timestamp:", timestamp)
console.log("sign:", signature)报价
搜索
根据条件搜索航班组合,成功则返回报价列表
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | https://test.hlzinterface.cn/api/standard/search |
| 请求方式 | POST |
请求字段
adults: integer
成人数
cabinClass: string
舱位等级,默认 Y
children: integer
儿童数
flightType: integer
航班类型 0:默认全部,1:直飞,2:中转
infants: integer
婴儿数
tripType: integer必填
行程类型 1:单程 2:往返 3:多程
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"adults": 1,
"cabinClass": "Y",
"children": 0,
"flightType": 0,
"infants": 0,
"legs": [
{
"arr": "HKG",
"dep": "BJS",
"depDate": "2025-04-02"
}
],
"tripType": 1
}json
{
"code": 0,
"data": {
"solutions": [
{
"adtFare": "1000.00",
"adtTax": "50.00",
"adults": 1,
"baggageRules": [
{
"baggageType": 1,
"passengerType": 1,
"piece": 2,
"segmentIndex": 1,
"weight": 23
}
],
"changeRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"chdFare": "800.00",
"chdTax": "50.00",
"children": 0,
"convenienceFee": "0.00",
"currency": "CNY",
"identify": "hKxTdXBwbGllckNvZGWkRlIyNKlTZWFyY2hLZXnZmFNlYXJjaDpoNmhVY21sd1ZIbHdaUUdxUm14cFoyaDBWSGx3WlFDcVEyRmlhVzVEYkdGemM2Rlpwa0ZrZFd4MGN3bW9RMmhwYkdSeVpXNEFwMGx1Wm1GdWRITUFwRXhsWjNPUmc2TkVaWENqU0V0SHAwUmxjRVJoZEdXcU1qQXlOUzB3TVMweU5hTkJjbktqUWtwVDpGUjI0qlNlZ21lbnRLZXnZIGVhYjdiYjRiMDRhNTJlMjIwYzk3ZTdjOWU1ZjI2MDM3qVRvdGFsRmFycQI/////gIW9iA=",
"journeys": [
{
"arrAirport": "PVG",
"arrCity": "SHA",
"depAirport": "PEK",
"depCity": "BJS",
"duration": 120,
"index": 1,
"segmentIndexs": [],
"transferCount": 0
}
],
"merchantFee": "0.00",
"platformServiceFee": "0.00",
"pnr": "EJB6GT",
"qCharge": "100.00",
"refundRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"segments": [
{
"airline": "CA",
"arrAirport": "PVG",
"arrCity": "SHA",
"arrTime": "2025-01-01 14:00",
"cabinClass": "Y",
"cabinCode": "Y",
"cabinCount": 9,
"codeShare": 0,
"depAirport": "PEK",
"depCity": "BJS",
"depTime": "2025-01-01 12:00",
"duration": 120,
"flightNo": "123",
"group": 0,
"index": 1,
"stopovers": [
{
"airport": "CAN",
"arrTime": "2025-01-01 13:00",
"city": "CAN",
"depTime": "2025-01-01 14:00",
"duration": 60
}
]
}
],
"ticketCarrier": "CA",
"tktFee": "0.00",
"totalFare": "1050.00",
"tripType": 1
}
]
},
"message": "success"
}验价
对航班报价进行验价操作,成功则返回报价内容和预订的SessionId
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | https://test.hlzinterface.cn/api/standard/verify |
| 请求方式 | POST |
请求字段
adults: integer
成人数
children: integer
儿童数
infants: integer
婴儿数
key: string必填
搜价返回报价中的Identify
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"adults": 1,
"children": 0,
"infants": 0,
"key": "hKxTdXBwbGllckNvZGWkRlIyNKlTZWFyY2hLZXnZmFNlYXJjaDpoNmhVY21sd1ZIbHdaUUdxUm14cFoyaDBWSGx3WlFDcVEyRmlhVzVEYkdGemM2Rlpwa0ZrZFd4MGN3bW9RMmhwYkdSeVpXNEFwMGx1Wm1GdWRITUFwRXhsWjNPUmc2TkVaWENqU0V0SHAwUmxjRVJoZEdXcU1qQXlOUzB3TVMweU5hTkJjbktqUWtwVDpGUjI0qlNlZ21lbnRLZXnZIGVhYjdiYjRiMDRhNTJlMjIwYzk3ZTdjOWU1ZjI2MDM3qVRvdGFsRmFycQI/////gIW9iA="
}json
{
"code": 0,
"data": {
"sessionId": "0E553602C2EC4FC1851D0D2B01C15276",
"solution": {
"adtFare": "1000.00",
"adtTax": "50.00",
"adults": 1,
"baggageRules": [
{
"baggageType": 1,
"passengerType": 1,
"piece": 2,
"segmentIndex": 1,
"weight": 23
}
],
"changeRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"chdFare": "800.00",
"chdTax": "50.00",
"children": 0,
"convenienceFee": "0.00",
"currency": "CNY",
"identify": "hKxTdXBwbGllckNvZGWkRlIyNKlTZWFyY2hLZXnZmFNlYXJjaDpoNmhVY21sd1ZIbHdaUUdxUm14cFoyaDBWSGx3WlFDcVEyRmlhVzVEYkdGemM2Rlpwa0ZrZFd4MGN3bW9RMmhwYkdSeVpXNEFwMGx1Wm1GdWRITUFwRXhsWjNPUmc2TkVaWENqU0V0SHAwUmxjRVJoZEdXcU1qQXlOUzB3TVMweU5hTkJjbktqUWtwVDpGUjI0qlNlZ21lbnRLZXnZIGVhYjdiYjRiMDRhNTJlMjIwYzk3ZTdjOWU1ZjI2MDM3qVRvdGFsRmFycQI/////gIW9iA=",
"journeys": [
{
"arrAirport": "PVG",
"arrCity": "SHA",
"depAirport": "PEK",
"depCity": "BJS",
"duration": 120,
"index": 1,
"segmentIndexs": [],
"transferCount": 0
}
],
"merchantFee": "0.00",
"platformServiceFee": "0.00",
"pnr": "EJB6GT",
"qCharge": "100.00",
"refundRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"segments": [
{
"airline": "CA",
"arrAirport": "PVG",
"arrCity": "SHA",
"arrTime": "2025-01-01 14:00",
"cabinClass": "Y",
"cabinCode": "Y",
"cabinCount": 9,
"codeShare": 0,
"depAirport": "PEK",
"depCity": "BJS",
"depTime": "2025-01-01 12:00",
"duration": 120,
"flightNo": "123",
"group": 0,
"index": 1,
"stopovers": [
{
"airport": "CAN",
"arrTime": "2025-01-01 13:00",
"city": "CAN",
"depTime": "2025-01-01 14:00",
"duration": 60
}
]
}
],
"ticketCarrier": "CA",
"tktFee": "0.00",
"totalFare": "1050.00",
"tripType": 1
}
},
"message": "success"
}售前辅营
搜索航班报价可购买的辅营产品
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | https://test.hlzinterface.cn/api/standard/ssr |
| 请求方式 | POST |
请求字段
sessionId: string
验价返回的sessionId
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"sessionId": "0E553602C2EC4FC1851D0D2B01C15276"
}json
{
"code": 0,
"data": {
"ancillaries": [
{
"flightNumber": "CA1234",
"isDirect": true,
"items": [
{
"code": "7e122baf-3af3-4510-98bd-8713dac383ec",
"currency": "USD",
"desc": "",
"name": "托运行李",
"piece": 1,
"price": 87.02,
"serviceFee": 0,
"size": "",
"unit": "KG",
"weight": 23
}
],
"segmentIndex": 1
}
]
},
"message": "success"
}下单支付
预订
根据报价预订航班,成功则返回生成的途灵订单信息
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | https://test.hlzinterface.cn/api/standard/booking |
| 请求方式 | POST |
请求字段
agentOrderNo: string必填
用户自定义订单号
sessionId: string必填
验价接口返回的SessionId
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"agentOrderNo": "5J2501021544NL",
"ancillaryItems": [
{
"code": "7e122baf-3af3-4510-98bd-8713dac383ec",
"count": 1,
"currency": "USD",
"desc": "托运行李",
"flightNo": "CA1234",
"name": "托运行李",
"passengerIndex": 1,
"piece": 1,
"price": 87.02,
"unit": "KG",
"weight": 23
}
],
"contact": {
"address": "北京市朝阳区",
"areaCode": "86",
"email": "test@example.com",
"name": "张三",
"phone": "13800138000"
},
"passengers": [
{
"associatedIndex": 0,
"birthday": "1990-01-01",
"cardExpired": "2030-01-01",
"cardIssuePlace": "CN",
"cardNo": "E12345678",
"cardType": "PP",
"email": "test@example.com",
"firstName": "JOHN",
"index": 1,
"lastName": "DOE",
"nationality": "CN",
"phone": "13800138000",
"sex": 1,
"type": 1
}
],
"sessionId": "0E553602C2EC4FC1851D0D2B01C15276"
}json
{
"code": 0,
"data": {
"order": {
"adults": 1,
"amount": "1000.00",
"ancillaryItems": [
{}
],
"children": 0,
"contact": {
"address": "北京市朝阳区",
"areaCode": "86",
"email": "test@example.com",
"name": "张三",
"phone": "13800138000"
},
"currency": "CNY",
"orderNo": "1876513316759830528",
"passengers": [
{
"associatedIndex": 0,
"birthday": "1990-01-01",
"cardExpired": "2030-01-01",
"cardIssuePlace": "CN",
"cardNo": "E12345678",
"cardType": "PP",
"email": "test@example.com",
"firstName": "JOHN",
"index": 1,
"lastName": "DOE",
"nationality": "CN",
"phone": "13800138000",
"sex": 1,
"type": 1
}
],
"paytime": "2023-01-01 12:00:00",
"status": 1,
"ticketingTime": "2023-01-01 12:00:00",
"tickets": [
{
"airlinePnr": "DEF456",
"firstName": "John",
"group": 1,
"lastName": "Doe",
"passengerIndex": 1,
"pnrCode": "KC4862",
"segmentIndex": 1,
"ticketNo": "EJB6GT"
}
]
},
"orderNo": "1876513316759830528",
"solution": {
"adtFare": "1000.00",
"adtTax": "50.00",
"adults": 1,
"baggageRules": [
{
"baggageType": 1,
"passengerType": 1,
"piece": 2,
"segmentIndex": 1,
"weight": 23
}
],
"changeRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"chdFare": "800.00",
"chdTax": "50.00",
"children": 0,
"convenienceFee": "0.00",
"currency": "CNY",
"identify": "hKxTdXBwbGllckNvZGWkRlIyNKlTZWFyY2hLZXnZmFNlYXJjaDpoNmhVY21sd1ZIbHdaUUdxUm14cFoyaDBWSGx3WlFDcVEyRmlhVzVEYkdGemM2Rlpwa0ZrZFd4MGN3bW9RMmhwYkdSeVpXNEFwMGx1Wm1GdWRITUFwRXhsWjNPUmc2TkVaWENqU0V0SHAwUmxjRVJoZEdXcU1qQXlOUzB3TVMweU5hTkJjbktqUWtwVDpGUjI0qlNlZ21lbnRLZXnZIGVhYjdiYjRiMDRhNTJlMjIwYzk3ZTdjOWU1ZjI2MDM3qVRvdGFsRmFycQI/////gIW9iA=",
"journeys": [
{
"arrAirport": "PVG",
"arrCity": "SHA",
"depAirport": "PEK",
"depCity": "BJS",
"duration": 120,
"index": 1,
"segmentIndexs": [],
"transferCount": 0
}
],
"merchantFee": "0.00",
"platformServiceFee": "0.00",
"pnr": "EJB6GT",
"qCharge": "100.00",
"refundRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"segments": [
{
"airline": "CA",
"arrAirport": "PVG",
"arrCity": "SHA",
"arrTime": "2025-01-01 14:00",
"cabinClass": "Y",
"cabinCode": "Y",
"cabinCount": 9,
"codeShare": 0,
"depAirport": "PEK",
"depCity": "BJS",
"depTime": "2025-01-01 12:00",
"duration": 120,
"flightNo": "123",
"group": 0,
"index": 1,
"stopovers": [
{
"airport": "CAN",
"arrTime": "2025-01-01 13:00",
"city": "CAN",
"depTime": "2025-01-01 14:00",
"duration": 60
}
]
}
],
"ticketCarrier": "CA",
"tktFee": "0.00",
"totalFare": "1050.00",
"tripType": 1
}
},
"message": "success"
}支付前验证
订单支付前验证是否为可支付状态
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | https://test.hlzinterface.cn/api/standard/pay/valid |
| 请求方式 | POST |
请求字段
orderNo: string必填
途灵订单号
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"orderNo": "1876513316759830528"
}json
{
"code": 0,
"data": {},
"message": "success"
}支付
支付
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | https://test.hlzinterface.cn/api/standard/pay |
| 请求方式 | POST |
请求字段
orderNo: string必填
途灵订单号
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"orderNo": "1876513316759830528"
}json
{
"code": 0,
"data": {
"orderNo": "1876513316759830528",
"solution": {
"adtFare": "1000.00",
"adtTax": "50.00",
"adults": 1,
"baggageRules": [
{
"baggageType": 1,
"passengerType": 1,
"piece": 2,
"segmentIndex": 1,
"weight": 23
}
],
"changeRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"chdFare": "800.00",
"chdTax": "50.00",
"children": 0,
"convenienceFee": "0.00",
"currency": "CNY",
"identify": "hKxTdXBwbGllckNvZGWkRlIyNKlTZWFyY2hLZXnZmFNlYXJjaDpoNmhVY21sd1ZIbHdaUUdxUm14cFoyaDBWSGx3WlFDcVEyRmlhVzVEYkdGemM2Rlpwa0ZrZFd4MGN3bW9RMmhwYkdSeVpXNEFwMGx1Wm1GdWRITUFwRXhsWjNPUmc2TkVaWENqU0V0SHAwUmxjRVJoZEdXcU1qQXlOUzB3TVMweU5hTkJjbktqUWtwVDpGUjI0qlNlZ21lbnRLZXnZIGVhYjdiYjRiMDRhNTJlMjIwYzk3ZTdjOWU1ZjI2MDM3qVRvdGFsRmFycQI/////gIW9iA=",
"journeys": [
{
"arrAirport": "PVG",
"arrCity": "SHA",
"depAirport": "PEK",
"depCity": "BJS",
"duration": 120,
"index": 1,
"segmentIndexs": [],
"transferCount": 0
}
],
"merchantFee": "0.00",
"platformServiceFee": "0.00",
"pnr": "EJB6GT",
"qCharge": "100.00",
"refundRules": [
{
"conditionList": [
{
"amount": "100.00",
"status": 1
}
],
"currency": "CNY",
"fee": "100.00",
"noShowFee": "200.00",
"noShowStatus": 1,
"noShowTime": 24,
"passengerType": 1,
"status": 1,
"ticketStatus": 1,
"useCondition": false
}
],
"segments": [
{
"airline": "CA",
"arrAirport": "PVG",
"arrCity": "SHA",
"arrTime": "2025-01-01 14:00",
"cabinClass": "Y",
"cabinCode": "Y",
"cabinCount": 9,
"codeShare": 0,
"depAirport": "PEK",
"depCity": "BJS",
"depTime": "2025-01-01 12:00",
"duration": 120,
"flightNo": "123",
"group": 0,
"index": 1,
"stopovers": [
{
"airport": "CAN",
"arrTime": "2025-01-01 13:00",
"city": "CAN",
"depTime": "2025-01-01 14:00",
"duration": 60
}
]
}
],
"ticketCarrier": "CA",
"tktFee": "0.00",
"totalFare": "1050.00",
"tripType": 1
}
},
"message": "success"
}订单查询
订单详情
根据途灵订单号查询订单详情
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | https://test.hlzinterface.cn/api/standard/order |
| 请求方式 | POST |
请求字段
orderNo: string必填
途灵订单号
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"orderNo": "1876513316759830528"
}json
{
"code": 0,
"data": {
"order": {
"adults": 1,
"amount": "1000.00",
"ancillaryItems": [
{}
],
"children": 0,
"contact": {
"address": "北京市朝阳区",
"areaCode": "86",
"email": "test@example.com",
"name": "张三",
"phone": "13800138000"
},
"currency": "CNY",
"orderNo": "1876513316759830528",
"passengers": [
{
"associatedIndex": 0,
"birthday": "1990-01-01",
"cardExpired": "2030-01-01",
"cardIssuePlace": "CN",
"cardNo": "E12345678",
"cardType": "PP",
"email": "test@example.com",
"firstName": "JOHN",
"index": 1,
"lastName": "DOE",
"nationality": "CN",
"phone": "13800138000",
"sex": 1,
"type": 1
}
],
"paytime": "2023-01-01 12:00:00",
"status": 1,
"ticketingTime": "2023-01-01 12:00:00",
"tickets": [
{
"airlinePnr": "DEF456",
"firstName": "John",
"group": 1,
"lastName": "Doe",
"passengerIndex": 1,
"pnrCode": "KC4862",
"segmentIndex": 1,
"ticketNo": "EJB6GT"
}
]
},
"segments": [
{
"airline": "CA",
"arrAirport": "PVG",
"arrCity": "SHA",
"arrTime": "2025-01-01 14:00",
"cabinClass": "Y",
"cabinCode": "Y",
"cabinCount": 9,
"codeShare": 0,
"depAirport": "PEK",
"depCity": "BJS",
"depTime": "2025-01-01 12:00",
"duration": 120,
"flightNo": "123",
"group": 0,
"index": 1,
"stopovers": [
{
"airport": "CAN",
"arrTime": "2025-01-01 13:00",
"city": "CAN",
"depTime": "2025-01-01 14:00",
"duration": 60
}
]
}
]
},
"message": "success"
}出票
订单出票通知
订单出票通知
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | |
| 请求方式 | POST |
请求字段
agentOrderNo: string必填
用户自定义订单号
orderNo: string必填
途灵订单号
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
json
{
"agentOrderNo": "1876513316759830528",
"orderNo": "1876513316759830528",
"tickets": [
{
"airlinePnr": "DEF456",
"firstName": "John",
"group": 1,
"lastName": "Doe",
"passengerIndex": 1,
"pnrCode": "KC4862",
"segmentIndex": 1,
"ticketNo": "EJB6GT"
}
]
}json
{
"code": 0,
"message": "success"
}售后
航变
推送订单航变数据
接口调用信息
| 名称 | 值 |
|---|---|
| 请求地址 | |
| 请求方式 | POST |
请求字段
agentOrderNo: string
changedType: integer
航变类型,1:航班变动,2:航班取消
orderNo: string
途灵订单号
pnr: string
PNR(订座记录编号)
响应字段
code: integer
0:成功,其他:错误码
message: string
错误信息
orderNo: string
途灵订单号
json
{
"agentOrderNo": "1947498981984833536",
"changedSegments": [
{
"arrAirport": "FUK",
"arrTime": "2025-09-07 10:50",
"cabinClass": "Y",
"cabinCode": "W",
"depAirport": "ICN",
"depTime": "2025-09-07 09:30",
"flightNo": "ZE641",
"group": 1
}
],
"changedType": 1,
"orderNo": "1947498981984833536",
"originalSegments": [
{
"arrAirport": "FUK",
"arrTime": "2025-09-07 09:55",
"cabinClass": "Y",
"cabinCode": "W",
"depAirport": "ICN",
"depTime": "2025-09-07 08:35",
"flightNo": "ZE641",
"group": 1
}
],
"pnr": "CWQRS4",
"tickets": [
{
"airlinePnr": "CWQRS4",
"firstName": "John",
"flightNo": "ZE641",
"lastName": "Doe",
"passengerIndex": 1,
"pnrCode": "CWQRS4",
"ticketNo": "8392882170841"
}
]
}json
{
"code": 0,
"message": "success",
"orderNo": "1947498981984833536"
}