php - 无法使用 Amadeus live API 凭证的“Flight Create Orders”创建预订
问题描述
我想使用具有实时凭据的 Amadeus API 的“Flight Create Orders”创建预订和生成 PNR。但是我已经使用带有测试凭据和相同请求 json 的 Amadeus API 的“Flight Create Orders”成功生成了 PNR。下面给出了我的测试 API URL
https://test.api.amadeus.com/v1/booking/flight-orders
我已使用波纹管 API 创建预订并生成 PNR
https://developers.amadeus.com/self-service/category/air/api-doc/flight-create-orders/api-reference
我用于创建预订 API URL 的波纹管 API URL
https://api.amadeus.com/v1/booking/flight-orders
我的请求 json 创建预订
{
"data": {
"type": "flight-order",
"flightOffers": [
{
"type": "flight-offer",
"id": "3",
"source": "GDS",
"instantTicketingRequired": false,
"nonHomogeneous": false,
"paymentCardRequired": false,
"lastTicketingDate": "2021-08-12",
"itineraries": [
{
"segments": [
{
"departure": {
"iataCode": "DUB",
"terminal": "1",
"at": "2021-08-12T05:55:00"
},
"arrival": {
"iataCode": "FRA",
"terminal": "1",
"at": "2021-08-12T08:50:00"
},
"carrierCode": "LH",
"number": "983",
"aircraft": {
"code": "32N"
},
"operating": {
"carrierCode": "LH"
},
"duration": "PT1H55M",
"id": "40",
"numberOfStops": 0
},
{
"departure": {
"iataCode": "FRA",
"terminal": "2",
"at": "2021-08-12T13:00:00"
},
"arrival": {
"iataCode": "DEL",
"terminal": "3",
"at": "2021-08-13T00:15:00"
},
"carrierCode": "UK",
"number": "26",
"aircraft": {
"code": "789"
},
"operating": {
"carrierCode": "UK"
},
"duration": "PT7H45M",
"id": "41",
"numberOfStops": 0
},
{
"departure": {
"iataCode": "DEL",
"terminal": "3",
"at": "2021-08-13T17:30:00"
},
"arrival": {
"iataCode": "CCU",
"at": "2021-08-13T19:35:00"
},
"carrierCode": "UK",
"number": "707",
"aircraft": {
"code": "320"
},
"operating": {
"carrierCode": "UK"
},
"duration": "PT2H5M",
"id": "42",
"numberOfStops": 0
}
],
"duration": "PT33H10M"
}
],
"price": {
"currency": "USD",
"total": "459.74",
"base": "418.00",
"fees": [
{
"amount": "0.00",
"type": "SUPPLIER"
},
{
"amount": "0.00",
"type": "TICKETING"
},
{
"amount": "0.00",
"type": "FORM_OF_PAYMENT"
}
],
"grandTotal": "459.74",
"billingCurrency": "USD"
},
"pricingOptions": {
"fareType": [
"PUBLISHED"
],
"includedCheckedBagsOnly": true
},
"validatingAirlineCodes": [
"UK"
],
"travelerPricings": [
{
"travelerId": "1",
"fareOption": "STANDARD",
"travelerType": "ADULT",
"price": {
"currency": "USD",
"total": "459.74",
"base": "418.00",
"taxes": [
{
"amount": "3.50",
"code": "YR"
},
{
"amount": "12.32",
"code": "UP"
},
{
"amount": "25.92",
"code": "RA"
}
],
"refundableTaxes": "230.74"
},
"fareDetailsBySegment": [
{
"segmentId": "40",
"cabin": "ECONOMY",
"fareBasis": "VOXEU9YV",
"brandedFare": "ECOYV",
"class": "K",
"includedCheckedBags": {
"quantity": 2
}
},
{
"segmentId": "41",
"cabin": "ECONOMY",
"fareBasis": "VOXEU9YV",
"brandedFare": "ECOYV",
"class": "V",
"includedCheckedBags": {
"quantity": 2
}
},
{
"segmentId": "42",
"cabin": "ECONOMY",
"fareBasis": "VOXEU9YV",
"brandedFare": "ECOYV",
"class": "V",
"includedCheckedBags": {
"quantity": 2
}
}
]
}
]
}
],
"travelers": [
{
"id": 1,
"dateOfBirth": "**********",
"name": {
"firstName": "**********",
"lastName": "**********"
},
"gender": "FEMALE",
"documents": [
{
"documentType": "PASSPORT",
"birthPlace": "**********",
"issuanceLocation": "**********",
"issuanceDate": "**********",
"number": "**********",
"expiryDate": "**********",
"issuanceCountry": "IN",
"validityCountry": "IN",
"nationality": "IN",
"holder": "true"
}
]
}
],
"contacts": [
{
"addresseeName": {
"firstName": "**********",
"lastName": "**********"
},
"purpose": "STANDARD",
"emailAddress": "**********",
"phones": [
{
"deviceType": "MOBILE",
"countryCallingCode": "**",
"number": "**********"
}
],
"address": {
"lines": [
"**********"
],
"postalCode": "**********",
"cityName": "**********",
"countryCode": "**********"
}
}
],
"remarks": {
"general": [
{
"subType": "GENERAL_MISCELLANEOUS",
"text": "ONLINE BOOKING FROM INCREIBLE VIAJES"
}
]
},
"ticketingAgreement": {
"option": "DELAY_TO_CANCEL",
"delay": "6D"
}
}
}
我收到了 API 的回复
stdClass Object
(
[errors] => Array
(
[0] => stdClass Object
(
[status] => 500
[code] => 141
[title] => SYSTEM ERROR HAS OCCURRED
[detail] => Unknown error occurred while processing the message
)
)
)
请指导我如何使用 amadeus API 的“Flight Create Orders”解决问题并生成 PNR
谢谢
解决方案
推荐阅读
- java - Spring Integration FtpOutboundGateway setLocalDirectory 与系统属性和#remoteDirectory
- css - 媒体查询未根据屏幕尺寸检测给定范围
- android - 如果您单击主页按钮并返回应用程序,应用程序会显示白屏
- java - E/RecyclerView:没有附加适配器;跳过布局未在 recyclerview 中显示数据
- ios - Azure AD B2C 刷新令牌/ID 令牌 iOS Swift 4
- c++11 - 为什么我的可变参数模板参数验证器拒绝在编译时进行评估?
- asp.net - 将新数据插入 XML 文件中的指定节点
- c++ - 读取 UTF-8 文件解析字符
- ios - 如何使用 MDCCardCollectionCell?【材质组件iOS】
- sql - 在sql中使用回滚查询删除命令