ballerinax/amadeus.flightoffersprice Ballerina library

2.0.0

Overview

Amadeus is a global travel technology company, and its Flight Offers Price API confirms the final price and availability of flight offers returned by a flight search. The connector lets applications price flight offers and read back the confirmed fares, booking requirements and additional services.

This connector supports version 1.3.0 of the Flight Offers Price API.

Key features

  • Confirm the price and availability of one or more flight offers before booking
  • Include optional extras such as extra bags, other services and detailed fare rules in the pricing response
  • Force the use of a specific booking class when pricing
  • Authenticate with the OAuth 2.0 client credentials grant, with tokens fetched and refreshed automatically

Setup guide

To use the Amadeus Flight Offers Price connector you need an API key and an API secret for the Amadeus Flight Offers Price API.

Note: Amadeus decommissioned its Self-Service APIs portal on 17 July 2026 and disabled the API keys issued through it, including those for the https://test.api.amadeus.com test environment that the connector uses by default. The Amadeus for Developers portal now serves Amadeus Enterprise APIs only, so new credentials are available only to Amadeus Enterprise customers.

  1. Obtain access to the Flight Offers Price API through an Amadeus Enterprise agreement, using the Amadeus for Developers portal.

  2. Get the API key and API secret issued for your application, along with the API and token URLs of your environment.

  3. The connector uses the API key and API secret as the client ID and client secret of the OAuth 2.0 client credentials grant. When you create the client, pass the API URL as the serviceUrl and the token URL as auth.tokenUrl.

Quickstart

To use the amadeus.flightoffersprice connector in your Ballerina application, update the .bal file as follows:

Step 1: Import the module

Copy
import ballerina/io;
import ballerinax/amadeus.flightoffersprice;

Step 2: Instantiate a new connector

Create a Config.toml file with your credentials:

Copy
clientId = "<api-key>"
clientSecret = "<api-secret>"

Then create a flightoffersprice:Client using them:

Copy
configurable string clientId = ?;
configurable string clientSecret = ?;

final flightoffersprice:Client amadeus = check new ({auth: {clientId, clientSecret}});

Step 3: Invoke the connector operation

Confirm the price of a flight offer returned by Flight Offers Search. Save one offer from the data array of a search response as flight-offer.json, and pass it to the connector unchanged, because pricing needs the offer's original fare and traveler pricing details:

Copy
public function main() returns error? {
    flightoffersprice:FlightOffer offer = check (check io:fileReadJson("flight-offer.json")).cloneWithType();
    flightoffersprice:QuoteAirOffersResponse _ = check amadeus->quoteAirOffers({
        data: {'type: "flight-offers-pricing", flightOffers: [offer]}
    });
}

Step 4: Run the Ballerina application

Copy
bal run

Examples

The Amadeus Flight Offers Price connector provides practical examples illustrating usage in various scenarios. Explore these examples, covering the following use cases:

  1. Round trip fare quote - Confirm the price of a round-trip flight offer and print the fare per offer and traveler.

  2. Baggage cost comparison - Price one flight offer with and without extra bag options and compare the cost of checked baggage.

Import

import ballerinax/amadeus.flightoffersprice;Copy

Other versions

See more...

Metadata

Released date: 1 day ago

Version: 2.0.0

License: Apache-2.0


Security

Direct vulnerabilities: No known direct vulnerabilities

Indirect vulnerabilities: 

Checked on 2026-11-21 via OSV.dev


Compatibility

Platform: any

Ballerina version: 2201.12.0

GraalVM compatible: Yes


Pull count

Total: 129

Current verison: 1


Weekly downloads


Source repository


Keywords

Vendor/Amadeus

Area/E-Commerce

Type/Connector


Contributors