GET/v1/flights/offers/:gdsprovider/:offerId
API 控制台
试一试
向沙箱 API 发送真实请求并查看响应。
凭证
登录后即可从已保存的 API 密钥中选择,无需手动粘贴。
路径参数
2 个字段GDS 提供方
用于获取航班内容的全球分销系统。选择 0 使用默认提供方。
Offer ID
上一次航班搜索请求返回的报价标识符。
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 | 说明 |
|---|---|
Authorization | Bearer <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-Type | Use application/json for requests with a body. |
请求参数结构
gdsproviderofferId请求体
不需要请求体。
成功响应
返回 offerData with the selected offer, passenger ids, document requirements, hold options and flight segments when supported.
响应体结构
offerDataofferDataofferIdofferDatagdsproviderofferDataexpiresAtofferDatatotalAmountofferDataholdOptionsofferDataholdOptionsavailableofferDataholdOptionspaymentRequiredByofferDataholdOptionspriceGuarantedUntilofferDatasupportedPassengerIdDocumentsofferDatasupportedPassengerIdDocuments[]offerDatapassengerIdentityDocumentsRequiredofferDatasupportedLoyaltyProgramsofferDatasupportedLoyaltyPrograms[]offerDataairlineofferDataairlinenameofferDataairlineiataCodeofferDataairlinelogoURLofferDataairlineconditionsOfCarriageofferDatapassengersofferDatapassengers[]idPublic passenger id to reuse during booking. Mystifly public offers generate internal ids such as
mystifly_pax_1.offerDatapassengers[]typeofferDataconditionsofferDataconditionsrefundBeforeDepartureofferDataconditionsrefundBeforeDeparturecurrencyofferDataconditionsrefundBeforeDeparturepenaltyAmountofferDataconditionsrefundBeforeDepartureallowedofferDataconditionschangeBeforeDepartureofferDataconditionschangeBeforeDeparturecurrencyofferDataconditionschangeBeforeDeparturepenaltyAmountofferDataconditionschangeBeforeDepartureallowedofferDataslicesofferDataslices[]fareNameofferDataslices[]departureofferDataslices[]departureiataCodeofferDataslices[]departurecityNameofferDataslices[]departureairportNameofferDataslices[]departuredepartingAtofferDataslices[]departuretimeZoneofferDataslices[]arrivalofferDataslices[]arrivaliataCodeofferDataslices[]arrivalcityNameofferDataslices[]arrivalairportNameofferDataslices[]arrivalarrivingAtofferDataslices[]arrivaltimeZoneofferDataslices[]durationMinutesofferDataslices[]conditionsofferDataslices[]conditionspriorityCheckInofferDataslices[]conditionspriorityBoardingofferDataslices[]conditionsadvanceSeatSelectionofferDataslices[]segmentsofferDataslices[]segments[]fareNameofferDataslices[]segments[]departureofferDataslices[]segments[]departureiataCodeofferDataslices[]segments[]departurecityNameofferDataslices[]segments[]departureairportNameofferDataslices[]segments[]departuredepartingAtofferDataslices[]segments[]departuretimeZoneofferDataslices[]segments[]departureterminalofferDataslices[]segments[]arrivalofferDataslices[]segments[]arrivaliataCodeofferDataslices[]segments[]arrivalcityNameofferDataslices[]segments[]arrivalairportNameofferDataslices[]segments[]arrivalarrivingAtofferDataslices[]segments[]arrivaltimeZoneofferDataslices[]segments[]arrivalterminalofferDataslices[]segments[]airlineofferDataslices[]segments[]airlineoperatingCarrierofferDataslices[]segments[]airlineoperatingCarriernameofferDataslices[]segments[]airlineoperatingCarrieriataCodeofferDataslices[]segments[]airlineoperatingCarrierlogoURLofferDataslices[]segments[]airlineoperatingCarrierconditionsOfCarriageofferDataslices[]segments[]airlinemarketingCarrierofferDataslices[]segments[]airlinemarketingCarriernameofferDataslices[]segments[]airlinemarketingCarrieriataCodeofferDataslices[]segments[]airlinemarketingCarrierlogoURLofferDataslices[]segments[]airlinemarketingCarrierconditionsOfCarriageofferDataslices[]segments[]flightNumberofferDataslices[]segments[]durationMinutesofferDataslices[]segments[]passengersofferDataslices[]segments[]passengers[]amenitiesofferDataslices[]segments[]passengers[]amenitieswifiofferDataslices[]segments[]passengers[]amenitieswificostofferDataslices[]segments[]passengers[]amenitieswifiavailableofferDataslices[]segments[]passengers[]amenitiesseatofferDataslices[]segments[]passengers[]amenitiesseatpitchofferDataslices[]segments[]passengers[]amenitiesseatlegroomofferDataslices[]segments[]passengers[]amenitiesseattypeofferDataslices[]segments[]passengers[]amenitiespowerofferDataslices[]segments[]passengers[]baggagesofferDataslices[]segments[]passengers[]baggages[]typeofferDataslices[]segments[]passengers[]baggages[]quantityofferDataslices[]segments[]passengers[]baggages[]maxKgofferDataCO2EmissionsKgofferDataholdIdofferDataoriginalCurrencyofferDatacurrencyliveModeTrue 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[].idwhen creating the order. Do not send internal user identifiers.
示例
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"响应
| 状态码 | 说明 |
|---|---|
200 | Flight offer detail retrieved successfully. |
400 | 请求无效:payload 不合法。 |
401 | 未授权:凭证无效或缺失。 |
403 | 禁止访问:凭证无效。 |
500 | 服务器内部错误 |
200 响应体
媒体类型:application/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
}