GitPedia

Uapi json

Best Travelport Universal API wrapper ever :airplane: :mountain_railway: :hotel:

From Travelport-Ukraine·Updated April 15, 2026·View on GitHub·

Best Travelport Universal API wrapper ever :airplane: :mountain_railway: :hotel: The project is written primarily in JavaScript, distributed under the MIT License license, first published in 2016. Key topics include: airplane, hotel, json, travelport, uapi.

Latest release: 1.19.0
April 15, 2026View Changelog →

Description

Build Status
Coverage
NPM
Tag

Best Travelport Universal API wrapper ever :airplane: :mountain_railway: :hotel:

Wrapper for Travelport Universal API.
Read official docs for more information.

Travelport Universal API offers an array of travel content for air, hotel, car, and rail, including ancillaries (optional services). It also provides functionality to build complete traveler, agency, branch, and account profiles.

This package provides JSON/Promises interface for SOAP calls. Requires uAPI credentials to run.

Contents

Installation

<a name="installation"></a>

Install package with npm install --save uapi-json.

Basic usage

<a name="usage"></a>

This package exports an object with three service constructors.

javascript
const uAPI = require('uapi-json'); const AirService = uAPI.createAirService(settings); const HotelService = uAPI.createHotelService(settings); const UtilsService = uAPI.createUtilsService(settings); const TerminalService = uAPI.createTerminalService(settings);

It also exports a set of error classes that help to check errors against them

javascript
const uAPI = require('uapi-json'); const settings = { auth: {username: 'USERNAME', password: 'PASSWORD', region: 'REGION'}}; const AirService = uAPI.createAirService(settings); AirService.importPNR().catch((err) => { if (err instanceof uAPI.errors.Common.ValidationError) { console.log('Validation error occured'); } if (err instanceof uAPI.errors.Request.RequestValidationError) { console.log('Validation error occured in request'); } if (err instanceof uAPI.errors.Request.RequestValidationError.ParamsMissing) { console.log('Params are missing for request'); } });

As the node-errors-helpers library used for error generating,
we strongly recommend you to take a look at it.
It also has several useful helpers to handle errors.

Settings

<a name="settings"></a>

uAPI

Settings object

ParamTypeDefaultDescription
authObject <username, password, targetBranch, emulatePcc, region, provider>-See auth description below.
debugNumber0Can be 0, 1, or 2.
productionBooleantrueProduction variable is connected with production and pre-production environment. Can be true for production and false for pre-production. For more information read docs.
timeoutNumber-Optional. Used for TerminalService only. See TerminalService
autoCloseBooleanOptional. Used only in TerminalService. Defines if service should make closeSession request.
optionsObject{}Optional. User for all services to all additional options like custom log function, etc. See options description bellow.

Additional options

<a name="options"></a>

logFunction - set custom logging function that should match next shape (...args) => {}. Will receive all requests and responses from uapi/terminal.

httpsAgent - set custom HTTPS agent for all requests created by the service. If the agent has options.timeout, that value is used as the request timeout.

javascript
const https = require('https'); const TerminalService = uAPI.createTerminalService({ auth, options: { httpsAgent: new https.Agent({ keepAlive: true, maxSockets: 1, maxFreeSockets: 1, timeout: 90000, }), }, });

Auth object

<a name="auth"></a>

ParamTypeDefaultDescription
 usernameString-User name identifier, provided by Travelport.
passwordString-Password for current username, provided by Travelport.
targetBranchString-Branch, provided by Travelport.
regionStringemeaOptional. Used to select region.
emulatePccString/BooleanFalseOptional. A PCC on behalf of which transactions are executed in Air, Hotels, Utils. This PCC needs to have set SVCB field in the AAT profile. Define a PCC if you have a service bureau and want to execute transactions on behalf of some of its PCCs. Follow this documentation to take a detailew view of the emulatePcc for the Terminal.
providerString1GOptional. Obtains data directly from specific provider. Be aware, the default provider is 1G, we never tested any other providers, use this option at your own risk.

There are 3 types of debug mode:

  • debug=0 - disabled any logs.
  • debug=1 - logging only request params, request xml and error if it's occurred.
  • debug=2 - same as 1 but also logging all response xml (due to lot of text to log).
  • debug=3 - logs everything.

Services

<a name="services"></a>
See the following services pages to take a detailed view

Contributing

Please visit CONTRIBUTING.md

Contributors

Showing top 12 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from Travelport-Ukraine/uapi-json via the GitHub API.Last fetched: 6/22/2026