在Get Flightoffers API中以Travelerclass的身份看到其他不同的机舱价值是正确的吗?

发布于 2025-02-09 12:51:53 字数 3473 浏览 2 评论 0原文

从飞行的获取路线的文档提供API,我可以添加TravelerClass作为滤波器来提出请求。如果我添加travelerclass经济? 我希望只看到经济的报价。但是,我看到在faredetailsbySeagement result 中,我看到某些报价具有其abacy值,而不是ancaign>经济< /代码>。我看到一些具有业务的价值,而另一些则为premium_economy。 这合适吗?

我的关注

  • 我希望能够获得所有仅基于经济的预订。因此,我需要确保首先返回的航班要受到travelerclass的限制。

我将感谢有关此问题的任何清晰度。另外,如果有更好的方法可以解决以上问题,这将是最大的赞赏。

我的请求的一个例子如下:

Amadeus.shopping.flightOffersSearch.get({
originLocationCode:      'SYD',
destinationLocationCode: 'BKK',
departureDate:           '2022-11-01',
adults:                  '1',
travelClass:             'ECONOMY'
}).then(...)

提供业务而不是经济

{
  "type": "flight-offer",
  "id": "22",
  "source": "GDS",
  "instantTicketingRequired": false,
  "nonHomogeneous": false,
  "oneWay": false,
  "lastTicketingDate": "2022-11-01",
  "numberOfBookableSeats": 6,
  "itineraries": [
    {
      "duration": "PT28H20M",
      "segments": [
        {
          "departure": {
            "iataCode": "SYD",
            "terminal": "1",
            "at": "2022-11-01T12:00:00"
          },
          "arrival": {
            "iataCode": "PVG",
            "terminal": "2",
            "at": "2022-11-01T19:30:00"
          },
          "carrierCode": "MU",
          "number": "562",
          "aircraft": {
            "code": "77W"
          },
          "operating": {
            "carrierCode": "MU"
          },
          "duration": "PT10H30M",
          "id": "13",
          "numberOfStops": 0,
          "blacklistedInEU": false
        },
        {
          "departure": {
            "iataCode": "PVG",
            "terminal": "1",
            "at": "2022-11-02T08:45:00"
          },
          "arrival": {
            "iataCode": "BKK",
            "at": "2022-11-02T12:20:00"
          },
          "carrierCode": "MU",
          "number": "541",
          "aircraft": {
            "code": "320"
          },
          "operating": {
            "carrierCode": "MU"
          },
          "duration": "PT4H35M",
          "id": "14",
          "numberOfStops": 0,
          "blacklistedInEU": false
        }
      ]
    }
  ],
  "price": {
    "currency": "EUR",
    "total": "4048.84",
    "base": "3858.00",
    "fees": [
      {
        "amount": "0.00",
        "type": "SUPPLIER"
      },
      {
        "amount": "0.00",
        "type": "TICKETING"
      }
    ],
    "grandTotal": "4048.84"
  },
  "pricingOptions": {
    "fareType": [
      "PUBLISHED"
    ],
    "includedCheckedBagsOnly": true
  },
  "validatingAirlineCodes": [
    "MU"
  ],
  "travelerPricings": [
    {
      "travelerId": "1",
      "fareOption": "STANDARD",
      "travelerType": "ADULT",
      "price": {
        "currency": "EUR",
        "total": "4048.84",
        "base": "3858.00"
      },
      "fareDetailsBySegment": [
        {
          "segmentId": "13",
          "cabin": "ECONOMY",
          "fareBasis": "YSE0WDNQ",
          "class": "Y",
          "includedCheckedBags": {
            "quantity": 2
          }
        },
        {
          "segmentId": "14",
          "cabin": "BUSINESS",
          "fareBasis": "QSE0WCNL",
          "class": "Q",
          "includedCheckedBags": {
            "quantity": 2
          }
        }
      ]
    }
  ]
}

From the documentation of the Get Route for the flight offers Api, I can add travelerClass as a filter to make a request. If I add say travelerClass as ECONOMY?
I expect to see only offers with ECONOMY. However I see that within the fareDetailsBySegment section in the result, I see that some Offers have their cabin values as other than ECONOMY. I see some with value of BUSINESS while others as PREMIUM_ECONOMY.
Is this proper?

My Concern

  • I want to be able to get all bookings that where ECONOMY based only. So I need to be sure that the flight offers returned in the first place are strictly limited by the travelerClass.

I will appreciate any clarity on the this issue. Also if there is a better way to go about this concern above, it will be most appreciated.

An example of my request is below:

Amadeus.shopping.flightOffersSearch.get({
originLocationCode:      'SYD',
destinationLocationCode: 'BKK',
departureDate:           '2022-11-01',
adults:                  '1',
travelClass:             'ECONOMY'
}).then(...)

Offer with BUSINESS instead of ECONOMY

