v1

latestOpenAPI 3.0.02026-07-247251950.2 KB
Flight Bookings

1. Create a checkout session (PREBOOK)

Overview

Initiate a flight booking session by reserving the offer with the provider, creating a payment intent when you use the Stripe SDK, and discovering available ancillary services — all in a single request.

When to Use

  • Start the booking flow once a user has confirmed their flight selection
  • Collect passenger details and initiate payment processing
  • Discover add-ons like seat selection and extra baggage before final confirmation

What You Get

  • Prebook ID required to complete the booking at /flights/bookings
  • Payment intent (transactionId, secretKey) when usePaymentSdk is true — for Stripe SDK integration
  • Credit line snapshot (creditLine in the response) when you set includeCreditBalance: true and your account has an enabled credit line with payment bypass
  • Available services (servicesAttachable) including seats and baggage options
  • Booking confirmation from the provider with reservation details

Key Features

  • End-to-end prebook flow: Verifies offer → payment setup (Stripe payment intent or credit line) → books with provider → fetches services
  • Payment options: usePaymentSdk: true uses the Stripe SDK. usePaymentSdk: false is allowed when your user has payment bypass and an enabled credit line (no Stripe intent; call /flights/bookings with payment.method: CREDIT)
  • Ancillary services: Returns attachable services (seats, baggage) that can be added before final booking
  • Same shape as /book: Uses offerId instead of prebookId

Quick Start

Required fields: offerId (from search/verify), contact (name, email, phone), passengers (with birthday, document, and name details).

Payment: Send usePaymentSdk: true for Stripe (typical). Send usePaymentSdk: false when paying on credit line (requires payment bypass); otherwise you receive a validation error.

Tip: Use the servicesAttachable in the response to offer seat selection or extra baggage before calling /flights/bookings.

post/flights/prebooks

Request body

offerIdstring required

The offerId from the search results (msgpack-encoded; unpacks to provider offerId)

usePaymentSdkboolean

If true, a Stripe payment intent is created (transactionId, secretKey). If false, payment bypass must apply and the account must have an enabled credit line (no Stripe intent); otherwise the request is rejected.

includeCreditBalanceboolean

Optional flag to include credit line information in the response. When set to true, credit line details will be returned if the user has a credit line available.

voucherCodestring

An optional voucher code to apply discounts to the booking. The vouchers API allows creation of these discounts

Example request

{
  "offerId": "h6NwaWTZJDAxOWQwNjZhLWNjMTktNzcyNi04ODM1LTEyMjFjNWRjN2UxNaJ0cMtAh471wo9cKaJtdctAJAAAAAAAAKNjdXKjVVNEo3VpZM0CeaJkZKoyMDI2LTA3LTAyonJkqjIwMjYtMDgtMDI=",
  "usePaymentSdk": true,
  "payment": {
    "descriptorSuffix": "FLIGHT"
  },
  "contact": {
    "email": "j.doe@example.com",
    "firstName": "John",
    "lastName": "Doe",
    "middleName": "Joshua",
    "phoneCountryCode": "33",
    "phoneNumber": "670-355-3640"
  },
  "passengers": [
    {
      "birthday": "1996-04-28",
      "documentExpiry": "2030-04-28",
      "documentIssueCountry": "US",
      "documentNumber": "123456789",
      "documentType": "passport",
      "firstName": "John",
      "gender": "M",
      "lastName": "Doe",
      "middleName": "Joshua",
      "nationality": "US",
      "loyaltyPrograms": [
        {
          "airlineCode": "BA",
          "programNumber": "BA1234567"
        }
      ]
    }
  ]
}

Response

Prebook created successfully

Example response

{
  "data": [
    {
      "booking": {
        "selectedServices": [
          {
            "serviceId": "g6Rwc2lk2SQwMTlkMDY3NC1hMzQzLTc0OGEtYmYyYS1jMDk4ZmNjMTk2ZGGhcMtAfB6PXCj1w6Fjo1VTRA==",
            "quantity": 1
          }
        ]
      }
    }
  ]
}