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
}