GET/v1/flights/offers/:gdsprovider/:offerId

获取航班报价详情

在预订前获取所选航班报价的最新详情,包括价格、规则、航段和可用的旅客要求。

分享
GET/v1/flights/offers/:gdsprovider/:offerId

API 控制台

试一试

向沙箱 API 发送真实请求并查看响应。

凭证

登录后即可从已保存的 API 密钥中选择,无需手动粘贴。

路径参数

2 个字段

GDS 提供方

用于获取航班内容的全球分销系统。选择 0 使用默认提供方。

Offer ID

上一次航班搜索请求返回的报价标识符。

cURL 请求

cURL
bash
curl -X GET 'https://api.sandbox.travelandz.com/v1/flights/offers/0/:offerId' \
  -H 'Authorization: Bearer YOUR_SECRET_KEY' \
  -H 'X-Travelandz-Id: YOUR_PUBLIC_KEY:YOUR_PROFILE_CODE'

请填写凭证以发送请求。

响应

点击「试一试!」发送请求,响应将显示在此处。

在预订前获取所选航班报价的最新详情,包括价格、规则、航段和可用的旅客要求。

接口

方法路径认证
GET/v1/flights/offers/:gdsprovider/:offerId需要 API key
必需请求头:
Header说明
AuthorizationBearer <secret_key>. The secret is shown only once when the credential is created.
X-Travelandz-Id<public_key>:<profile_code>. The profile_code is the dp_-prefixed Developer Profile code shown in your dashboard. This binds the request to a profile and credential.
Content-TypeUse application/json for requests with a body.

请求参数结构

gdsprovider
number
offerId
string

请求体

不需要请求体。

成功响应

返回 offerData with the selected offer, passenger ids, document requirements, hold options and flight segments when supported.

响应体结构

