// Generated by dts-bundle v0.7.3 // Dependencies for this module: // ../node-fetch declare module '@duffel/api' { import { PaymentIntents } from '@duffel/api/DuffelPayments'; import { BatchOfferRequests, OfferRequests, Offers, OrderCancellations, Orders, OrderChangeRequests, OrderChangeOffers, OrderChanges, Payments, PartialOfferRequests, SeatMaps, AirlineInitiatedChanges } from '@duffel/api/booking'; import { Config, DuffelError as _DuffelError } from '@duffel/api/Client'; import { Aircraft, Airlines, Airports } from '@duffel/api/supportingResources'; import { Suggestions } from '@duffel/api/Places/Suggestions'; import { Refunds } from '@duffel/api/DuffelPayments/Refunds'; import { Sessions } from '@duffel/api/Links'; import { Webhooks } from '@duffel/api/notifications'; import { Stays } from '@duffel/api/Stays/Stays'; import { Cars } from '@duffel/api/Cars/Cars'; import { Cards } from '@duffel/api/Payments/Cards'; import { ThreeDSecureSessions } from '@duffel/api/Payments/ThreeDSecureSessions'; import { Identity } from '@duffel/api/Identity/Identity'; import { hasService as hasServiceImport } from '@duffel/api/functions/hasService'; import { hasAvailableSeatService as hasAvailableSeatServiceImport } from '@duffel/api/functions/hasAvailableSeatService'; export interface DuffelAPIClient { aircraft: Aircraft; airlines: Airlines; airports: Airports; batchOfferRequests: BatchOfferRequests; offers: Offers; offerRequests: OfferRequests; orders: Orders; orderChangeRequests: OrderChangeRequests; orderChangeOffers: OrderChangeOffers; orderChanges: OrderChanges; orderCancellations: OrderCancellations; payments: Payments; seatMaps: SeatMaps; threeDSecureSessions: ThreeDSecureSessions; } export class Duffel { aircraft: Aircraft; airlineInitiatedChanges: AirlineInitiatedChanges; airlines: Airlines; airports: Airports; links: Sessions; batchOfferRequests: BatchOfferRequests; offerRequests: OfferRequests; offers: Offers; orders: Orders; orderChangeRequests: OrderChangeRequests; orderChangeOffers: OrderChangeOffers; orderChanges: OrderChanges; orderCancellations: OrderCancellations; payments: Payments; seatMaps: SeatMaps; paymentIntents: PaymentIntents; partialOfferRequests: PartialOfferRequests; suggestions: Suggestions; refunds: Refunds; webhooks: Webhooks; stays: Stays; cars: Cars; three_d_secure_sessions: ThreeDSecureSessions; identity: Identity; cards: Cards; constructor(config: Config); } export const DuffelError: typeof _DuffelError; export const hasService: typeof hasServiceImport; export const hasAvailableSeatService: typeof hasAvailableSeatServiceImport; } declare module '@duffel/api/DuffelPayments' { export * from '@duffel/api/DuffelPayments/PaymentIntents'; } declare module '@duffel/api/booking' { export * from '@duffel/api/booking/AirlineInitiatedChanges'; export * from '@duffel/api/booking/Identity'; export * from '@duffel/api/booking/BatchOfferRequests'; export * from '@duffel/api/booking/OfferRequests'; export * from '@duffel/api/booking/Offers'; export * from '@duffel/api/booking/OrderCancellations'; export * from '@duffel/api/booking/Orders'; export * from '@duffel/api/booking/OrderChangeRequests'; export * from '@duffel/api/booking/OrderChangeOffers'; export * from '@duffel/api/booking/OrderChanges'; export * from '@duffel/api/booking/Payments'; export * from '@duffel/api/booking/PartialOfferRequests'; export * from '@duffel/api/booking/SeatMaps'; } declare module '@duffel/api/Client' { import { Headers } from 'node-fetch'; import { DuffelResponse, SDKOptions, ApiResponseMeta, ApiResponseError } from '@duffel/api/types'; export interface Config { token: string; basePath?: string; apiVersion?: string; debug?: SDKOptions; source?: string; } export class DuffelError extends Error { meta: ApiResponseMeta; errors: ApiResponseError[]; headers: Headers; constructor({ meta, errors, headers, }: { meta: ApiResponseMeta; errors: ApiResponseError[]; headers: Headers; }); } export class Client { constructor({ token, basePath, apiVersion, debug, source }: Config); request: ({ method, path, data, params, compress, }: { method: string; path: string; data?: Record; params?: Record; compress?: boolean; }) => Promise>; paginatedRequest({ path, params, }: { path: string; params?: Record; }): AsyncGenerator, void, unknown>; } } declare module '@duffel/api/supportingResources' { export * from '@duffel/api/supportingResources/Aircraft'; export * from '@duffel/api/supportingResources/Airlines'; export * from '@duffel/api/supportingResources/Airports'; } declare module '@duffel/api/Places/Suggestions' { export * from '@duffel/api/Places/Suggestions/Suggestions'; } declare module '@duffel/api/DuffelPayments/Refunds' { export * from '@duffel/api/DuffelPayments/Refunds/Refunds'; } declare module '@duffel/api/Links' { export * from '@duffel/api/Links/Sessions'; } declare module '@duffel/api/notifications' { export * from '@duffel/api/notifications/Webhooks'; } declare module '@duffel/api/Stays/Stays' { import { Client } from '@duffel/api/Client'; import { StaysSearchParams, StaysSearchResponse } from '@duffel/api/Stays/StaysTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; import { Accommodation } from '@duffel/api/Stays/Accommodation'; import { Brands } from '@duffel/api/Stays/Brands'; import { LoyaltyProgrammes } from '@duffel/api/Stays/LoyaltyProgrammes'; import { Bookings } from '@duffel/api/Stays/Bookings'; import { Quotes } from '@duffel/api/Stays/Quotes'; import { SearchResults } from '@duffel/api/Stays/SearchResults'; export class Stays extends Resource { /** * Endpoint path */ path: string; accommodation: Accommodation; loyaltyProgrammes: LoyaltyProgrammes; brands: Brands; searchResults: SearchResults; quotes: Quotes; bookings: Bookings; constructor(client: Client); /** * Search for accommodations * @param {object} params - The search parameters */ search: (params: StaysSearchParams) => Promise>; } } declare module '@duffel/api/Cars/Cars' { import { Client } from '@duffel/api/Client'; import { CarsSearchParams, CarsSearch } from '@duffel/api/Cars/CarsTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; import { Bookings } from '@duffel/api/Cars/Bookings'; import { Quotes } from '@duffel/api/Cars/Quotes'; export class Cars extends Resource { /** * Endpoint path */ path: string; bookings: Bookings; quotes: Quotes; constructor(client: Client); /** * Search for available rental cars * @param {object} params - The search parameters */ search: (params: CarsSearchParams) => Promise>; } } declare module '@duffel/api/Payments/Cards' { export * from '@duffel/api/Payments/Cards/Cards'; } declare module '@duffel/api/Payments/ThreeDSecureSessions' { export * from '@duffel/api/Payments/ThreeDSecureSessions/ThreeDSecureSessions'; } declare module '@duffel/api/Identity/Identity' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { CustomerUsers } from '@duffel/api/Identity/CustomerUsers'; import { CustomerUserGroups } from '@duffel/api/Identity/CustomerUserGroups'; import { ComponentClientKeys } from '@duffel/api/Identity/ComponentClientKeys'; export class Identity extends Resource { /** * Endpoint path */ path: string; customerUsers: CustomerUsers; customerUserGroups: CustomerUserGroups; componentClientKeys: ComponentClientKeys; constructor(client: Client); } } declare module '@duffel/api/functions/hasService' { import { Offer, SeatMap } from '@duffel/api/types'; export function hasService(offer: Offer, seatMaps?: SeatMap[]): boolean; } declare module '@duffel/api/functions/hasAvailableSeatService' { import { SeatMap } from '@duffel/api/types'; export function hasAvailableSeatService(seatMaps?: SeatMap[]): boolean; } declare module '@duffel/api/DuffelPayments/PaymentIntents' { export * from '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntents'; } declare module '@duffel/api/booking/AirlineInitiatedChanges' { export * from '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChanges'; } declare module '@duffel/api/booking/Identity' { export * from '@duffel/api/booking/Identity/ComponentClientKey'; } declare module '@duffel/api/booking/BatchOfferRequests' { export * from '@duffel/api/booking/BatchOfferRequests/BatchOfferRequests'; } declare module '@duffel/api/booking/OfferRequests' { export * from '@duffel/api/booking/OfferRequests/OfferRequests'; } declare module '@duffel/api/booking/Offers' { export * from '@duffel/api/booking/Offers/Offers'; } declare module '@duffel/api/booking/OrderCancellations' { export * from '@duffel/api/booking/OrderCancellations/OrderCancellations'; } declare module '@duffel/api/booking/Orders' { export * from '@duffel/api/booking/Orders/Orders'; } declare module '@duffel/api/booking/OrderChangeRequests' { export * from '@duffel/api/booking/OrderChangeRequests/OrderChangeRequests'; } declare module '@duffel/api/booking/OrderChangeOffers' { export * from '@duffel/api/booking/OrderChangeOffers/OrderChangeOffers'; } declare module '@duffel/api/booking/OrderChanges' { export * from '@duffel/api/booking/OrderChanges/OrderChanges'; } declare module '@duffel/api/booking/Payments' { export * from '@duffel/api/booking/Payments/Payments'; } declare module '@duffel/api/booking/PartialOfferRequests' { export * from '@duffel/api/booking/PartialOfferRequests/PartialOfferRequests'; } declare module '@duffel/api/booking/SeatMaps' { export * from '@duffel/api/booking/SeatMaps/SeatMaps'; } declare module '@duffel/api/types' { export * from '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntentsType'; export * from '@duffel/api/Places/Suggestions/SuggestionsType'; export * from '@duffel/api/Stays/StaysTypes'; export * from '@duffel/api/Cars/CarsTypes'; export * from '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChangesTypes'; export * from '@duffel/api/booking/OfferRequests/OfferRequestsTypes'; export * from '@duffel/api/booking/BatchOfferRequests/BatchOfferRequestsTypes'; export * from '@duffel/api/booking/Offers/OfferTypes'; export * from '@duffel/api/booking/OrderCancellations/OrderCancellationsTypes'; export * from '@duffel/api/booking/OrderChangeOffers/OrderChangeOfferTypes'; export * from '@duffel/api/booking/OrderChangeRequests/OrderChangeRequestsTypes'; export * from '@duffel/api/booking/OrderChanges/OrderChangesTypes'; export * from '@duffel/api/booking/Orders/OrdersTypes'; export * from '@duffel/api/booking/Payments/PaymentsTypes'; export * from '@duffel/api/booking/SeatMaps/SeatMapTypes'; export * from '@duffel/api/notifications/Webhooks/WebhooksType'; export * from '@duffel/api/supportingResources/Aircraft/AircraftTypes'; export * from '@duffel/api/supportingResources/Airlines/AirlinesTypes'; export * from '@duffel/api/supportingResources/Airports/AirportsTypes'; export * from '@duffel/api/types/ClientType'; export * from '@duffel/api/types/Identity'; export * from '@duffel/api/types/shared'; export * from '@duffel/api/Identity/IdentityTypes'; } declare module '@duffel/api/supportingResources/Aircraft' { export * from '@duffel/api/supportingResources/Aircraft/Aircraft'; } declare module '@duffel/api/supportingResources/Airlines' { export * from '@duffel/api/supportingResources/Airlines/Airlines'; export * as AirlineType from '@duffel/api/supportingResources/Airlines/AirlinesTypes'; } declare module '@duffel/api/supportingResources/Airports' { export * from '@duffel/api/supportingResources/Airports/Airports'; export * as AirportType from '@duffel/api/supportingResources/Airports/AirportsTypes'; } declare module '@duffel/api/Places/Suggestions/Suggestions' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, Places } from '@duffel/api/types'; interface PlacesSuggestionsParameters { /** * A search string for finding matching Places. * Deprecated in favour of "name". */ query?: string; /** * A search string for finding matching Places by name. */ name?: string; /** * The radius, in metres, to search within. */ rad?: string; /** * The latitude to search by. */ lat?: string; /** * The longitude to search by. */ lng?: string; } /** * A Place is a city or airport that can serve as an origin or destination. * * @link https://duffel.com/docs/api/places */ export class Suggestions extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Retrieves a list of Places matching the provided query */ list: (params: PlacesSuggestionsParameters) => Promise>; } export {}; } declare module '@duffel/api/DuffelPayments/Refunds/Refunds' { import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; import { CreateRefund, Refund } from '@duffel/api/DuffelPayments/Refunds/RefundsType'; export class Refunds extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * You should use this API to get the complete, up-to-date information about a Refund. * @param {string} id - Duffel's unique identifier for the Refund * @link https://duffel.com/docs/api/refunds/get-refund-by-id */ get: (id: string) => Promise>; /** * Create a Refund to refund some money to a customer that they paid using a Payment Intent. You must specify the amount and currency. The currency is currently limited to the currency in which the Payment Intent was made. * @param {Object.} params - Endpoint params (amount, currency and payment_intent_id) */ create: (params: CreateRefund) => Promise>; } } declare module '@duffel/api/Links/Sessions' { export * from '@duffel/api/Links/Sessions/Sessions'; } declare module '@duffel/api/notifications/Webhooks' { export * from '@duffel/api/notifications/Webhooks/Webhooks'; } declare module '@duffel/api/Stays/StaysTypes' { import { PaginationMeta } from '@duffel/api/types'; export type StaysBedType = 'single' | 'double' | 'queen' | 'king' | 'sofabed'; export interface StaysBed { /** * The type of beds available in the room Available types: "single", "double", "queen", "king", "sofabed" */ type: StaysBedType; /** * The number of beds of this type in the room. */ count: number; } export interface StaysRating { /** * The source of this rating. Possible values: `"aaa"` (American Automobile Association Diamond Rating), `"northstar"` (Northstar Crown Rating), `"priceline"` (Priceline star rating) */ source: 'aaa' | 'northstar' | 'priceline' | 'bookingcom'; /** * The rating value. This is an integer from 1 to 5 regardless of the `source`. */ value: number; } export interface StaysRateCondition { /** * One or more paragraphs that outline the rate condition */ description: string; /** * The condition title */ title: string; } export interface StaysRateCancellationTimeline { /** * The amount refundable up until the specified before date */ refund_amount: string; /** * The ISO 8601 datetime for the deadline of a refund. */ before: string; /** * The currency of the amount, as an ISO 4217 currency code. */ currency: string; } export type StaysLoyaltyProgrammeReference = 'wyndham_rewards' | 'choice_privileges' | 'marriott_bonvoy' | 'best_western_rewards' | 'world_of_hyatt' | 'hilton_honors' | 'ihg_one_rewards' | 'leaders_club' | 'stash_rewards' | 'omni_select_guest' | 'i_prefer' | 'accor_live_limitless' | 'my_6' | 'jumeirah_one' | 'global_hotel_alliance_discovery' | 'duffel_hotel_group_rewards'; export type StaysPaymentMethod = 'balance' | 'card'; export type StaysPaymentType = 'guarantee' | 'deposit' | 'pay_now'; export type StaysSource = 'bookingcom' | 'priceline' | 'travelport' | 'expedia' | 'sabre' | 'duffel_hotel_group'; export interface StaysRate { /** * The currency of the base_amount, as an ISO 4217 currency code. */ base_amount: string | null; /** * The currency of the base_amount, as an ISO 4217 currency code. */ base_currency: string; /** * The type of boarding offered by this rate. */ board_type: 'room_only' | 'breakfast' | 'half_board' | 'full_board' | 'all_inclusive'; /** * A timeline that contains policies, such as possible refunds, once this rate has been booked. This is sorted in ascending chronological order. */ cancellation_timeline: StaysRateCancellationTimeline[]; /** * The conditions or policies that apply to the rate. The information provided should be treated as mandatory and displayed to the traveller during and after the booking process. */ conditions: Array; /** * Fees are sometimes payable at time of check in. These fees are not collected during the booking process */ due_at_accommodation_amount: string | null; /** * The currency of the due_at_accommodation_amount */ due_at_accommodation_currency: string; /** * ID of a given rate for a accommodation */ id: string; /** * The accepted payment type for this rate. * Guarantee rates are paid at at the accommodation. * Deposit rates require a prepayment of a deposit amount, then the remainder at the accommodation. * Pay now rates require full prepayment. * */ payment_type: StaysPaymentType; /** * The fee amount, as an ISO 4217 currency code. */ fee_amount: string | null; /** * The currency of the fee_amount, as an ISO 4217 currency code */ fee_currency: string; /** * The tax amount, as an ISO 4217 currency code. */ tax_amount: string | null; /** * The currency of the tax_amount, as an ISO 4217 currency code */ tax_currency: string; /** * The total price for the room for all nights and for all occupants. Please note, the occupant may be required to pay fees on arrival at the hotel. These are not included in the total_amount, and are included in due_at_accommodation_amount */ total_amount: string; /** * The currency of the total_amount, as an ISO 4217 currency code */ total_currency: string; /** * The methods available for payment of this rate. A rate with the `balance` payment method can be paid for using your Duffel Balance. A rate with the `card` payment method can be paid for with card details provided at time of booking. */ available_payment_methods: StaysPaymentMethod[]; /** * The loyalty programme that this rate supports. * If the rate does not support a loyalty programme, this will be null. * The duffel_hotel_group_rewards value is an example programme for testing and integration purposes, and will only appear on Duffel Hotel Group test hotel rates. */ supported_loyalty_programme: StaysLoyaltyProgrammeReference | null; /** * Whether this rate requires you to be a member of the supported loyalty programme. * If true, you must supply a loyalty_programme_account_number when creating a booking for this rate. */ loyalty_programme_required: boolean; /** * The estimated commission amount for this rate. */ estimated_commission_amount: string | null; /** * The currency of the estimated_commission_amount. */ estimated_commission_currency: string | null; /** * The source of the rate. * Useful in scenarios where a rate requires explicitly showing the source. */ source: StaysSource; /** * The ISO 8601 date and time at which the rate will expire */ expires_at: string; /** * A rate code is an alphanumeric identifier of specific negotiated pricing and booking conditions. * Rate codes are only returned when special contracted rates are available through the hotel provider, * distinguishing them from standard public rates. */ code: string | null; /** * The rate description provided by the rate supplier. * This typically includes important information about what's included in the rate, * such as meal plans, amenities, credits, upgrades, or special benefits. * This field is returned exactly as provided by the supplier and is not normalised or * standardised across sources. * It's intended for internal use or agent review rather than direct display to the guest, * as formatting and content quality may vary significantly between suppliers. */ description: string | null; /** * The name of the rate, provided by the rate supplier. * This is typically a short, human-readable label that identifies the rate, * such as "Best Available Rate" or "Advance Purchase". * * Example: "Best Available Rate" */ name: string | null; } export interface StaysRoomRate extends StaysRate { /** * The quantity of rooms available to be booked at this rate. This number is not guaranteed to be accurate. Will be null if this information is unknown. */ quantity_available: number | null; } export interface StaysPhoto { url: string; } export interface StaysRoom { /** * The room name. */ name: string; /** * Available beds in the room */ beds?: StaysBed[]; /** * Supplied photos for the room */ photos?: StaysPhoto[]; /** * The available rates for a specific room, including commission, distribution, payment and included services information. */ rates: StaysRoomRate[]; } export interface StaysAmenity { type: 'parking' | 'gym' | 'wifi' | '24_hour_front_desk' | 'accessibility_hearing' | 'accessibility_mobility' | 'adult_only' | 'business_centre' | 'cash_machine' | 'childcare_service' | 'concierge' | 'laundry' | 'lounge' | 'pets_allowed' | 'pool' | 'restaurant' | 'room_service' | 'spa'; description: string; } export interface StaysChain { /** * The hotel chain’s name */ name: string; } export interface StaysAddress { /** * The name of the city or metropolitan area where the accommodation is located. */ city_name: string; /** * The ISO 3166-1 alpha-2 code for the country where the hotel is located. */ country_code: string; /** * The first line of the accommodation's address */ line_one: string; /** * The accommodation's postal code (or zip code) */ postal_code: string; /** * The stay's region or state */ region?: string; } export interface GeographicCoordinates { /** * The latitude position of the accommodation represented in Decimal degrees with 6 decimal points with a range between -90° and 90° */ latitude: number; /** * The longitude position of the accommodation represented in Decimal degrees with 6 decimal points with a range between -180° and 180° */ longitude: number; } export interface StaysLocation { /** * Address information of the location */ address: StaysAddress; /** * The exact latitude-longitude position of the accommodation. Useful for map views. */ geographic_coordinates: GeographicCoordinates | null; } export interface StaysAccommodationBrand { name: string; id: string; } export interface StaysAccommodation { /** * Duffel ID for this accommodation. Useful for searching availability * for the same accommodation via accommodation based search. */ id: string; /** * The amenities available at the accommodation */ amenities: StaysAmenity[] | null; /** * Information about the chain this accommodation belongs to */ chain: StaysChain | null; brand: StaysAccommodationBrand | null; /** * Check in and check out related information */ check_in_information: { /** * The ISO 8601 format for the earliest time a traveller can check-in to their room. */ check_out_before_time: string; /** * The ISO 8601 format for the earliest time a traveller can check-out to their room. */ check_in_after_time: string; } | null; /** * The key collection details for the accommodation. */ key_collection: StaysBookingKeyCollection | null; /** * The accommodation’s description */ description?: string; /** * The accommodation’s email address. Note that this data may differ from the accommodation’s records if it was updated directly by the accommodation after the booking was created. */ email: string | null; /** * Information on the accommodation's location */ location: StaysLocation; /** * The accommodation's name */ name: string; /** * The accommodation's phone number in E.164 (international) format. Note that this data may differ from the accommodation's records if it was updated directly by the accommodation after the booking was created. */ phone_number: string | null; /** * Photos for the accommodation */ photos?: StaysPhoto[]; /** * Ratings of the accommodation */ ratings: StaysRating[] | null; /** * A "star rating" of this accommodation. If available, this is an integer from 1 to 5 "stars". This value is consolidated by Duffel based on data provided by our sources and accommodation providers. For more detailed rating information, see ratings. */ rating: number | null; /** * The number of reviews that contributed to the aggregated review score * Example: 336 */ review_count: number | null; /** * A review score of this accommodation, aggregated from guest reviews. If available, the value is a score from the 1.0-10.0 range. This value is consolidated by Duffel based on user review data from multiple sources. */ review_score: number | null; /** * Rooms for the accommodation */ rooms: StaysRoom[]; /** * The loyalty programme that this accommodation supports. */ supported_loyalty_programme: StaysLoyaltyProgrammeReference | null; } export interface StaysAccommodationSuggestion { accommodation_id: StaysAccommodation['id']; accommodation_name: StaysAccommodation['name']; accommodation_location: StaysLocation; } /** * Represents a quote for a stay. */ export interface StaysQuote { /** * The id of the stay quote. * * @example: "quo_0000AS0NZdKjjnnHZmSUbI" */ id: string; /** * The ISO 8601 date on which the guest wants to check in. * This comes from the search request this quote originates from. * * Example: "2023-05-24" */ check_in_date: string; /** * The ISO 8601 date on which the guest wants to check out. * This comes from the search request this quote originates from. * * Example: "2023-05-28" */ check_out_date: string; /** * The accommodation associated with this quote. */ accommodation: StaysAccommodation; /** * The total price for the room for all nights and for all guests. * Please note, the guest may be required to pay mandatory fees and taxes at the stay. * These are not included in the total_amount, and are included in due_at_accommodation_amount. * * Example: "799.00" */ total_amount: string; /** * The currency of the total_amount, as an ISO 4217 currency code. * * Example: "GBP" */ total_currency: string; /** * The base amount for this quote, excluding taxes and fees. * Will be null if the base amount is unknown. * * Example: "665.83" */ base_amount: string | null; /** * The currency of the base_amount, as an ISO 4217 currency code. * * Example: "GBP" */ base_currency: string; /** * The fee amount for this quote. * Will be null if the fee amount is unknown. * * Example: "50.94" */ fee_amount: string | null; /** * The currency of the fee_amount, as an ISO 4217 currency code. * * Example: "GBP" */ fee_currency: string; /** * The tax amount for this quote. * Will be null if the tax amount is unknown. * * Example: "133.17" */ tax_amount: string | null; /** * The currency of the tax_amount, as an ISO 4217 currency code. * * Example: "GBP" */ tax_currency: string; /** * Mandatory fees or taxes that are due by the guest at the accommodation. * Depending on the accommodation, these may be payable on check-in or check-out. * These fees are not collected during the booking process. * Will be null if the amount due at accommodation is unknown. * * Example: "39.95" */ due_at_accommodation_amount: string | null; /** * The currency of the due_at_accommodation_amount, as an ISO 4217 currency code. * * Example: "GBP" */ due_at_accommodation_currency: string; /** * The portion of total_amount that is payable before check in as deposit for the stay. * It may be null if the quote is for a deposit rate but we couldn't get full deposit information — * in that case, deposit details are expected to be specified in the rate conditions. * * Example: "159.80" */ deposit_amount: string | null; /** * The currency of the tax_amount, as an ISO 4217 currency code. * * Example: "GBP" */ deposit_currency: string; /** * The loyalty programme that this quote supports. */ supported_loyalty_programme: StaysLoyaltyProgrammeReference | null; rooms: number; guests: Array; } export type StaysBookingStatus = 'confirmed' | 'cancelled'; export interface StaysBookingKeyCollection { instructions: string; } export interface StaysBooking { /** * The ID of the booking */ id: string; /** * The email of the lead guest of the booking */ email: string; /** * The phone number of the lead guest of the booking */ phone_number: string; /** * The accommodation object for the booking */ accommodation: StaysAccommodation; /** * The ISO 8601 date on which the guest wants to check in. */ check_in_date: string; /** * The ISO 8601 date on which the guest wants to check out. */ check_out_date: string; /** * A booking reference for the property you’ll be staying in. This is the reference you should use when contacting the accommodation. */ reference: string | null; /** * The status of the booking. Possible values: requested, confirmed, failed,cancellation_requested,cancellation_confirmed. */ status: StaysBookingStatus; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the booking was made. */ confirmed_at: string; /** * The ISO 8601 datetime of the cancellation of this booking. * This is null if the booking is not cancelled. */ cancelled_at: string | null; /** * The guests for the booking */ guests: Array<{ given_name: string; family_name: string; }>; /** * The loyalty programme that this booking supports. */ supported_loyalty_programme: StaysLoyaltyProgrammeReference | null; /** * Loyalty account number to associate with this booking. Use this only when the quote has a supported_loyalty_programme indicated. Otherwise, this will result into an error. */ loyalty_programme_account_number: string | null; /** * The number of rooms in the booking. */ rooms: number; /** * Metadata pertaining to this booking, generated by the Duffel API. */ metadata: Record | null; /** * Deprecated: Instructions to access the accommodation in the booking */ key_collection: StaysBookingKeyCollection | null; /** * The estimated commission amount for this rate. */ estimated_commission_amount: string | null; /** * The currency of the estimated_commission_amount. */ estimated_commission_currency: string | null; } type Adult = { type: 'adult'; age?: number; }; type Child = { type: 'child'; age: number; }; export type Guest = Adult | Child; interface CommonStaysSearchParams { check_in_date: string; check_out_date: string; rooms: number; guests: Array; mobile?: boolean; free_cancellation_only?: boolean; /** * Preview: when `true`, only pay-now (Duffel/source) rates; when `false`, only pay-at-property; * when `null` or omitted, all rates. See Duffel Stays search API schema. */ instant_payment?: boolean | null; } export type LocationParams = { radius: number; geographic_coordinates: GeographicCoordinates; }; type LocationSearchParams = { location: LocationParams; } & CommonStaysSearchParams; type AccommodationSearchParams = { accommodation: { ids: Array; fetch_rates?: boolean; }; } & CommonStaysSearchParams; export type StaysSearchParams = LocationSearchParams | AccommodationSearchParams; export interface ListAccommodationParams extends PaginationMeta { radius?: LocationParams['radius']; latitude: GeographicCoordinates['latitude']; longitude: GeographicCoordinates['longitude']; } export interface StaysSearchResponse { results: Array; created_at: string; } export interface StaysSearchResult { id: string; check_in_date: string; check_out_date: string; accommodation: StaysAccommodation; rooms: number; guests: Array; cheapest_rate_total_amount: string; cheapest_rate_currency: string; cheapest_rate_base_amount: string | null; cheapest_rate_base_currency: string | null; cheapest_rate_public_amount: string | null; cheapest_rate_public_currency: string; cheapest_rate_due_at_accommodation_amount: string | null; cheapest_rate_due_at_accommodation_currency: string | null; /** * The ISO 8601 date and time at which the search result will expire */ expires_at: string; } export interface StaysLoyaltyProgramme { reference: StaysLoyaltyProgrammeReference; name: string; logo_url_svg: string; logo_url_png_small: string; } export interface StaysAccommodationReview { created_at: string; reviewer_name: string; score: number; text: string; } export interface StaysAccommodationReviewResponse { reviews: Array; } export type ListParamsBookings = { /** * Whether to filter bookings matching a given customer user id. */ user_id?: string; }; export {}; } declare module '@duffel/api/Resource' { import { Client } from '@duffel/api/Client'; import { DuffelResponse } from '@duffel/api/types'; export class Resource { constructor(client: Client); protected request: ({ method, path, data, params, }: { method: string; path: string; data?: Record; params?: Record; }) => Promise>; protected paginatedRequest: ({ path, params, }: { path: string; params?: Record; }) => AsyncGenerator, void, unknown>; } } declare module '@duffel/api/Stays/Accommodation' { export * from '@duffel/api/Stays/Accommodation/Accommodation'; } declare module '@duffel/api/Stays/Brands' { export * from '@duffel/api/Stays/Brands/Brands'; } declare module '@duffel/api/Stays/LoyaltyProgrammes' { export * from '@duffel/api/Stays/LoyaltyProgrammes/LoyaltyProgrammes'; } declare module '@duffel/api/Stays/Bookings' { export * from '@duffel/api/Stays/Bookings/Bookings'; } declare module '@duffel/api/Stays/Quotes' { export * from '@duffel/api/Stays/Quotes/Quotes'; } declare module '@duffel/api/Stays/SearchResults' { export * from '@duffel/api/Stays/SearchResults/SearchResults'; } declare module '@duffel/api/Cars/CarsTypes' { export interface CarsGeographicCoordinates { latitude: number; longitude: number; } export interface CarsSearchLocation { radius?: number; geographic_coordinates: CarsGeographicCoordinates; } export interface CarsSearchDriver { age: number; residence_country_code: string; } export interface CarsSearchParams { pickup_date: string; pickup_time: string; dropoff_date: string; dropoff_time: string; pickup_location: CarsSearchLocation; dropoff_location: CarsSearchLocation; driver: CarsSearchDriver; } export type CarsPaymentType = 'postpaid' | 'guarantee' | 'prepaid'; export type CarsMileageUnit = 'kilometres' | 'miles'; export type CarsMileage = { type: 'unlimited'; } | { type: 'limited'; unit: CarsMileageUnit; limit: number; }; export interface CarsSupplier { name: string; logo_url: string | null; } export type CarsCategory = 'mini' | 'mini_elite' | 'economy' | 'economy_elite' | 'compact' | 'compact_elite' | 'intermediate' | 'intermediate_elite' | 'standard' | 'standard_elite' | 'fullsize' | 'fullsize_elite' | 'premium' | 'premium_elite' | 'luxury' | 'luxury_elite' | 'special'; export type CarsVehicleType = 'two_door' | 'two_or_four_door' | 'four_door' | 'wagon_estate' | 'passenger_van' | 'limousine' | 'sport' | 'convertible' | 'suv' | 'open_air_all_terrain' | 'special' | 'pickup_regular_cab' | 'pickup_extended_cab' | 'special_offer_car' | 'coupe' | 'monospace' | 'recreational_vehicle' | 'two_wheel_vehicle'; export type CarsTransmission = 'manual' | 'automatic'; export type CarsFuel = 'unspecified_fuel' | 'diesel' | 'hybrid' | 'electric' | 'lpg' | 'hydrogen' | 'multi_fuel' | 'petrol'; export interface CarsBaggage { large: number; small: number; } export interface CarsImage { url: string; } export interface Car { name: string; /** * The ACRISS or SIPP code for this car. A four-letter code describing the car's attributes. */ code: string; category: CarsCategory; type: CarsVehicleType; transmission: CarsTransmission; fuel: CarsFuel; air_conditioning: boolean; max_passengers: number | null; baggage: CarsBaggage | null; images: CarsImage[] | null; } export type CarsLocationAccess = 'in_terminal' | 'shuttle' | 'meet_and_greet' | 'call_for_pickup'; export interface CarsLocationAdditionalInformation { title: string; text: string; } export interface CarsLocationOpeningHours { from: string; to: string; } export interface CarsLocationAddress { line_one: string | null; city_name: string | null; postal_code: string | null; region: string | null; country_code: string; } export interface CarsLocation { name: string; geographic_coordinates: CarsGeographicCoordinates; address: CarsLocationAddress; phone_number: string | null; access: CarsLocationAccess | null; additional_information: CarsLocationAdditionalInformation[]; opening_hours: CarsLocationOpeningHours[]; } export interface CarsRate { id: string; base_amount: string | null; base_currency: string | null; total_amount: string; total_currency: string; payment_type: CarsPaymentType; mileage: CarsMileage; supplier: CarsSupplier; car: Car; pickup_location: CarsLocation; dropoff_location: CarsLocation; } export interface CarsSearch { id: string; live_mode: boolean; created_at: string; pickup_date: string; pickup_time: string; dropoff_date: string; dropoff_time: string; pickup_location: CarsSearchLocation; dropoff_location: CarsSearchLocation; driver: CarsSearchDriver; rates: CarsRate[]; } export interface CarsCharge { amount: string; currency: string; description: string | null; } export interface CarsCondition { title: string; text: string; } export interface CarsPrivacyPolicy { title: string; text: string; } export interface CarsQuote { id: string; live_mode: boolean; rate_id: string; search_id: string; base_amount: string | null; base_currency: string; total_amount: string; total_currency: string; charges: CarsCharge[] | null; payment_type: CarsPaymentType; mileage: CarsMileage; supplier: CarsSupplier; car: Car; conditions: CarsCondition[]; privacy_policies: CarsPrivacyPolicy[] | null; pickup_location: CarsLocation; dropoff_location: CarsLocation; pickup_date: string; pickup_time: string; dropoff_date: string; dropoff_time: string; } export type CarsBookingStatus = 'confirmed' | 'cancelled'; export interface CarsBookingDriver { given_name: string; family_name: string; date_of_birth: string; email: string; phone_number: string; user_id: string | null; } export interface CarsBooking { id: string; live_mode: boolean; reference: string; confirmed_at: string | null; cancelled_at: string | null; status: CarsBookingStatus; driver: CarsBookingDriver; quote_id: string; base_amount: string | null; base_currency: string; total_amount: string; total_currency: string; charges: CarsCharge[] | null; payment_type: CarsPaymentType; mileage: CarsMileage; supplier: CarsSupplier; metadata: Record | null; users: string[]; car: Car; conditions: CarsCondition[]; privacy_policies: CarsPrivacyPolicy[] | null; pickup_location: CarsLocation; dropoff_location: CarsLocation; pickup_date: string; pickup_time: string; dropoff_date: string; dropoff_time: string; } } declare module '@duffel/api/Cars/Bookings' { export * from '@duffel/api/Cars/Bookings/Bookings'; } declare module '@duffel/api/Cars/Quotes' { export * from '@duffel/api/Cars/Quotes/Quotes'; } declare module '@duffel/api/Payments/Cards/Cards' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; interface CardParameters { /** * The first line of the card owner's address */ address_line_1: string; /** * The card owner's postal code (or zip code) */ address_postal_code: string; /** * The card owner's city */ address_city: string; /** * The card owner's region or state */ address_region: string; /** * The ISO 3166-1 alpha-2 code for the card owner's country */ address_country_code: string; /** * The month that the card expires in as a two-digit string, e.g. "01" */ expiry_month: string; /** * The year that the card expires in as a two-digit string, e.g. "28" */ expiry_year: string; /** * The card owner's name */ name: string; /** * The card number */ number: string; /** * The card verification code */ cvc: string; /** * Set to true to indicate that this card can be used multiple times */ multi_use: boolean; } interface CardRecord { id: string; live_mode: boolean; multi_use: boolean; unavailable_at: string; brand: string; last_4_digits: string; } export class Cards extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Create a Duffel card record */ create: (data: CardParameters) => Promise>; } export {}; } declare module '@duffel/api/Payments/ThreeDSecureSessions/ThreeDSecureSessions' { import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; interface Service { /** * The quantity of the service ID to pay for */ quantity: number; /** * The ID of the service to pay for */ id: string; } interface ThreeDSecureSessionParameters { /** * The offer ID, order ID, order change ID or quote ID intended to pay */ resource_id: string; /** * The services inteded to pay */ services: Service[]; /** * The card ID */ card_id: string; /** * The exception name for the 3DS session */ exception: string; } interface ThreeDSecureSessionRecord { id: string; resource_id: string; card_id: string; live_mode: boolean; expires_at: string; status: string; client_id: string; } export class ThreeDSecureSessions extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Create a Duffel ThreeDSecureSession record */ create: (data: ThreeDSecureSessionParameters) => Promise>; } export {}; } declare module '@duffel/api/Identity/CustomerUsers' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, PaginationMeta } from '@duffel/api/types'; import { CustomerUser, CustomerUserPayload } from '@duffel/api/Identity/IdentityTypes'; export class CustomerUsers extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Creates a customer user for the organisation. */ create: (data: CustomerUserPayload) => Promise>; /** * Retrieves an customer user by its ID */ get: (id: CustomerUser["id"]) => Promise>; /** * Updates a customer user based on provided ID */ update: (id: CustomerUser["id"], data: CustomerUserPayload) => Promise>; /** * Retrieves a list of customer user groups * Allows filtering by email */ list: (options?: PaginationMeta & { email?: string; }) => Promise>; } } declare module '@duffel/api/Identity/CustomerUserGroups' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, PaginationMeta } from '@duffel/api/types'; import { CustomerUserGroup, CustomerUserGroupPayload } from '@duffel/api/Identity/IdentityTypes'; export class CustomerUserGroups extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Retrieves a list of customer user groups */ list: (options?: PaginationMeta) => Promise>; /** * Creates a customer user group for the organisation. */ create: (data: CustomerUserGroupPayload) => Promise>; /** * Deletes a customer user group by its ID */ delete: (id: CustomerUserGroup["id"]) => Promise>; /** * Retrieves an customer user group by its ID */ get: (id: CustomerUserGroup["id"]) => Promise>; /** * Updates an customer user group by its ID */ update: (id: CustomerUserGroup["id"], data: CustomerUserGroupPayload) => Promise>; } } declare module '@duffel/api/Identity/ComponentClientKeys' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; import { ComponentClientKey, ComponentClientKeyPayload } from '@duffel/api/Identity/IdentityTypes'; export class ComponentClientKeys extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * The client key to authenticate Duffel UI components. */ create: (data?: ComponentClientKeyPayload) => Promise>; } } declare module '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntents' { import { DuffelResponse } from '@duffel/api/types'; import { Resource } from '@duffel/api/Resource'; import { CreatePaymentIntent, PaymentIntent } from '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntentsType'; export class PaymentIntents extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * You should use this API to get the complete, up-to-date information about a Payment Intent. * @param {string} id - Duffel's unique identifier for the Payment Intent * @link https://duffel.com/docs/api/payment-intents/get-payment-intent-by-id */ get: (id: string) => Promise>; /** * Once you've successfully collected the customer's card details, using the `client_token` from when you first created the Payment Intent, you then need to confirm it using this endpoint. * Once confirmed, the amount charged to your customer's card will be added to your `Balance` (minus any Duffel Payment fees). */ confirm: (id: string) => Promise>; /** * To begin the process of collecting a card payment from your customer, you need to create a Payment Intent. * The Payment Intent will contain a `client_token` that you use to collect the card payment in your application. * If the Payment Intent is created in test mode you should use a [test card](https://duffel.com/docs/api/overview/test-mode/test-card-numbers). * @param {Object.} params - Endpoint params (amount and string) */ create: (params: CreatePaymentIntent) => Promise>; } } declare module '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChanges' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, Order } from '@duffel/api/types'; import { AirlineInitiatedChange, AirlineInitiatedChangeActionTaken } from '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChangesTypes'; /** * Sometimes there can be changes to your order initiated by the airline, for * example a flight being delayed. We record every one of these changes so that * you can view them all or for an order. You can filter changes for a specific * order using the `order_id` parameter. * * Each airline-initiated change contains an `added` and `removed` field. `added` * contains the updated slices following the change. These slices and their * segments may have a new ID based on the change. `removed` contains a list of * slices and their segments as they were before the change. */ export class AirlineInitiatedChanges extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * This endpoint is only available to those airline-initiated changes that * Duffel cannot accept on behalf of the customer. Duffel is unable to accept * an airline-initiated change when these two conditions are true: the order * was booked with the merchant's IATA number and Duffel is unable to accept * the airline-initiated change programatically. In this case you, the * customer, are responsible to resolve airline-initiated changes concerning * this order (e.g. by contacting the airline directly). Once these have been * resolved, you need to inform us of the action taken so we can mark it * accordingly in our system. * * @param {AirlineInitiatedChange['id']} id - Duffel's unique identifier for * the airline-initiated change * * @param action_taken - The action taken in response to this * airline-initiated change. Accepted, cancelled and changed reflect your * action in accepting the change, cancelling the order or changing the order * respectively. * * @link https://duffel.com/docs/api/v1/airline-initiated-changes/update-airline-initiated-changes */ update: (id: AirlineInitiatedChange["id"], action_taken: AirlineInitiatedChangeActionTaken) => Promise>; /** * Once there is an airline-initiated change you can choose to accept it. * * @param {AirlineInitiatedChange['id']} id - Duffel's unique identifier for * the airline-initiated change * * @link https://duffel.com/docs/api/v1/airline-initiated-changes/accept-airline-initiated-changes */ accept: (id: AirlineInitiatedChange["id"]) => Promise>; /** * Retrieves a list of all airline-initiated changes. * * @param order_id - Filters airline-initiated changes by their order ID. * Value must be a valid order ID. Check the [Order schema](https://duffel.com/docs/api/orders/schema#orders-schema-id) * for details. * * @link https://duffel.com/docs/api/v1/airline-initiated-changes/get-airline-initiated-changes */ list: (order_id: Order["id"]) => Promise>; } } declare module '@duffel/api/booking/Identity/ComponentClientKey' { export * from '@duffel/api/booking/Identity/ComponentClientKey/ComponentClientKeys'; } declare module '@duffel/api/booking/BatchOfferRequests/BatchOfferRequests' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { BatchOfferRequest, CreateBatchOfferRequest, CreateBatchOfferRequestResponse, CreateBatchOfferRequestQueryParameters, DuffelResponse } from '@duffel/api/types'; /** * To search for flights, you'll need to create an `offer request`. * The batch offer requests endpoint allows you to retrieve orders as soon as they become available. * They function as long-polling resources that you can repeatedly retrieve after creating them, returning whatever offers are available at the time or waiting for more to become available. Batches are expected to be consumed promptly, and as such, batch offer requests expire after one minute. However, offers remain accessible and can be retrieved using the offer request ID as usual. * @class * @link https://duffel.com/docs/api/batch-offer-requests */ export class BatchOfferRequests extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Call this endpoint repeatedly to retrieve all the offers as they become available. The total_batches and remaining_batches properties can be used to estimate the remaining amount of work, although you may receive multiple batches at the same time if multiple batches are available. * Once you get a response with remaining_batches of 0 you can stop requesting the endpoint as there are no more offers coming. * @param {string} id - Duffel's unique identifier for the offer request * @link https:/duffel.com/docs/api/offer-requests/get-offer-request-by-id */ get: (id: string) => Promise>; /** * To search for flights, you'll need to create an `offer request`. * An offer request describes the passengers and where and when they want to travel (in the form of a list of `slices`). * It may also include additional filters (e.g. a particular cabin to travel in). * Batch offer requests are a mechanism for retrieving offers as they become available, instead of waiting for the entire offer payload to finish processing. * They function as long-polling resources that you can repeatedly retrieve after creating them, returning whatever offers are available at the time or waiting for more to become available. Batches are expected to be consumed promptly, and as such, batch offer requests expire after one minute. * However, offers remain accessible and can be retrieved using the offer request ID as usual. * @param {Object} [options] - the parameters for making an offer requests (required: slices, passengers; optional: cabin_class) * @link https://duffel.com/docs/api/v2/batch-offer-requests/create-batch-offer-request */ create: (options: CreateBatchOfferRequest & QueryParams) => Promise>; } } declare module '@duffel/api/booking/OfferRequests/OfferRequests' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { CreateOfferRequest, CreateOfferRequestQueryParameters, DuffelResponse, OfferRequest, PaginationMeta } from '@duffel/api/types'; /** * To search for flights, you'll need to create an `offer request`. * An offer request describes the passengers and where and when they want to travel (in the form of a list of `slices`). * It may also include additional filters (e.g. a particular cabin to travel in). * @class * @link https://duffel.com/docs/api/offer-requests */ export class OfferRequests extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Retrieves an offer request by its ID * @param {string} id - Duffel's unique identifier for the offer request * @link https:/duffel.com/docs/api/offer-requests/get-offer-request-by-id */ get: (id: string) => Promise>; /** * Retrieves a page of offer requests. The results may be returned in any order. * @param {Object} [options] - Pagination options (optional: limit, after, before) * @link https://duffel.com/docs/api/offer-requests/get-offer-requests */ list: (options?: PaginationMeta) => Promise>; /** * Retrieves a generator of all offer requests. The results may be returned in any order. * @link https://duffel.com/docs/api/offer-requests/get-offer-requests */ listWithGenerator: () => AsyncGenerator, void, unknown>; /** * To search for flights, you'll need to create an `offer request`. * An offer request describes the passengers and where and when they want to travel (in the form of a list of `slices`). * It may also include additional filters (e.g. a particular cabin to travel in). * @param {Object} [options] - the parameters for making an offer requests (required: slices, passengers; optional: cabin_class, return_offers) * When `return_offers` is set to `true`, the offer request resource returned will include all the `offers` returned by the airlines. * If set to false, the offer request resource won't include any `offers`. To retrieve the associated offers later, use the List Offers endpoint, specifying the `offer_request_id`. * @link https://duffel.com/docs/api/offer-requests/create-offer-request */ create: (options: CreateOfferRequest & QueryParams) => Promise : OfferRequest>>; } } declare module '@duffel/api/booking/Offers/Offers' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, GetOfferPricedParams, ListOffersParams, Offer, OfferPriced, LoyaltyProgrammeAccounts, UpdateOffer } from '@duffel/api/types'; interface UpdateOfferBodyParameters { loyalty_programme_accounts: LoyaltyProgrammeAccounts[]; given_name: string; family_name: string; } /** * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria. * @class * @link https://duffel.com/docs/api/offers */ export class Offers extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Retrieves an offer by its ID * @param {string} id - Duffel's unique identifier for the offer * @param {string} return_available_services - When set to true, the offer resource returned will include all the available_services returned by the airline. If set to false, the offer resource won't include any available_services. * @link https:/duffel.com/docs/api/offers/get-offer-by-id */ get: (id: string, params?: { return_available_services: boolean; }) => Promise>; /** * Retrieves a page of offers. The results may be returned in any order. * @param {Object.} params - Endpoint options (optional: limit, after, before, max_connections, sort) * @param {string} params.offer_request_id - Duffel's unique identifier for the offer request, returned when it was created * @link https://duffel.com/docs/api/offers/get-offers */ list: ({ offer_request_id, ...params }: ListOffersParams) => Promise>; /** * Retrieves a generator of all offers. The results may be returned in any order. * @param {Object.} params - Endpoint options (optional: limit, after, before, max_connections, sort) * @param {string} params.offer_request_id - Duffel's unique identifier for the offer request, returned when it was created * @link https://duffel.com/docs/api/offers/get-offers */ listWithGenerator: ({ offer_request_id, ...params }: ListOffersParams) => AsyncGenerator, void, unknown>; /** * Some offer passenger fields are updateable. Each field that can be updated is detailed in the request object. * @param {string} offerId - Duffel's unique identifier for the offer * @param {string} passengerId - The identifier for the passenger. This ID will be generated by Duffel * @param {string} params.family_name - The passenger's family name. Only space, -, ', and letters from the ASCII, Latin-1 Supplement and Latin Extended-A (with the exceptions of Æ, æ, IJ, ij, Œ, œ, Þ, and ð) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters. * @param {string} params.given_name - The passenger's given name. Only space, -, ', and letters from the ASCII, Latin-1 Supplement and Latin Extended-A (with the exceptions of Æ, æ, IJ, ij, Œ, œ, Þ, and ð) Unicode charts are accepted. All other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 characters. * @param {Object.} params.loyalty_programme_accounts - The Loyalty Programme Accounts for this passenger */ update: (offerId: string, passengerId: string, params: UpdateOfferBodyParameters) => Promise>; /** * Price the offer with intended payment methods and intended services. This will return the total amount that will be charged to the customer, including any applicable surcharges. * @param {string} offerId - Duffel's unique identifier for the offer * @param {Object.} params - The intended payment methods and services of the offer */ getPriced: (offerId: string, params: GetOfferPricedParams) => Promise>; /** * Retrieve all fare brands given a basic fare offer. Applicable only for some airlines. All of the returned offers have the same itinerary. * @param {string} offerId - Duffel's unique identifier for the offer */ upsellFares: (offerId: string) => Promise>; } export {}; } declare module '@duffel/api/booking/OrderCancellations/OrderCancellations' { import { Resource } from '@duffel/api/Resource'; import { CreateOrderCancellation, DuffelResponse, OrderCancellation, ListOrderCancellationsParams } from '@duffel/api/types'; export class OrderCancellations extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Retrieves an order cancellation by its ID * @param {string} id - Duffel's unique identifier for the order cancellation * @link https:/duffel.com/docs/api/order-cancellations/get-order-cancellation-by-id */ get: (id: string) => Promise>; /** * Retrieves a page of order cancellations. The results may be returned in any order. * @param {Object.} params - Endpoint options (optional: limit, after, before, order_id) * @link https://duffel.com/docs/api/order-cancellations/get-order-cancellations */ list: (params?: ListOrderCancellationsParams) => Promise>; /** * Retrieves a generator of all order cancellations. The results may be returned in any order. * @param {Object.} params - Endpoint options (optional: limit, after, before, order_id) * @link https://duffel.com/docs/api/order-cancellations/get-order-cancellations */ listWithGenerator: (params?: ListOrderCancellationsParams) => AsyncGenerator, void, unknown>; /** * Create order cancellation * @description To begin the process of cancelling an order you need to create an order cancellation. * @param order_id - Duffel's unique identifier for the order * @link https://duffel.com/docs/api/order-cancellations/create-order-cancellation */ create: (options: CreateOrderCancellation) => Promise>; /** * Confirm order cancellation * @description Once you've created a pending order cancellation, you'll know the `refund_amount` you're due to get back. * @param {string} id - Duffel's unique identifier for the order to cancel * @link https://duffel.com/docs/api/order-cancellations/confirm-order-cancellation */ confirm: (id: string) => Promise>; } } declare module '@duffel/api/booking/Orders/Orders' { import { Resource } from '@duffel/api/Resource'; import { AddServices, CreateOrder, DuffelResponse, ListParamsOrders, Order, OrderAvailableService, PaginationMeta, UpdateSingleOrder } from '@duffel/api/types'; export class Orders extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Retrieves an order by its ID * @param {string} id - Duffel's unique identifier for the order */ get: (id: string) => Promise>; /** * Retrieves a page of orders. The results may be returned in any order. * @param {Object} [options] - Pagination options (optional: limit, after, before) * @link https://duffel.com/docs/api/orders/get-orders */ list: (options?: PaginationMeta & ListParamsOrders) => Promise>; /** * Retrieves a generator of all orders. The results may be returned in any order. * You can optionally filter the results by the `awaiting_payment` state and sort by the `payment_required_by` date. * @param {Object} [options] - Optional query parameters: awaiting_payment, sort * @link https://duffel.com/docs/api/orders/get-orders */ listWithGenerator: (options?: ListParamsOrders) => AsyncGenerator, void, unknown>; /** * Creates a booking with an airline based on an offer. */ create: (options: CreateOrder) => Promise>; /** * Updates a single order * @description Some order fields are updateable. Each field that can be updated is detailed in the request object. * @param {string} id - Duffel's unique identifier for the order * @param {Object.UpdateSingleOrder} options * @example (id: 'ord_00009hthhsUZ8W4LxQgkjo', { metadata: { 'payment_intent_id': 'pit_00009htYpSCXrwaB9DnUm2' } } ) * @link https://duffel.com/docs/api/orders/update-order-by-id */ update: (id: string, options: UpdateSingleOrder) => Promise>; /** * Retrieves the available services for an order by its ID * @param {string} id - Duffel's unique identifier for the order */ getAvailableServices: (id: string) => Promise>; /** * Adds services for an order by its ID * @param {string} id - Duffel's unique identifier for the order * @param {Object.AddServices} options * @link https://duffel.com/docs/api/orders/create-order-services */ addServices: (id: string, options: AddServices) => Promise>; } } declare module '@duffel/api/booking/OrderChangeRequests/OrderChangeRequests' { import { Resource } from '@duffel/api/Resource'; import { CreateOrderChangeRequest, DuffelResponse, OrderChangeRequestResponse } from '@duffel/api/types'; /** * * To change an order, you'll need to create an order change request. * This is still in PREVIEW mode * @export * @class OrderChangeRequests * @extends {Resource} */ export class OrderChangeRequests extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Retrieves an order change request by its ID * @param {string} id - The ID of your order change request */ get: (id: string) => Promise>; /** * * To change flights on an existing paid order, you'll need to create an order change request. * @link https://duffel.com/docs/api/order-change-requests/create-order-change-request * @memberof OrderChangeRequests */ create: (options: CreateOrderChangeRequest) => Promise>; } } declare module '@duffel/api/booking/OrderChangeOffers/OrderChangeOffers' { import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, OrderChangeOffer, PaginationMeta } from '@duffel/api/types'; /** * After you've searched for flights to add to your order by creating an order change request, we'll send your search to a range of airlines, which may return order change offers. * This is still in PREVIEW mode * @export * @class OrderChangeOffers * @extends {Resource} */ export class OrderChangeOffers extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Retrieves an order change offer by its ID * @param {string} id - The ID of your order change offer * @link https://duffel.com/docs/api/order-change-offers/get-order-change-offer-by-id */ get: (id: string) => Promise>; /** * Retrieves a page of order change offers. The results may be returned in any order. * @param {Object} [options] - Pagination options (optional: limit, after, before) */ list: (options?: PaginationMeta) => Promise>; /** * Retrieves a generator of all order change offers. The results may be returned in any order. */ listWithGenerator: () => AsyncGenerator, void, unknown>; } } declare module '@duffel/api/booking/OrderChanges/OrderChanges' { import { Resource } from '@duffel/api/Resource'; import { ConfirmOrderChangePayment, CreateOrderChangeParameters, DuffelResponse, OrderChangeOffer } from '@duffel/api/types'; /** * Once you've created an order change request, and you've chosen which slices to add and remove, you'll then want to create an order change. */ export class OrderChanges extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * To begin the process of changing an order you need to create an order change. * The OrderChange will contain the `selected_order_change_offer` reference of the change you wish to make to your order. * @link https://duffel.com/docs/api/order-changes/create-order-change */ create: (options: CreateOrderChangeParameters) => Promise>; /** * Retrieves an order change by its ID * @param {string} id - Duffel's unique identifier for the order change * @link https://duffel.com/docs/api/order-changes/get-order-change-by-id */ get: (id: string) => Promise>; /** * Once you've created a pending order change, you'll know the change_total_amount due for the change. * @param {string} id - Duffel's unique identifier for the order change * @param {payment} Object - The payment details to use to pay for the order change, if there is an amount to be paid. Some order changes may not need this if they instead refund an amount. In those cases, you can pass any empty object. * @link https://duffel.com/docs/api/order-changes/confirm-order-change */ confirm: (id: string, options: Partial) => Promise>; } } declare module '@duffel/api/booking/Payments/Payments' { import { Resource } from '@duffel/api/Resource'; import { CreatePayment, DuffelResponse, Payment } from '@duffel/api/types'; export class Payments extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Creates a payment for an existing pay later order. * An order can be paid for up to the time limit indicated in `payment_required_by`, after which the space held for the order will be released and you will have to create a new order. * @param {string} order_id * @param {string} payment */ create: (options: CreatePayment) => Promise>; } } declare module '@duffel/api/booking/PartialOfferRequests/PartialOfferRequests' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { CreateOfferRequest, DuffelResponse, OfferRequest } from '@duffel/api/types'; import { CreatePartialOfferRequestQueryParam, SelectedPartialOffersParams } from '@duffel/api/booking/PartialOfferRequests/PartialOfferRequestTypes'; /** * To search for and select flights separately for each slice of the journey, you'll need to create a partial offer request. * * A partial offer request describes the passengers and where and when they want to travel (in the form of a list of slices). * @class * @link https://duffel.com/docs/api/partial-offer-requests */ export class PartialOfferRequests extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Retrieves a partial offers request by its ID, only including partial offers for the current slice of multi-step search flow. * @param {string} id - Duffel's unique identifier for the partial offer request * @param {Object} [options] - Selected partial offers * @link https:/duffel.com/docs/api/partial-offer-requests/get-partial-offer-request-by-id */ get: (id: string, options?: SelectedPartialOffersParams) => Promise>; /** * To search for and select flights separately for each slice of the journey, you'll need to create a partial offer request. * A partial offer request describes the passengers and where and when they want to travel (in the form of a list of slices). * It may also include additional filters (e.g. a particular cabin to travel in). * @param {Object} [options] - the parameters for making a partial offer requests (required: slices, passengers; optional: cabin_class) * @link https://duffel.com/docs/api/partial-offer-requests/create-partial-offer-request */ create: (options: CreateOfferRequest & QueryParams) => Promise>; /** * Retrieves an offer request with offers for fares matching selected partial offers.. * @param {string} id - Duffel's unique identifier for the partial offer request * @param {Object} [options] - Selected partial offers * @link https:/duffel.com/docs/api/partial-offer-requests/get-partial-offer-request-fares-by-id */ getFaresById: (id: string, options?: SelectedPartialOffersParams) => Promise>; } } declare module '@duffel/api/booking/SeatMaps/SeatMaps' { import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, SeatMap } from '@duffel/api/types'; export class SeatMaps extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Gets seat maps by specific parameters. At the moment we only support querying by an offer ID. * @param {string} offer_id - Duffel's unique identifier for the offer * @link https://duffel.com/docs/api/seat-maps/get-seat-maps */ get: (params: { offer_id: string; }) => Promise>; } } declare module '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntentsType' { export interface PaymentIntent { /** * The amount of the Payment Intent that covers the cost of the flight being sold and any additional markup. * The card payment will be charged this amount. */ amount: string; /** * The [ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2) code of the country that issued the card used to confirm the Payment Intent. * It will be null until the Payment Intent is confirmed. */ card_country_code: string | null; /** * The last four digits of the card used to confirm the Payment Intent. * It will be null until the Payment Intent is confirmed. */ card_last_four_digits: string | null; /** * The card network in which the Payment Intent was processed on. * It will be null until the Payment Intent is confirmed. */ card_network: 'amex' | 'cartes_bancaires' | 'diners' | 'discover' | 'interac' | 'jcb' | 'mastercard' | 'unionpay' | 'visa' | 'unknown' | null; /** * This value is used when displaying the payment collection form to securely identify and transmit the values to Duffel. */ client_token: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the Payment Intent was confirmed */ confirmed_at: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the Payment Intent was created */ created_at: string; /** * The currency of the `amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * The card payment will be charged in this currency. * If it's different to your Balance currency, it will be converted to your Balance currency before the Balance is topped up. */ currency: string; /** * The amount of the fees to process the Payment Intent. * It will be `null` until the Payment Intent is confirmed. */ fees_amount: string | null; /** * The currency of the fees_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * This currency will match your Balance currency. * It will be null until the Payment Intent is confirmed. */ fees_currency: string | null; /** * Duffel's unique identifier for the `Payment Intent` */ id: string; /** * Whether the Payment Intent was created in live mode. This field will be set to `true` if the Payment Intent was created in live mode, or `false` if it was created in test mode. */ live_mode: boolean; /** * The amount of the Payment Intent that was added to the Balance. * It'll be `amount` (in the Balance currency) less the `fees_amount`. * It will be `null` until the Payment Intent is confirmed. */ net_amount: string | null; /** * The currency of the net_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * This currency will match your Balance currency. * It will be null until the Payment Intent is confirmed. */ net_currency: string | null; /** * The Refunds for this Payment Intent * @link https://duffel.com/docs/api/payment-intents/schema#payment-intents-schema-refunds */ refunds: { amount: string; arrival: string; created_at: string; currency: string; destination: string; id: string; live_mode: boolean; net_amount: string; net_currency: string; payment_intent_id: string; status: 'succeeded' | 'pending' | 'failed'; updated_at: string; }[]; /** * The status of this Payment Intent */ status: null | 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'requires_capture' | 'cancelled' | 'succeeded'; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the Payment Intent was updated */ updated_at: string; } export interface CreatePaymentIntent { /** * This is the amount that the card payment being taken will be charged. * It should be enough to cover the service(s) you want to sell (enough to book an Offer for example) and the processing fees. * If the currency is different from your Balance currency you should also account for foreign exchange. * It can be higher than that, in which case the remainder will be considered your markup. * If it's higher than the maximum allowed for you organisation you will get a validation error. By default the maximum is 5,000.00 GBP (or equivalent in the same currency). If you need a maximum higher than the default please get in touch with us via help@duffel.com. */ amount: string; /** * The currency of the amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * This is going to be the currency that the card payment being taken in will be charged in. */ currency: string; } } declare module '@duffel/api/Places/Suggestions/SuggestionsType' { import { Airport, City } from '@duffel/api/types'; export interface Places { /** * The type of the place */ type: string; /** * The time zone of the airport, specified by name from the tz database */ time_zone: string | null; /** * The name of the place */ name: string; /** * The longitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -180° and 180° */ longitude: number | null; /** * The latitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -90° and 90° */ latitude: number | null; /** * Duffel's unique identifier for the place */ id: string; /** * The four-character ICAO code for the airport */ icao_code: string | null; /** * The ISO 3166-1 alpha-2 code for the country where the city is located */ iata_country_code: string; /** * The 3-letter IATA code for the place */ iata_code: string; /** * The 3-letter IATA code for the city where the place is located. Only present for airports which are registered with IATA as belonging to a metropolitan area. */ iata_city_code: string | null; /** * The name of the country where the city or airport is located */ country_name: string | null; /** * The name of the city (or cities separated by a /) where the airport is located */ city_name: string | null; /** * The metropolitan area where the airport is located. Only present for airports which are registered with IATA as belonging to a metropolitan area. */ city: City | null; /** * The airports associated to a city. This will only be provided where the type is city. */ airports: Airport[] | null; } } declare module '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChangesTypes' { import { OrderSlice } from '@duffel/api/types'; export type AirlineInitiatedChangeActionTaken = 'accepted' | 'cancelled' | 'changed'; export type AirlineInitiatedChangeAvailableAction = 'accept' | 'cancel' | 'change' | 'update'; /** * The associated Travel Agent Ticket, if any, for this Airline-Initiated Change. * This value will be present for Airline-Initiated changes that take some time to be processed. */ export interface TravelAgentTicket { id: string; external_ticket_id: string; } type EmptyObject = Record; export interface AirlineInitiatedChange { /** * The action taken in response to this airline-initiated change. Accepted, * cancelled and changed reflect your action in accepting the change, * cancelling the order or changing the order respectively. */ action_taken: AirlineInitiatedChangeActionTaken | null; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which an * action was taken. */ action_taken_at: string | null; /** * List of updated (slices and segments)[https://duffel.com/docs/api/orders/schema#orders-schema-slices] * following the change. These slices and segments may each have a new ID as a * result of the changes. */ added: OrderSlice[]; /** * The available actions you can take on this Airline-Initiated Change through * our API.`"update"` means that you can use the update endpoint for an * Airline-Initiated Change. */ available_actions: AirlineInitiatedChangeAvailableAction[]; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which we * detected the airline-initiated change. */ created_at: string; /** * Duffel's unique identifier for the airline-initiated change. */ id: string; /** * Duffel's unique identifier for the order. */ order_id: string; /** * List of (slices and segments)[https://duffel.com/docs/api/orders/schema#orders-schema-slices] * as they were before the change. */ removed: OrderSlice[]; /** * The associated Travel Agent Ticket, if any, for this Airline-Initiated * Change. This value will be present for Airline-Initiated changes that take * some time to be processed. */ travel_agent_ticket: TravelAgentTicket | EmptyObject | null; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which * the airline-initiated change was last updated. */ updated_at: string; } export {}; } declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' { import { Airline, CabinClass, PassengerType, Place, PlaceType } from '@duffel/api/types'; import { Offer } from '@duffel/api/booking/Offers/OfferTypes'; export interface OfferRequestSlice { /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the passengers want to depart */ departure_date: string; /** * The city or airport the passengers want to travel to */ destination: Place; /** * The city or airport the passengers want to depart from */ origin: Place; /** * The type of the origin */ origin_type: PlaceType; /** * The type of the destination */ destination_type: PlaceType; } interface CreateOfferRequestPassengerCommon { /** * The passenger's family name. Only `space`, `-`, `'`, and letters from the * `ASCII`, `Latin-1 Supplement` and `Latin Extended-A` (with the exceptions * of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. * All other characters will result in a validation error. The minimum length * is 1 character, and the maximum is 20 characters. * * This is only required if you're also including * **Loyalty Programme Accounts**. */ family_name?: string; /** * The passenger's given name. Only `space`, `-`, `'`, and letters from the * `ASCII`, `Latin-1 Supplement` and `Latin Extended-A` (with the exceptions * of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted. * All other characters will result in a validation error. The minimum length * is 1 character, and the maximum is 20 characters. * * This is only required if you're also including * **Loyalty Programme Accounts**. */ given_name?: string; /** * The **Loyalty Programme Accounts** for this passenger. */ loyalty_programme_accounts?: LoyaltyProgrammeAccount[]; } export interface CreateOfferRequestAdultPassenger extends CreateOfferRequestPassengerCommon { age?: never; fare_type?: never; /** * The type of the passenger. If the passenger is aged 18 or over, you should * specify a `type` of `adult`. If a passenger is aged under 18, you should * specify their `age` instead of a `type`. A passenger can have only a type * or an age, but not both. */ type: Extract; } export interface CreateOfferRequestNonAdultPassenger extends CreateOfferRequestPassengerCommon { /** * The age of the passenger on the `departure_date` of the final slice. e.g. * if you a searching for a round trip and the passenger is 15 years old at * the time of the outbound flight, but they then have their birthday and are * 16 years old for the inbound flight, you must set the age to 16. You should * specify an `age` for passengers who are under 18 years old. A passenger can * have only a type or an age, but not both. You can optionally pass age with * `fare_type` though. */ age: number; fare_type?: never; type?: never; } export type CreateOfferRequestPassengerFareType = 'accompanying_adult' | 'contract_bulk' | 'contract_bulk_child' | 'contract_bulk_infant_with_seat' | 'contract_bulk_infant_without_seat' | 'frequent_flyer' | 'group_inclusive_tour' | 'group_inclusive_tour_child' | 'humanitarian' | 'individual_inclusive_tour_child' | 'marine' | 'seat_only' | 'student' | 'teacher' | 'tour_operator_inclusive' | 'tour_operator_inclusive_infant' | 'unaccompanied_child' | 'visiting_friends_and_family'; interface CreateOfferRequestPassengerWithFareType extends CreateOfferRequestPassengerCommon { /** * The age of the passenger on the `departure_date` of the final slice. e.g. * if you a searching for a round trip and the passenger is 15 years old at * the time of the outbound flight, but they then have their birthday and are * 16 years old for the inbound flight, you must set the age to 16. You should * specify an `age` for passengers who are under 18 years old. A passenger can * have only a type or an age, but not both. You can optionally pass age with * `fare_type` though. */ age?: number; /** * The fare type of the passenger. If the passenger is aged less than 18, you * should pass in age as well. */ fare_type: CreateOfferRequestPassengerFareType; type?: never; } export type CreateOfferRequestPassenger = CreateOfferRequestAdultPassenger | CreateOfferRequestNonAdultPassenger | CreateOfferRequestPassengerWithFareType; export interface CreateOfferRequestPrivateFare { corporate_code: string; tracking_reference: string; } /** * The passengers who want to travel. A passenger will have only a type or an age. */ export interface OfferRequestPassenger { /** * The age of the passenger on the `departure_date` of the final slice. */ age?: number; /** * The type of the passenger. */ type?: PassengerType; /** * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 * characters. * * This is only required if you're also including **Loyalty Programme Accounts**. */ family_name?: string; /** * The passenger's given name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 * characters. * * This is only required if you're also including **Loyalty Programme Accounts**. */ given_name?: string; /** * The **Loyalty Programme Accounts** for this passenger. */ loyalty_programme_accounts?: LoyaltyProgrammeAccount[]; /** * The identifier for the passenger, unique within this Offer Request and across all Offer Requests. * This ID will be generated by Duffel unless you had optionally provided one. * Optionally providing one has been deprecated. */ id: string; } /** * The **Loyalty Programme Account** details. */ export interface LoyaltyProgrammeAccount { /** * The passenger's account number for this **Loyalty Programme Account**. */ account_number: string; /** * The IATA code for the airline that this **Loyalty Programme Account** belongs to. */ airline_iata_code: Airline['iata_code']; } /** * To search for flights, you'll need to create an offer request. * An offer request describes the passengers and where and when they want to travel (in the form of a list of slices). * It may also include additional filters (e.g. a particular cabin to travel in). * @link https://duffel.com/docs/api/offer-requests/schema */ export interface OfferRequest { /** * The slices that make up this offer request. * One-way journeys can be expressed using one slice, whereas return trips will need two. * @link https://duffel.com/docs/api/overview/key-principles */ slices: OfferRequestSlice[]; /** * The cabin that the passengers want to travel in */ cabin_class?: CabinClass; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer request was created */ created_at: string; /** * Duffel's unique identifier for the offer request */ id: string; /** * Whether the offer request was created in live mode. This field will be set to true if the offer request was created in live mode, or false if it was created in test mode. */ live_mode: boolean; /** * The offers returned by the airlines */ offers: Omit[]; /** * The passengers who want to travel. A passenger will have only a type or an age. */ passengers: OfferRequestPassenger[]; } export interface CreateOfferRequest { /** * The cabin that the passengers want to travel in. */ cabin_class?: CabinClass; /** * The maximum number of connections within any slice of the offer. For * example 0 means a direct flight which will have a single segment within * each slice and 1 means a maximum of two segments within each slice of the * offer. */ max_connections?: 0 | 1 | 2; /** * The passengers who want to travel. If you specify an `age` for a passenger, * the `type` may differ for the same passenger in different offers due to * airline's different rules. E.g. one airline may treat a 14 year old as an * adult, and another as a young adult. You may only specify an `age` or a * `type` – not both. */ passengers: CreateOfferRequestPassenger[]; /** * The private fare codes for this Offer Request. You can pass in multiple * airlines with their specific private fare codes. The key is the airline's * IATA code that provided the private fare code. The `corporate_code` is * provided to you by the airline and the `tracking_reference` is to identify * your business by the airlines. */ private_fares?: { [iataCode: string]: CreateOfferRequestPrivateFare[]; }; /** * The [slices](https://duffel.com/docs/api/overview/key-principles) that make * up this offer request. One-way journeys can be expressed using one slice, * whereas return trips will need two. */ slices: CreateOfferRequestSlice[]; } export type TimeRangeFilter = { from: string; to: string; }; export interface CreateOfferRequestSlice { /** * The 3-letter IATA code for the city or airport where this slice ends * Example: "JFK" */ destination: string; /** * The 3-letter IATA code for the city or airport where this slice starts * Example: "LHR" */ origin: string; /** * The ISO 8601 date on which the passengers want to depart * Example: "2020-04-24" */ departure_date: string; /** * The inclusive time range for the arrival of the slice */ arrival_time: TimeRangeFilter | null; /** * The inclusive time range for the departure of the slice */ departure_time: TimeRangeFilter | null; } export interface CreateOfferRequestQueryParameters { /** * When set to `true`, the offer request resource returned will include all the offers returned by the airlines. * If set to `false`, the offer request resource won't include any offers. * To retrieve the associated `offers` later, use the [List Offers](https://duffel.com/docs/api/offers/get-offers) endpoint, specifying the `offer_request_id`. * You should use this option if you want to take advantage of the pagination, sorting and filtering that the [List Offers](https://duffel.com/docs/api/offers/get-offers) endpoint provides. */ return_offers?: boolean; /** * The maximum amount of time in milliseconds to wait for each airline search to complete. * This timeout applies to the response time of the call to the airline and includes * some additional overhead added by Duffel. Value should be between `2` seconds and `60` seconds. * Any values outside the range will be ignored and the default supplier_timeout will be used. * If a value is set, the response will only include offers from airline searches that completed * within the given time. If a value is not set, the response will only include offers from * airline searches that completed within the default supplier_timeout value of 20 seconds. * We recommend setting supplier_timeout lower than the timeout on the HTTP request you send to * Duffel API as that will allow us to respond with the offers we received before your request * times out with an empty response. */ supplier_timeout?: number; } export {}; } declare module '@duffel/api/booking/BatchOfferRequests/BatchOfferRequestsTypes' { import { CabinClass, Offer } from '@duffel/api/types'; import { CreateOfferRequestPassenger, CreateOfferRequestSlice, CreateOfferRequestPrivateFare } from '@duffel/api/booking/OfferRequests/OfferRequestsTypes'; export interface BatchOfferRequest { /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer request was created */ created_at: string; /** * Duffel's unique identifier for the offer request */ id: string; /** * Whether the offer request was created in live mode. This field will be set to true if the offer request was created in live mode, or false if it was created in test mode. */ live_mode: boolean; /** * A client key to allow the Duffel Ancillaries component to talk to the Duffel API to retrieve information about an offer and its ancillaries. Learn more about how to use this on https://duffel.com/docs/guides/ancillaries-component. */ client_key: string; /** * The total number of batches of offers. */ total_batches: number; /** * The number of batches of offers that are remaining. This can be used with the total_batches to estimate the amount of work remaining. Once this reaches zero, there are no more batches of offers to process. */ remaining_batches: number; /** * The offers related to this batch offer request. */ offers: Omit[]; } export type CreateBatchOfferRequestResponse = Omit; export interface CreateBatchOfferRequest { /** * The cabin that the passengers want to travel in. */ cabin_class?: CabinClass; /** * The maximum number of connections within any slice of the offer. For * example 0 means a direct flight which will have a single segment within * each slice and 1 means a maximum of two segments within each slice of the * offer. */ max_connections?: 0 | 1 | 2; /** * The passengers who want to travel. If you specify an `age` for a passenger, * the `type` may differ for the same passenger in different offers due to * airline's different rules. E.g. one airline may treat a 14 year old as an * adult, and another as a young adult. You may only specify an `age` or a * `type` – not both. */ passengers: CreateOfferRequestPassenger[]; /** * The private fare codes for this Offer Request. You can pass in multiple * airlines with their specific private fare codes. The key is the airline's * IATA code that provided the private fare code. The `corporate_code` is * provided to you by the airline and the `tracking_reference` is to identify * your business by the airlines. */ private_fares?: { [iataCode: string]: CreateOfferRequestPrivateFare[]; }; /** * The [slices](https://duffel.com/docs/api/overview/key-principles) that make * up this offer request. One-way journeys can be expressed using one slice, * whereas return trips will need two. */ slices: CreateOfferRequestSlice[]; } export interface CreateBatchOfferRequestQueryParameters { /** * The maximum amount of time in milliseconds to wait for each airline search to complete. * This timeout applies to the response time of the call to the airline and includes * some additional overhead added by Duffel. Value should be between `2` seconds and `60` seconds. * Any values outside the range will be ignored and the default supplier_timeout will be used. * If a value is set, the response will only include offers from airline searches that completed * within the given time. If a value is not set, the response will only include offers from * airline searches that completed within the default supplier_timeout value of 20 seconds. * We recommend setting supplier_timeout lower than the timeout on the HTTP request you send to * Duffel API as that will allow us to respond with the offers we received before your request * times out with an empty response. */ supplier_timeout?: number; } } declare module '@duffel/api/booking/Offers/OfferTypes' { import { Aircraft, Airline, Airport, CabinClass, CreateOfferRequestPassengerFareType, PassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferSliceConditions, PaginationMeta, Place, PlaceType, Stop } from '@duffel/api/types'; /** * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria. * @link https://duffel.com/docs/api/offers/schema */ export interface Offer { /** * The services that can be booked along with the offer but are not included by default, for example an additional checked bag. * This field is only returned in the Get single offer endpoint. * When there are no services available, or we don't support services for the airline, this list will be empty. */ available_services: OfferAvailableService[]; /** * The base price of the offer for all passengers, excluding taxes. * It does not include the base amount of any service(s) that might be booked with the offer. */ base_amount: string; /** * The currency of the `base_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code */ base_currency: string; /** * The conditions associated with this offer, describing the kinds of modifications you can make post-booking and any penalties that will apply to those modifications. * This information assumes the condition is applied to all of the slices and passengers associated with this offer - for information at the slice level (e.g. "what happens if I just want to change the first slice?") refer to the `slices`. * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API. * In some cases, you may need to contact the Duffel support team or the airline directly. */ conditions: FlightsConditions; /** * The ISO 8601 datetime at which the offer was created */ created_at: string; /** * The ISO 8601 datetime at which the offer will expire and no longer be usable to create an order */ expires_at: string; /** * Duffel's unique identifier for the offer */ id: string; /** * Whether the offer request was created in live mode. * This field will be set to `true` if the offer request was created in live mode, or `false` if it was created in test mode. */ live_mode: boolean; /** * The airline which provided the offer */ owner: Airline; /** * Whether identity documents must be provided for each of the passengers when creating an order based on this offer. * If this is `true`, you must provide an identity document for every passenger. */ passenger_identity_documents_required: boolean; /** * The passengers included in the offer */ passengers: OfferPassenger[]; /** * The payment requirements for this offer */ payment_requirements: PaymentRequirements; /** * The private fares applied on this offer. */ private_fares: OfferPrivateFare[]; /** * The slices that make up this offer. Each slice will include one or more segments, * the specific flights that the airline is offering to take the passengers from the slice's `origin` to its `destination`. */ slices: OfferSlice[]; /** * The amount of tax payable on the offer for all passengers */ tax_amount: string | null; /** * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code */ tax_currency: string | null; /** * The total price of the offer for all passengers, including taxes. * It does not include the total price of any service(s) that might be booked with the offer. */ total_amount: string; /** * An estimate of the total carbon dioxide (CO₂) emissions when * all of the passengers fly this offer's itinerary, measured in kilograms */ total_emissions_kg: string; /** * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code */ total_currency: string; /** * The ISO 8601 datetime at which the offer was last updated */ updated_at: string; /** * Whether this is a partial or full offer. * A partial offer can't be booked directly, but it can be combined with other partial offers to form a full offer. * Partial offers are only ever returned through the multi-step search flow. */ partial: boolean; /** * A list of airline IATA codes whose loyalty programmes are supported when booking the offer. * Loyalty programmes present within the offer passengers that are not present in this field shall be ignored at booking. * If this is an empty list ([]), no loyalty programmes are supported for the offer and shall be ignored if provided. * @example: ["AF","KL","DL"] */ supported_loyalty_programmes: string[]; /** * The types of identity documents supported by the airline and may be provided for the * passengers when creating an order based on this offer. Currently, possible types are `passport`, * `tax_id`, `known_traveler_number`, and `passenger_redress_number`. */ supported_passenger_identity_document_types: OfferSupportedPassengerIdentityDocumentTypes[]; } export type OfferSupportedPassengerIdentityDocumentTypes = 'passport' | 'tax_id' | 'known_traveler_number' | 'passenger_redress_number'; export interface OfferAvailableServiceBaggageMetadata { /** * The maximum weight that the baggage can have in kilograms. */ maximum_weight_kg: number | null; /** * The maximum height that the baggage can have in centimetres. */ maximum_height_cm: number | null; /** * The maximum length that the baggage can have in centimetres. */ maximum_length_cm: number | null; /** * The maximum depth that the baggage can have in centimetres. */ maximum_depth_cm: number | null; /** * The type of the baggage */ type: BaggageType; } export interface OfferAvailableServiceCFARMetadata { /** * The amount the customer will receive back if the service is used, in * `offer.total_currency`. */ refund_amount: string; /** * Information to display to customers. */ merchant_copy: string; /** * URL with the T&Cs for customers. */ terms_and_conditions_url: string; } export interface OfferAvailableServiceCommon { /** * Duffel's unique identifier for the service. */ id: string; /** * The maximum quantity of this service that can be booked with an order. */ maximum_quantity: number; /** * The list of passenger `id`s the service applies to. If you add this * service to an order it will apply to all the passengers in this list. * For services where the type is `baggage`, this list will include only a * single passenger. */ passenger_ids: string[]; /** * The list of segment `id`s the service applies to. If you add this * service to an order it will apply to all the segments in this list. For * services where the type is `baggage`, depending on the airline, this * list includes all the segments of all slices or all the segments of a * single slice. */ segment_ids: string[]; /** * The total price of the service for all passengers and segments it * applies to, including taxes. This price is for a single unit of the * service. */ total_amount: string; /** * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) * currency code. It will match your organisation's billing currency unless * you’re using Duffel as an accredited IATA agent, in which case it will be * in the currency provided by the airline (which will usually be based on the * country where your IATA agency is registered). */ total_currency: string; } export interface OfferAvailableServiceBaggage extends OfferAvailableServiceCommon { /** * The metadata varies by the type of service. It includes further data * about the service. For example, for baggages, it may have data about * size and weight restrictions. */ metadata: OfferAvailableServiceBaggageMetadata; /** * The type of the service. */ type: 'baggage'; } export interface OfferAvailableServiceCFAR extends OfferAvailableServiceCommon { /** * The metadata varies by the type of service. It includes further data * about the service. For example, for baggages, it may have data about * size and weight restrictions. */ metadata: OfferAvailableServiceCFARMetadata; /** * The type of the service. */ type: 'cancel_for_any_reason'; } export type OfferAvailableService = OfferAvailableServiceBaggage | OfferAvailableServiceCFAR; export interface PaymentRequirements { /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime by which * you must pay for this order. At this time, if still unpaid, the reserved * space on the flight(s) will be released and you will have to create a new * order. This will be null only for orders where `awaiting_payment` is * `false`. */ payment_required_by: string | null; /** * The ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the * price associated with the order will no longer be guaranteed by the airline * and may change before payment. This will be null when * `requires_instant_payment` is `true`. */ price_guarantee_expires_at: string | null; /** * When payment is required at the time of booking this will be true and * `payment_required_by` and `price_guarantee_expires_at` will be `null`. When * payment can be made at a time after booking, this will be `false` and the * time limits on the payment will be provided in `payment_required_by` and * `price_guarantee_expires_at`. */ requires_instant_payment: boolean; } export interface OfferPrivateFare { /** * The corporate code that was applied, if any. */ corporate_code?: string; /** * The tracking reference that was applied, if any. */ tracking_reference?: string; /** * The type of private fare applied. */ type: 'corporate' | 'leisure' | 'negotiated'; } export interface OfferPassenger { /** * The age of the passenger on the departure_date of the final slice. */ age: number | null; /** * The type of the passenger. */ type: PassengerType | null; /** * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 * characters. * * This is only required if you're also including **Loyalty Programme Accounts**. */ family_name?: string; /** * The passenger's given name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20 * characters. * * This is only required if you're also including **Loyalty Programme Accounts**. */ given_name?: string; /** * The **Loyalty Programme Accounts** for this passenger. */ loyalty_programme_accounts?: LoyaltyProgrammeAccount[]; /** * The identifier for the passenger, unique within this Offer Request and across all Offer Requests. * This ID will be generated by Duffel unless you had optionally provided one. * Optionally providing one has been deprecated. */ id: string; /** * The fare type of the passenger * Example: "contract_bulk" */ fare_type: CreateOfferRequestPassengerFareType | null; } export interface OfferSlice { /** * The type of the destination */ destination_type: PlaceType; /** * The city or airport where this slice ends */ destination: Place; /** * The type of the origin */ origin_type: PlaceType; /** * The city or airport where this slice begins */ origin: Place; /** * The duration of the slice, represented as a ISO 8601 duration */ duration: string | null; /** * The name of the fare brand associated with this slice. * A fare brand specifies the travel conditions you get on your slice made available * by the airline. e.g. a British Airways Economy Basic fare will only include a hand baggage allowance. * It is worth noting that the fare brand names are defined by the airlines themselves and therefore they * are subject to change without any prior notice. We're in the process of adding support for fare_brand_name across * all our airlines, so for now, this field may be null in some offers. * This will become a non-nullable attribute in the near future. */ fare_brand_name: string | null; /** * Duffel's unique identifier for the slice. It identifies the slice of an offer (i.e. the same slice across offers will have different `id`s */ id: string; /** * The segments - that is, specific flights - that the airline is offering to get the passengers from the `origin` to the `destination` */ segments: OfferSliceSegment[]; /** * The conditions associated with this slice, describing the kinds of modifications you can make post-booking and any penalties that will apply to those modifications * and also what perks shall be available to passengers when travelling. * This condition is applied only to this slice and to all the passengers associated with this offer - for information at the offer level (e.g. "what happens if I want to change all the slices?") refer to the conditions at the top level. * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API. * In some cases, you may need to contact the Duffel support team or the airline directly. * Note that the perks associated with the slice are aggregated across passengers and segments and are intended to provide a brief summary of the passenger experience, * however, the experience may not be consistent across all segments. * As an example, priority boarding may be flagged as available but not available on all segments on the slice. * See segment passenger conditions for a per-flight breakdown what is available to * passengers if you require this level of granularity. */ conditions: OfferSliceConditions; /** * A summary of the seat characteristics and extras available to passengers on the given slice. * The shelf is calculated by Duffel and may be used to group similar slices across offers when building a shopping display. * Note this value does not take into account any services that may be purchased in addition to the offer and should not be directly used * in any offer ranking systems. * Includes the following: * - `"1"`: standard seating with limited extras. * - `"2"`: standard seating with extras, i.e. carry-on baggage, advanced seat selection, priority boarding etc. * - `"3"`: preferred seating, such as additional legroom, seat width or middle seat free * - `"4"`: premium seating, additional legroom and recline. Situated in business class or higher. * - `"5"`: deluxe seating, additional legroom and reclines to lie flat position. Situated in business class or higher. */ ngs_shelf: number | null; /** * A hash uniquely identifying this slice. This value could be use to group together identical slices from different offers. */ comparison_key: string; } export interface OfferSliceSegment { /** * The aircraft that the operating carrier will use to operate this segment */ aircraft: Aircraft; /** * The ISO 8601 datetime at which the segment is scheduled to arrive */ arriving_at: string; /** * The terminal at the destination airport where the segment is scheduled to arrive */ destination_terminal: string | null; /** * The ISO 8601 datetime at which the segment is scheduled to depart */ departing_at: string; /** * The terminal at the origin airport from which the segment is scheduled to depart */ origin_terminal: string | null; /** * The airport at which the segment is scheduled to arrive */ destination: Airport; /** * The distance of the segment in kilometres */ distance: string | null; /** * The duration of the segment, represented as a ISO 8601 duration */ duration: string | null; /** * Duffel's unique identifier for the segment. It identifies the segment of an offer (i.e. the same segment across offers will have different `id`s */ id: string; /** * The airline selling the tickets for this segment. * This may differ from the `operating_carrier` in the case of a "codeshare", where one airline sells flights operated by another airline. */ marketing_carrier: Airline; /** * The flight number assigned by the marketing carrier */ marketing_carrier_flight_number: string; /** * The airport from which the flight is scheduled to depart */ origin: Airport; /** * The airline actually operating this segment. * This may differ from the marketing_carrier in the case of a "codeshare", where one airline sells flights operated by another airline. */ operating_carrier: Airline; /** * The flight number assigned by the operating carrier */ operating_carrier_flight_number: string; /** * Additional segment-specific information about the passengers included in the offer (e.g. their baggage allowance and the cabin class they will be travelling in) */ passengers: OfferSliceSegmentPassenger[]; /** * Additional segment-specific information about the stops, if any, included in the segment */ stops: Array; } export type WiFiAmenityCost = 'free' | 'paid' | 'free or paid' | 'n/a'; export type SeatPitch = 'less' | 'more' | 'standard' | 'n/a'; export type SeatType = 'standard' | 'extra_legroom' | 'skycouch' | 'recliner' | 'angle_flat' | 'full_flat' | 'private_suite'; export interface OfferSliceSegmentPassenger { /** * The baggage allowances for the passenger on this segment included in the offer. * Some airlines may allow additional baggage to be booked as a service - see the offer's available_services. */ baggages: OfferSliceSegmentPassengerBaggage[]; /** * The cabin class that the passenger will travel in on this segment */ cabin_class: CabinClass; /** * The name that the marketing carrier uses to market this cabin class */ cabin_class_marketing_name: string; /** * The identifier for the passenger. * You may have specified this ID yourself when creating the offer request, or otherwise, Duffel will have generated its own random ID. */ passenger_id: string; /** * The airline's alphanumeric code for the fare that the passenger is using to travel. Where this is `null`, it means that either the * fare basis code is not available or the airline does not use fare basis codes. */ fare_basis_code: string; /** * Data about the cabin that the passenger will be flying in for this segment */ cabin: OfferSliceSegmentPassengerCabin | null; } export interface OfferSliceSegmentPassengerCabin { /** * The name of the cabin class */ name: CabinClass; /** * TThe name that the marketing carrier uses to market this cabin class */ marketing_name: string; /** * The amenities specific to this cabin class on this plane */ amenities: { /** * If Wi-Fi is available, information on its cost, availability, etc */ wifi: { /** * Whether Wi-Fi is available in this cabin */ available: boolean; /** * The cost, if any, to use the Wi-Fi */ cost: WiFiAmenityCost; } | null; /** * Information on the standard seat in this cabin class. Exceptions may apply, such as on exit rows. */ seat: { /** * The distance from a point on a seat to the seat front/behind it, in inches, or "n/a" if not available */ pitch: SeatPitch; /** * A summary of the seat characteristics for the cabin. * Includes the following: * - `"standard"` - typical seating with regular legroom / recline * - `"extra_legroom"` - typical seating with additional legroom * - `"skycouch"` - a row of seats converted into a couch layout * - `"recliner"` - seating with additional legroom and recline * - `"angle_flat"` - seating with additional legroom and near flat recline * - `"full_flat_pod"` - seating with full flat recline and enclosing privacy screens * - `"private_suite"` - a full suite, typically including a bed and recliner seat */ type: SeatType; } | null; /** * If power (AC and/or USB) is available, information on what is available */ power: { /** * Whether there is power available or not in this cabin */ available: boolean; } | null; }; } export type BaggageType = 'carry_on' | 'checked'; export interface OfferSliceSegmentPassengerBaggage { /** * The type of the baggage allowance */ type: BaggageType; /** * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases. */ quantity: number; } export interface ListOffersParams extends PaginationMeta { /** * Duffel's unique identifier for the offer request, returned when it was created */ offer_request_id: string; /** * Allows to filter the offers list by the maximum number of connections in a given offer. e.g. a return flight with three flights outbound and a direct inbound flight would be filtered out if `max_connections=1` was passed. */ max_connections?: number; /** * By default, the offers will be returned sorted by ID in ascending order. * This parameter allows you to sort the list of offers by `total_amount` or `total_duration`. * By default the sorting order will be ascending, if you wish to sort in descending order a - will need to be prepended to the sorting attribute (i.e: `-total_amount`). */ sort?: 'total_amount' | 'total_duration'; } export interface LoyaltyProgrammeAccounts { /** * The passenger's account number for this Loyalty Programme Account */ account_number: string; /** * The IATA code for the airline that this Loyalty Programme Account belongs to */ airline_iata_code: string; } export interface UpdateOffer { type: string; loyalty_programme_accounts: LoyaltyProgrammeAccounts; id: string; given_name: string; family_name: string; age: number; } export type OfferIntendedPaymentMethod = { /** * The type of payment method intended to use */ type: 'card'; /** * The ID of the card intended to pay with */ card_id: string; } | { /** * The type of payment method intended to use */ type: 'airline_credit'; /** * The ID of the airline credit intended to pay with */ airline_credit_id: string; }; export interface OfferIntendedService { /** * The ID of the service to pay for */ id: string; /** * The quantity of the service ID to pay for */ quantity: number; } export interface GetOfferPricedParams { /** * The payment methods intended to use to pay for the offer */ intended_payment_methods: OfferIntendedPaymentMethod[]; /** * The services intended to book along with the offer */ intended_services: OfferIntendedService[]; } /** * Represents a priced offer, including the charge and surcharge amounts for the intended payment methods and services */ export interface OfferPriced extends Offer { /** * The payment methods intended to use to pay for the offer, along with the charge and surcharge amounts */ intended_payment_methods: (OfferIntendedPaymentMethod & { charge_currency: string; charge_amount: string; surcharge_amount: string; surcharge_currency: string; })[]; /** * The services intended to book along with the offer */ intended_services: OfferIntendedService[]; } } declare module '@duffel/api/booking/OrderCancellations/OrderCancellationsTypes' { import { PaginationMeta } from '@duffel/api/types'; export interface CreateOrderCancellation { /** * Duffel's unique identifier for the order */ order_id: string; } export interface ListOrderCancellationsParams extends PaginationMeta { /** * Duffel's unique identifier for the order, returned when it was created */ order_id?: string; } export interface OrderCancellationAirlineCredit { /** * Duffel's unique identifier for the airline credit */ id: string; /** * The human-readable name used by the airline to categorize the type of credit being offered. This name should help when trying to understand the airline's conditions of use which apply to this credit. */ credit_name: string; /** * The code which identifies the airline credit to the airline and will be used to redeem the airline credit */ credit_code: string; /** * The monetary value associated with this airline credit */ credit_amount: string; /** * The currency in which this airline credit is issued, as an ISO 4217 currency code */ credit_currency: string; /** * The date the credit was issued. It is important to note that this date might not be the same as the date of cancellation. Often airlines associate credits with tickets, in which case the date of issue is considered to be the date the ticket was originally issued. Airline credits may have expiration dates which are based on the date of issue. Airlines don't always reliably disclose the expiration date in their APIs at the time of cancellation, so we are unable to return this information on airline credits. To get the latest info on expiration dates for airline credits we recommend checking directly with the airlines to determine the specific conditions of use for the credit. */ issued_on: string; /** * Duffel's unique identifier for the passenger on the order that the credit is associated with */ passenger_id: string; } export interface OrderCancellation { /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime that indicates when the order cancellation was confirmed */ confirmed_at: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the order cancellation was created */ created_at: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime by which this cancellation must be confirmed */ expires_at: string; /** * Duffel's unique identifier for the order cancellation */ id: string; /** * Whether the order cancellation was created in live mode. This field will be set to `true` if the order cancellation was created in live mode, or `false` if it was created in test mode. */ live_mode: boolean; /** * Duffel's unique identifier for the order */ order_id: string; /** * The amount that will be returned to the original payment method if the order is cancelled, determined according * to the fare conditions. This may be 0.00 if the fare is non-refundable. It will include the refund amount * of the flights and the services booked. This may be null in cases where the refund amount is unknown. * This only applies in cases where we are unable to get a refund quote from the carrier. */ refund_amount: string | null; /** * The currency of the refund_amount, as an ISO 4217 currency code. * It will match your organisation's billing currency unless you’re using Duffel as an accredited IATA agent, * in which case it will be in the currency provided by the airline (which will usually be based on the * country where your IATA agency is registered). For hold orders that are awaiting payment, the refund amount will always be 0.00. */ refund_currency: string | null; /** * Where the refund, once confirmed, will be sent. `card` is currently a restricted feature. `awaiting_payment` is for pay later orders where no payment has been made yet. */ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment' | 'airline_credits'; /** * The airline credits for this OrderCancellation */ airline_credits: OrderCancellationAirlineCredit[]; } } declare module '@duffel/api/booking/OrderChangeOffers/OrderChangeOfferTypes' { import { OfferSliceSegment, OfferSliceSegmentPassengerBaggage } from '@duffel/api/booking/Offers/OfferTypes'; import { PlaceType, Place, CabinClass } from '@duffel/api/types'; /** * @link https://duffel.com/docs/api/order-change-offers/schema */ export interface OrderChangeOffer { /** * The price of this offer as a change to your existing order, excluding taxes */ change_total_amount: string | null; /** * The currency of the change_total_amount, as an ISO 4217 currency code. * It will match your organisation's billing currency unless you're using Duffel * as an accredited IATA agent, in which case it will be in the currency provided * by the airline (which will usually be based on the country where your * IATA agency is registered). */ change_total_currency: string | null; /** * The ISO 8601 datetime at which the offer was created */ created_at: string; /** * The ISO 8601 datetime at which the offer will expire * and no longer be usable to create an order */ expires_at: string; /** * Duffel's unique identifier for the order change offer */ id: string; /** * The price of this offer if it was newly purchased, excluding taxes */ new_total_amount: string | null; /** * The currency of the new_total_amount, as an ISO 4217 currency code. * It will match your organisation's billing currency unless you're using * Duffel as an accredited IATA agent, in which case it will be in the * currency provided by the airline (which will usually be based on the * country where your IATA agency is registered). */ new_total_currency: string; /** * The ID for an order change if one has already been created from this order change offer */ order_change_id: string; /** * The penalty price imposed by the airline for making this change */ penalty_amount: string; /** * The currency of the penalty_amount, as an ISO 4217 currency code. * It will match your organisation's billing currency unless you're using * Duffel as an accredited IATA agent, in which case it will be in the * currency provided by the airline (which will usually be based on * the country where your IATA agency is registered). */ penalty_currency: string; /** * Where the refund, once confirmed, will be sent. card is currently a restricted feature. * `awaiting_payment` is for pay later orders where no payment has been made yet. */ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment' | 'original_form_of_payment'; /** * The slices to be added and/or removed */ slices: OrderChangeOfferSlices; /** * The ISO 8601 datetime at which the offer was last updated */ updated_at: string; } export interface OrderChangeOfferSlices { /** * The slices that will be added to the order */ add: OrderChangeOfferSlice[]; /** * The slices that will be removed from the order */ remove: OrderChangeOfferSlice[]; } export interface OrderChangeOfferSlice { /** * The city or airport where this slice ends */ destination: Place; /** * The type of the destination */ destination_type: PlaceType; /** * The duration of the slice, represented as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) duration */ duration?: string | null; /** * The name of the fare brand associated with this slice. * A fare brand specifies the travel conditions you get on your slice made available * by the airline. e.g. a British Airways Economy Basic fare will only include a hand baggage allowance. * It is worth noting that the fare brand names are defined by the airlines themselves and therefore they * are subject to change without any prior notice. We're in the process of adding support for fare_brand_name across * all our airlines, so for now, this field may be null in some offers. * This will become a non-nullable attribute in the near future. */ fare_brand_name: string | null; /** * Duffel's unique identifier for the slice. It identifies the slice of an order (i.e. the same slice across orders will have different `id`s. */ id: string; /** * The city or airport where this slice begins */ origin: Place; /** * The type of the origin */ origin_type: PlaceType; /** * The segments - that is, specific flights - that the airline is offering to get the passengers from the `origin` to the `destination` */ segments: Array & { /** Additional segment-specific information about the passengers included in the offer (e.g. their baggage allowance and the cabin class they will be travelling in) */ passengers: Array<{ baggages: OfferSliceSegmentPassengerBaggage[]; cabin_class: CabinClass | null; cabin_class_marketing_name: string | null; passenger_id: string; seat: { designator: string; disclosure: string; name: string; }; }>; }>; } } declare module '@duffel/api/booking/OrderChangeRequests/OrderChangeRequestsTypes' { import { CabinClass, Place } from '@duffel/api/types'; import { OrderChangeOfferSlices } from '@duffel/api/booking/OrderChangeOffers/OrderChangeOfferTypes'; export interface OrderChangeSliceResponse { remove: { slice_id: string; }[]; add: { /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the passengers want to depart */ departure_date: string; /** * The city or airport where this slice ends */ destination: Place; /** * The city or airport where this slice begins */ origin: Place; /** * The cabin that the passengers want to travel in */ cabin_class: CabinClass | null; }[]; } export interface OrderChangeOffers { /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer was last updated */ updated_at: string; /** * The price of this offer as a change to your existing order, excluding taxes */ change_total_amount: string | null; /** * The currency of the `change_total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * It will match your organisation's billing currency unless you're using Duffel as an accredited IATA agent, in which case it will be in the currency provided by the airline (which will usually be based on the country where your IATA agency is registered). */ change_total_currency: string | null; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer was created */ created_at: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer will expire and no longer be usable to create an order */ expires_at: string; /** * Duffel's unique identifier for the order change offer */ id: string; /** * The price of this offer if it was newly purchased, excluding taxes */ new_total_amount: string | null; /** * The currency of the `new_total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. It will match your organisation's billing currency unless you're using Duffel as an accredited IATA agent, in which case it will be in the currency provided by the airline (which will usually be based on the country where your IATA agency is registered). */ new_total_currency: string; /** * The ID for an `order change` if one has already been created from this `order change offer` */ order_change_id: string; /** * The penalty price imposed by the airline for making this change */ penalty_amount: string | null; /** * The currency of the `penalty_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * It will match your organisation's billing currency unless you're using Duffel as an accredited IATA agent, in which case it will be in the currency provided by the airline (which will usually be based on the country where your IATA agency is registered). */ penalty_currency: string | null; /** * Where the refund, once confirmed, will be sent. `card` is currently a restricted feature. `awaiting_payment` is for pay later orders where no payment has been made yet. */ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment'; /** * The slices within an order change that are being added to and/or removed from the order */ slices: OrderChangeOfferSlices; } export interface OrderChangeRequestResponse { /** * The ID of your order change request */ id: string; /** * Whether the order was created in live mode. This field will be set to `true` if the order was created in live mode, or `false` if it was created in test mode. */ live_mode: boolean; /** * The list of the offers available to perform change on the order. */ order_change_offers: OrderChangeOffers[]; /** * The order ID that you want to change */ order_id: string; /** * The slices to be added and/or removed */ slices: OrderChangeSliceResponse; } export interface CreateOrderChangeRequest { /** * The [slices](https://duffel.com/docs/api/overview/key-principles) that make up this offer request. One-way journeys can be expressed using one slice, whereas return trips will need two. */ slices: { /** * The search criteria for slices which you wish to add to your order */ add: { /** * The cabin that the passengers want to travel in */ cabin_class?: CabinClass | null; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the passengers want to depart */ departure_date: string; /** * The 3-letter IATA code for the city or airport where this slice ends */ destination: string; /** * The 3-letter IATA code for the city or airport where this slice starts */ origin: string; }[]; /** * The slices that you wish to remove from your order */ remove: { slice_id: string; }[]; }; /** * The order ID you wish to change */ order_id: string; } } declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' { import { OrderChangeOfferSlices, PaymentType } from '@duffel/api/types'; export interface OrderChange { /** * The price of this offer as a change to your existing order, excluding taxes */ change_total_amount: string; /** * The currency of the change_total_amount, as an ISO 4217 currency code. * It will match your organisation's billing currency unless you're using Duffel * as an accredited IATA agent, in which case it will be in the currency provided * by the airline (which will usually be based on the country where your * IATA agency is registered). */ change_total_currency: string; /** * Whether the order was created in live mode. This field will be set to `true` * if the order was created in live mode, or `false` if it was created in test mode. */ live_mode: boolean; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer was created */ created_at: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime that indicates when the order change was confirmed */ confirmed_at: string | null; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer will expire * and no longer be usable to create an order */ expires_at: string; /** * Duffel's unique identifier for the order change offer */ id: string; /** * The price of this offer if it was newly purchased, excluding taxes */ new_total_amount: string; /** * The currency of the new_total_amount, as an ISO 4217 currency code. * It will match your organisation's billing currency unless you're using * Duffel as an accredited IATA agent, in which case it will be in the * currency provided by the airline (which will usually be based on the * country where your IATA agency is registered). */ new_total_currency: string; /** * Duffel's unique identifier for the order which is being changed */ order_id: string; /** * The penalty price imposed by the airline for making this change */ penalty_total_amount: string | null; /** * The currency of the penalty_amount, as an ISO 4217 currency code. * It will match your organisation's billing currency unless you're using * Duffel as an accredited IATA agent, in which case it will be in the * currency provided by the airline (which will usually be based on * the country where your IATA agency is registered). */ penalty_total_currency: string | null; /** * Where the refund, once confirmed, will be sent. * Refunds are indicated by a negative change_total_amount. * If the change does not require a refund, this field will be null. * original_form_of_payment refers to the form of payment used to create the order. */ refund_to: 'voucher' | 'original_form_of_payment'; /** * The slices to be added and/or removed */ slices: OrderChangeOfferSlices; /** * The available payment types to complete the order change. */ available_payment_types?: PaymentType[] | null; } export interface CreateOrderChangeParameters { /** * Duffel's unique identifier for the order change offer */ selected_order_change_offer: string; } export interface ConfirmOrderChangePayment { /** The payment details to use to pay for the order change, if there is an amount to be paid. * Some order changes may not need this. * If the change_total_amount is zero or negative, there is no need to pass a payment object. */ payment?: { /** * The amount of the payment. This should be the same as the change_total_amount of the order change. */ amount: string; /** * The currency of the change_total_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. */ currency: string; /** * The type of payment you want to use for the Order Change. * If you are an IATA agent with your own agreements with airlines, in some cases, you can pay using ARC/BSP cash by specifying arc_bsp_cash. * Otherwise, you must pay using your Duffel account's balance by specifying balance. * In test mode, your balance is unlimited. * If you're not sure which of these options applies to you, get in touch with the Duffel support team at [help@duffel.com](mailto:help@duffel.com). */ type: PaymentType | 'card'; /** * The id of the 3DSecure Session ID. This is the autentication when paying by card. */ three_d_secure_session_id?: string; }; } } declare module '@duffel/api/booking/Orders/OrdersTypes' { import { Aircraft, Airline, AirlineInitiatedChange, Airport, CabinClass, DuffelPassengerGender, DuffelPassengerTitle, FlightsConditions, LoyaltyProgrammeAccount, OfferAvailableServiceBaggage, OfferAvailableServiceBaggageMetadata, OrderCancellation, PassengerIdentityDocumentType, PassengerType, PaymentType, Place, PlaceType } from '@duffel/api/types'; /** * An object containing metadata about the service, like the designator of the seat. */ export interface Seat { /** * The designator used to uniquely identify the seat, usually made up of a row number and a column letter * @example "14B" */ designator: string; /** * Each disclosure is text, in English, provided by the airline that describes the terms and conditions of this seat. We recommend showing this in your user interface to make sure that customers understand any restrictions and limitations. * @example "["Do not seat children in exit row seats","Do not seat passengers with special needs in exit row seats"]" */ disclosures: string[]; /** * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features * @example "Exit row seat" */ name: string | null; } /** * An object containing metadata about the service, like the maximum weight and dimensions of the baggage. */ export type OrderServiceBaggageMetadata = OfferAvailableServiceBaggageMetadata; export interface OrderSegmentPassengerBaggage { /** * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases. */ quantity: number; /** * The type of the baggage allowance */ type: 'checked' | 'carry_on'; } /** * Once you've searched for flights by creating an offer request, and you've chosen which offer you want to book, you'll then want to create an order. * @link https://duffel.com/docs/api/orders/schema */ export interface OrderService { /** * Duffel's unique identifier for the booked service * @example "ser_00009UhD4ongolulWd9123" */ id: string; /** * The metadata varies by the type of service. It includes further data about the service. * For example, for baggages, it may have data about size and weight restrictions. */ metadata?: OrderServiceBaggageMetadata | Seat; /** * List of passenger ids the service applies to. The service applies to all the passengers in this list. * @example ["pas_00009hj8USM7Ncg31cBCLL"] */ passenger_ids: string[]; /** * The quantity of the service that was booked * @example 1 */ quantity: number; /** * List of segment `ids` the service applies to. The service applies to all the segments in this list. * @example "["seg_00009hj8USM7Ncg31cB456"]" */ segment_ids: string[]; /** * The total price of the service for all passengers and segments it applies to, accounting for quantity and including taxes * @example "15.00" */ total_amount: string; /** * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * It will match your organisation's billing currency unless you're using Duffel as an accredited IATA agent, in which case it will be in the currency provided by the airline (which will usually be based on the country where your IATA agency is registered). * @example "GBP" */ total_currency: string; /** * The type of the service. * For now we only return services of type `baggage` and `seat` but we will return other types in the future. We won't consider adding new service types a breaking change. */ type: 'baggage' | 'seat'; } export interface OrderSegmentPassenger { /** * The baggage allowances for the passenger on this segment that were included in the original offer. * Any extra baggage items which were booked as services will be listed in the services field instead of here. */ baggages: OrderSegmentPassengerBaggage[]; /** * The cabin class that the passenger will travel in on this segment */ cabin_class: CabinClass; /** * The name that the marketing carrier uses to market this cabin class */ cabin_class_marketing_name: string; /** * The identifier for the passenger. You may have specified this ID yourself when creating the offer request, or otherwise, Duffel will have generated its own random ID. */ passenger_id?: string; /** * An object containing metadata about the service, like the designator of the seat. */ seat?: Seat; } export interface OrderPassenger { id: string; /** * The passenger's date of birth * @example "1987-07-24" */ born_on: string; /** * The passenger's family name * @example "Earheart" */ family_name: string; /** * The passenger's given name * @xample "Amelia" */ given_name: string; /** * The passenger's gender * @return "m" or "f" */ gender: DuffelPassengerGender; /** * The passenger's title * @returns "mr", "ms", "mrs", or "miss" */ title: DuffelPassengerTitle; /** * The type of the passenger * @return "adult", "child", or "infant_without_seat" */ type: PassengerType; /** * The id of the infant associated with this passenger * @return "adult", "child", or "infant_without_seat" */ infant_passenger_id?: string | null; /** * The **Loyalty Programme Accounts** for this passenger. */ loyalty_programme_accounts?: LoyaltyProgrammeAccount[]; /** * The passenger's email address. * Note that this data may differ from the airline's records if it was updated directly with the airline since the order was created. * @xample "amelia@duffel.com" */ email: string; /** * The passenger's phone number in E.164 (international) format. * Note that this data may differ from the airline's records if it was updated directly with the airline since the order was created. * @xample "442080160509" */ phone_number: string; } export interface OrderPassengerIdentityDocument { /** * The type of the identity document. This must be one of the allowed_passenger_identity_document_types on the offer. */ type: PassengerIdentityDocumentType; /** * The unique identifier of the identity document */ unique_identifier: string; /** * The ISO 3166-1 alpha-2 code of the country that issued this identity document */ issuing_country_code: string; /** * The date on which the identity document expires */ expires_on: string; } export interface CreateOrderPassenger extends Omit { /** * The passenger's identity documents. You may only provide one identity document per passenger. The identity document's type must be included in the offer's allowed_passenger_identity_document_types. If the offer's passenger_identity_documents_required is set to true, then an identity document must be provided. */ identity_documents?: OrderPassengerIdentityDocument[]; /** * Creates an association between the passenger and a previously created user. * This is intended to allow passengers the ability to manage their own orders. * @example "icu_0000000000000000000000" */ user_id?: string; /** * The passenger's email address * @example "amelia@duffel.com" */ email: string; /** * The passenger's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) (international) format * @example "+442080160509" */ phone_number: string; } export interface OrderSliceSegment { /** * The aircraft that the operating carrier will use to operate this segment */ aircraft: Aircraft; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the segment is scheduled to arrive, in the destination airport timezone (see destination.timezone) */ arriving_at: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the segment is scheduled to depart, in the origin airport timezone */ departing_at: string; /** * The airport at which the segment is scheduled to arrive */ destination: Airport; /** * The terminal at the destination airport where the segment is scheduled to arrive * @example "5" */ destination_terminal: string; /** * The duration of the segment, represented as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) duration */ duration: string; /** * Duffel's unique identifier for the segment. * It identifies the segment of an order (i.e. the same segment across orders will have different ids. */ id: string; /** * The airline selling the tickets for this segment. This may differ from the `operating_carrier` in the case of a "codeshare", where one airline sells flights operated by another airline. */ marketing_carrier: Airline; /** * The flight number assigned by the marketing carrier * @example "1234" */ marketing_carrier_flight_number: string; /** * The airline actually operating this segment. This may differ from the `marketing_carrier` in the case of a "codeshare", where one airline sells flights operated by another airline. */ operating_carrier: Airline; /** * The flight number assigned by the operating carrier. This may not be present, in which case you should display the `marketing_carrier`'s information and the `marketing_carrier_flight_number`, and simply state the name of the `operating_carrier`. * @example "4321" */ operating_carrier_flight_number: string; /** * The airport from which the flight is scheduled to depart */ origin: Airport; /** * The terminal at the origin airport from which the segment is scheduled to depart * @example "B" */ origin_terminal: string; /** * Additional segment-specific information about the passengers included in the offer (e.g. their baggage allowance and the cabin class they will be travelling in) */ passengers: OrderSegmentPassenger[]; /** * The distance of the segment in kilometres * @example "424.2" */ distance: string; /** * Additional segment-specific information about the stops, if any, included in the segment */ stops: Array; } export interface Stop { /** * The airport at which the stop happens */ airport: Airport; /** * The ISO 8601 datetime at which the stop is scheduled to arrive, in the airport's timezone (see destination.timezone) * * @example "2020-06-13T16:38:02" */ arriving_at: string; /** * The ISO 8601 datetime at which the stop is scheduled to depart, in the airport's timezone (see origin.timezone) * * @example "2020-06-13T16:38:02" */ departing_at: string; /** * The duration of the stop, represented as a ISO 8601 duration * * @example "PT02H26M" */ duration: string; /** * Duffel's unique identifier for the resource * * @example "sto_00009htYpSCXrwaB9Dn456" */ id: string; } export interface OrderSlice { /** * The conditions associated with this slice, describing the kinds of modifications you can make and any penalties that will apply to those modifications. * This condition is applied only to this slice and to all the passengers associated with this order - for information at the order level (e.g. "what happens if I want to change all the slices?") refer to the `conditions` at the top level. If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API. In some cases, you may need to contact the Duffel support team or the airline directly. */ conditions: Omit; /** * The city or airport where this slice ends */ destination: Place; /** * The type of the destination */ destination_type: PlaceType; /** * The city or airport where this slice begins */ origin: Place; /** * The type of the origin */ origin_type: PlaceType; /** * Duffel's unique identifier for the slice. It identifies the slice of an order (i.e. the same slice across orders will have different ids. */ id: string; /** * The duration of the slice, represented as a ISO 8601 duration */ duration: string | null; /** * The segments - that is, specific flights - that the airline is offering to get the passengers from the origin to the destination */ segments: OrderSliceSegment[]; /** * The name of the fare brand associated with this slice. * A fare brand specifies the travel conditions you get on your slice made available * by the airline. e.g. a British Airways Economy Basic fare will only include a hand baggage allowance. * It is worth noting that the fare brand names are defined by the airlines themselves and therefore they * are subject to change without any prior notice. We're in the process of adding support for fare_brand_name across * all our airlines, so for now, this field may be null in some offers. * This will become a non-nullable attribute in the near future. */ fare_brand_name: string | null; } export interface OrderPaymentStatus { /** * Whether a payment has been made, or the airline is waiting for a payment to be made */ awaiting_payment: boolean; /** * The ISO 8601 datetime by which you must pay for this order. * At this time, if still unpaid, the reserved space on the flight(s) * will be released and you will have to create a new order. * This will be null only for orders where `awaiting_payment` is `false`. * Payment Required by means it will hold space */ payment_required_by?: string; /** * The ISO 8601 datetime at which the price associated * with the order will no longer be guaranteed by the airline * and the order will need to be repriced before payment. * This can be null when there is no price guarantee. * Price Guarantee means it will hold price */ price_guarantee_expires_at?: string; /** * The ISO 8601 datetime at which the Order was paid for, if at all */ paid_at: string | null; } /** * The type of document * @returns "electronic_ticket", "electronic_miscellaneous_document_associated", or "electronic_miscellaneous_document_standalone" */ export type OrderDocumentsType = 'electronic_ticket' | 'electronic_miscellaneous_document_associated' | 'electronic_miscellaneous_document_standalone'; export interface OrderDocument { /** * The identifier for the document, in the case of electronic * tickets this string represents the payment or the entitlement to fly. * @example "1252106312810" */ unique_identifier: string; /** * The type of document */ type: OrderDocumentsType; /** * The list of passenger ids the document applies to * @example ["pas_00009hj8USM7Ncg31cBCLL"] */ passenger_ids: string[]; } export interface OrderPayment { /** * The type of payment you want to apply to the order. * If you are an IATA agent with your own agreements with airlines, in some cases, you can pay using ARC/BSP cash by specifying `arc_bsp_cash`. * Otherwise, you must pay using your Duffel account's `balance` by specifying balance. In test mode, your balance is unlimited. * If you're not sure which of these options applies to you, get in touch with the Duffel support team at [help@duffel.com](mailto:help@duffel.com). */ type: PaymentType; /** * The amount of the payment. This should be the same as the `total_amount` of the offer specified in `selected_offers` for an instant order or the `total_amount` of the previously created pay later order specified in `order_id`, plus the `total_amount` of all the services specified in `services`. * @example "30.20" */ amount: string; /** * The currency of the amount, as an ISO 4217 currency code. For an instant order, this should be the same as the total_currency of the offer specified in selected_offers. For a pay later order, this should be the same as the total_currency of the previously created order specified in order_id. * @example "GBP" */ currency: string; } export interface Order { /** * The amount of tax payable on the order for all the flights booked */ tax_amount?: string; /** * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code */ tax_currency: string; /** * The total price of the order for all the flights and services booked, including taxes */ total_amount: string; /** * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code */ total_currency: string; /** * The [slices](https://duffel.com/docs/api/overview/key-principles) that make up the itinerary of this order. * One-way journeys can be expressed using one slice, * whereas return trips will need two. */ slices: OrderSlice[]; /** * The services booked along with this order */ services: OrderService[]; /** * The passengers who are travelling */ passengers: OrderPassenger[]; /** * The payment status for this order * */ payment_status: OrderPaymentStatus; /** * The airline who owns the order */ owner: Airline; /** * Whether the order was created in live mode. * This field will be set to true if the order was created * in live mode, or false if it was created in test mode. */ live_mode: boolean; /** * Duffel's unique identifier for the order */ id: string; /** * The documents issued for this order. */ documents?: OrderDocument[]; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was created */ created_at: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was cancelled, if it has been cancelled */ cancelled_at?: string | null; /** * The airline's reference for the order, sometimes known as a * "passenger name record" (PNR) or "record locator". * Your customers can use this to check in and manage * their booking on the airline's website. */ booking_reference: string; /** * The currency of the base_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * It will match your organisation's billing currency unless you're * using Duffel as an accredited IATA agent, in which case it will * be in the currency provided by the airline (which will usually * be based on the country where your IATA agency is registered). */ base_currency: string; /** * The base price of the order for all flights and services booked, excluding taxes */ base_amount: string; /** * The conditions associated with this order, describing the kinds of modifications you can make post-booking and any penalties that will apply to those modifications. * * This information assumes the condition is applied to all of the slices and passengers associated with this order - for information at the slice level (e.g. "what happens if I just want to change the first slice?") refer to the `slices`. * * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API. * * In some cases, you may need to contact the Duffel support team or the airline directly. */ conditions: FlightsConditions; /** * Metadata contains a set of key-value pairs that you can attach to an object. * It can be useful for storing additional information about the object, in a structured format. * Duffel does not use this information. * You should not store sensitive information in this field. */ metadata: Record; /** * The airline-initiated changes for this order. */ airline_initiated_changes: AirlineInitiatedChange[]; /** * The available actions you can take on this order through our API. * It's a list of zero or more of the following values: * * "cancel": You can cancel the order. * "change": You can can change the order's slices. * "update": You can update some of the order's fields. * * @example: ["cancel","update"] */ available_actions: OrderAvailableAction[]; /** * Airlines are always the source of truth for orders. The orders returned in the Duffel API * are a view of those orders. This field is the ISO 8601 datetime at which the order was * last synced with the airline. If this datetime is in the last minute you can consider the order up to date. * * @example "2020-04-11T15:48:11Z" */ synced_at: string; /** * The confirmed cancellation associated with this Order (if this Order has been cancelled) */ cancellation?: OrderCancellation | null; } export type OrderAvailableAction = 'cancel' | 'change' | 'update'; export interface CreateOrder { /** * The `id`s of the offers you want to book. You must specify an array containing exactly one selected offer. */ selected_offers: string[]; /** * The services you want to book along wpith the first selected offer. */ services?: CreateOrderService[]; /** * The personal details of the passengers, expanding on the information initially provided when creating the offer request */ passengers: CreateOrderPassenger[]; /** * The payment details to use to pay for the order */ payments?: OrderPayment[]; /** * The payment action you want to take for your order. You can only use pay_later with offers that contain requires_instant_payment: false. */ type: 'instant' | 'pay_later'; /** * The ids of users that would be allowed to manage the order. * @example ["icu_0000000000000000000000"] */ users?: string[]; /** * Metadata contains a set of key-value pairs that you can attach to an object. It can be useful for storing additional information about the object, in a structured format. Duffel does not use this information. You should not store sensitive information in this field. * * The metadata is a collection of key-value pairs, both of which are strings. You can store a maximum of 50 key-value pairs, where each key has a maximum length of 40 characters and each value has a maximum length of 500 characters. * * Keys must only contain numbers, letters, dashes, or underscores. */ metadata?: Record; } export type CreateOrderService = Pick; export interface ListParamsOrders { /** * Whether to filter orders that are awaiting payment or not. If not specified, all orders regardless of their payment state will be returned. */ awaiting_payment?: boolean; /** * Whether to filter orders matching a passenger name. Partial and exact matches in given and family names will be returned. */ 'passenger_name[]'?: string[]; /** * Whether to filter orders matching a given passenger name record (PNR) */ booking_reference?: string; /** * Whether to filter orders matching a given customer user id. */ user_id?: string; } export interface UpdateSingleOrder { metadata: Order['metadata']; } export interface AddServices { payment: OrderPayment; add_services: Pick[]; } export type OrderAvailableService = OfferAvailableServiceBaggage; } declare module '@duffel/api/booking/Payments/PaymentsTypes' { import { PaymentType } from '@duffel/api/types'; /** * To pay for an unpaid order you've previously created, you'll need to create a payment for it. * @link https:/duffel.com/docs/api/payments/schema */ export interface Payment { /** * The amount of the payment. * This should be the same as the `total_amount` of the offer specified in `selected_offers` for an instant order or the `total_amount` of the previously created pay later order specified in `order_id`, plus the `total_amount` of all the services specified in services. */ amount: string; /** * The currency of the amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * For an instant order, this should be the same as the `total_currency` of the offer specified in selected_offers. * For a pay later order, this should be the same as the `total_currency` of the previously created order specified in `order_id`. */ currency?: string | null; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the payment was created */ created_at: string; /** * Duffel's unique identifier for the payment */ id: string; /** * The type of payment you want to apply to the order. * If you are an IATA agent with your own agreements with airlines, in some cases, you can pay using ARC/BSP cash by specifying `arc_bsp_cash`. * Otherwise, you must pay using your Duffel account's balance by specifying `balance`. In [test mode](https://duffel.com/docs/api/overview/test-mode), your balance is unlimited. * If you're not sure which of these options applies to you, get in touch with the Duffel support team at [help@duffel.com](mailto:help@duffel.com). */ type: PaymentType; } export interface CreatePayment { /** * The `id` of the order you want to pay for. */ order_id: string; /** * The payment details to use to pay for the order */ payment: Omit; } } declare module '@duffel/api/booking/SeatMaps/SeatMapTypes' { /** * Seat maps are used to build a rich experience for your customers so they can select a seat as part of an order. * A seat map includes the data for rendering seats in the relevant cabins, along with their total cost and other information such as disclosures. * @link https://duffel.com/docs/api/seat-maps/schema */ export interface SeatMap { /** * Duffel's unique identifier for the seat map */ id: string; /** * Duffel's unique identifier for the slice. It identifies the slice of an offer (i.e. the same slice across offers will have different ids.) */ slice_id: string; /** * Duffel's unique identifier for the segment. It identifies the segment of an offer (i.e. the same segment across offers will have different ids). */ segment_id: string; /** * The list of cabins in this seat map. * Cabins are ordered by deck from lowest to highest, and then within each deck from the front to back of the aircraft. */ cabins: SeatMapCabin[]; } export interface SeatMapCabin { /** * Level 0 is the main deck and level 1 is the upper deck above that, which is found on some large aircraft. */ deck: number; /** * The cabin class that the passenger will travel in on this segment */ cabin_class: string; /** * Where the wings of the aircraft are in relation to rows in the cabin. * The numbers correspond to the indices of the first and the last row which are overwing. You can use this to draw a visual representation of the wings to help users get a better idea of what they will see outside their window. * The indices are 0 th-based and are for all rows, not just those that have seats. * This is null when no rows of the cabin are overwing. */ wings: { /** * The index of the first row which is overwing, starting from the front of the aircraft. */ first_row_index: number; /** * The index of the last row which is overwing, starting from the front of the aircraft. */ last_row_index: number; } | null; /** * The number of aisles in this cabin. * If this is set to 1, each row of the cabin is split into two sections. If this is set to 2, each row of the cabin is split into three section. */ aisles: number; /** * A list of rows in this cabin. * Row sections are broken up by aisles. Rows are ordered from front to back of the aircraft. */ rows: SeatMapCabinRow[]; } export interface SeatMapCabinRow { /** * A list of sections. * Each row is divided into sections by one or more aisles. */ sections: SeatMapCabinRowSection[]; } export interface SeatMapCabinRowSection { /** * The elements that make up this section. */ elements: SeatMapCabinRowSectionElement[]; } /** * A seat for a passenger. If the available_services list is empty (which will be represented as an empty list : []), the seat is unavailable. * For display, all seats should be displayed with the same static width. */ export interface SeatMapCabinRowSectionElementSeat { /** * The type of this element. */ type: 'seat' | 'restricted_seat_general'; /** * The designator used to uniquely identify the seat, usually made up of a row number and a column letter */ designator: string; /** * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features */ name?: string; /** * Each disclosure is text, in English, provided by the airline that describes the terms and conditions of this seat. We recommend showing this in your user interface to make sure that customers understand any restrictions and limitations. */ disclosures: string[]; /** * Seats are considered a special kind of service. There will be at most one service per seat per passenger. A seat can only be booked for one passenger. If a seat has no available services (which will be represented as an empty list : []) then it's unavailable. */ available_services: SeatMapCabinRowSectionAvailableService[]; } export interface SeatMapCabinRowSectionAvailableService { /** * Duffel's unique identifier for the service */ id: string; /** * The passenger that this seat is for */ passenger_id: string; /** * The total price of the seat, including taxes */ total_amount: string; /** * The currency of the total_amount, as an ISO 4217 currency code */ total_currency: string; } /** * A bassinet is a child's cradle. This element will be aligned with the corresponding seat in the following row. * For display, this element should have the same width as a seat for proper alignment. */ export interface SeatMapCabinRowSectionElementBassinet { /** * The type of this element. */ type: 'bassinet'; } /** * An empty space used for padding in some non-standard seat arrangements. * For display, this element should have the same dimensions as a seat for proper alignment. */ export interface SeatMapCabinRowSectionElementEmpty { /** * The type of this element. */ type: 'empty'; } /** * An exit row represents the extra wide legroom used to reach aircraft exits. There is one exit_row element per row section. * Exit row elements only occur in their own row, so they can be displayed as one element across the whole row. Displaying an exit row element filling all available space in its section or using the same width as the seat is also reasonable. */ export interface SeatMapCabinRowSectionElementExitRow { /** * The type of this element. */ type: 'exit_row'; } /** * A lavatory for use by passengers. * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable. */ export interface SeatMapCabinRowSectionElementLavatory { /** * The type of this element. */ type: 'lavatory'; } /** * A galley is the compartment where food is cooked or prepared. These are conventionally marked with a teacup symbol. * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable. */ export interface SeatMapCabinRowSectionElementGalley { /** * The type of this element. */ type: 'galley'; } /** * A closet used for storage. These are conventionally marked with a clothes hanger symbol. * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable. */ export interface SeatMapCabinRowSectionElementCloset { /** * The type of this element. */ type: 'closet'; } /** * A set of stairs to another deck. * For display, this element should ideally fill or shrink to available space in a row section. Displaying it with the same width as seat is also reasonable. */ export interface SeatMapCabinRowSectionElementStairs { /** * The type of this element. */ type: 'stairs'; } export type SeatMapCabinRowSectionElement = SeatMapCabinRowSectionElementSeat | SeatMapCabinRowSectionElementBassinet | SeatMapCabinRowSectionElementEmpty | SeatMapCabinRowSectionElementExitRow | SeatMapCabinRowSectionElementLavatory | SeatMapCabinRowSectionElementGalley | SeatMapCabinRowSectionElementCloset | SeatMapCabinRowSectionElementStairs; export type SeatMapCabinRowSectionElementType = SeatMapCabinRowSectionElement['type']; export type SeatMapCabinRowSectionElementAmenity = Exclude; } declare module '@duffel/api/notifications/Webhooks/WebhooksType' { import { PaginationMeta } from '@duffel/api/types'; export interface Webhooks { /** * Whether the webhook receiver is actively being notified or not */ active: boolean; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the webhook was created */ created_at: string; /** * The events that this webhook will be subscribed to */ events: string[]; /** * Duffel's unique identifier for the webhook receiver */ id: string; /** * The live mode that the webhook was created in. It will only receive events for that same live mode. For example, you won't receive order.created events for orders that you created in the sandbox, if your webhook is for live_mode: true. */ live_mode: boolean; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the order change was updated */ updated_at: string; /** * The URL where your webhook will be received */ url: string; } export interface WebhooksListDeliveriesParams extends PaginationMeta { delivery_success: boolean; /** * Filters the returned webhook deliveries by creation datetime. */ created_at?: PaginationMeta; /** * Filters webhook deliveries by the type of their related webhook event. */ type?: string; /** * Filters webhook deliveries by the ID of the related webhook endpoint. */ endpoint_id: string; } export interface WebhooksUpdateParams { /** * The desired active status of the webhook */ active: boolean; /** * The desired events that the webhook should subscribe to */ events: string[]; /** * The desired url of the webhook */ url: string; } export interface WebhooksCreateParams { /** * The desired events that the webhook should subscribe to */ events: string[]; /** * The desired url of the webhook */ url: string; } export interface WebhooksListDeliveriesResponse { /** * The URL where your webhook will be received */ url: string; endpoint_id: string; /** * Webhook deliveries will be included if they were successful. */ delivery_success?: boolean; type: string; response_status_code: 200; response_body: string; event_id: string; /** * The live mode that the webhook was created in. It will only receive events for that same live mode. For example, you won't receive order.created events for orders that you created in the sandbox, if your webhook is for live_mode: true. */ live_mode: boolean; /** * Duffel's unique identifier for the webhook receiver */ id: string; /** * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the webhook was created */ created_at: string; } export interface WebhooksListResponse extends Webhooks { /** * Webhook deliveries will be included if they were successful. */ delivery_success?: boolean; } export interface WebhooksCreateResponse { secret: string; url: string; updated_at: string; live_mode: boolean; id: string; events: string[]; created_at: string; active: boolean; } } declare module '@duffel/api/supportingResources/Aircraft/AircraftTypes' { /** * Aircraft are used to describe what passengers will fly in for a given trip * @link https://duffel.com/docs/api/aircraft/schema */ export interface Aircraft { /** * The name of the aircraft */ name: string; /** * Duffel's unique identifier for the aircraft */ id: string; /** * The three-character IATA code for the aircraft */ iata_code: string; } } declare module '@duffel/api/supportingResources/Airlines/AirlinesTypes' { /** * Airlines are used to identify the air travel companies selling and operating flights * @link https://duffel.com/docs/api/airlines/schema */ export interface Airline { /** * The three-character IATA code for the airline */ name: string; /** * Duffel's unique identifier for the airline */ id: string; iata_code: string | null; logo_lockup_url: string | null; logo_symbol_url: string | null; conditions_of_carriage_url: string | null; } } declare module '@duffel/api/supportingResources/Airports/AirportsTypes' { import { City } from '@duffel/api/types'; /** * Airports are used to identify origins and destinations in journey slices * @link https://duffel.com/docs/api/airports/schema */ export interface Airport { /** * The metropolitan area where the airport is located. * Only present for airports which are registered with IATA as belonging to a metropolitan area. */ city: City | null; /** * The name of the city (or cities separated by a `/`) where the airport is located */ city_name: string; /** * The three-character IATA code for the airport */ iata_code: string | null; /** * The ISO 3166-1 alpha-2 code for the country where the city is located * @link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 * @example "GB" */ iata_country_code: string; /** * The 3-letter IATA code for the city where the place is located. * Only present for airports which are registered with IATA as belonging to a [metropolitan area](https://portal.iata.org/faq/articles/en_US/FAQ/How-do-I-create-a-new-Metropolitan-Area). */ iata_city_code: string | null; /** * The four-character ICAO code for the airport */ icao_code: string; /** * Duffel's unique identifier for the airport */ id: string; /** * The latitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -90° and 90° */ latitude: number; /** * The longitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -180° and 180° */ longitude: number; /** * The name of the airport */ name: string; /** * The time zone of the airport, specified by name from the [tz database](https://en.wikipedia.org/wiki/Tz_database) */ time_zone: string; /** * The type of the place */ type: 'airport'; } } declare module '@duffel/api/types/ClientType' { import { Headers } from 'node-fetch'; /** * Our list APIs will only return a limited number of results at a time. * By default, we'll return 50 results per page, but you can set this to any number between 1 and 200. * @link https://duffel.com/docs/api/overview/pagination */ export interface PaginationMeta { /** * The number of results to be returned in a page, between 1 and 200 (optional, default is 50) */ limit?: number; /** * "Before" cursor for pagination */ before?: string; /** * "After" cursor for pagination */ after?: string | null; } export interface ApiResponseMeta { /** * The identifier of the request */ request_id: string; /** * The [HTTP status](https://httpstatuses.com/) of the request */ status: number; } /** * Duffel uses standard [HTTP response codes](https://httpstatuses.com/) to indicate the success or failure of API requests. * @link https://duffel.com/docs/api/overview/errors */ export interface ApiResponseError { /** * A machine-readable identifier for this specific error */ code: string; /** * A URL pointing to a place in our documentation where you can read about the error */ documentation_url: string; /** * A more detailed human-readable description of what went wrong */ message: string; /** * A quick and simple description of what went wrong */ title: string; /** * A machine-readable identifier for the general category of error */ type: string; } export interface DuffelResponse { /** * The body of the response */ data: T_Data; /** * Optional metadata for the request */ meta?: PaginationMeta; /** * The headers from the http response */ headers?: Headers; /** * The status from the http response */ status: number; } export interface SDKOptions { /** * If `true` it will output the path and the method called */ verbose?: boolean; } } declare module '@duffel/api/types/Identity' { export type AcceptedCurrencies = 'AUD' | 'CAD' | 'EUR' | 'GBP' | 'USD'; export type LegalEntityType = 'corporation' | 'non_profit' | 'other' | 'partnership' | 'sole_proprietorship'; export type PersonalAccessTokenRole = 'roles/user/personal'; export type SourceOfFunds = 'capital_invested' | 'debt' | 'other' | 'revenue'; export type TokenRole = 'roles/api/read_write' | 'roles/api/read_only'; export type UserRole = 'roles/duffel/travel_ops' | 'roles/user/admin' | 'roles/user/agent' | 'roles/user/developer' | 'roles/user/owner' | 'roles/user/viewer' | PersonalAccessTokenRole; export type VerificationFlow = 'duffel_2020' | 'stripe_connect'; export interface AccessToken { created_at: string; expires_at: string; id: string; last_used_at: string | null; last_version_used: string | null; live_mode: boolean | null; name: string | null; scope: TokenRole | UserRole; token: string; } export interface Invitation { accepted_at: string | null; created_at: string; expires_at: string | null; id: string; organisation: Organisation; organisation_id: string; recipient: User | null; recipient_email: string; recipient_id: string | null; revoked_at: string | null; scope: UserRole; sender: User; sender_id: string; sent_at: string; token: string; } export interface Organisation { access_tokens: AccessToken[] | null; avatar_url: string | null; created_at: string; id: string; name: string; settlement_currency: AcceptedCurrencies; slug: string; verified: boolean | null; legal_entity: LegalEntity | null; stripe_customer_id: string | null; stripe_payment_method_id: string | null; verification_flow: VerificationFlow; contact_emails: string[] | null; schedule_change_emails: string[] | null; is_duffel_links_enabled: boolean; stays_access_status: 'disabled' | 'live' | 'test'; password_expiry_timeout_days: number | null; session_expiry_timeout: number; } export interface OrganisationMembership { avatar_url: string | null; id: string; created_at: string; disabled_at: string | null; organisation_id: string; owner: boolean | null; scope: UserRole; user_id: string; user: User; } export interface User { avatar_url: string | null; created_at: string; duffel_admin: boolean | null; email: string; email_confirmed_at: string | null; full_name: string; id: string; organisation_invitations: Invitation[] | null; organisation_memberships: UserOrganisationMembership[] | null; unconfirmed_email: string | null; temporary_personal_access_tokens: PersonalAccessToken[] | null; send_marketing_emails: boolean; } export interface PersonalAccessToken { created_at: string; expires_at: string; id: string; last_used_at: null | string; last_version_used: null | string; live_mode: true; name: null; scope: PersonalAccessTokenRole; token: string; } export interface UserOrganisationMembership extends OrganisationMembership { organisation: Organisation; } export interface LegalEntity { name: string; type: LegalEntityType; type_extra: string | null; trading_name: string | null; registered_business_address_line1: string; registered_business_address_line2: string | null; registered_business_address_city: string; registered_business_address_region: string | null; registered_business_address_postal_code: string; registered_business_address_country_code: string; registration_number: string; registration_country_code: string; tax_identification_number: string; key_contact_first_name: string; key_contact_last_name: string; key_contact_job_title: string; key_contact_email: string; initial_top_up_source_of_funds: SourceOfFunds; initial_top_up_source_of_funds_description: string | null; } } declare module '@duffel/api/types/shared' { import { Airport } from '@duffel/api/supportingResources/Airports/AirportsTypes'; /** * The metropolitan area where the airport is located. * Only present for airports which are registered with IATA as belonging to a metropolitan area. * @link https://portal.iata.org/faq/articles/en_US/FAQ/How-do-I-create-a-new-Metropolitan-Area */ export interface City { /** * The three-character IATA code for the city * @example "LON" */ iata_code: string; /** * The ISO 3166-1 alpha-2 code for the country where the city is located * @link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2 * @example "GB" */ iata_country_code: string; /** * Duffel's unique identifier for the city * @example "cit_lon_gb" */ id: string; /** * The name of the city * @example "London" */ name: string; /** * "The airports associated to a city. This will only be provided where the `type` is `city`." */ airports?: Airport[]; /** * The type of the place */ type: 'city'; } /** * The cabin class that the passenger will travel in on this segment */ export type CabinClass = 'first' | 'business' | 'premium_economy' | 'economy'; /** * The type of the passenger */ export type PassengerType = 'adult' | 'child' | 'infant_without_seat'; /** * The passenger's title */ export type DuffelPassengerTitle = 'mr' | 'ms' | 'mrs' | 'miss' | 'dr'; /** * The passenger's gender */ export type DuffelPassengerGender = 'm' | 'f'; /** * The type of the identity document. * This must be one of the `allowed_passenger_identity_document_types` on the offer. */ export type PassengerIdentityDocumentType = 'passport' | 'tax_id'; export type Place = (Airport & { type: 'airport'; }) | (City & { type: 'city'; }); /** * The type of the origin or destination */ export type PlaceType = Place['type']; export type FlightsConditionAllowed = { /** * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer. * If this is `null` then `penalty_amount` will also be `null`. * * @example "GBP" */ penalty_currency: string | null; /** * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers. * If there is no penalty, the value will be zero. If the modification isn't `allowed` or the penalty is not known then this field will be `null`. * If this is `null` then the `penalty_currency` will also be null. * * @example "100.00" */ penalty_amount: string | null; /** * Whether this kind of modification is allowed post-booking * * @example "true" */ allowed: true; }; export type FlightsConditionNotAllowed = { /** * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code. * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer. * If this is `null` then `penalty_amount` will also be `null`. * * @example "GBP" */ penalty_currency: null; /** * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers. * If there is no penalty, the value will be zero. If the modification isn't `allowed` or the penalty is not known then this field will be `null`. * If this is `null` then the `penalty_currency` will also be null. * * @example "100.00" */ penalty_amount: null; /** * Whether this kind of modification is allowed post-booking * * @example "true" */ allowed: false; }; export type FlightsCondition = FlightsConditionAllowed | FlightsConditionNotAllowed; /** * The conditions associated with this offer, describing the kinds of modifications you can make post-booking and any penalties that will apply to those modifications. * This information assumes the condition is applied to all of the slices and passengers associated with this offer - for information at the slice level (e.g. "what happens if I just want to change the first slice?") refer to the slices. * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API. * In some cases, you may need to contact the Duffel support team or the airline directly. */ export type FlightsConditions = { /** * Whether the whole order or offer can be refunded before the departure of the first slice. * If all of the slices on the order or offer can be refunded then the `allowed` property will be `true` and information will be provided about any penalties. * If any of the slices on the order or offer can't be refunded then the `allowed` property will be `false`. * If the airline hasn't provided any information about whether this order or offer can be refunded then this property will be `null`. */ refund_before_departure: FlightsCondition | null; /** * Whether the whole order or offer can be changed before the departure of the first slice. * If all of the slices on the order or offer can be changed then the `allowed` property will be `true`. * Refer to the `slices` for information about change penalties. * If any of the slices on the order or offer can't be changed then the `allowed` property will be `false`. * In this case you should refer to the slices conditions to determine if any part of the order or offer is changeable. * If the airline hasn't provided any information about whether this order or offer can be changed then this property will be `null`. */ change_before_departure: FlightsCondition | null; }; /** * The conditions associated with this offer, describing the kinds of modifications you can make post-booking and any penalties that will apply to those modifications. * This information assumes the condition is applied to all of the slices and passengers associated with this offer - for information at the slice level (e.g. "what happens if I just want to change the first slice?") refer to the slices. * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API. * In some cases, you may need to contact the Duffel support team or the airline directly. * Note that the perks associated with the slice are aggregated across passengers and segments and are intended to provide a brief summary of the passenger experience, * however, the experience may not be consistent across all segments. * As an example, priority boarding may be flagged as available but not available on all segments on the slice. * See segment passenger conditions for a per-flight breakdown what is available to * passengers if you require this level of granularity. */ export type OfferSliceConditions = FlightsConditions & { /** * Whether passengers are able to select a seat prior to check in. */ advance_seat_selection: boolean | null; /** * Whether passengers are given preferential boarding over others passengers in their cabin. */ priority_boarding: boolean | null; /** * Whether passengers are given access to a fast track lane during check in. */ priority_check_in: boolean | null; }; /** * The type of payment you want to apply to the order. * If you are an IATA agent with your own agreements with airlines, in some cases, you can pay using ARC/BSP cash by specifying `arc_bsp_cash`. Otherwise, you must pay using your Duffel account's balance by specifying `balance`. * In test mode, your balance is unlimited. If you're not sure which of these options applies to you, get in touch with the Duffel support team at [help@duffel.com](mailto:help@duffel.com). */ export type PaymentType = 'arc_bsp_cash' | 'balance'; } declare module '@duffel/api/Identity/IdentityTypes' { export interface CustomerUserPayload { /** * The customer user's email address */ email: string; /** * The customer user's given name */ family_name: string; /** * The customer user's family name */ given_name: string; /** * The group you'd like to associate the customer user to */ group_id?: string | null; /** * The customer user's phone number in E.164 (international) format. */ phone_number?: string | null; } export interface CustomerUser { /** * The ISO 8601 datetime at which the user was created */ created_at: string; /** * The customer user's email address */ email: string; /** * The customer user's family name */ family_name: string; /** * The customer user's given name */ given_name: string; /** * The group to which the user belongs */ group: { /** * Duffel's unique identifier for the resource */ id: string; /** * The group's name */ name: string; } | null; /** * Duffel's unique identifier for the resource */ id: string; /** * This field will be set to true if the customer user was created in live mode, or false if it was created in test mode. */ live_mode: boolean; /** * The customer user's phone number in E.164 (international) format. */ phone_number: string | null; } export interface CustomerUserGroupPayload { /** * The customer user group's name */ name: string; /** * The list of customer users that belong to this group */ user_ids: Array; } export interface CustomerUserGroup { /** * Duffel's unique identifier for the resource */ id: string; /** * The customer user group's name */ name: string; /** * The list of customer users that belong to this group */ user_ids: string[]; } export type ComponentClientKeyPayload = ComponentClientKeyPayloadNoData | ComponentClientKeyPayloadUserOnly | ComponentClientKeyPayloadUserAndOrderPayload | ComponentClientKeyPayloadUserAndBookingPayload; export interface ComponentClientKeyPayloadNoData { } export interface ComponentClientKeyPayloadUserOnly { /** * The ID of the user for whom the client key will be created. */ user_id: string; } export interface ComponentClientKeyPayloadUserAndOrderPayload extends ComponentClientKeyPayloadUserOnly { /** * The ID of the order for which the client key will be created. */ order_id: string; } export interface ComponentClientKeyPayloadUserAndBookingPayload extends ComponentClientKeyPayloadUserOnly { /** * The ID of the booking for which the client key will be created. */ booking_id: string; } export interface ComponentClientKey { /** * The client key to authenticate Duffel UI components. */ component_client_key: string; } } declare module '@duffel/api/supportingResources/Aircraft/Aircraft' { import { Resource } from '@duffel/api/Resource'; import { Aircraft as AircraftType, DuffelResponse, PaginationMeta } from '@duffel/api/types'; /** Aircraft are used to describe what passengers will fly in for a given trip * @class * @link https://duffel.com/docs/api/aircraft */ export class Aircraft extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Retrieves an aircraft by its ID * @param {string} id - Duffel's unique identifier for the aircraft * @link https://duffel.com/docs/api/aircraft/get-aircraft-by-id */ get: (id: string) => Promise>; /** * Retrieves a page of aircraft. The results may be returned in any order. * @param {Object} [options] - Pagination options (optional: limit, after, before) * @link https://duffel.com/docs/api/aircraft/get-aircraft */ list: (options?: PaginationMeta) => Promise>; /** * Retrieves a generator of all aircraft. The results may be returned in any order. * @link https://duffel.com/docs/api/aircraft/get-aircraft */ listWithGenerator: () => AsyncGenerator, void, unknown>; } } declare module '@duffel/api/supportingResources/Airlines/Airlines' { import { Resource } from '@duffel/api/Resource'; import { Airline, DuffelResponse, PaginationMeta } from '@duffel/api/types'; /** Airlines are used to identify the air travel companies selling and operating flights * @class * @link https://duffel.com/docs/api/airlines */ export class Airlines extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Retrieves an airline by its ID * @param {string} id - Duffel's unique identifier for the airline * @link https://duffel.com/docs/api/airlines/get-airline-by-id */ get: (id: string) => Promise>; /** * Retrieves a page of airlines. The results may be returned in any order. * @param {Object} [options] - Pagination options (optional: limit, after, before) * @link https://duffel.com/docs/api/airlines/get-airlines */ list: (options?: PaginationMeta) => Promise>; /** * Retrieves a generator of all airlines. The results may be returned in any order. * @link https://duffel.com/docs/api/airlines/get-airlines */ listWithGenerator: () => AsyncGenerator, void, unknown>; } } declare module '@duffel/api/supportingResources/Airports/Airports' { import { Resource } from '@duffel/api/Resource'; import { Airport, DuffelResponse, PaginationMeta } from '@duffel/api/types'; /** Airports are used to identify origins and destinations in journey slices * @class * @link https://duffel.com/docs/api/airports */ export class Airports extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * Retrieves an airport by its ID * @param {string} id - Duffel's unique identifier for the airport * @link https://duffel.com/docs/api/airports/get-airport-by-id */ get: (id: string) => Promise>; /** * Retrieves a page of airports. The results may be returned in any order. * @param {Object} [options] - Pagination options (optional: limit, after, before) * @link https://duffel.com/docs/api/airports/get-airports */ list: (options?: PaginationMeta) => Promise>; /** * Retrieves a generator of all airports. The results may be returned in any order. * @link https://duffel.com/docs/api/airports/get-airports */ listWithGenerator: () => AsyncGenerator, void, unknown>; } } declare module '@duffel/api/DuffelPayments/Refunds/RefundsType' { export interface Refund { /** * The amount of the Payment Intent that will be refunded to the customer */ amount: string; /** * When the refund is expected to arrive in the destination */ arrival: string; /** * The ISO 8601 datetime at which the Refund was created */ created_at: string; /** * The currency of the amount, as an ISO 4217 currency code. * It will always match the currency of the Payment Intent. */ currency: string; /** * Where the Refund amount will be sent to */ destination: 'original_form_of_payment'; /** * Duffel's unique identifier for the Refund */ id: string; /** * Whether the Refund was created in live mode. This field will be set to true if the Refund was created in live mode, or false if it was created in test mode. */ live_mode: boolean; /** * The amount deducted from your Balance to cover the Refund amount */ net_amount: string; /** * The currency of the net_amount, as an ISO 4217 currency code. * This currency will match your Balance currency. */ net_currency: string; /** * Duffel's unique identifier for the Payment Intent that the Refund is for */ payment_intent_id: string; /** * The status of the Refund. * Succeeded: The refund is on its way to the destination. * Pending: The Refund could not be processed immediately, and is pending processing. * Failed: A refund can fail if the customer’s bank or card issuer has been unable to process it correctly (e.g., a closed bank account or a problem with the card). The bank returns the refunded amount to us and we add it back to your Balance. This process can take up to 30 days from the post date. */ status: 'succeeded' | 'pending' | 'failed'; /** * The ISO 8601 datetime at which the Refund was updated */ updated_at: string; } export interface CreateRefund { /** * This amount that will be refunded to the customer's card. */ amount: string; /** * The currency of the amount, as an ISO 4217 currency code. * It must match the Payment Intent currency. */ currency: string; /** * Duffel's unique identifier for the Payment Intent that the Refund is for */ payment_intent_id: string; } } declare module '@duffel/api/Links/Sessions/Sessions' { import { Client } from '@duffel/api/Client'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; interface SessionParameters { /** * A tracking reference for the booking that may be created within this Duffel Links session */ reference: string; /** * A url to return to when a flight is booked via Duffel Links */ success_url: string; /** * A url to return to when there is an error within Duffel Links */ failure_url: string; /** * A url to return to when the user exits Duffel Links before booking */ abandonment_url: string; /** * A primary color to show within Duffel Links */ primary_color?: string; /** * A url of the logo to show within Duffel Links */ logo_url?: string; /** * A markup amount to be added to the flights shown within Duffel Links */ markup_amount?: number; /** * A markup amount to be added to the flights shown within Duffel Links */ markup_currency?: string; /** * A markup percentage to be added to the flights shown within Duffel Links */ markup_rate?: number; /** * A text to be shown on the checkout page within Duffel Links */ checkout_display_text?: string; } interface Session { /** * The Duffel Links url that contains the specified configuration */ url: string; } export class Sessions extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Create a Duffel Links Session per the configuration */ create: (data: SessionParameters) => Promise>; } export {}; } declare module '@duffel/api/notifications/Webhooks/Webhooks' { import { DuffelResponse, PaginationMeta, Webhooks as WebhooksType, WebhooksCreateParams, WebhooksCreateResponse, WebhooksListDeliveriesParams, WebhooksListDeliveriesResponse, WebhooksListResponse, WebhooksUpdateParams } from '@duffel/api/types'; import { Resource } from '@duffel/api/Resource'; import { Client } from '@duffel/api/Client'; export class Webhooks extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Trigger a re-delivery of an event to a webhook. * @param {string} id - Duffel's unique identifier for the webhook event * @link https://duffel.com/docs/api/v1/webhooks/schema#webhooks-retry-delivering-a-webhook-event-url-parameters-id */ redeliver: (id: string) => Promise>; /** * Send a ping, a "fake event" notification, to a webhook. * @param {string} id - Duffel's unique identifier for the webhook receiver */ ping: (id: string) => Promise>; /** * Retrieves a webhook event by its ID. * @param {string} id- Duffel's unique identifier for the webhook event */ get: (id: string) => Promise>; /** * Retrieve a paginated list of webhook deliveries * @param {Object.} params - Endpoint options */ listDeliveries: ({ ...params }: WebhooksListDeliveriesParams) => Promise>; /** * Delete a webhook * @param {string} id - Duffel's unique identifier for the webhook receiver */ delete: (id: string) => Promise>; /** * Update a webhook * @param {string} id - Duffel's unique identifier for the webhook receiver */ update: (id: string, { active, events, url }: WebhooksUpdateParams) => Promise>; /** * Retrieve a paginated list of webhook * @param {Object.} params - Endpoint options */ list: ({ ...params }: PaginationMeta) => Promise>; /** * Create a webhook * @param {Object.} params - Endpoint options */ create: ({ events, url, }: WebhooksCreateParams) => Promise>; } } declare module '@duffel/api/Stays/Accommodation/Accommodation' { import { Client } from '@duffel/api/Client'; import { LocationParams, ListAccommodationParams, StaysAccommodationSuggestion, StaysAccommodation, StaysAccommodationReviewResponse } from '@duffel/api/Stays/StaysTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, PaginationMeta } from '@duffel/api/types'; export class Accommodation extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Get suggestions for accommodation given a query string. * @param {string} query - The query string for the search */ suggestions: (query: string, location?: LocationParams) => Promise>; reviews: (id: StaysAccommodation["id"], options?: PaginationMeta) => Promise>; /** * Get information about an accommodation with a specific Duffel ID * @param {string} id - The Duffel ID of the Accommodation */ get: (id: StaysAccommodation["id"]) => Promise>; /** * Retrieves a page of accommodation. * @param {Object.} params - Endpoint options (radius, latitude, longitude, before, after, limit) * @link https://duffel.com/docs/api/v2/accommodation/list-accommodation */ list: (params: ListAccommodationParams) => Promise>; /** * Retrieves a generator of accommodation pages given the criteria in the params. * @param {Object.} params - Endpoint options (radius, latitude, longitude, before, after, limit) * @link https://duffel.com/docs/api/v2/accommodation/list-accommodation */ listWithGenerator: (params: ListAccommodationParams) => AsyncGenerator>; } } declare module '@duffel/api/Stays/Brands/Brands' { import { Client } from '@duffel/api/Client'; import { StaysAccommodationBrand } from '@duffel/api/Stays/StaysTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; export class Brands extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Get a brand * @param {string} brandId - The ID of the brand */ get: (brandId: string) => Promise>; /** * List brands */ list: () => Promise>; } } declare module '@duffel/api/Stays/LoyaltyProgrammes/LoyaltyProgrammes' { import { Client } from '@duffel/api/Client'; import { StaysLoyaltyProgramme } from '@duffel/api/Stays/StaysTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; export class LoyaltyProgrammes extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * List all the loyalty programmes supported by Duffel Stays */ list: () => Promise>; } } declare module '@duffel/api/Stays/Bookings/Bookings' { import { Client } from '@duffel/api/Client'; import { ListParamsBookings, StaysBooking } from '@duffel/api/Stays/StaysTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse, PaginationMeta } from '@duffel/api/types'; export interface StaysBookingPayload { quote_id: string; loyalty_programme_account_number?: string; guests: Array<{ given_name: string; family_name: string; /** * Creates an association between the guest and a previously created user. * This is intended to allow guests the ability to manage their own bookings. * @example ["icu_0000000000000000000000"] */ user_id?: string; }>; email: string; phone_number: string; accommodation_special_requests?: string; payment?: { card_id: string; } | { three_d_secure_session_id: string; }; metadata?: StaysBooking['metadata']; /** * The ids of users that would be allowed to manage the booking. * @example ["icu_0000000000000000000000"] */ users?: string[]; } export class Bookings extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Create a booking * @param {object} payload - The booking payload, including quote id and guest information */ create: (payload: StaysBookingPayload) => Promise>; /** * Get a booking * @param {string} bookingId - The ID of the booking */ get: (bookingId: string) => Promise>; /** * List bookings * @param {Object} [options] - Pagination options (optional: limit, after, before) * @link https://duffel.com/docs/api/bookings/list-bookings */ list: (options?: PaginationMeta & ListParamsBookings) => Promise>; /** * Retrieves a generator of all bookings. The results may be returned in any order. * @link https://duffel.com/docs/api/bookings/list-bookings */ listWithGenerator: (options?: ListParamsBookings) => AsyncGenerator, void, unknown>; /** * Cancel a booking * @param {string} bookingId - The ID of the booking */ cancel: (bookingId: string) => Promise>; } } declare module '@duffel/api/Stays/Quotes/Quotes' { import { Client } from '@duffel/api/Client'; import { StaysQuote } from '@duffel/api/Stays/StaysTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; export class Quotes extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Create a quote for the selected rate * @param {string} quoteId - The ID of the rate to create a quote for */ get: (quoteId: string) => Promise>; /** * Create a quote for the selected rate * @param {string} rateId - The ID of the rate to create a quote for */ create: (rateId: string) => Promise>; } } declare module '@duffel/api/Stays/SearchResults/SearchResults' { import { Client } from '@duffel/api/Client'; import { StaysSearchResult } from '@duffel/api/Stays/StaysTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; export class SearchResults extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Fetch all rates for the given search result * @param {string} searchResultId - The ID of the search result to fetch rates for */ fetchAllRates: (searchResultId: string) => Promise>; } } declare module '@duffel/api/Cars/Bookings/Bookings' { import { Client } from '@duffel/api/Client'; import { CarsBooking } from '@duffel/api/Cars/CarsTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; export interface CarsBookingPayload { quote_id: string; driver: { given_name: string; family_name: string; email: string; phone_number: string; date_of_birth: string; user_id?: string; }; inbound_flight_number?: string; supplier_loyalty_programme_account_number?: string; payment?: { method: 'card'; card_id: string; }; metadata?: Record; users?: string[]; } export class Bookings extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Create a booking from a quote * @param {object} payload - The booking payload, including quote id and driver information */ create: (payload: CarsBookingPayload) => Promise>; /** * Get a booking by ID * @param {string} bookingId - The ID of the booking */ get: (bookingId: string) => Promise>; /** * Cancel a booking * @param {string} bookingId - The ID of the booking to cancel */ cancel: (bookingId: string) => Promise>; } } declare module '@duffel/api/Cars/Quotes/Quotes' { import { Client } from '@duffel/api/Client'; import { CarsQuote } from '@duffel/api/Cars/CarsTypes'; import { Resource } from '@duffel/api/Resource'; import { DuffelResponse } from '@duffel/api/types'; export class Quotes extends Resource { /** * Endpoint path */ path: string; constructor(client: Client); /** * Create a quote for the selected rate * @param {string} rateId - The ID of the rate to create a quote for */ create: (rateId: string) => Promise>; } } declare module '@duffel/api/booking/Identity/ComponentClientKey/ComponentClientKeys' { import { Resource } from '@duffel/api/Resource'; import { type DuffelResponse } from '@duffel/api/types/ClientType'; import { type ComponentClientKey } from '@duffel/api/booking/Identity/ComponentClientKey/types'; /** * A component client key is a unique identifier that allows you to authenticate with the Duffel API. */ export class ComponentClientKeys extends Resource { /** * Endpoint path */ path: string; constructor(args: any); /** * A component client key is a unique identifier that allows you to authenticate with the Duffel API. * @param data A JSON object containing the data to create a new component client key */ create: (data?: Record) => Promise>; } } declare module '@duffel/api/booking/PartialOfferRequests/PartialOfferRequestTypes' { export interface SelectedPartialOffersParams { /** * Whether to filter orders that are awaiting payment or not. If not specified, all orders regardless of their payment state will be returned. */ 'selected_partial_offer[]'?: string[]; } export interface CreatePartialOfferRequestQueryParam { /** * The maximum amount of time in milliseconds to wait for each airline search to complete. * This timeout applies to the response time of the call to the airline and includes * some additional overhead added by Duffel. Value should be between `2` seconds and `60` seconds. * Any values outside the range will be ignored and the default supplier_timeout will be used. * If a value is set, the response will only include offers from airline searches that completed * within the given time. If a value is not set, the response will only include offers from * airline searches that completed within the default supplier_timeout value of 20 seconds. * We recommend setting supplier_timeout lower than the timeout on the HTTP request you send to * Duffel API as that will allow us to respond with the offers we received before your request * times out with an empty response. */ supplier_timeout?: number; } } declare module '@duffel/api/booking/Identity/ComponentClientKey/types' { export interface ComponentClientKey { /** * The client key used to authenticate Duffel UI components to our API. */ component_client_key: string; } }