Booking | SetPassengers
Set passengers for an itinerary specified in the request. It’s mandatory before Commit, Sell SSR or AssignSeats.
Notice:
Product Scope : TechHub, FareMarket
POST
/flight/booking
Parameter
Field | Mandatory | Type | Scope | Description |
---|---|---|---|---|
action | required |
String | SetPassengers | |
key | required |
String | API security key applied from AeroHub | |
signature | required |
String | Refer to Guideline to generate. | |
timestamp | required |
Int | The ‘timestamp’ field should be a 10-digit Unix timestamp in seconds, used for encryption and data verification. | |
version | optional |
String | API version information, e.g. 3.0.0 | |
request | required |
Object | ||
sessionId | required |
String | SessionId,generated from AirPricing | |
timeout | optional |
Int | timeout in seconds | |
contact | required |
Object | Object for contact information | |
firstName | required |
String | FirstName,in case of middle name, format is firstName middleName. Only English is supported. | |
lastName | required |
String | LastName, Only English is supported. | |
mobile | required |
String | Mobile information, format: country number - mobile number e.g.: 65-123412341234 | |
required |
String | |||
address | optional |
String | Detail address | |
postCode | optional |
String | Post code of address | |
otherPhone | optional |
String | Other contact mobile number, if don’t collect it, please leave empty string. format: country number - mobile number e.g.: 65-123412341234 | |
countryCode | optional |
String | National code, country 2_letter code e.g. JP | |
city | optional |
String | City | |
title | optional |
String | Contact person title, e.g. Mr, Ms | |
companyName | optional |
String | Company name | |
passengers | required |
Object[] | Object for Passenger information | |
passengerId | required |
String | Passengerid, start from 0, no duplicate, e.g.: 0, 1, 2, 3, 4, 5 | |
withPassengerId | optional |
String | Refer to adult’s passengerId while ageType is 2(infant). when the user don’t collect adult and infant relationship, please leave it empty string, we will set this parameter value, and ensure that every adult only relate one infant | |
firstName | required |
String | FirstName,in case of middle name, format is firstName middleName | |
lastName | required |
String | LastName | |
ageType | required |
Int | Passenger type: 0:adult 1:child 2:infant |
|
birthday | required |
String | Birthday, format: YYYYMMDD | |
gender | required |
String | M: male ; F: female; |
|
nationality | optional |
String | Nationality, 2_letter country code | |
cardNum | optional |
String | Identity Number, maximum 15 char. | |
cardType | optional |
String | Identity Type, PP: passport ID: Identity number UN: If the value is null or anything other than PP, ID, it defaults to this value. |
|
cardExpired | optional |
String | Identity expired date, format: YYYYMMDD | |
cardIssuePlace | optional |
String | Identity issued country, country 2_letter code e.g. JP |
Request_Example:
{ "action": "SetPassengers", "key": "n93mPT7WzN6cLKC2", "signature": "YhQ2EoBQOfOnf/EOnuuuK5i+K+ncydeQhjFpoXYiEMo=", "timestamp": 1685116516, "request": { "contact": { "city": "NewYork", "companyName": "XXX", "countryCode": "US", "email": "LongMike@gmail.com", "firstName": "Long", "lastName": "Mike", "mobile": "1-123412341234", "otherPhone": "1-18888888888", "postcode": "200335", "title": "MR", "address": "Manhattan(New York county), New York, United States" }, "passengers": [ { "ageType": 0, "birthday": "19860814", "cardExpired": "20231119", "cardIssuePlace": "US", "cardNum": "479893396", "cardType": "PP", "firstName": "TNG", "gender": "F", "lastName": "WDH", "nationality": "US", "passengerId": "0" }, { "ageType": 0, "birthday": "19740625", "cardExpired": "20231119", "cardIssuePlace": "US", "cardNum": "067751203", "cardType": "PP", "firstName": "XEK", "gender": "F", "lastName": "ZPN", "nationality": "US", "passengerId": "1" } ], "sessionId": "d5fb84e9b3651688b6ec2e3cde8d3a4c", "timeout": 200 }, "version": "v2.0.3" }
Response
Field | Type | Description |
---|---|---|
status | int | 0 for success, others for failure, refer to status error appendix for details |
msg | String | Return message, maximum 64 char |
contentStatus | int | Return the original code from airlines or suppliers. |
contentMsg | String | Return the original message from airlines or suppliers, maximum 64 char |
amount | Float | Total cost for all passengers |
currency | String | Currency information, 3_letter code e.g. USD |
origionalAmount | Float | Total cost for all passengers |
origionalCurrency | String | Currency information, 3_letter code e.g. USD |
Success-Response:
{ "status": 0, "originalAmount": 59805.02, "originalCurrency": "TWD", "msg": "Success", "amount": 268516.52, "currency": "JPY", "contentStatus": 0, "contentMsg": "Success" }
Status Code
Name | Description |
---|---|
1000 | General system error |
1001 | Request parameters or part of parameters missing |
1002 | Invalid Action |
1003 | API request timeout, please request again |
1004 | Invalid request parameter |
1005 | Service system error |
1006 | System busy, please try again |
1101 | Authentication fail, wrong signature |
1102 | Account disabled, please contact with account administrator |
2007 | Invalid passenger type |
2008 | Passengers already set, can not set passengers again |
2009 | PassengerID does not exist |
2014 | Children’s number should less than adult’s number, and only child is not allowed |
Error-Response
{ "status": 1000, "msg": "Letslfy flight internal error" }
Author:AeroHub Create time:2023-05-24 16:05
Last editor:AeroHub Update time:2025-04-22 14:25
Last editor:AeroHub Update time:2025-04-22 14:25