post_flights_prebooks
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/bookingsPayment intent (
transactionId,secretKey) whenusePaymentSdkis true — for Stripe SDK integrationCredit line snapshot (
creditLinein the response) when you setincludeCreditBalance: trueand your account has an enabled credit line with payment bypassAvailable services (
servicesAttachable) including seats and baggage optionsBooking 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: trueuses the Stripe SDK.usePaymentSdk: falseis allowed when your user has payment bypass (sandbox or whitelabel) and either an enabled credit line or a whitelabel/CMI checkout (no Stripe intent; complete payment via WL and call/flights/bookingswithpayment.method: THIRD_PARTYandpayment.token)Ancillary services: Returns attachable services (seats, baggage) that can be added before final booking
Same shape as /book: Uses
offerIdinstead ofprebookId
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 or via whitelabel/CMI (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.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| contact | Yes | Primary contact person for the booking (receives confirmation emails) | |
| offerId | Yes | The offerId from the search results (msgpack-encoded; unpacks to provider offerId) | |
| payment | No | Payment configuration options | |
| passengers | Yes | List of passengers travelling. Length must match the adults+children+infants counts from the search. | |
| voucherCode | No | An optional voucher code to apply discounts to the booking. The vouchers API allows creation of these discounts | |
| travelPurpose | No | Optional purpose of the trip. | |
| usePaymentSdk | No | If true, a Stripe payment intent is created (`transactionId`, `secretKey`). If false, payment bypass must apply and the account must use credit line or whitelabel/CMI checkout (no Stripe intent); otherwise the request is rejected. | |
| includeCreditBalance | No | 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. |