offerData
object
offerDataofferId
string
offerDatagdsprovider
number
offerDataexpiresAt
string
Format: ISO 8601
offerDatatotalAmount
number
offerDataholdOptions
object
offerDataholdOptionsavailable
boolean
offerDataholdOptionspaymentRequiredBy
string
Format: ISO 8601
可为空
offerDataholdOptionspriceGuarantedUntil
string
Format: ISO 8601
可为空
offerDatasupportedPassengerIdDocuments
array
offerDatasupportedPassengerIdDocuments[]
enum[]
offerDatapassengerIdentityDocumentsRequired
boolean
offerDatasupportedLoyaltyPrograms
array
offerDatasupportedLoyaltyPrograms[]
string[]
offerDataairline
object
offerDataairlinename
string
offerDataairlineiataCode
string
offerDataairlinelogoURL
string可为空
offerDataairlineconditionsOfCarriage
string
offerDatapassengers
array
offerDatapassengers[]id
string
Public passenger id to reuse during booking. Mystifly public offers generate internal ids such as mystifly_pax_1.
offerDatapassengers[]type
enum
adultchildinfant_without_seat
offerDataconditions
object
offerDataconditionsrefundBeforeDeparture
object
offerDataconditionsrefundBeforeDeparturecurrency
string
offerDataconditionsrefundBeforeDeparturepenaltyAmount
string
offerDataconditionsrefundBeforeDepartureallowed
boolean
offerDataconditionschangeBeforeDeparture
object
offerDataconditionschangeBeforeDeparturecurrency
string
offerDataconditionschangeBeforeDeparturepenaltyAmount
string
offerDataconditionschangeBeforeDepartureallowed
boolean
offerDataslices
array
offerDataslices[]fareName
string
offerDataslices[]departure
object
offerDataslices[]departureiataCode
string
offerDataslices[]departurecityName
string
offerDataslices[]departureairportName
string
offerDataslices[]departuredepartingAt
string
Format: ISO 8601
offerDataslices[]departuretimeZone
string
offerDataslices[]arrival
object
offerDataslices[]arrivaliataCode
string
offerDataslices[]arrivalcityName
string
offerDataslices[]arrivalairportName
string
offerDataslices[]arrivalarrivingAt
string
Format: ISO 8601
offerDataslices[]arrivaltimeZone
string
offerDataslices[]durationMinutes
number
offerDataslices[]conditions
object
offerDataslices[]conditionspriorityCheckIn
boolean
offerDataslices[]conditionspriorityBoarding
boolean
offerDataslices[]conditionsadvanceSeatSelection
boolean
offerDataslices[]segments
array
offerDataslices[]segments[]fareName
string
offerDataslices[]segments[]departure
object
offerDataslices[]segments[]departureiataCode
string
offerDataslices[]segments[]departurecityName
string
offerDataslices[]segments[]departureairportName
string
offerDataslices[]segments[]departuredepartingAt
string
Format: ISO 8601
offerDataslices[]segments[]departuretimeZone
string
offerDataslices[]segments[]departureterminal
string
offerDataslices[]segments[]arrival
object
offerDataslices[]segments[]arrivaliataCode
string
offerDataslices[]segments[]arrivalcityName
string
offerDataslices[]segments[]arrivalairportName
string
offerDataslices[]segments[]arrivalarrivingAt
string
Format: ISO 8601
offerDataslices[]segments[]arrivaltimeZone
string
offerDataslices[]segments[]arrivalterminal
string
offerDataslices[]segments[]airline
object
offerDataslices[]segments[]airlineoperatingCarrier
object
offerDataslices[]segments[]airlineoperatingCarriername
string
offerDataslices[]segments[]airlineoperatingCarrieriataCode
string
offerDataslices[]segments[]airlineoperatingCarrierlogoURL
string可为空
offerDataslices[]segments[]airlineoperatingCarrierconditionsOfCarriage
string
offerDataslices[]segments[]airlinemarketingCarrier
object
offerDataslices[]segments[]airlinemarketingCarriername
string
offerDataslices[]segments[]airlinemarketingCarrieriataCode
string
offerDataslices[]segments[]airlinemarketingCarrierlogoURL
string可为空
offerDataslices[]segments[]airlinemarketingCarrierconditionsOfCarriage
string
offerDataslices[]segments[]flightNumber
string
offerDataslices[]segments[]durationMinutes
number
offerDataslices[]segments[]passengers
array
offerDataslices[]segments[]passengers[]amenities
object
offerDataslices[]segments[]passengers[]amenitieswifi
object
offerDataslices[]segments[]passengers[]amenitieswificost
enum
freefree or paidpaid
可为空
offerDataslices[]segments[]passengers[]amenitieswifiavailable
boolean
offerDataslices[]segments[]passengers[]amenitiesseat
object
offerDataslices[]segments[]passengers[]amenitiesseatpitch
enum
"number"n/a
offerDataslices[]segments[]passengers[]amenitiesseatlegroom
enum
lessmorestandardn/a
offerDataslices[]segments[]passengers[]amenitiesseattype
enum
standardskycouchreclinerangle_flatfull_flatfull_flat_podprivate_suite
可为空
offerDataslices[]segments[]passengers[]amenitiespower
boolean
offerDataslices[]segments[]passengers[]baggages
array
offerDataslices[]segments[]passengers[]baggages[]type
enum
checkedcarry_on
offerDataslices[]segments[]passengers[]baggages[]quantity
number
offerDataslices[]segments[]passengers[]baggages[]maxKg
string
offerDataCO2EmissionsKg
number可为空
offerDataholdId
string可为空
offerDataoriginalCurrency
enum
EURUSDCNY
offerDatacurrency
enum
EURUSDCNY
liveMode
boolean
True when the request is served by the live Travelandz environment. This value comes from Travelandz, not the provider payload.

集成说明

  • Fresh offer detail availability depends on the selected source.
  • If direct offer detail is unavailable, keep the offer returned by public search and complete booking before it expires.
  • Reuse offerData.passengers[].id when creating the order. Do not send internal user identifiers.

示例

bash
bash
curl https://api.sandbox.travelandz.com/v1/flights/offers/0/offer_123 \
  -H "Authorization: Bearer $TRAVELANDZ_SECRET_KEY" \
  -H "X-Travelandz-Id: $TRAVELANDZ_PUBLIC_KEY:$TRAVELANDZ_PROFILE_CODE"

响应

状态码说明
200Flight offer detail retrieved successfully.
400请求无效:payload 不合法。
401未授权:凭证无效或缺失。
403禁止访问:凭证无效。
500服务器内部错误