{
  "type": "flight-offer",
  "id": "22",
  "source": "GDS",
  "instantTicketingRequired": false,
  "nonHomogeneous": false,
  "oneWay": false,
  "lastTicketingDate": "2022-11-01",
  "numberOfBookableSeats": 6,
  "itineraries": [
    {
      "duration": "PT28H20M",
      "segments": [
        {
          "departure": {
            "iataCode": "SYD",
            "terminal": "1",
            "at": "2022-11-01T12:00:00"
          },
          "arrival": {
            "iataCode": "PVG",
            "terminal": "2",
            "at": "2022-11-01T19:30:00"
          },
          "carrierCode": "MU",
          "number": "562",
          "aircraft": {
            "code": "77W"
          },
          "operating": {
            "carrierCode": "MU"
          },
          "duration": "PT10H30M",
          "id": "13",
          "numberOfStops": 0,
          "blacklistedInEU": false
        },
        {
          "departure": {
            "iataCode": "PVG",
            "terminal": "1",
            "at": "2022-11-02T08:45:00"
          },
          "arrival": {
            "iataCode": "BKK",
            "at": "2022-11-02T12:20:00"
          },
          "carrierCode": "MU",
          "number": "541",
          "aircraft": {
            "code": "320"
          },
          "operating": {
            "carrierCode": "MU"
          },
          "duration": "PT4H35M",
          "id": "14",
          "numberOfStops": 0,
          "blacklistedInEU": false
        }
      ]
    }
  ],
  "price": {
    "currency": "EUR",
    "total": "4048.84",
    "base": "3858.00",
    "fees": [
      {
        "amount": "0.00",
        "type": "SUPPLIER"
      },
      {
        "amount": "0.00",
        "type": "TICKETING"
      }
    ],
    "grandTotal": "4048.84"
  },
  "pricingOptions": {
    "fareType": [
      "PUBLISHED"
    ],
    "includedCheckedBagsOnly": true
  },
  "validatingAirlineCodes": [
    "MU"
  ],
  "travelerPricings": [
    {
      "travelerId": "1",
      "fareOption": "STANDARD",
      "travelerType": "ADULT",
      "price": {
        "currency": "EUR",
        "total": "4048.84",
        "base": "3858.00"
      },
      "fareDetailsBySegment": [
        {
          "segmentId": "13",
          "cabin": "ECONOMY",
          "fareBasis": "YSE0WDNQ",
          "class": "Y",
          "includedCheckedBags": {
            "quantity": 2
          }
        },
        {
          "segmentId": "14",
          "cabin": "BUSINESS",
          "fareBasis": "QSE0WCNL",
          "class": "Q",
          "includedCheckedBags": {
            "quantity": 2
          }
        }
      ]
    }
  ]
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

时光无声 2025-02-16 12:51:53

为了将过滤器应用于机舱类,我建议您尝试使用post方法。

post方法中,您可以应用更多的搜索标准,以下是我尝试过的示例,它可以使用:响应仅包含经济类,通过在abacyrestrictions下更新值

请求模型的详细信息可在 API参考页

 amadeus.shopping.flightOffersSearch.post(JSON.stringify({
  "currencyCode": "USD",
  "originDestinations": [
    {
      "id": "1",
      "originLocationCode": "SYD",
      "destinationLocationCode": "BKK",
      "departureDateTimeRange": {
        "date": "2022-11-01"
      }
    }
  ],
  "travelers": [
    {
      "id": "1",
      "travelerType": "ADULT"
    }
  ],
  "sources": [
    "GDS"
  ],
  "searchCriteria": {
    "maxFlightOffers": 10,
    "flightFilters": {
      "cabinRestrictions": [
        {
          "cabin": "ECONOMY",
          "coverage": "ALL_SEGMENTS",
          "originDestinationIds": [
            1
          ]
        }
      ]
    }
  }
})).then(...)

in order to apply the filter for cabin class, I suggest you to try with POST method.

in POST method has more search criteria you can apply, below example is something that I have tried and it works: response only contains ECONOMY classes by updating values under cabinRestrictions.

details of the request model is available in API reference page

 amadeus.shopping.flightOffersSearch.post(JSON.stringify({
  "currencyCode": "USD",
  "originDestinations": [
    {
      "id": "1",
      "originLocationCode": "SYD",
      "destinationLocationCode": "BKK",
      "departureDateTimeRange": {
        "date": "2022-11-01"
      }
    }
  ],
  "travelers": [
    {
      "id": "1",
      "travelerType": "ADULT"
    }
  ],
  "sources": [
    "GDS"
  ],
  "searchCriteria": {
    "maxFlightOffers": 10,
    "flightFilters": {
      "cabinRestrictions": [
        {
          "cabin": "ECONOMY",
          "coverage": "ALL_SEGMENTS",
          "originDestinationIds": [
            1
          ]
        }
      ]
    }
  }
})).then(...)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文