Skip to content

Tourmind Flight Distribution API (1.0) ​

下载 Swagger 规范: 下载

这是 Tourmind Flight Distribution API(途灵机票分销接口)的开发文档。

Tourmind.com

概述 ​

  • 这是Tourmind Flight Distribution API的规范。
  • 从代理到Tourmind Flight Distribution API的所有通信均通过HTTP发布。
  • 请求有效载荷的格式基于JSON。
  • 所有请求都包含公共请求标头,其中包括身份验证信息。

更新日志 ​

版本日期说明
v1.0.12025.01.07接口文档v1
v1.0.22025.02.21新增签名用例
v1.0.32025.04.09新增JavaScript签名用例,调整签名算法
v1.0.42025.04.16新增凭证类型;修正价格字段为decimal字符串类型
v1.0.52025.07.15调整签名算法;修正下单、支付接口返回数据结构
v1.0.62025.08.14新增售前辅营接口;新增航变推送接口
v1.0.72025.09.25新增错误码文档
v1.0.82026.06.08新增婴儿类型参数、说明

错误码 ​

搜价错误码 (101xx)

codemessage错误描述
10101look2book error差定比超出
10102currency not same币种不一致
10103parse supplier resp解析供应商返回失败
10104search time invalid搜索时间无效
10105iata code invalidIATA 代码无效
10106there should be at least one adult至少需要一名成人
10107the number of infant passengers can not exceed the number of adult passengers婴儿人数不能超过成人人数
10108the maximum number of passengers with seat is 9有座乘客最多9
10109can not find the related data未找到相关数据
10110shopping failed from upstream上游搜价失败

验价错误码 (201xx)

codemessage错误描述
20101verify error验价失败
20102verify price change变价
20103verify no seat无座
20104verify no solution无对应报价
20105verify permission denied验价权限不足
20106flight near take-off航班临近起飞
20107can not find any price for this flight未找到该航班价格
20108can not find any supplier for current search当前搜索未找到供应商

下单错误码 (301xx)

codemessage错误描述
30101booking error下单失败
30102booking price change变价
30103booking params error参数错误
30104booking no seat无座
30105booking passenger info error乘客信息异常
30106too late booking验价后下单超时
30107session id expiredsession id 过期
30108solution not found未找到报价方案
30109ancillary not found未找到辅营
30110permission denied下单权限不足
30111need card info需要证件信息
30113duplicate reservation重复预订
30114flight re-schedule航班可能改期
30115airline pnr missing缺少航司 PNR
30116create failed from gdsGDS 创建订单失败
30117retrieve pnr failedGDS 提取 PNR 失败
30118save price failed from gdsGDS 保存价格失败
30119airline or flight restriction航司或航班限制
30120last ticketing time not enough最晚出票时间不足
30121segment status invalid航段状态无效
30122saved booking failed保存订单失败
30123infant type error婴儿乘客类型错误
30124associatedIndex required for infant婴儿缺少关联乘客索引
30125passenger name too long乘客姓名过长
30126adult age error成人年龄错误
30127verify data expired验价数据过期
30128flight invalid, please select other flight options航班无效,请选择其他航班
30129fare unavailable, please select other flight options运价不可用,请选择其他航班
30130children age error儿童年龄错误
30131passenger name illegal乘客姓名非法
30132passenger doc required缺少乘客证件信息
30133passenger age limitation乘客年龄限制
30134lack of passenger index缺少乘客索引
30135duplicate baggages重复行李
30136multiple seat selection重复选座

支付前校验错误码 (401xx)

codemessage错误描述
40101pay valid error支付前校验失败
40102pay valid timeout超过支付时效
40103pay valid order status error订单状态错误
40104no airline pnr exist航司 PNR 不存在
40105pnr status invalidPNR 状态无效
40106price changed价格变化
40107latest ticketing time expired最晚出票时间已过期
40108flight changed航班变化
40109order not found订单不存在
40110supplier status is invalid供应商状态无效
40111flight status invalid航班状态无效
40112fare is not guaranteed运价未保障
40113no price无价格
40114order pricing failed, please try again订单计价失败,请重试
40115no seat无座

支付错误码 (501xx)

codemessage错误描述
50101pay error支付失败
50102pay order cancel订单已取消
50103pay duplicate重复支付
50104pay balance not enough余额不足
50105pay deadline expired支付期限已过期
50106pay deadline expired订单号不存在
50107pay order status invalid支付订单状态无效

辅营错误码 (601xx)

codemessage错误描述
60101ancillary not support不支持辅营
60102ancillary search failed辅营查询失败
60103ssr count seg count not same辅营结果与航段数量不一致

搜索错误码 (701xx)

codemessage错误描述
70101query error搜索失败

改签错误码 (801xx)

codemessage错误描述
80101change not support不支持改签
80102change exists change存在进行中的改签
80103miss required data缺少必填参数
80104amount error金额错误

退票错误码 (901xx)

codemessage错误描述
90101refund not support不支持退票
90102refund exists refund存在进行中的退票
90103miss required data缺少必填参数

废票错误码 (1001xx)

codemessage错误描述
100101void not support不支持废票
100102void exists void存在进行中的废票
100103miss required data缺少必填参数

错误码分类说明

  • 101xx: 搜价相关错误
  • 201xx: 验价相关错误
  • 301xx: 下单相关错误
  • 401xx: 支付前校验错误
  • 501xx: 支付相关错误
  • 601xx: 辅营相关错误
  • 701xx: 搜索相关错误
  • 801xx: 改签相关错误
  • 901xx: 退票相关错误
  • 1001xx: 废票相关错误

API调用流程 ​

图例:

接口调用流程:

生成签名 ​

用于生成 API 请求签名的代码示例。secretKey将由Tourmind提供。

为了保证API请求的安全性,所有请求需在请求头中加入签名信息: X-Key为appKey(可选项), X-Timestamp为时间戳,X-Signature为签名。

签名算法如下:

  1. 定义一个字符串,格式为:body&timestamp
  2. 使用 secretKey 作为密钥,对该字符串进行 HMAC-SHA256 加密
  3. HMAC-SHA256 加密后的结果转换为十六进制字符串。
  4. 对十六进制字符串进行 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"
}