200 响应体

媒体类型:application/json

json
json
{
  "offerData": {
    "offerId": "off_0000B7SbjlHTw4iTcv9u1c",
    "gdsprovider": 0,
    "expiresAt": "2026-06-18T15:02:31.989Z",
    "totalAmount": 235.38,
    "holdOptions": {
      "available": true,
      "paymentRequiredBy": "2026-06-21T14:32:31.000Z",
      "priceGuarantedUntil": "2026-06-20T14:32:31.000Z"
    },
    "supportedPassengerIdDocuments": [
      "passport",
      "known_traveler_number",
      "passenger_redress_number"
    ],
    "passengerIdentityDocumentsRequired": false,
    "supportedLoyaltyPrograms": [
      "ZZ"
    ],
    "airline": {
      "name": "Duffel Airways",
      "iataCode": "ZZ",
      "logoURL": "http://localhost:5000/v1/assets/airlines/0/for-light-background/full-color-logo/ZZ.svg",
      "conditionsOfCarriage": "https://duffelairways.com/dummy-url/conditions-of-carriage"
    },
    "passengers": [
      {
        "id": "pas_0000B7Sbjl2apQo4skC0pb",
        "type": "adult"
      }
    ],
    "conditions": {
      "refundBeforeDeparture": {
        "currency": "EUR",
        "penaltyAmount": "40.00",
        "allowed": true
      },
      "changeBeforeDeparture": {
        "currency": "EUR",
        "penaltyAmount": "40.00",
        "allowed": true
      }
    },
    "slices": [
      {
        "fareName": "Basic",
        "departure": {
          "iataCode": "MAD",
          "cityName": "Madrid",
          "airportName": "MAD",
          "departingAt": "2026-08-12T08:30:00",
          "timeZone": "Europe/Madrid"
        },
        "arrival": {
          "iataCode": "JFK",
          "cityName": "New York",
          "airportName": "JFK",
          "arrivingAt": "2026-08-12T10:45:00",
          "timeZone": "America/New_York"
        },
        "durationMinutes": 495,
        "conditions": {
          "priorityCheckIn": false,
          "priorityBoarding": false,
          "advanceSeatSelection": false
        },
        "segments": [
          {
            "fareName": "Basic",
            "departure": {
              "iataCode": "MAD",
              "cityName": "Madrid",
              "airportName": "MAD",
              "departingAt": "2026-08-12T08:30:00",
              "timeZone": "Europe/Madrid",
              "terminal": "2"
            },
            "arrival": {
              "iataCode": "JFK",
              "cityName": "New York",
              "airportName": "JFK",
              "arrivingAt": "2026-08-12T10:45:00",
              "timeZone": "America/New_York",
              "terminal": "1"
            },
            "airline": {
              "operatingCarrier": {
                "name": "Duffel Airways",
                "iataCode": "ZZ",
                "logoURL": "http://localhost:5000/v1/assets/airlines/0/for-light-background/full-color-logo/ZZ.svg",
                "conditionsOfCarriage": "https://duffelairways.com/dummy-url/conditions-of-carriage"
              },
              "marketingCarrier": {
                "name": "Duffel Airways",
                "iataCode": "ZZ",
                "logoURL": "http://localhost:5000/v1/assets/airlines/0/for-light-background/full-color-logo/ZZ.svg",
                "conditionsOfCarriage": "https://duffelairways.com/dummy-url/conditions-of-carriage"
              }
            },
            "flightNumber": "7252",
            "durationMinutes": 495,
            "passengers": [
              {
                "amenities": {
                  "wifi": {
                    "cost": "paid",
                    "available": true
                  },
                  "seat": {
                    "pitch": "30",
                    "legroom": "n/a",
                    "type": null
                  },
                  "power": true
                },
                "baggages": [
                  {
                    "type": "checked",
                    "quantity": 1,
                    "maxKg": "23"
                  },
                  {
                    "type": "carry_on",
                    "quantity": 1
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "CO2EmissionsKg": 249,
    "originalCurrency": "EUR",
    "currency": "EUR"
  },
  "liveMode": false
}