航班 API

從搜尋到出票,端到端的航班預訂

跨多個來源搜尋即時票價,二次驗證價格,預訂並出票。一套 REST 介面,價格統一以美元計。

POST /Air/AirLowFareSearch
{
  "AdultCount": 1,
  "TravelPreference": { "CabinType": 3 },
  "OriginDestinationInformations": [
    { "OriginLocationCode": "TBS",
      "DestinationLocationCode": "DXB",
      "DepartureDateTime": "2026-11-14T00:00:00" }
  ]
}
概覽

航空公司內容零散,各來源格式不一。此機票預訂 API 將搜尋、退改規則、行李、預訂、出票與退款統一在一致的 JSON 契約之下。

端點背後是一套正規化的票價引擎,透過單一 JSON 合約與全球分銷系統與低成本航空對話。無論內容來自 GDS 或航空公司直連,你都能取得一致的行程、票價規則、行李與座位資料,讓你的機票預訂 App 或 OTA 一次接入、處處擴展。

你將獲得

1

依航班組搜尋最低價行程,或透過伺服器推送事件(SSE)串流回傳結果,達成快速首屏。

2

在預訂前二次驗證票價,讓你收取的價格與實際一致。

3

掌控完整生命週期:鎖定座位、出票,隨後查詢、取消或退款。

4

透過 server-sent events 串流回傳行程,在慢速航線上也能快速首屏渲染。

5

完整的開票後處理:取得憑證、在時限內作廢、取消與退款。

流程如何運作

01

Search

Post routes and dates, get priced itineraries back, or stream them over server-sent events.

02

Revalidate

Re-price the chosen itinerary right before booking so the fare you charge is the fare you get.

03

Book

Create the booking, hold the seats, and receive a booking reference.

04

Issue

Issue the ticket against your balance, then track, void, cancel, or refund.

主要端點

POST/Air/AirLowFareSearchSearch the cheapest itinerary per flight group.
POST/Air/AirLowFareSearchStreamStream itineraries over server-sent events.
POST/Air/AirRevalidateRe-price and validate an itinerary before booking.
POST/Air/AirBookCreate the booking and hold seats.
POST/Air/AirTicketIssue the ticket for a booking.
GET/Air/AirBookingDetailsRetrieve a booking, its status, and documents.

請求與回應

Request · POST /Air/AirLowFareSearch
{
  "AdultCount": 1,
  "TravelPreference": { "CabinType": 3 },
  "OriginDestinationInformations": [
    { "OriginLocationCode": "TBS",
      "DestinationLocationCode": "DXB",
      "DepartureDateTime": "2026-11-14T00:00:00" }
  ]
}
Response · 200 OK
{
  "itineraries": [
    {
      "fareCode": "TBSDXB-Y-412",
      "total": { "amount": 412.00, "currency": "USD" },
      "seatsRemaining": 5,
      "segments": [
        { "from": "TBS", "to": "DXB",
          "depart": "2026-11-14T09:40",
          "carrier": "EK", "flight": "2201" }
      ]
    }
  ]
}

回應包含什麼

fareCode
Opaque identifier you pass to revalidate and book.
total
Final price with currency, already normalized to USD.
seatsRemaining
Bookable seats left at this fare.
segments
Each flight leg with carrier, flight number, times, and airports.
baggage
Included allowance and paid options per segment.
1,000+

航空公司

常見問題

航班搜尋回傳什麼?

帶價格的行程,每筆含票價代碼、航段、美元總價與剩餘座位。

可以串流回傳結果嗎?

可以。增量搜尋介面會在結果抵達時,透過伺服器推送事件逐筆回傳行程。

如何安全測試?

將用戶端指向沙盒。搜尋是真實的;出票呼叫會對獨立錢包進行模擬。

支援單程、來回與多程嗎?

支援。在同一搜尋內容中送出一個或多個出發-到達組合;單程、來回與多程使用相同結構。

退款如何處理?

在航空公司作廢時限內作廢,或於開票後申請退款。API 會回傳可退金額與結果狀態。

用一個 API 打造你的旅遊產品。

串接免費。每張票 1%,每筆上限 10 美元。航班、飯店與活動的即時涵蓋。