The Air workflow allows you to do what most travel agents did in the past and what many search engines still do today: book a trip for a customer. Air service provides:
- Air Shop: Search for flight options by lowest fare (LowFareSearch(Asynch)Req) or availability (AirAvailability).
- Air Price: Price the selected flights and request additional information about rules, flight details, and seating.
- Air Book: Book the flights when you are satisfied with the times, price, and rules.
AirService
- .shop(params)
- .availability(params) (same params as
.shop(params)) - .book(params)
- .ticket(params)
- .toQueue(params)
- .getPNR(params)
- .importPNR(params)
- .getUniversalRecordByPNR(params)
- .getUniversalRecord(params)
- .flightInfo(params)
- .getPNRByTicketNumber(params)
- .searchBookingsByPassengerName(params)
- .getTicket(params)
- .getTickets(params)
- .cancelTicket(params)
- .cancelPNR(params)
Low Fare Shop functionality combines air availability and a fare quote request to return the lowest available fares for a specified itinerary, using origin/destination and date information. Fares are available for one-way, round-trip, and multi-city travel. Low Fare Shop does not require a booked itinerary to return fare data.
Returns: Promise
See: Low Fare Shopping Model
| Param | Type | Description |
|---|---|---|
| legs | Array<Leg> |
See Leg description below. |
| passengers | Search Passengers |
See Search Passengers description below. |
| pricing | Pricing |
See Pricing modifiers description below. Optional. |
| cabins | Array<Cabin> |
See Cabins array description below. |
| requestId | string |
Trace id of this request. Optional. |
| maxJourneyTime | number |
Maximum travel time in hours 0-99. Total for all legs Optional. |
| maxSolutions | number |
Maximum number of solutionsOptional. |
| carriers | Array<String> |
Array of carriers' codes. Optional. |
| preferredConnectionPoints | Array<String> |
Array of IATA codes. Optional. |
| prohibitedConnectionPoints | Array<String> |
Array of IATA codes. Optional. |
| permittedConnectionPoints | Array<String> |
Array of IATA codes. Optional. |
| Param | Type | Description |
|---|---|---|
| currency | String |
Currency to convert results prices. |
| eTicketability | Boolean |
Detect if pricing solution will be ticketable as e-ticket. |
Each leg represents one part of the journey. For example, a typical roundtrip IEV-PAR-IEV should have two legs: IEV-PAR and PAR-IEV. An open-jaw route would still consist of two legs, e.g. IEV-PAR, AMS-IEV. For a more complicated route, more than two legs can be requested.
| Param | Type | Description |
|---|---|---|
| from | String |
IATA code. |
| to | String |
IATA code. |
| departureDate | String |
Date in format YYYY-MM-DD. |
| Param | Type | Description |
|---|---|---|
| ADT | Number |
Adults count. |
| INF | Number |
Infants count ( < 2 years ) . |
| CNN | Number |
Children count ( < 12 years ). |
| Other types | Number |
Other IATA Passenger Type Codes available (see uAPI documentation). |
The cabins array lists requested cabin types, currently Economy or Business or both.
See: Shop example
After searching for air segments and fares, air bookings are created using the results from an Air Pricing response. Book is aggregated function which do AirPrice request before making booking request. So you don't need to make AirPrice request manually.
Returns: Promise
See: Create Air Booking
| Param | Type | Description |
|---|---|---|
| segments | Array<Segment> |
See Segment description below. |
| passengers | Book Passengers |
See Book Passengers description below. |
| phone | Phone |
Booking agency/traveller phone. See Phone description below. |
| rule | String |
Custom check rule. |
| allowWaitlist | Boolean |
Allow open waitlisted segments, do not cancel booking. See allowWaitlist description below. |
| deliveryInformation | Delivery Information |
Optional. See Delivery Information description below. |
| tau | String/Date/Array<Number> |
Optional. Takes See TAU description below. The default value is 3 hours from the current timestamp. |
| platingCarrier | String |
Optional. PlatingCarrier. |
Each search response has Directions array which represents different variations of the same trip (with same price), but with the different flight options. Each index of Directions array represents leg index. For example if you have IEV-PAR-IEV roundtrip search request it will have IEV-PAR, PAR-IEV legs. And Directions array will have length 2. Under Directions[0] and Directions[1] will be different options for the flight.
So under Directions[0][1] you will find Segments array. This segments are used for booking.
Please specify transfer field to mark connection segment.
Segment object sample.
{
"from": "KBP",
"to": "AMS",
"bookingClass": "G",
"departure": "2016-11-10T19:40:00.000+02:00",
"arrival": "2016-11-10T21:45:00.000+01:00",
"airline": "KL",
"flightNumber": "3098",
"serviceClass": "Economy",
"plane": "E90",
"fareBasisCode": "GSRUA",
"group": 0
}| Param | Type | Description |
|---|---|---|
| lastName | String |
Passenger last name. |
| firstName | String |
Passenger first name. |
| birthDate | String |
Birth date in format YYYY-MM-DD. |
| gender | String |
One of ['M', 'F']. |
| ageCategory | String |
One of ['ADT', 'CNN', 'INF']. Or other types |
| passNumber | String |
Pass number. |
| passCountry | String |
2-letter code of country. |
| Param | Type | Description |
|---|---|---|
| location | String |
City code of the phone number origin. |
| countryCode | String |
Country code, prepending telephone number. |
| number | String |
Phone number. |
Default behavior is to cancel the entire Universal Record when part of the booking has failed.
This includes both open and closed waitlisting and other errors.
With allowWaitlist=true the UR is canceled only for a closed wait list, but open waitlist reservation is kept and returned to user.
| Param | Type | Description |
|---|---|---|
| name | String |
First and last name of the delivery recipient |
| street | String |
Street address |
| zip | String |
Postal code |
| country | String |
Country |
| city | String |
City |
Ticketing Arrangement is an optional param used for domestic purposes of agents to specify assumed date/time of booking.
The default value is 3 hours from the current timestamp.
The tau option represents an ISO 8601 format, Date object or Array of numbers.
To see the list of all available formats, please use the following documentation.
See: Book example
This library is designed to do getPNR right after ticketing is finished with success.
Ticketing is typically included as a follow-on request to an Air Booking response.
Any number of tickets can be issued from one Stored Fare Quote when a booking has multiple passengers. Tickets can also be issued when there is more than one Stored Fare Quote in the PNR.
Ticketing function returns true if the process is finished with success or Error.
Returns: Promise(true | Error).
See: Air Ticketing
| Param | Type | Description |
|---|---|---|
| commission | Object{amount|percent} |
If amount is passed than it should be provided with currency. Ex: { comission: { amount: 'UAH10' }}. If percent - it should be string with float number |
| fop | Form Of Payment |
See Form Of Payment description below. |
| pnr | String |
1G PNR. |
Warning: Currently only Cash FOP is supported.
| Param | Type | Description |
|---|---|---|
| type | String |
Form of payment type. See docs |
See: Ticketing example
The Queue Place functionality adds a specific booking (PNR) to a queue in the provider system for a specific Pseudo City Code. If a Universal Record (UR) does not exist for the PNR, it is placed in the queue anyway, but PNR Import is not completed for the UR database.
Returns: Promise(true | Error).
See: Queue managment
| Param | Type | Description |
|---|---|---|
| pcc | String |
PCC to place booking. |
| queue | String |
Queue number to place booking. |
| pnr | String |
1G PNR. |
See: Queue example
May require Terminal access enabled in uAPI. See TerminalService
This method returns an array of all PNR objects, which are contained in Universal record, holding the PNR provided. If Universal record does not exists it is being created and PNR is imported into created Universal record.
If the PNR contains no active segments it could not be imported into uAPI. Thus library tries to add OPEN segment to he PNR, using TerminalService, importing PNR and then removing created segment.
Returns: Promise. - All Information for requested PNR.
See: Importing PNR
| Param | Type | Description |
|---|---|---|
| pnr | String |
1G PNR. |
See: Example
This method returns an array of all PNR objects, which are contained in Universal record, holding the PNR provided. If Universal record does not exists RuntimeError.AirRuntimeError "Record locator not found" will be raised.
Returns: Promise. - All Information for requested Universal Record.
See: Retrieving a Universal Record with a Known Locator
| Param | Type | Description |
|---|---|---|
| universalRecordLocatorCode | String |
uAPI Record Locator Code |
See: Example
May require Terminal access enabled in uAPI. See TerminalService
This method executes getUniversalRecordByPNR and then returns single PNR object from its output.
Returns: Promise. - All Information for requested PNR.
See: Importing PNR
| Param | Type | Description |
|---|---|---|
| pnr | String |
1G PNR. |
See: getPNR example
May require Terminal access enabled in uAPI. See TerminalService
This method will be DEPRECATED in version 1.0.0, USE getPNR instead
This method executes getUniversalRecordByPNR and then returns an array, containing single PNR object.
Returns: Promise. - All Information for requested PNR.
See: Importing PNR
| Param | Type | Description |
|---|---|---|
| pnr | String |
1G PNR. |
See: Import example
Request for the flight information.
Returns: Promise
See: Flight Information
| Param | Type | Description |
|---|---|---|
| airline | string |
The marketing carrier for the segment. |
| departure | string |
The departure date; either the current date or a date in the future, not include the time zone which is derived from the origin location. |
| flightNumber | string |
The flight number for the segment |
See: FlightInfo basic example, FlightInfo multiple items example
Requires Terminal access enabled in uAPI. See TerminalService
Request for the ticket information.
Returns: Promise, which is fullfilled with PNR as String
This function executes terminal command to get PNR from *TE command response.
| Param | Type | Description |
|---|---|---|
| ticketNumber | String |
The number of the ticket. |
See: getPNRByTicketNumber example
May require Terminal access enabled in uAPI. See TerminalService
Request for the ticket information.
Returns: Promise
See: Ticket Information
| Param | Type | Description |
|---|---|---|
| ticketNumber | String |
The number of the ticket. |
See: getTicket example
May require Terminal access enabled in uAPI. See TerminalService
Request for the ticket information for all tickets in PNR.
Returns: Promise
See: Ticket Information
| Param | Type | Description |
|---|---|---|
| reservationLocatorCode | String |
uAPI reservation code. |
See: getTickets example
Requires Terminal access enabled in uAPI. See TerminalService
Searches for PNRs in PCC, that match provided searchPhrase. Returns single PNR or a list.
Returns: Promise with next shape { type: 'list' | 'pnr', data: Array | String }
This function executes terminal command to get passengers list from *-NAME command response.
| Param | Type | Description |
|---|---|---|
| searchPhrase | String |
Last name to look for. |
While function returns object with type list it means that Array is returned.
Example of list response:
{
type: 'list',
data: [
{ id: 1, firstName: 'John', lastName: 'Kovalski', pnr: 'PNR001', date, isCancelled },
{ id: 2, firstName: 'Inna', lastName: 'Kovalchuk', pnr: 'PNR002', date, isCancelled },
]
}
When type equals pnr than data field contains pnr string.
See: getPNRByTicketNumber example
May require Terminal access enabled in uAPI. See TerminalService
Gets ticket information with getTicket and then tries to cancel it.
Returns: Promise which is resolved with true
| Param | Type | Description |
|---|---|---|
| ticketNumber | String |
Ticket number. |
See: cancelTicket example
May require Terminal access enabled in uAPI. See TerminalService
Gets pnr information and tickets list from importPNR and then do one of following actions:
- if PNR has tickets and all of them have status
VOID,REFUNDor both of them, then tries to cancel PNR - if PNR has tickets and no
cancelTicketsflag is set, error is returned - if PNR has tickets and
cancelTicketsflag set totrue, checks tickets- if PNR has only tickets with
VOIDorOPENcoupons, then tickets are cancelled, then the booking is cancelled - if PNR contains tickets with coupons having other statuses, then error is returned
- if PNR has only tickets with
- if
ignoreTicketsflag set totrue, all tickets in PNR will be ignored, regardless of their status andcancelTicketsflag
Returns: Promise which is resolved with true
| Param | Type | Description |
|---|---|---|
| pnr | String |
PNR |
| cancelTickets | Boolean |
Defines if tickets should be cancelled or not |
| ignoreTickets | Boolean |
Defines if tickets should be ignored. The default value is false |
See: cancelPNR example