@duffel/api 1.29.0 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,4199 @@
1
+ // Generated by dts-bundle v0.7.3
2
+ // Dependencies for this module:
3
+ // ../Client
4
+ // ../types
5
+ // ../node-fetch
6
+
7
+ declare module '@duffel/api' {
8
+ import { PaymentIntents } from '@duffel/api/DuffelPayments';
9
+ import { OfferRequests, Offers, OrderCancellations, Orders, OrderChangeRequests, OrderChangeOffers, OrderChanges, Payments, PartialOfferRequests, SeatMaps, AirlineInitiatedChanges } from '@duffel/api/booking';
10
+ import { Config, DuffelError as _DuffelError } from '@duffel/api/Client';
11
+ import { Aircraft, Airlines, Airports } from '@duffel/api/supportingResources';
12
+ import { Suggestions } from '@duffel/api/Places/Suggestions';
13
+ import { Refunds } from '@duffel/api/DuffelPayments/Refunds';
14
+ import { Sessions } from '@duffel/api/Links';
15
+ import { Webhooks } from '@duffel/api/notifications';
16
+ import { Stays } from '@duffel/api/Stays/Stays';
17
+ export interface DuffelAPIClient {
18
+ aircraft: Aircraft;
19
+ airlines: Airlines;
20
+ airports: Airports;
21
+ offers: Offers;
22
+ offerRequests: OfferRequests;
23
+ orders: Orders;
24
+ orderChangeRequests: OrderChangeRequests;
25
+ orderChangeOffers: OrderChangeOffers;
26
+ orderChanges: OrderChanges;
27
+ orderCancellations: OrderCancellations;
28
+ payments: Payments;
29
+ seatMaps: SeatMaps;
30
+ }
31
+ export class Duffel {
32
+ aircraft: Aircraft;
33
+ airlineInitiatedChanges: AirlineInitiatedChanges;
34
+ airlines: Airlines;
35
+ airports: Airports;
36
+ links: Sessions;
37
+ offerRequests: OfferRequests;
38
+ offers: Offers;
39
+ orders: Orders;
40
+ orderChangeRequests: OrderChangeRequests;
41
+ orderChangeOffers: OrderChangeOffers;
42
+ orderChanges: OrderChanges;
43
+ orderCancellations: OrderCancellations;
44
+ payments: Payments;
45
+ seatMaps: SeatMaps;
46
+ paymentIntents: PaymentIntents;
47
+ partialOfferRequests: PartialOfferRequests;
48
+ suggestions: Suggestions;
49
+ refunds: Refunds;
50
+ webhooks: Webhooks;
51
+ stays: Stays;
52
+ constructor(config: Config);
53
+ }
54
+ export const DuffelError: typeof _DuffelError;
55
+ }
56
+
57
+ declare module '@duffel/api/DuffelPayments' {
58
+ export * from '@duffel/api/DuffelPayments/PaymentIntents';
59
+ }
60
+
61
+ declare module '@duffel/api/booking' {
62
+ export * from '@duffel/api/booking/AirlineInitiatedChanges';
63
+ export * from '@duffel/api/booking/OfferRequests';
64
+ export * from '@duffel/api/booking/Offers';
65
+ export * from '@duffel/api/booking/OrderCancellations';
66
+ export * from '@duffel/api/booking/Orders';
67
+ export * from '@duffel/api/booking/OrderChangeRequests';
68
+ export * from '@duffel/api/booking/OrderChangeOffers';
69
+ export * from '@duffel/api/booking/OrderChanges';
70
+ export * from '@duffel/api/booking/Payments';
71
+ export * from '@duffel/api/booking/PartialOfferRequests';
72
+ export * from '@duffel/api/booking/SeatMaps';
73
+ }
74
+
75
+ declare module '@duffel/api/Client' {
76
+ import { DuffelResponse, SDKOptions, ApiResponseMeta, ApiResponseError } from '@duffel/api/types';
77
+ export interface Config {
78
+ token: string;
79
+ basePath?: string;
80
+ apiVersion?: string;
81
+ debug?: SDKOptions;
82
+ source?: string;
83
+ }
84
+ export class DuffelError extends Error {
85
+ meta: ApiResponseMeta;
86
+ errors: ApiResponseError[];
87
+ headers: Record<string, string>;
88
+ constructor({ meta, errors, headers, }: {
89
+ meta: ApiResponseMeta;
90
+ errors: ApiResponseError[];
91
+ headers: Record<string, string>;
92
+ });
93
+ }
94
+ export class Client {
95
+ constructor({ token, basePath, apiVersion, debug, source }: Config);
96
+ request: <T_Data = any>({ method, path, data, params, compress, }: {
97
+ method: string;
98
+ path: string;
99
+ data?: Record<string, any> | undefined;
100
+ params?: Record<string, any> | undefined;
101
+ compress?: boolean | undefined;
102
+ }) => Promise<DuffelResponse<T_Data>>;
103
+ paginatedRequest<T_Data = any>({ path, params, }: {
104
+ path: string;
105
+ params?: Record<string, any>;
106
+ }): AsyncGenerator<DuffelResponse<T_Data>, void, unknown>;
107
+ }
108
+ }
109
+
110
+ declare module '@duffel/api/supportingResources' {
111
+ export * from '@duffel/api/supportingResources/Aircraft';
112
+ export * from '@duffel/api/supportingResources/Airlines';
113
+ export * from '@duffel/api/supportingResources/Airports';
114
+ }
115
+
116
+ declare module '@duffel/api/Places/Suggestions' {
117
+ export * from '@duffel/api/Places/Suggestions/Suggestions';
118
+ }
119
+
120
+ declare module '@duffel/api/DuffelPayments/Refunds' {
121
+ export * from '@duffel/api/DuffelPayments/Refunds/Refunds';
122
+ }
123
+
124
+ declare module '@duffel/api/Links' {
125
+ export * from '@duffel/api/Links/Sessions';
126
+ }
127
+
128
+ declare module '@duffel/api/notifications' {
129
+ export * from '@duffel/api/notifications/Webhooks';
130
+ }
131
+
132
+ declare module '@duffel/api/Stays/Stays' {
133
+ import { Client } from '@duffel/api/Client';
134
+ import { StaysSearchParams, StaysSearchResult } from '@duffel/api/Stays/StaysTypes';
135
+ import { Resource } from '@duffel/api/Resource';
136
+ import { DuffelResponse } from '@duffel/api/types';
137
+ import { Bookings } from '@duffel/api/Stays/Bookings';
138
+ import { Quotes } from '@duffel/api/Stays/Quotes';
139
+ import { SearchResults } from '@duffel/api/Stays/SearchResults';
140
+ export class Stays extends Resource {
141
+ /**
142
+ * Endpoint path
143
+ */
144
+ path: string;
145
+ searchResults: SearchResults;
146
+ quotes: Quotes;
147
+ bookings: Bookings;
148
+ constructor(client: Client);
149
+ /**
150
+ * Search for accommodations
151
+ * @param {object} params - The search parameters
152
+ */
153
+ search: (params: StaysSearchParams) => Promise<DuffelResponse<StaysSearchResult>>;
154
+ }
155
+ }
156
+
157
+ declare module '@duffel/api/DuffelPayments/PaymentIntents' {
158
+ export * from '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntents';
159
+ }
160
+
161
+ declare module '@duffel/api/booking/AirlineInitiatedChanges' {
162
+ export * from '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChanges';
163
+ }
164
+
165
+ declare module '@duffel/api/booking/OfferRequests' {
166
+ export * from '@duffel/api/booking/OfferRequests/OfferRequests';
167
+ }
168
+
169
+ declare module '@duffel/api/booking/Offers' {
170
+ export * from '@duffel/api/booking/Offers/Offers';
171
+ }
172
+
173
+ declare module '@duffel/api/booking/OrderCancellations' {
174
+ export * from '@duffel/api/booking/OrderCancellations/OrderCancellations';
175
+ }
176
+
177
+ declare module '@duffel/api/booking/Orders' {
178
+ export * from '@duffel/api/booking/Orders/Orders';
179
+ }
180
+
181
+ declare module '@duffel/api/booking/OrderChangeRequests' {
182
+ export * from '@duffel/api/booking/OrderChangeRequests/OrderChangeRequests';
183
+ }
184
+
185
+ declare module '@duffel/api/booking/OrderChangeOffers' {
186
+ export * from '@duffel/api/booking/OrderChangeOffers/OrderChangeOffers';
187
+ }
188
+
189
+ declare module '@duffel/api/booking/OrderChanges' {
190
+ export * from '@duffel/api/booking/OrderChanges/OrderChanges';
191
+ }
192
+
193
+ declare module '@duffel/api/booking/Payments' {
194
+ export * from '@duffel/api/booking/Payments/Payments';
195
+ }
196
+
197
+ declare module '@duffel/api/booking/PartialOfferRequests' {
198
+ export * from '@duffel/api/booking/PartialOfferRequests/PartialOfferRequests';
199
+ }
200
+
201
+ declare module '@duffel/api/booking/SeatMaps' {
202
+ export * from '@duffel/api/booking/SeatMaps/SeatMaps';
203
+ }
204
+
205
+ declare module '@duffel/api/types' {
206
+ export * from '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChangesTypes';
207
+ export * from '@duffel/api/booking/OfferRequests/OfferRequestsTypes';
208
+ export * from '@duffel/api/booking/Offers/OfferTypes';
209
+ export * from '@duffel/api/booking/OrderCancellations/OrderCancellationsTypes';
210
+ export * from '@duffel/api/booking/OrderChangeOffers/OrderChangeOfferTypes';
211
+ export * from '@duffel/api/booking/OrderChangeRequests/OrderChangeRequestsTypes';
212
+ export * from '@duffel/api/booking/OrderChanges/OrderChangesTypes';
213
+ export * from '@duffel/api/booking/Orders/OrdersTypes';
214
+ export * from '@duffel/api/booking/Payments/PaymentsTypes';
215
+ export * from '@duffel/api/booking/SeatMaps/SeatMapTypes';
216
+ export * from '@duffel/api/supportingResources/Aircraft/AircraftTypes';
217
+ export * from '@duffel/api/supportingResources/Airlines/AirlinesTypes';
218
+ export * from '@duffel/api/supportingResources/Airports/AirportsTypes';
219
+ export * from '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntentsType';
220
+ export * from '@duffel/api/Places/Suggestions/SuggestionsType';
221
+ export * from '@duffel/api/types/shared';
222
+ export * from '@duffel/api/types/ClientType';
223
+ export * from '@duffel/api/notifications/Webhooks/WebhooksType';
224
+ export * from '@duffel/api/Stays/StaysTypes';
225
+ }
226
+
227
+ declare module '@duffel/api/supportingResources/Aircraft' {
228
+ export * from '@duffel/api/supportingResources/Aircraft/Aircraft';
229
+ }
230
+
231
+ declare module '@duffel/api/supportingResources/Airlines' {
232
+ export * from '@duffel/api/supportingResources/Airlines/Airlines';
233
+ export * as AirlineType from '@duffel/api/supportingResources/Airlines/AirlinesTypes';
234
+ }
235
+
236
+ declare module '@duffel/api/supportingResources/Airports' {
237
+ export * from '@duffel/api/supportingResources/Airports/Airports';
238
+ export * as AirportType from '@duffel/api/supportingResources/Airports/AirportsTypes';
239
+ }
240
+
241
+ declare module '@duffel/api/Places/Suggestions/Suggestions' {
242
+ import { Client } from 'Client';
243
+ import { Resource } from '@duffel/api/Resource';
244
+ import { DuffelResponse, Places } from '@duffel/api/types';
245
+ interface PlacesSuggestionsParameters {
246
+ /**
247
+ * A search string for finding matching Places.
248
+ */
249
+ query: string;
250
+ }
251
+ /**
252
+ * A Place is a city or airport that can serve as an origin or destination.
253
+ * * @link https://duffel.com/docs/api/places
254
+ */
255
+ export class Suggestions extends Resource {
256
+ /**
257
+ * Endpoint path
258
+ */
259
+ path: string;
260
+ constructor(client: Client);
261
+ /**
262
+ * Retrieves a list of Places matching the provided query
263
+ */
264
+ list: (params: PlacesSuggestionsParameters) => Promise<DuffelResponse<Places[]>>;
265
+ }
266
+ export {};
267
+ }
268
+
269
+ declare module '@duffel/api/DuffelPayments/Refunds/Refunds' {
270
+ import { Resource } from '@duffel/api/Resource';
271
+ import { DuffelResponse } from '@duffel/api/types';
272
+ import { CreateRefund, Refund } from '@duffel/api/DuffelPayments/Refunds/RefundsType';
273
+ export class Refunds extends Resource {
274
+ /**
275
+ * Endpoint path
276
+ */
277
+ path: string;
278
+ constructor(args: any);
279
+ /**
280
+ * You should use this API to get the complete, up-to-date information about a Refund.
281
+ * @param {string} id - Duffel's unique identifier for the Refund
282
+ * @link https://duffel.com/docs/api/refunds/get-refund-by-id
283
+ */
284
+ get: (id: string) => Promise<DuffelResponse<Refund>>;
285
+ /**
286
+ * 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.
287
+ * @param {Object.<CreateFund>} params - Endpoint params (amount, currency and payment_intent_id)
288
+ */
289
+ create: (params: CreateRefund) => Promise<DuffelResponse<Refund>>;
290
+ }
291
+ }
292
+
293
+ declare module '@duffel/api/Links/Sessions' {
294
+ export * from '@duffel/api/Links/Sessions/Sessions';
295
+ }
296
+
297
+ declare module '@duffel/api/notifications/Webhooks' {
298
+ export * from '@duffel/api/notifications/Webhooks/Webhooks';
299
+ }
300
+
301
+ declare module '@duffel/api/Stays/StaysTypes' {
302
+ export type StaysBedType = 'single' | 'double' | 'queen' | 'king' | 'sofabed';
303
+ export interface StaysBed {
304
+ /**
305
+ * The type of beds available in the room Available types: "single", "double", "queen", "king", "sofabed"
306
+ */
307
+ type: StaysBedType;
308
+ /**
309
+ * The number of beds of this type in the room.
310
+ */
311
+ count: number;
312
+ }
313
+ export interface StaysRating {
314
+ /**
315
+ * The source of this rating. Possible values: `"aaa"` (American Automobile Association Diamond Rating), `"northstar"` (Northstar Crown Rating), `"priceline"` (Priceline star rating)
316
+ */
317
+ source: 'aaa' | 'northstar' | 'priceline';
318
+ /**
319
+ * The rating value. This is an integer from 1 to 5 regardless of the `source`.
320
+ */
321
+ value: number;
322
+ }
323
+ export interface StaysRateCondition {
324
+ /**
325
+ * One or more paragraphs that outline the rate condition
326
+ */
327
+ description: string;
328
+ /**
329
+ * The condition title
330
+ */
331
+ title: string;
332
+ }
333
+ export interface StaysRateCancellationTimeline {
334
+ /**
335
+ * The amount refundable up until the specified before date
336
+ */
337
+ refund_amount: string;
338
+ /**
339
+ * The ISO 8601 datetime for the deadline of a refund.
340
+ */
341
+ before: string;
342
+ /**
343
+ * The currency of the amount, as an ISO 4217 currency code.
344
+ */
345
+ currency: string;
346
+ }
347
+ export interface StaysRate {
348
+ /**
349
+ * The currency of the base_amount, as an ISO 4217 currency code.
350
+ */
351
+ base_amount: string | null;
352
+ /**
353
+ * The currency of the base_amount, as an ISO 4217 currency code.
354
+ */
355
+ base_currency: string;
356
+ /**
357
+ * The type of boarding offered by this rate.
358
+ */
359
+ board_type: 'room_only' | 'breakfast' | 'all_inclusive';
360
+ /**
361
+ * A timeline that contains policies, such as possible refunds, once this rate has been booked. This is sorted in ascending chronological order.
362
+ */
363
+ cancellation_timeline: StaysRateCancellationTimeline[];
364
+ /**
365
+ * 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.
366
+ */
367
+ conditions: Array<StaysRateCondition>;
368
+ /**
369
+ * Fees are sometimes payable at time of check in. These fees are not collected during the booking process
370
+ */
371
+ due_at_accommodation_amount: string | null;
372
+ /**
373
+ * The currency of the due_at_accommodation_amount
374
+ */
375
+ due_at_accommodation_currency: string;
376
+ /**
377
+ * ID of a given rate for a accommodation
378
+ */
379
+ id: string;
380
+ /**
381
+ * The accepted payment method for this rate. Prepaid rates require payment at time of reservation. Accepted types: prepaid
382
+ */
383
+ payment_type: 'prepaid';
384
+ /**
385
+ * The supplier from which Duffel got this rate
386
+ */
387
+ supplier: 'priceline';
388
+ /**
389
+ * The fee amount, as an ISO 4217 currency code.
390
+ */
391
+ fee_amount: string | null;
392
+ /**
393
+ * The currency of the fee_amount, as an ISO 4217 currency code
394
+ */
395
+ fee_currency: string;
396
+ /**
397
+ * The tax amount, as an ISO 4217 currency code.
398
+ */
399
+ tax_amount: string | null;
400
+ /**
401
+ * The currency of the tax_amount, as an ISO 4217 currency code
402
+ */
403
+ tax_currency: string;
404
+ /**
405
+ * 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
406
+ */
407
+ total_amount: string;
408
+ /**
409
+ * The currency of the total_amount, as an ISO 4217 currency code
410
+ */
411
+ total_currency: string;
412
+ }
413
+ export interface StaysPhoto {
414
+ url: string;
415
+ }
416
+ export interface StaysRoom {
417
+ /**
418
+ * The room name.
419
+ */
420
+ name: string;
421
+ /**
422
+ * Available beds in the room
423
+ */
424
+ beds?: StaysBed[];
425
+ /**
426
+ * Supplied photos for the room
427
+ */
428
+ photos?: StaysPhoto[];
429
+ /**
430
+ * The available rates for a specific room, including commission, distribution, payment and included services information.
431
+ */
432
+ rates: StaysRate[];
433
+ }
434
+ export interface StaysAmenity {
435
+ type: 'parking' | 'wi-fi' | 'gym';
436
+ description: string;
437
+ }
438
+ export interface StaysChain {
439
+ /**
440
+ * The hotel chain’s name
441
+ */
442
+ name: string;
443
+ }
444
+ export interface StaysAddress {
445
+ /**
446
+ * The name of the city or metropolitan area where the accommodation is located.
447
+ */
448
+ city_name: string;
449
+ /**
450
+ * The ISO 3166-1 alpha-2 code for the country where the hotel is located.
451
+ */
452
+ country_code: string;
453
+ /**
454
+ * The first line of the accommodation's address
455
+ */
456
+ line_one: string;
457
+ /**
458
+ * The accommodation's postal code (or zip code)
459
+ */
460
+ postal_code: string;
461
+ /**
462
+ * The setay's region or state
463
+ */
464
+ region: string;
465
+ }
466
+ export interface GeographicCoordinates {
467
+ /**
468
+ * The latitude position of the accommodation represented in Decimal degrees with 6 decimal points with a range between -90° and 90°
469
+ */
470
+ latitude: number;
471
+ /**
472
+ * The longitude position of the accommodation represented in Decimal degrees with 6 decimal points with a range between -180° and 180°
473
+ */
474
+ longitude: number;
475
+ }
476
+ export interface StaysLocation {
477
+ /**
478
+ * Address information of the location
479
+ */
480
+ address: StaysAddress;
481
+ /**
482
+ * The exact latitude-longitude position of the accommodation. Useful for map views.
483
+ */
484
+ geographic_coordinates: GeographicCoordinates | null;
485
+ }
486
+ export interface StaysAccommodation {
487
+ /**
488
+ * The amenities available at the accommodation
489
+ */
490
+ amenities: StaysAmenity[] | null;
491
+ /**
492
+ * Information about the chain this accommodation belongs to
493
+ */
494
+ chain: StaysChain | null;
495
+ /**
496
+ * Check in and check out related information
497
+ */
498
+ check_in_information: {
499
+ /**
500
+ * The ISO 8601 format for the earliest time a traveller can check-in to their room.
501
+ */
502
+ check_out_before_time: string;
503
+ /**
504
+ * The ISO 8601 format for the earliest time a traveller can check-out to their room.
505
+ */
506
+ check_in_after_time: string;
507
+ } | null;
508
+ /**
509
+ * The total currency for the cheapest rate for this accommodation, as an ISO 4217 currency code. If rooms data is available, this is equivalent to the cheapest rate for the cheapest room.
510
+ */
511
+ cheapest_rate_currency: string;
512
+ /**
513
+ * The total amount for the cheapest rate for this accommodation. If rooms data is available, this is equivalent to the cheapest rate for the cheapest room.
514
+ */
515
+ cheapest_rate_total_amount: string;
516
+ /**
517
+ * The accommodation’s description
518
+ */
519
+ description?: string;
520
+ /**
521
+ * 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.
522
+ */
523
+ email: string | null;
524
+ /**
525
+ * Information on the accommodation's location
526
+ */
527
+ location: StaysLocation;
528
+ /**
529
+ * The accommodation's name
530
+ */
531
+ name: string;
532
+ /**
533
+ * 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.
534
+ */
535
+ phone_number: string | null;
536
+ /**
537
+ * Photos for the accommodation
538
+ */
539
+ photos?: StaysPhoto[];
540
+ /**
541
+ * Ratings of the accommodation
542
+ */
543
+ ratings: StaysRating[] | null;
544
+ /**
545
+ * Rooms for the accommodation
546
+ */
547
+ rooms: StaysRoom[];
548
+ }
549
+ /**
550
+ * Represents a quote for a stay.
551
+ */
552
+ export interface StaysQuote {
553
+ /**
554
+ * The id of the stay quote.
555
+ *
556
+ * Example: "quo_0000AS0NZdKjjnnHZmSUbI"
557
+ */
558
+ id: string;
559
+ /**
560
+ * The ISO 8601 date on which the guest wants to check in.
561
+ * This comes from the search request this quote originates from.
562
+ *
563
+ * Example: "2023-05-24"
564
+ */
565
+ check_in_date: string;
566
+ /**
567
+ * The ISO 8601 date on which the guest wants to check out.
568
+ * This comes from the search request this quote originates from.
569
+ *
570
+ * Example: "2023-05-28"
571
+ */
572
+ check_out_date: string;
573
+ /**
574
+ * The accommodation associated with this quote.
575
+ */
576
+ accommodation: StaysAccommodation;
577
+ /**
578
+ * The total price for the room for all nights and for all guests.
579
+ * Please note, the guest may be required to pay mandatory fees and taxes at the stay.
580
+ * These are not included in the total_amount, and are included in due_at_accommodation_amount.
581
+ *
582
+ * Example: "799.00"
583
+ */
584
+ total_amount: string;
585
+ /**
586
+ * The currency of the total_amount, as an ISO 4217 currency code.
587
+ *
588
+ * Example: "GBP"
589
+ */
590
+ total_currency: string;
591
+ /**
592
+ * The base amount for this quote, excluding taxes and fees.
593
+ * Will be null if the base amount is unknown.
594
+ *
595
+ * Example: "665.83"
596
+ */
597
+ base_amount: string | null;
598
+ /**
599
+ * The currency of the base_amount, as an ISO 4217 currency code.
600
+ *
601
+ * Example: "GBP"
602
+ */
603
+ base_currency: string;
604
+ /**
605
+ * The fee amount for this quote.
606
+ * Will be null if the fee amount is unknown.
607
+ *
608
+ * Example: "50.94"
609
+ */
610
+ fee_amount: string | null;
611
+ /**
612
+ * The currency of the fee_amount, as an ISO 4217 currency code.
613
+ *
614
+ * Example: "GBP"
615
+ */
616
+ fee_currency: string;
617
+ /**
618
+ * The tax amount for this quote.
619
+ * Will be null if the tax amount is unknown.
620
+ *
621
+ * Example: "133.17"
622
+ */
623
+ tax_amount: string | null;
624
+ /**
625
+ * The currency of the tax_amount, as an ISO 4217 currency code.
626
+ *
627
+ * Example: "GBP"
628
+ */
629
+ tax_currency: string;
630
+ /**
631
+ * Mandatory fees or taxes that are due by the guest at the accommodation.
632
+ * Depending on the accommodation, these may be payable on check-in or check-out.
633
+ * These fees are not collected during the booking process.
634
+ * Will be null if the amount due at accommodation is unknown.
635
+ *
636
+ * Example: "39.95"
637
+ */
638
+ due_at_accommodation_amount: string | null;
639
+ /**
640
+ * The currency of the due_at_accommodation_amount, as an ISO 4217 currency code.
641
+ *
642
+ * Example: "GBP"
643
+ */
644
+ due_at_accommodation_currency: string;
645
+ }
646
+ export type StaysBookingStatus = 'requested' | 'confirmed' | 'failed' | 'cancellation_confirmed';
647
+ export interface StaysBooking {
648
+ /**
649
+ * The ID of the booking
650
+ */
651
+ id: string;
652
+ /**
653
+ * The accommodation object for the booking
654
+ */
655
+ accommodation: StaysAccommodation;
656
+ /**
657
+ * The ISO 8601 date on which the guest wants to check in.
658
+ */
659
+ check_in_date: string;
660
+ /**
661
+ * The ISO 8601 date on which the guest wants to check out.
662
+ */
663
+ check_out_date: string;
664
+ /**
665
+ * A booking reference for the property you’ll be staying in. This is the reference you should use when contacting the accommodation.
666
+ */
667
+ reference: string | null;
668
+ /**
669
+ * The status of the booking. Possible values: requested, confirmed, failed,cancellation_requested,cancellation_confirmed.
670
+ */
671
+ status: StaysBookingStatus;
672
+ /**
673
+ * The ISO 8601 datetime at which the booking was confirmed by the accommodation.
674
+ */
675
+ confirmed_at: string | null;
676
+ /**
677
+ * The ISO 8601 datetime of the cancellation of this booking.
678
+ * This is null if the booking is not cancelled.
679
+ */
680
+ cancelled_at: string | null;
681
+ /**
682
+ * The guests for the booking
683
+ */
684
+ guests: Array<{
685
+ given_name: string;
686
+ family_name: string;
687
+ }>;
688
+ }
689
+ export interface StaysSearchParams {
690
+ check_in_date: string;
691
+ check_out_date: string;
692
+ adults: number;
693
+ rooms: number;
694
+ location: {
695
+ radius: number;
696
+ geographic_coordinates: {
697
+ latitude: number;
698
+ longitude: number;
699
+ };
700
+ };
701
+ }
702
+ export interface StaysSearchResult {
703
+ id: string;
704
+ check_in_date: string;
705
+ check_out_date: string;
706
+ accommodation: StaysAccommodation;
707
+ }
708
+ }
709
+
710
+ declare module '@duffel/api/Resource' {
711
+ import { Client } from '@duffel/api/Client';
712
+ import { DuffelResponse } from '@duffel/api/types';
713
+ export class Resource {
714
+ constructor(client: Client);
715
+ protected request: <T_Data = any>({ method, path, data, params, }: {
716
+ method: string;
717
+ path: string;
718
+ data?: Record<string, any> | undefined;
719
+ params?: Record<string, any> | undefined;
720
+ }) => Promise<DuffelResponse<T_Data>>;
721
+ protected paginatedRequest: <T_Data = any>({ path, params, }: {
722
+ path: string;
723
+ params?: Record<string, any> | undefined;
724
+ }) => AsyncGenerator<DuffelResponse<T_Data>, void, unknown>;
725
+ }
726
+ }
727
+
728
+ declare module '@duffel/api/Stays/Bookings' {
729
+ export * from '@duffel/api/Stays/Bookings/Bookings';
730
+ }
731
+
732
+ declare module '@duffel/api/Stays/Quotes' {
733
+ export * from '@duffel/api/Stays/Quotes/Quotes';
734
+ }
735
+
736
+ declare module '@duffel/api/Stays/SearchResults' {
737
+ export * from '@duffel/api/Stays/SearchResults/SearchResults';
738
+ }
739
+
740
+ declare module '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntents' {
741
+ import { DuffelResponse } from '@duffel/api/types';
742
+ import { Resource } from '@duffel/api/Resource';
743
+ import { CreatePaymentIntent, PaymentIntent } from '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntentsType';
744
+ export class PaymentIntents extends Resource {
745
+ /**
746
+ * Endpoint path
747
+ */
748
+ path: string;
749
+ constructor(args: any);
750
+ /**
751
+ * You should use this API to get the complete, up-to-date information about a Payment Intent.
752
+ * @param {string} id - Duffel's unique identifier for the Payment Intent
753
+ * @link https://duffel.com/docs/api/payment-intents/get-payment-intent-by-id
754
+ */
755
+ get: (id: string) => Promise<DuffelResponse<PaymentIntent>>;
756
+ /**
757
+ * 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.
758
+ * Once confirmed, the amount charged to your customer's card will be added to your `Balance` (minus any Duffel Payment fees).
759
+ */
760
+ confirm: (id: string) => Promise<DuffelResponse<PaymentIntent>>;
761
+ /**
762
+ * To begin the process of collecting a card payment from your customer, you need to create a Payment Intent.
763
+ * The Payment Intent will contain a `client_token` that you use to collect the card payment in your application.
764
+ * 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).
765
+ * @param {Object.<CreatePaymentIntent>} params - Endpoint params (amount and string)
766
+ */
767
+ create: (params: CreatePaymentIntent) => Promise<DuffelResponse<PaymentIntent>>;
768
+ }
769
+ }
770
+
771
+ declare module '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChanges' {
772
+ import { Client } from '@duffel/api/Client';
773
+ import { Resource } from '@duffel/api/Resource';
774
+ import { DuffelResponse, Order } from '@duffel/api/types';
775
+ import { AirlineInitiatedChange, AirlineInitiatedChangeActionTaken } from '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChangesTypes';
776
+ /**
777
+ * Sometimes there can be changes to your order initiated by the airline, for
778
+ * example a flight being delayed. We record every one of these changes so that
779
+ * you can view them all or for an order. You can filter changes for a specific
780
+ * order using the `order_id` parameter.
781
+ *
782
+ * Each airline-initiated change contains an `added` and `removed` field. `added`
783
+ * contains the updated slices following the change. These slices and their
784
+ * segments may have a new ID based on the change. `removed` contains a list of
785
+ * slices and their segments as they were before the change.
786
+ */
787
+ export class AirlineInitiatedChanges extends Resource {
788
+ /**
789
+ * Endpoint path
790
+ */
791
+ path: string;
792
+ constructor(client: Client);
793
+ /**
794
+ * This endpoint is only available to those airline-initiated changes that
795
+ * Duffel cannot accept on behalf of the customer. Duffel is unable to accept
796
+ * an airline-initiated change when these two conditions are true: the order
797
+ * was booked with the merchant's IATA number and Duffel is unable to accept
798
+ * the airline-initiated change programatically. In this case you, the
799
+ * customer, are responsible to resolve airline-initiated changes concerning
800
+ * this order (e.g. by contacting the airline directly). Once these have been
801
+ * resolved, you need to inform us of the action taken so we can mark it
802
+ * accordingly in our system.
803
+ *
804
+ * @param {AirlineInitiatedChange['id']} id - Duffel's unique identifier for
805
+ * the airline-initiated change
806
+ *
807
+ * @param action_taken - The action taken in response to this
808
+ * airline-initiated change. Accepted, cancelled and changed reflect your
809
+ * action in accepting the change, cancelling the order or changing the order
810
+ * respectively.
811
+ *
812
+ * @link https://duffel.com/docs/api/v1/airline-initiated-changes/update-airline-initiated-changes
813
+ */
814
+ update: (id: AirlineInitiatedChange['id'], action_taken: AirlineInitiatedChangeActionTaken) => Promise<DuffelResponse<AirlineInitiatedChange>>;
815
+ /**
816
+ * Once there is an airline-initiated change you can choose to accept it.
817
+ *
818
+ * @param {AirlineInitiatedChange['id']} id - Duffel's unique identifier for
819
+ * the airline-initiated change
820
+ *
821
+ * @link https://duffel.com/docs/api/v1/airline-initiated-changes/accept-airline-initiated-changes
822
+ */
823
+ accept: (id: AirlineInitiatedChange['id']) => Promise<DuffelResponse<AirlineInitiatedChange>>;
824
+ /**
825
+ * Retrieves a list of all airline-initiated changes.
826
+ *
827
+ * @param order_id - Filters airline-initiated changes by their order ID.
828
+ * Value must be a valid order ID. Check the [Order schema](https://duffel.com/docs/api/orders/schema#orders-schema-id)
829
+ * for details.
830
+ *
831
+ * @link https://duffel.com/docs/api/v1/airline-initiated-changes/get-airline-initiated-changes
832
+ */
833
+ list: (order_id: Order['id']) => Promise<DuffelResponse<Order['airline_initiated_changes']>>;
834
+ }
835
+ }
836
+
837
+ declare module '@duffel/api/booking/OfferRequests/OfferRequests' {
838
+ import { Client } from 'Client';
839
+ import { Resource } from '@duffel/api/Resource';
840
+ import { CreateOfferRequest, CreateOfferRequestQueryParameters, DuffelResponse, OfferRequest, PaginationMeta } from '@duffel/api/types';
841
+ /**
842
+ * To search for flights, you'll need to create an `offer request`.
843
+ * An offer request describes the passengers and where and when they want to travel (in the form of a list of `slices`).
844
+ * It may also include additional filters (e.g. a particular cabin to travel in).
845
+ * @class
846
+ * @link https://duffel.com/docs/api/offer-requests
847
+ */
848
+ export class OfferRequests extends Resource {
849
+ /**
850
+ * Endpoint path
851
+ */
852
+ path: string;
853
+ constructor(client: Client);
854
+ /**
855
+ * Retrieves an offer request by its ID
856
+ * @param {string} id - Duffel's unique identifier for the offer request
857
+ * @link https:/duffel.com/docs/api/offer-requests/get-offer-request-by-id
858
+ */
859
+ get: (id: string) => Promise<DuffelResponse<OfferRequest>>;
860
+ /**
861
+ * Retrieves a page of offer requests. The results may be returned in any order.
862
+ * @param {Object} [options] - Pagination options (optional: limit, after, before)
863
+ * @link https://duffel.com/docs/api/offer-requests/get-offer-requests
864
+ */
865
+ list: (options?: PaginationMeta) => Promise<DuffelResponse<OfferRequest[]>>;
866
+ /**
867
+ * Retrieves a generator of all offer requests. The results may be returned in any order.
868
+ * @link https://duffel.com/docs/api/offer-requests/get-offer-requests
869
+ */
870
+ listWithGenerator: () => AsyncGenerator<DuffelResponse<OfferRequest>, void, unknown>;
871
+ /**
872
+ * To search for flights, you'll need to create an `offer request`.
873
+ * An offer request describes the passengers and where and when they want to travel (in the form of a list of `slices`).
874
+ * It may also include additional filters (e.g. a particular cabin to travel in).
875
+ * @param {Object} [options] - the parameters for making an offer requests (required: slices, passengers; optional: cabin_class, return_offers)
876
+ * When `return_offers` is set to `true`, the offer request resource returned will include all the `offers` returned by the airlines.
877
+ * 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`.
878
+ * @link https://duffel.com/docs/api/offer-requests/create-offer-request
879
+ */
880
+ create: <QueryParams extends CreateOfferRequestQueryParameters>(options: CreateOfferRequest & QueryParams) => Promise<DuffelResponse<QueryParams extends {
881
+ return_offers: false;
882
+ } ? Omit<OfferRequest, "offers"> : OfferRequest>>;
883
+ }
884
+ }
885
+
886
+ declare module '@duffel/api/booking/Offers/Offers' {
887
+ import { Client } from 'Client';
888
+ import { Resource } from '@duffel/api/Resource';
889
+ import { DuffelResponse, ListOffersParams, Offer, LoyaltyProgrammeAccounts, UpdateOffer } from '@duffel/api/types';
890
+ interface UpdateOfferBodyParameters {
891
+ loyalty_programme_accounts: LoyaltyProgrammeAccounts[];
892
+ given_name: string;
893
+ family_name: string;
894
+ }
895
+ /**
896
+ * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria.
897
+ * @class
898
+ * @link https://duffel.com/docs/api/offers
899
+ */
900
+ export class Offers extends Resource {
901
+ /**
902
+ * Endpoint path
903
+ */
904
+ path: string;
905
+ constructor(client: Client);
906
+ /**
907
+ * Retrieves an offer by its ID
908
+ * @param {string} id - Duffel's unique identifier for the offer
909
+ * @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.
910
+ * @link https:/duffel.com/docs/api/offers/get-offer-by-id
911
+ */
912
+ get: (id: string, params?: {
913
+ return_available_services: boolean;
914
+ }) => Promise<DuffelResponse<Offer>>;
915
+ /**
916
+ * Retrieves a page of offers. The results may be returned in any order.
917
+ * @param {Object.<ListOffersParams>} params - Endpoint options (optional: limit, after, before, max_connections, sort)
918
+ * @param {string} params.offer_request_id - Duffel's unique identifier for the offer request, returned when it was created
919
+ * @link https://duffel.com/docs/api/offers/get-offers
920
+ */
921
+ list: ({ offer_request_id, ...params }: ListOffersParams) => Promise<DuffelResponse<Offer[]>>;
922
+ /**
923
+ * Retrieves a generator of all offers. The results may be returned in any order.
924
+ * @param {Object.<ListOffersParams>} params - Endpoint options (optional: limit, after, before, max_connections, sort)
925
+ * @param {string} params.offer_request_id - Duffel's unique identifier for the offer request, returned when it was created
926
+ * @link https://duffel.com/docs/api/offers/get-offers
927
+ */
928
+ listWithGenerator: ({ offer_request_id, ...params }: ListOffersParams) => AsyncGenerator<DuffelResponse<Offer>, void, unknown>;
929
+ /**
930
+ * Some offer passenger fields are updateable. Each field that can be updated is detailed in the request object.
931
+ * @param {string} offerId - Duffel's unique identifier for the offer
932
+ * @param {string} passengerId - The identifier for the passenger. This ID will be generated by Duffel
933
+ * @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.
934
+ * @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.
935
+ * @param {Object.<LoyaltyProgrammeAccounts>} params.loyalty_programme_accounts - The Loyalty Programme Accounts for this passenger
936
+ */
937
+ update: (offerId: string, passengerId: string, params: UpdateOfferBodyParameters) => Promise<DuffelResponse<UpdateOffer>>;
938
+ }
939
+ export {};
940
+ }
941
+
942
+ declare module '@duffel/api/booking/OrderCancellations/OrderCancellations' {
943
+ import { Resource } from '@duffel/api/Resource';
944
+ import { CreateOrderCancellation, DuffelResponse, OrderCancellation, ListOrderCancellationsParams } from '@duffel/api/types';
945
+ export class OrderCancellations extends Resource {
946
+ /**
947
+ * Endpoint path
948
+ */
949
+ path: string;
950
+ constructor(args: any);
951
+ /**
952
+ * Retrieves an order cancellation by its ID
953
+ * @param {string} id - Duffel's unique identifier for the order cancellation
954
+ * @link https:/duffel.com/docs/api/order-cancellations/get-order-cancellation-by-id
955
+ */
956
+ get: (id: string) => Promise<DuffelResponse<OrderCancellation>>;
957
+ /**
958
+ * Retrieves a page of order cancellations. The results may be returned in any order.
959
+ * @param {Object.<ListOrderCancellationsParams>} params - Endpoint options (optional: limit, after, before, order_id)
960
+ * @link https://duffel.com/docs/api/order-cancellations/get-order-cancellations
961
+ */
962
+ list: (params?: ListOrderCancellationsParams) => Promise<DuffelResponse<OrderCancellation[]>>;
963
+ /**
964
+ * Retrieves a generator of all order cancellations. The results may be returned in any order.
965
+ * @param {Object.<ListOrderCancellationsParams>} params - Endpoint options (optional: limit, after, before, order_id)
966
+ * @link https://duffel.com/docs/api/order-cancellations/get-order-cancellations
967
+ */
968
+ listWithGenerator: (params?: ListOrderCancellationsParams) => AsyncGenerator<DuffelResponse<OrderCancellation>, void, unknown>;
969
+ /**
970
+ * Create order cancellation
971
+ * @description To begin the process of cancelling an order you need to create an order cancellation.
972
+ * @param order_id - Duffel's unique identifier for the order
973
+ * @link https://duffel.com/docs/api/order-cancellations/create-order-cancellation
974
+ */
975
+ create: (options: CreateOrderCancellation) => Promise<DuffelResponse<OrderCancellation>>;
976
+ /**
977
+ * Confirm order cancellation
978
+ * @description Once you've created a pending order cancellation, you'll know the `refund_amount` you're due to get back.
979
+ * @param {string} id - Duffel's unique identifier for the order to cancel
980
+ * @link https://duffel.com/docs/api/order-cancellations/confirm-order-cancellation
981
+ */
982
+ confirm: (id: string) => Promise<DuffelResponse<OrderCancellation>>;
983
+ }
984
+ }
985
+
986
+ declare module '@duffel/api/booking/Orders/Orders' {
987
+ import { Resource } from '@duffel/api/Resource';
988
+ import { AddServices, CreateOrder, DuffelResponse, ListParamsOrders, Order, OrderAvailableService, PaginationMeta, UpdateSingleOrder } from '@duffel/api/types';
989
+ export class Orders extends Resource {
990
+ /**
991
+ * Endpoint path
992
+ */
993
+ path: string;
994
+ constructor(args: any);
995
+ /**
996
+ * Retrieves an order by its ID
997
+ * @param {string} id - Duffel's unique identifier for the order
998
+ */
999
+ get: (id: string) => Promise<DuffelResponse<Order>>;
1000
+ /**
1001
+ * Retrieves a page of orders. The results may be returned in any order.
1002
+ * @param {Object} [options] - Pagination options (optional: limit, after, before)
1003
+ * @link https://duffel.com/docs/api/orders/get-orders
1004
+ */
1005
+ list: (options?: PaginationMeta & ListParamsOrders) => Promise<DuffelResponse<Order[]>>;
1006
+ /**
1007
+ * Retrieves a generator of all orders. The results may be returned in any order.
1008
+ * You can optionally filter the results by the `awaiting_payment` state and sort by the `payment_required_by` date.
1009
+ * @param {Object} [options] - Optional query parameters: awaiting_payment, sort
1010
+ * @link https://duffel.com/docs/api/orders/get-orders
1011
+ */
1012
+ listWithGenerator: (options?: ListParamsOrders) => AsyncGenerator<DuffelResponse<Order>, void, unknown>;
1013
+ /**
1014
+ * Creates a booking with an airline based on an offer.
1015
+ */
1016
+ create: (options: CreateOrder) => Promise<DuffelResponse<Order>>;
1017
+ /**
1018
+ * Updates a single order
1019
+ * @description Some order fields are updateable. Each field that can be updated is detailed in the request object.
1020
+ * @param {string} id - Duffel's unique identifier for the order
1021
+ * @param {Object.UpdateSingleOrder} options
1022
+ * @example (id: 'ord_00009hthhsUZ8W4LxQgkjo', { metadata: { 'payment_intent_id': 'pit_00009htYpSCXrwaB9DnUm2' } } )
1023
+ * @link https://duffel.com/docs/api/orders/update-order-by-id
1024
+ */
1025
+ update: (id: string, options: UpdateSingleOrder) => Promise<DuffelResponse<Order>>;
1026
+ /**
1027
+ * Retrieves the available services for an order by its ID
1028
+ * @param {string} id - Duffel's unique identifier for the order
1029
+ */
1030
+ getAvailableServices: (id: string) => Promise<DuffelResponse<OrderAvailableService[]>>;
1031
+ /**
1032
+ * Adds services for an order by its ID
1033
+ * @param {string} id - Duffel's unique identifier for the order
1034
+ * @param {Object.AddServices} options
1035
+ * @link https://duffel.com/docs/api/orders/create-order-services
1036
+ */
1037
+ addServices: (id: string, options: AddServices) => Promise<DuffelResponse<Order>>;
1038
+ }
1039
+ }
1040
+
1041
+ declare module '@duffel/api/booking/OrderChangeRequests/OrderChangeRequests' {
1042
+ import { Resource } from '@duffel/api/Resource';
1043
+ import { CreateOrderChangeRequest, DuffelResponse, OrderChangeRequestResponse } from '@duffel/api/types';
1044
+ /**
1045
+ *
1046
+ * To change an order, you'll need to create an order change request.
1047
+ * This is still in PREVIEW mode
1048
+ * @export
1049
+ * @class OrderChangeRequests
1050
+ * @extends {Resource}
1051
+ */
1052
+ export class OrderChangeRequests extends Resource {
1053
+ /**
1054
+ * Endpoint path
1055
+ */
1056
+ path: string;
1057
+ constructor(args: any);
1058
+ /**
1059
+ * Retrieves an order change request by its ID
1060
+ * @param {string} id - The ID of your order change request
1061
+ */
1062
+ get: (id: string) => Promise<DuffelResponse<OrderChangeRequestResponse>>;
1063
+ /**
1064
+ *
1065
+ * To change flights on an existing paid order, you'll need to create an order change request.
1066
+ * @link https://duffel.com/docs/api/order-change-requests/create-order-change-request
1067
+ * @memberof OrderChangeRequests
1068
+ */
1069
+ create: (options: CreateOrderChangeRequest) => Promise<DuffelResponse<OrderChangeRequestResponse>>;
1070
+ }
1071
+ }
1072
+
1073
+ declare module '@duffel/api/booking/OrderChangeOffers/OrderChangeOffers' {
1074
+ import { Resource } from '@duffel/api/Resource';
1075
+ import { DuffelResponse, OrderChangeOffer, PaginationMeta } from '@duffel/api/types';
1076
+ /**
1077
+ * 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.
1078
+ * This is still in PREVIEW mode
1079
+ * @export
1080
+ * @class OrderChangeOffers
1081
+ * @extends {Resource}
1082
+ */
1083
+ export class OrderChangeOffers extends Resource {
1084
+ /**
1085
+ * Endpoint path
1086
+ */
1087
+ path: string;
1088
+ constructor(args: any);
1089
+ /**
1090
+ * Retrieves an order change offer by its ID
1091
+ * @param {string} id - The ID of your order change offer
1092
+ * @link https://duffel.com/docs/api/order-change-offers/get-order-change-offer-by-id
1093
+ */
1094
+ get: (id: string) => Promise<DuffelResponse<OrderChangeOffer>>;
1095
+ /**
1096
+ * Retrieves a page of order change offers. The results may be returned in any order.
1097
+ * @param {Object} [options] - Pagination options (optional: limit, after, before)
1098
+ */
1099
+ list: (options?: PaginationMeta) => Promise<DuffelResponse<OrderChangeOffer[]>>;
1100
+ /**
1101
+ * Retrieves a generator of all order change offers. The results may be returned in any order.
1102
+ */
1103
+ listWithGenerator: () => AsyncGenerator<DuffelResponse<OrderChangeOffer>, void, unknown>;
1104
+ }
1105
+ }
1106
+
1107
+ declare module '@duffel/api/booking/OrderChanges/OrderChanges' {
1108
+ import { Resource } from '@duffel/api/Resource';
1109
+ import { ConfirmOrderChangePayment, CreateOrderChangeParameters, DuffelResponse, OrderChangeOfferSlice } from '@duffel/api/types';
1110
+ /**
1111
+ * 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.
1112
+ */
1113
+ export class OrderChanges extends Resource {
1114
+ /**
1115
+ * Endpoint path
1116
+ */
1117
+ path: string;
1118
+ constructor(args: any);
1119
+ /**
1120
+ * To begin the process of changing an order you need to create an order change.
1121
+ * The OrderChange will contain the `selected_order_change_offer` reference of the change you wish to make to your order.
1122
+ * @link https://duffel.com/docs/api/order-changes/create-order-change
1123
+ */
1124
+ create: (options: CreateOrderChangeParameters) => Promise<DuffelResponse<OrderChangeOfferSlice>>;
1125
+ /**
1126
+ * Retrieves an order change by its ID
1127
+ * @param {string} id - Duffel's unique identifier for the order change
1128
+ * @link https://duffel.com/docs/api/order-changes/get-order-change-by-id
1129
+ */
1130
+ get: (id: string) => Promise<DuffelResponse<OrderChangeOfferSlice>>;
1131
+ /**
1132
+ * Once you've created a pending order change, you'll know the change_total_amount due for the change.
1133
+ * @param {string} id - Duffel's unique identifier for the order change
1134
+ * @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.
1135
+ * @link https://duffel.com/docs/api/order-changes/confirm-order-change
1136
+ */
1137
+ confirm: (id: string, options: Partial<ConfirmOrderChangePayment>) => Promise<DuffelResponse<OrderChangeOfferSlice>>;
1138
+ }
1139
+ }
1140
+
1141
+ declare module '@duffel/api/booking/Payments/Payments' {
1142
+ import { Resource } from '@duffel/api/Resource';
1143
+ import { CreatePayment, DuffelResponse, Payment } from '@duffel/api/types';
1144
+ export class Payments extends Resource {
1145
+ /**
1146
+ * Endpoint path
1147
+ */
1148
+ path: string;
1149
+ constructor(args: any);
1150
+ /**
1151
+ * Creates a payment for an existing pay later order.
1152
+ * 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.
1153
+ * @param {string} order_id
1154
+ * @param {string} payment
1155
+ */
1156
+ create: (options: CreatePayment) => Promise<DuffelResponse<Payment>>;
1157
+ }
1158
+ }
1159
+
1160
+ declare module '@duffel/api/booking/PartialOfferRequests/PartialOfferRequests' {
1161
+ import { Client } from 'Client';
1162
+ import { Resource } from '@duffel/api/Resource';
1163
+ import { CreateOfferRequest, DuffelResponse, OfferRequest } from '@duffel/api/types';
1164
+ import { SelectedPartialOffersParams } from '@duffel/api/booking/PartialOfferRequests/PartialOfferRequestTypes';
1165
+ /**
1166
+ * To search for and select flights separately for each slice of the journey, you'll need to create a partial offer request.
1167
+ *
1168
+ * A partial offer request describes the passengers and where and when they want to travel (in the form of a list of slices).
1169
+ * @class
1170
+ * @link https://duffel.com/docs/api/partial-offer-requests
1171
+ */
1172
+ export class PartialOfferRequests extends Resource {
1173
+ /**
1174
+ * Endpoint path
1175
+ */
1176
+ path: string;
1177
+ constructor(client: Client);
1178
+ /**
1179
+ * Retrieves a partial offers request by its ID, only including partial offers for the current slice of multi-step search flow.
1180
+ * @param {string} id - Duffel's unique identifier for the partial offer request
1181
+ * @param {Object} [options] - Selected partial offers
1182
+ * @link https:/duffel.com/docs/api/partial-offer-requests/get-partial-offer-request-by-id
1183
+ */
1184
+ get: (id: string, options?: SelectedPartialOffersParams) => Promise<DuffelResponse<OfferRequest>>;
1185
+ /**
1186
+ * To search for and select flights separately for each slice of the journey, you'll need to create a partial offer request.
1187
+ * A partial offer request describes the passengers and where and when they want to travel (in the form of a list of slices).
1188
+ * It may also include additional filters (e.g. a particular cabin to travel in).
1189
+ * @param {Object} [options] - the parameters for making a partial offer requests (required: slices, passengers; optional: cabin_class)
1190
+ * @link https://duffel.com/docs/api/partial-offer-requests/create-partial-offer-request
1191
+ */
1192
+ create: <QueryParams>(options: CreateOfferRequest & QueryParams) => Promise<DuffelResponse<OfferRequest>>;
1193
+ /**
1194
+ * Retrieves an offer request with offers for fares matching selected partial offers..
1195
+ * @param {string} id - Duffel's unique identifier for the partial offer request
1196
+ * @param {Object} [options] - Selected partial offers
1197
+ * @link https:/duffel.com/docs/api/partial-offer-requests/get-partial-offer-request-fares-by-id
1198
+ */
1199
+ getFaresById: (id: string, options?: SelectedPartialOffersParams) => Promise<DuffelResponse<OfferRequest>>;
1200
+ }
1201
+ }
1202
+
1203
+ declare module '@duffel/api/booking/SeatMaps/SeatMaps' {
1204
+ import { Resource } from '@duffel/api/Resource';
1205
+ import { DuffelResponse, SeatMap } from '@duffel/api/types';
1206
+ export class SeatMaps extends Resource {
1207
+ /**
1208
+ * Endpoint path
1209
+ */
1210
+ path: string;
1211
+ constructor(args: any);
1212
+ /**
1213
+ * Gets seat maps by specific parameters. At the moment we only support querying by an offer ID.
1214
+ * @param {string} offer_id - Duffel's unique identifier for the offer
1215
+ * @link https://duffel.com/docs/api/seat-maps/get-seat-maps
1216
+ */
1217
+ get: (params: {
1218
+ offer_id: string;
1219
+ }) => Promise<DuffelResponse<SeatMap>>;
1220
+ }
1221
+ }
1222
+
1223
+ declare module '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChangesTypes' {
1224
+ import { OrderSlice } from 'types';
1225
+ export type AirlineInitiatedChangeActionTaken = 'accepted' | 'cancelled' | 'changed';
1226
+ export type AirlineInitiatedChangeAvailableAction = 'accept' | 'cancel' | 'change' | 'update';
1227
+ export interface AirlineInitiatedChange {
1228
+ /**
1229
+ * The action taken in response to this airline-initiated change. Accepted,
1230
+ * cancelled and changed reflect your action in accepting the change,
1231
+ * cancelling the order or changing the order respectively.
1232
+ */
1233
+ action_taken: AirlineInitiatedChangeActionTaken | null;
1234
+ /**
1235
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which an
1236
+ * action was taken.
1237
+ */
1238
+ action_taken_at: string | null;
1239
+ /**
1240
+ * List of updated (slices and segments)[https://duffel.com/docs/api/orders/schema#orders-schema-slices]
1241
+ * following the change. These slices and segments may each have a new ID as a
1242
+ * result of the changes.
1243
+ */
1244
+ added: OrderSlice[];
1245
+ /**
1246
+ * The available actions you can take on this Airline-Initiated Change through
1247
+ * our API.`"update"` means that you can use the update endpoint for an
1248
+ * Airline-Initiated Change.
1249
+ */
1250
+ available_actions: AirlineInitiatedChangeAvailableAction[];
1251
+ /**
1252
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which we
1253
+ * detected the airline-initiated change.
1254
+ */
1255
+ created_at: string;
1256
+ /**
1257
+ * Duffel's unique identifier for the airline-initiated change.
1258
+ */
1259
+ id: string;
1260
+ /**
1261
+ * Duffel's unique identifier for the order.
1262
+ */
1263
+ order_id: string;
1264
+ /**
1265
+ * List of (slices and segments)[https://duffel.com/docs/api/orders/schema#orders-schema-slices]
1266
+ * as they were before the change.
1267
+ */
1268
+ removed: OrderSlice[];
1269
+ /**
1270
+ * The associated Travel Agent Ticket, if any, for this Airline-Initiated
1271
+ * Change. This value will be present for Airline-Initiated changes that take
1272
+ * some time to be processed.
1273
+ */
1274
+ travel_agent_ticket: any | null;
1275
+ /**
1276
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which
1277
+ * the airline-initiated change was last updated.
1278
+ */
1279
+ updated_at: string;
1280
+ }
1281
+ }
1282
+
1283
+ declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' {
1284
+ import { Airline, CabinClass, DuffelPassengerType, Place, PlaceType } from '@duffel/api/types';
1285
+ import { Offer } from '@duffel/api/booking/Offers/OfferTypes';
1286
+ export interface OfferRequestSlice {
1287
+ /**
1288
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the passengers want to depart
1289
+ */
1290
+ departure_date: string;
1291
+ /**
1292
+ * The city or airport the passengers want to travel to
1293
+ */
1294
+ destination: Place | string;
1295
+ /**
1296
+ * The city or airport the passengers want to depart from
1297
+ */
1298
+ origin: Place | string;
1299
+ /**
1300
+ * The type of the origin
1301
+ */
1302
+ origin_type: PlaceType;
1303
+ /**
1304
+ * The type of the destination
1305
+ */
1306
+ destination_type: PlaceType;
1307
+ }
1308
+ interface CreateOfferRequestPassengerCommon {
1309
+ /**
1310
+ * The passenger's family name. Only `space`, `-`, `'`, and letters from the
1311
+ * `ASCII`, `Latin-1 Supplement` and `Latin Extended-A` (with the exceptions
1312
+ * of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted.
1313
+ * All other characters will result in a validation error. The minimum length
1314
+ * is 1 character, and the maximum is 20 characters.
1315
+ *
1316
+ * This is only required if you're also including
1317
+ * **Loyalty Programme Accounts**.
1318
+ */
1319
+ family_name?: string;
1320
+ /**
1321
+ * The passenger's given name. Only `space`, `-`, `'`, and letters from the
1322
+ * `ASCII`, `Latin-1 Supplement` and `Latin Extended-A` (with the exceptions
1323
+ * of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, and `ð`) Unicode charts are accepted.
1324
+ * All other characters will result in a validation error. The minimum length
1325
+ * is 1 character, and the maximum is 20 characters.
1326
+ *
1327
+ * This is only required if you're also including
1328
+ * **Loyalty Programme Accounts**.
1329
+ */
1330
+ given_name?: string;
1331
+ /**
1332
+ * The **Loyalty Programme Accounts** for this passenger.
1333
+ */
1334
+ loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
1335
+ }
1336
+ interface CreateOfferRequestAdultPassenger extends CreateOfferRequestPassengerCommon {
1337
+ age?: never;
1338
+ fare_type?: never;
1339
+ /**
1340
+ * The type of the passenger. If the passenger is aged 18 or over, you should
1341
+ * specify a `type` of `adult`. If a passenger is aged under 18, you should
1342
+ * specify their `age` instead of a `type`. A passenger can have only a type
1343
+ * or an age, but not both.
1344
+ */
1345
+ type: Extract<DuffelPassengerType, 'adult'>;
1346
+ }
1347
+ interface CreateOfferRequestNonAdultPassenger extends CreateOfferRequestPassengerCommon {
1348
+ /**
1349
+ * The age of the passenger on the `departure_date` of the final slice. e.g.
1350
+ * if you a searching for a round trip and the passenger is 15 years old at
1351
+ * the time of the outbound flight, but they then have their birthday and are
1352
+ * 16 years old for the inbound flight, you must set the age to 16. You should
1353
+ * specify an `age` for passengers who are under 18 years old. A passenger can
1354
+ * have only a type or an age, but not both. You can optionally pass age with
1355
+ * `fare_type` though.
1356
+ */
1357
+ age: number;
1358
+ fare_type?: never;
1359
+ type?: never;
1360
+ }
1361
+ 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';
1362
+ interface CreateOfferRequestPassengerWithFareType extends CreateOfferRequestPassengerCommon {
1363
+ /**
1364
+ * The age of the passenger on the `departure_date` of the final slice. e.g.
1365
+ * if you a searching for a round trip and the passenger is 15 years old at
1366
+ * the time of the outbound flight, but they then have their birthday and are
1367
+ * 16 years old for the inbound flight, you must set the age to 16. You should
1368
+ * specify an `age` for passengers who are under 18 years old. A passenger can
1369
+ * have only a type or an age, but not both. You can optionally pass age with
1370
+ * `fare_type` though.
1371
+ */
1372
+ age?: number;
1373
+ /**
1374
+ * The fare type of the passenger. If the passenger is aged less than 18, you
1375
+ * should pass in age as well.
1376
+ */
1377
+ fare_type: CreateOfferRequestPassengerFareType;
1378
+ type?: never;
1379
+ }
1380
+ export type CreateOfferRequestPassenger = CreateOfferRequestAdultPassenger | CreateOfferRequestNonAdultPassenger | CreateOfferRequestPassengerWithFareType;
1381
+ export interface CreateOfferRequestPrivateFare {
1382
+ corporate_code: string;
1383
+ tracking_reference: string;
1384
+ }
1385
+ /**
1386
+ * The passengers who want to travel. A passenger will have only a type or an age.
1387
+ */
1388
+ export interface OfferRequestPassenger {
1389
+ /**
1390
+ * The age of the passenger on the `departure_date` of the final slice.
1391
+ */
1392
+ age?: number;
1393
+ /**
1394
+ * The type of the passenger.
1395
+ */
1396
+ type?: DuffelPassengerType;
1397
+ /**
1398
+ * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
1399
+ * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
1400
+ * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
1401
+ * characters.
1402
+ *
1403
+ * This is only required if you're also including **Loyalty Programme Accounts**.
1404
+ */
1405
+ family_name?: string;
1406
+ /**
1407
+ * The passenger's given name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
1408
+ * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
1409
+ * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
1410
+ * characters.
1411
+ *
1412
+ * This is only required if you're also including **Loyalty Programme Accounts**.
1413
+ */
1414
+ given_name?: string;
1415
+ /**
1416
+ * The **Loyalty Programme Accounts** for this passenger.
1417
+ */
1418
+ loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
1419
+ /**
1420
+ * The identifier for the passenger, unique within this Offer Request and across all Offer Requests.
1421
+ * This ID will be generated by Duffel unless you had optionally provided one.
1422
+ * Optionally providing one has been deprecated.
1423
+ */
1424
+ id: string;
1425
+ }
1426
+ /**
1427
+ * The **Loyalty Programme Account** details.
1428
+ */
1429
+ export interface LoyaltyProgrammeAccount {
1430
+ /**
1431
+ * The passenger's account number for this **Loyalty Programme Account**.
1432
+ */
1433
+ account_number: string;
1434
+ /**
1435
+ * The IATA code for the airline that this **Loyalty Programme Account** belongs to.
1436
+ */
1437
+ airline_iata_code: Airline['iata_code'];
1438
+ }
1439
+ /**
1440
+ * To search for flights, you'll need to create an offer request.
1441
+ * An offer request describes the passengers and where and when they want to travel (in the form of a list of slices).
1442
+ * It may also include additional filters (e.g. a particular cabin to travel in).
1443
+ * @link https://duffel.com/docs/api/offer-requests/schema
1444
+ */
1445
+ export interface OfferRequest {
1446
+ /**
1447
+ * The slices that make up this offer request.
1448
+ * One-way journeys can be expressed using one slice, whereas return trips will need two.
1449
+ * @link https://duffel.com/docs/api/overview/key-principles
1450
+ */
1451
+ slices: OfferRequestSlice[];
1452
+ /**
1453
+ * The cabin that the passengers want to travel in
1454
+ */
1455
+ cabin_class?: CabinClass;
1456
+ /**
1457
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer request was created
1458
+ */
1459
+ created_at: string;
1460
+ /**
1461
+ * Duffel's unique identifier for the offer request
1462
+ */
1463
+ id: string;
1464
+ /**
1465
+ * 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.
1466
+ */
1467
+ live_mode: boolean;
1468
+ /**
1469
+ * The offers returned by the airlines
1470
+ */
1471
+ offers: Omit<Offer, 'available_services'>[];
1472
+ /**
1473
+ * The passengers who want to travel. A passenger will have only a type or an age.
1474
+ */
1475
+ passengers: OfferRequestPassenger[];
1476
+ }
1477
+ export interface CreateOfferRequest {
1478
+ /**
1479
+ * The cabin that the passengers want to travel in.
1480
+ */
1481
+ cabin_class?: CabinClass;
1482
+ /**
1483
+ * The maximum number of connections within any slice of the offer. For
1484
+ * example 0 means a direct flight which will have a single segment within
1485
+ * each slice and 1 means a maximum of two segments within each slice of the
1486
+ * offer.
1487
+ */
1488
+ max_connections?: 0 | 1 | 2;
1489
+ /**
1490
+ * The passengers who want to travel. If you specify an `age` for a passenger,
1491
+ * the `type` may differ for the same passenger in different offers due to
1492
+ * airline's different rules. E.g. one airline may treat a 14 year old as an
1493
+ * adult, and another as a young adult. You may only specify an `age` or a
1494
+ * `type` – not both.
1495
+ */
1496
+ passengers: CreateOfferRequestPassenger[];
1497
+ /**
1498
+ * The private fare codes for this Offer Request. You can pass in multiple
1499
+ * airlines with their specific private fare codes. The key is the airline's
1500
+ * IATA code that provided the private fare code. The `corporate_code` is
1501
+ * provided to you by the airline and the `tracking_reference` is to identify
1502
+ * your business by the airlines.
1503
+ */
1504
+ private_fares?: {
1505
+ [iataCode: string]: CreateOfferRequestPrivateFare[];
1506
+ };
1507
+ /**
1508
+ * The [slices](https://duffel.com/docs/api/overview/key-principles) that make
1509
+ * up this offer request. One-way journeys can be expressed using one slice,
1510
+ * whereas return trips will need two.
1511
+ */
1512
+ slices: Omit<OfferRequestSlice, 'origin_type' | 'destination_type'>[];
1513
+ }
1514
+ export interface CreateOfferRequestQueryParameters {
1515
+ /**
1516
+ * When set to `true`, the offer request resource returned will include all the offers returned by the airlines.
1517
+ * If set to `false`, the offer request resource won't include any offers.
1518
+ * To retrieve the associated `offers` later, use the [List Offers](https://duffel.com/docs/api/offers/get-offers) endpoint, specifying the `offer_request_id`.
1519
+ * 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.
1520
+ */
1521
+ return_offers?: boolean;
1522
+ }
1523
+ export {};
1524
+ }
1525
+
1526
+ declare module '@duffel/api/booking/Offers/OfferTypes' {
1527
+ import { CabinClass, FlightsConditions, LoyaltyProgrammeAccount, PassengerIdentityDocumentType, Place, PlaceType, Aircraft, Airline, Airport, PaginationMeta, DuffelPassengerType } from '@duffel/api/types';
1528
+ /**
1529
+ * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria.
1530
+ * @link https://duffel.com/docs/api/offers/schema
1531
+ */
1532
+ export interface Offer {
1533
+ /**
1534
+ * The types of identity documents that may be provided for the passengers when creating an order based on this offer.
1535
+ * If this is `[]`, then you must not provide identity documents.
1536
+ */
1537
+ allowed_passenger_identity_document_types: PassengerIdentityDocumentType[];
1538
+ /**
1539
+ * The services that can be booked along with the offer but are not included by default, for example an additional checked bag.
1540
+ * This field is only returned in the Get single offer endpoint.
1541
+ * When there are no services available, or we don't support services for the airline, this list will be empty.
1542
+ */
1543
+ available_services: OfferAvailableService[];
1544
+ /**
1545
+ * The base price of the offer for all passengers, excluding taxes.
1546
+ * It does not include the base amount of any service(s) that might be booked with the offer.
1547
+ */
1548
+ base_amount: string;
1549
+ /**
1550
+ * The currency of the `base_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
1551
+ */
1552
+ base_currency: string;
1553
+ /**
1554
+ * 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.
1555
+ * 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`.
1556
+ * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
1557
+ * In some cases, you may need to contact the Duffel support team or the airline directly.
1558
+ */
1559
+ conditions: FlightsConditions;
1560
+ /**
1561
+ * The ISO 8601 datetime at which the offer was created
1562
+ */
1563
+ created_at: string;
1564
+ /**
1565
+ * The ISO 8601 datetime at which the offer will expire and no longer be usable to create an order
1566
+ */
1567
+ expires_at: string;
1568
+ /**
1569
+ * Duffel's unique identifier for the offer
1570
+ */
1571
+ id: string;
1572
+ /**
1573
+ * Whether the offer request was created in live mode.
1574
+ * 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.
1575
+ */
1576
+ live_mode: boolean;
1577
+ /**
1578
+ * The airline which provided the offer
1579
+ */
1580
+ owner: Airline;
1581
+ /**
1582
+ * Whether identity documents must be provided for each of the passengers when creating an order based on this offer.
1583
+ * If this is `true`, you must provide an identity document for every passenger.
1584
+ */
1585
+ passenger_identity_documents_required: boolean;
1586
+ /**
1587
+ * The passengers included in the offer
1588
+ */
1589
+ passengers: OfferPassenger[];
1590
+ /**
1591
+ * The payment requirements for this offer
1592
+ */
1593
+ payment_requirements: PaymentRequirements;
1594
+ /**
1595
+ * The private fares applied on this offer.
1596
+ */
1597
+ private_fares: OfferPrivateFare[];
1598
+ /**
1599
+ * The slices that make up this offer. Each slice will include one or more segments,
1600
+ * the specific flights that the airline is offering to take the passengers from the slice's `origin` to its `destination`.
1601
+ */
1602
+ slices: OfferSlice[];
1603
+ /**
1604
+ * The amount of tax payable on the offer for all passengers
1605
+ */
1606
+ tax_amount: string | null;
1607
+ /**
1608
+ * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
1609
+ */
1610
+ tax_currency: string | null;
1611
+ /**
1612
+ * The total price of the offer for all passengers, including taxes.
1613
+ * It does not include the total price of any service(s) that might be booked with the offer.
1614
+ */
1615
+ total_amount: string;
1616
+ /**
1617
+ * An estimate of the total carbon dioxide (CO₂) emissions when
1618
+ * all of the passengers fly this offer's itinerary, measured in kilograms
1619
+ */
1620
+ total_emissions_kg: string;
1621
+ /**
1622
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
1623
+ */
1624
+ total_currency: string;
1625
+ /**
1626
+ * The ISO 8601 datetime at which the offer was last updated
1627
+ */
1628
+ updated_at: string;
1629
+ /**
1630
+ * Whether this is a partial or full offer.
1631
+ * A partial offer can't be booked directly, but it can be combined with other partial offers to form a full offer.
1632
+ * Partial offers are only ever returned through the multi-step search flow.
1633
+ */
1634
+ partial: boolean;
1635
+ }
1636
+ export interface OfferAvailableServiceBaggageMetadata {
1637
+ /**
1638
+ * The maximum weight that the baggage can have in kilograms.
1639
+ */
1640
+ maximum_weight_kg: number | null;
1641
+ /**
1642
+ * The maximum height that the baggage can have in centimetres.
1643
+ */
1644
+ maximum_height_cm: number | null;
1645
+ /**
1646
+ * The maximum length that the baggage can have in centimetres.
1647
+ */
1648
+ maximum_length_cm: number | null;
1649
+ /**
1650
+ * The maximum depth that the baggage can have in centimetres.
1651
+ */
1652
+ maximum_depth_cm: number | null;
1653
+ /**
1654
+ * The type of the baggage
1655
+ */
1656
+ type: BaggageType;
1657
+ }
1658
+ export interface OfferAvailableServiceCFARMetadata {
1659
+ /**
1660
+ * The amount the customer will receive back if the service is used, in
1661
+ * `offer.total_currency`.
1662
+ */
1663
+ refund_amount: string;
1664
+ /**
1665
+ * Information to display to customers.
1666
+ */
1667
+ merchant_copy: string;
1668
+ /**
1669
+ * URL with the T&Cs for customers.
1670
+ */
1671
+ terms_and_conditions_url: string;
1672
+ type: 'cancel_for_any_reason';
1673
+ }
1674
+ export interface OfferAvailableServiceCommon {
1675
+ /**
1676
+ * Duffel's unique identifier for the service.
1677
+ */
1678
+ id: string;
1679
+ /**
1680
+ * The maximum quantity of this service that can be booked with an order.
1681
+ */
1682
+ maximum_quantity: number;
1683
+ /**
1684
+ * The list of passenger `id`s the service applies to. If you add this
1685
+ * service to an order it will apply to all the passengers in this list.
1686
+ * For services where the type is `baggage`, this list will include only a
1687
+ * single passenger.
1688
+ */
1689
+ passenger_ids: string[];
1690
+ /**
1691
+ * The list of segment `id`s the service applies to. If you add this
1692
+ * service to an order it will apply to all the segments in this list. For
1693
+ * services where the type is `baggage`, depending on the airline, this
1694
+ * list includes all the segments of all slices or all the segments of a
1695
+ * single slice.
1696
+ */
1697
+ segment_ids: string[];
1698
+ /**
1699
+ * The total price of the service for all passengers and segments it
1700
+ * applies to, including taxes. This price is for a single unit of the
1701
+ * service.
1702
+ */
1703
+ total_amount: string;
1704
+ /**
1705
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
1706
+ * currency code. It will match your organisation's billing currency unless
1707
+ * you’re using Duffel as an accredited IATA agent, in which case it will be
1708
+ * in the currency provided by the airline (which will usually be based on the
1709
+ * country where your IATA agency is registered).
1710
+ */
1711
+ total_currency: string;
1712
+ }
1713
+ export interface OfferAvailableServiceBaggage extends OfferAvailableServiceCommon {
1714
+ /**
1715
+ * The metadata varies by the type of service. It includes further data
1716
+ * about the service. For example, for baggages, it may have data about
1717
+ * size and weight restrictions.
1718
+ */
1719
+ metadata: OfferAvailableServiceBaggageMetadata;
1720
+ /**
1721
+ * The type of the service.
1722
+ */
1723
+ type: 'baggage';
1724
+ }
1725
+ export interface OfferAvailableServiceCFAR extends OfferAvailableServiceCommon {
1726
+ /**
1727
+ * The metadata varies by the type of service. It includes further data
1728
+ * about the service. For example, for baggages, it may have data about
1729
+ * size and weight restrictions.
1730
+ */
1731
+ metadata: OfferAvailableServiceCFARMetadata;
1732
+ /**
1733
+ * The type of the service.
1734
+ */
1735
+ type: 'cancel_for_any_reason';
1736
+ }
1737
+ export type OfferAvailableService = OfferAvailableServiceBaggage | OfferAvailableServiceCFAR;
1738
+ export interface PaymentRequirements {
1739
+ /**
1740
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime by which
1741
+ * you must pay for this order. At this time, if still unpaid, the reserved
1742
+ * space on the flight(s) will be released and you will have to create a new
1743
+ * order. This will be null only for orders where `awaiting_payment` is
1744
+ * `false`.
1745
+ */
1746
+ payment_required_by: string | null;
1747
+ /**
1748
+ * The ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the
1749
+ * price associated with the order will no longer be guaranteed by the airline
1750
+ * and may change before payment. This will be null when
1751
+ * `requires_instant_payment` is `true`.
1752
+ */
1753
+ price_guarantee_expires_at: string | null;
1754
+ /**
1755
+ * When payment is required at the time of booking this will be true and
1756
+ * `payment_required_by` and `price_guarantee_expires_at` will be `null`. When
1757
+ * payment can be made at a time after booking, this will be `false` and the
1758
+ * time limits on the payment will be provided in `payment_required_by` and
1759
+ * `price_guarantee_expires_at`.
1760
+ */
1761
+ requires_instant_payment: boolean;
1762
+ }
1763
+ export interface OfferPrivateFare {
1764
+ /**
1765
+ * The corporate code that was applied, if any.
1766
+ */
1767
+ corporate_code?: string;
1768
+ /**
1769
+ * The tracking reference that was applied, if any.
1770
+ */
1771
+ tracking_reference?: string;
1772
+ /**
1773
+ * The type of private fare applied.
1774
+ */
1775
+ type: 'corporate' | 'leisure' | 'negotiated';
1776
+ }
1777
+ export interface OfferPassenger {
1778
+ /**
1779
+ * The age of the passenger on the departure_date of the final slice.
1780
+ */
1781
+ age?: number;
1782
+ /**
1783
+ * The type of the passenger.
1784
+ */
1785
+ type?: DuffelPassengerType;
1786
+ /**
1787
+ * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
1788
+ * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
1789
+ * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
1790
+ * characters.
1791
+ *
1792
+ * This is only required if you're also including **Loyalty Programme Accounts**.
1793
+ */
1794
+ family_name?: string;
1795
+ /**
1796
+ * The passenger's given name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
1797
+ * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
1798
+ * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
1799
+ * characters.
1800
+ *
1801
+ * This is only required if you're also including **Loyalty Programme Accounts**.
1802
+ */
1803
+ given_name?: string;
1804
+ /**
1805
+ * The **Loyalty Programme Accounts** for this passenger.
1806
+ */
1807
+ loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
1808
+ /**
1809
+ * The identifier for the passenger, unique within this Offer Request and across all Offer Requests.
1810
+ * This ID will be generated by Duffel unless you had optionally provided one.
1811
+ * Optionally providing one has been deprecated.
1812
+ */
1813
+ id: string;
1814
+ }
1815
+ export interface OfferSlice {
1816
+ /**
1817
+ * The type of the destination
1818
+ */
1819
+ destination_type: PlaceType;
1820
+ /**
1821
+ * The city or airport where this slice ends
1822
+ */
1823
+ destination: Place;
1824
+ /**
1825
+ * The type of the origin
1826
+ */
1827
+ origin_type: PlaceType;
1828
+ /**
1829
+ * The city or airport where this slice begins
1830
+ */
1831
+ origin: Place;
1832
+ /**
1833
+ * The duration of the slice, represented as a ISO 8601 duration
1834
+ */
1835
+ duration: string | null;
1836
+ /**
1837
+ * The name of the fare brand associated with this slice.
1838
+ * A fare brand specifies the travel conditions you get on your slice made available
1839
+ * by the airline. e.g. a British Airways Economy Basic fare will only include a hand baggage allowance.
1840
+ * It is worth noting that the fare brand names are defined by the airlines themselves and therefore they
1841
+ * are subject to change without any prior notice. We're in the process of adding support for fare_brand_name across
1842
+ * all our airlines, so for now, this field may be null in some offers.
1843
+ * This will become a non-nullable attribute in the near future.
1844
+ */
1845
+ fare_brand_name: string | null;
1846
+ /**
1847
+ * 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
1848
+ */
1849
+ id: string;
1850
+ /**
1851
+ * The segments - that is, specific flights - that the airline is offering to get the passengers from the `origin` to the `destination`
1852
+ */
1853
+ segments: OfferSliceSegment[];
1854
+ /**
1855
+ * 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.
1856
+ * 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.
1857
+ * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
1858
+ * In some cases, you may need to contact the Duffel support team or the airline directly.
1859
+ */
1860
+ conditions: FlightsConditions;
1861
+ }
1862
+ export interface OfferSliceSegment {
1863
+ /**
1864
+ * The aircraft that the operating carrier will use to operate this segment
1865
+ */
1866
+ aircraft: Aircraft;
1867
+ /**
1868
+ * The ISO 8601 datetime at which the segment is scheduled to arrive
1869
+ */
1870
+ arriving_at: string;
1871
+ /**
1872
+ * The terminal at the destination airport where the segment is scheduled to arrive
1873
+ */
1874
+ destination_terminal: string | null;
1875
+ /**
1876
+ * The ISO 8601 datetime at which the segment is scheduled to depart
1877
+ */
1878
+ departing_at: string;
1879
+ /**
1880
+ * The terminal at the origin airport from which the segment is scheduled to depart
1881
+ */
1882
+ origin_terminal: string | null;
1883
+ /**
1884
+ * The airport at which the segment is scheduled to arrive
1885
+ */
1886
+ destination: Airport;
1887
+ /**
1888
+ * The distance of the segment in kilometres
1889
+ */
1890
+ distance: string | null;
1891
+ /**
1892
+ * The duration of the segment, represented as a ISO 8601 duration
1893
+ */
1894
+ duration: string | null;
1895
+ /**
1896
+ * 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
1897
+ */
1898
+ id: string;
1899
+ /**
1900
+ * The airline selling the tickets for this segment.
1901
+ * This may differ from the `operating_carrier` in the case of a "codeshare", where one airline sells flights operated by another airline.
1902
+ */
1903
+ marketing_carrier: Airline;
1904
+ /**
1905
+ * The flight number assigned by the marketing carrier
1906
+ */
1907
+ marketing_carrier_flight_number: string;
1908
+ /**
1909
+ * The airport from which the flight is scheduled to depart
1910
+ */
1911
+ origin: Airport;
1912
+ /**
1913
+ * The airline actually operating this segment.
1914
+ * This may differ from the marketing_carrier in the case of a "codeshare", where one airline sells flights operated by another airline.
1915
+ */
1916
+ operating_carrier: Airline;
1917
+ /**
1918
+ * The flight number assigned by the operating carrier
1919
+ */
1920
+ operating_carrier_flight_number: string;
1921
+ /**
1922
+ * 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)
1923
+ */
1924
+ passengers: OfferSliceSegmentPassenger[];
1925
+ /**
1926
+ * Additional segment-specific information about the stops, if any, included in the segment
1927
+ */
1928
+ stops?: OfferSliceSegmentStop[];
1929
+ }
1930
+ export interface OfferSliceSegmentStop {
1931
+ /**
1932
+ * Duffel's unique identifier for the Stop
1933
+ */
1934
+ id: string;
1935
+ /**
1936
+ * The airport at which the Stop happens
1937
+ */
1938
+ airport: Airport;
1939
+ /**
1940
+ * The ISO 8601 datetime at which the Stop is scheduled to arrive, in the airport's timezone (see destination.timezone)
1941
+ */
1942
+ arrivingAt: string;
1943
+ /**
1944
+ * The ISO 8601 datetime at which the Stop is scheduled to depart, in the airport's timezone (see origin.timezone)
1945
+ */
1946
+ departingAt: string;
1947
+ /**
1948
+ * The duration of the Stop, represented as a ISO 8601 duration
1949
+ */
1950
+ duration: string;
1951
+ }
1952
+ export interface OfferSliceSegmentPassenger {
1953
+ /**
1954
+ * The baggage allowances for the passenger on this segment included in the offer.
1955
+ * Some airlines may allow additional baggage to be booked as a service - see the offer's available_services.
1956
+ */
1957
+ baggages: OfferSliceSegmentPassengerBaggage[];
1958
+ /**
1959
+ * The cabin class that the passenger will travel in on this segment
1960
+ */
1961
+ cabin_class: CabinClass;
1962
+ /**
1963
+ * The name that the marketing carrier uses to market this cabin class
1964
+ */
1965
+ cabin_class_marketing_name: string;
1966
+ /**
1967
+ * The identifier for the passenger.
1968
+ * You may have specified this ID yourself when creating the offer request, or otherwise, Duffel will have generated its own random ID.
1969
+ */
1970
+ passenger_id: string;
1971
+ /**
1972
+ * The airline's alphanumeric code for the fare that the passenger is using to travel. Where this is `null`, it means that either the
1973
+ * fare basis code is not available or the airline does not use fare basis codes.
1974
+ */
1975
+ fare_basis_code: string;
1976
+ }
1977
+ export type BaggageType = 'carry_on' | 'checked';
1978
+ export interface OfferSliceSegmentPassengerBaggage {
1979
+ /**
1980
+ * The type of the baggage allowance
1981
+ */
1982
+ type: BaggageType;
1983
+ /**
1984
+ * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases.
1985
+ */
1986
+ quantity: number;
1987
+ }
1988
+ export interface ListOffersParams extends PaginationMeta {
1989
+ /**
1990
+ * Duffel's unique identifier for the offer request, returned when it was created
1991
+ */
1992
+ offer_request_id: string;
1993
+ /**
1994
+ * 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.
1995
+ */
1996
+ max_connections?: number;
1997
+ /**
1998
+ * By default, the offers will be returned sorted by ID in ascending order.
1999
+ * This parameter allows you to sort the list of offers by `total_amount` or `total_duration`.
2000
+ * 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`).
2001
+ */
2002
+ sort?: 'total_amount' | 'total_duration';
2003
+ }
2004
+ export interface LoyaltyProgrammeAccounts {
2005
+ /**
2006
+ * The passenger's account number for this Loyalty Programme Account
2007
+ */
2008
+ account_number: string;
2009
+ /**
2010
+ * The IATA code for the airline that this Loyalty Programme Account belongs to
2011
+ */
2012
+ airline_iata_code: string;
2013
+ }
2014
+ export interface UpdateOffer {
2015
+ type: string;
2016
+ loyalty_programme_accounts: LoyaltyProgrammeAccounts;
2017
+ id: string;
2018
+ given_name: string;
2019
+ family_name: string;
2020
+ age: number;
2021
+ }
2022
+ }
2023
+
2024
+ declare module '@duffel/api/booking/OrderCancellations/OrderCancellationsTypes' {
2025
+ import { PaginationMeta } from '@duffel/api/types';
2026
+ export interface CreateOrderCancellation {
2027
+ /**
2028
+ * Duffel's unique identifier for the order
2029
+ */
2030
+ order_id: string;
2031
+ }
2032
+ export interface ListOrderCancellationsParams extends PaginationMeta {
2033
+ /**
2034
+ * Duffel's unique identifier for the order, returned when it was created
2035
+ */
2036
+ order_id?: string;
2037
+ }
2038
+ export interface OrderCancellation {
2039
+ /**
2040
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime that indicates when the order cancellation was confirmed
2041
+ */
2042
+ confirmed_at: string;
2043
+ /**
2044
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the order cancellation was created
2045
+ */
2046
+ created_at: string;
2047
+ /**
2048
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime by which this cancellation must be confirmed
2049
+ */
2050
+ expires_at: string;
2051
+ /**
2052
+ * Duffel's unique identifier for the order cancellation
2053
+ */
2054
+ id: string;
2055
+ /**
2056
+ * 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.
2057
+ */
2058
+ live_mode: boolean;
2059
+ /**
2060
+ * Duffel's unique identifier for the order
2061
+ */
2062
+ order_id: string;
2063
+ /**
2064
+ * 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.
2065
+ */
2066
+ refund_amount: string;
2067
+ /**
2068
+ * The currency of the `refund_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
2069
+ * 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).
2070
+ * For pay later orders that are awaiting payment, the refund amount will always be 0.00.
2071
+ */
2072
+ refund_currency: string;
2073
+ /**
2074
+ * 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.
2075
+ */
2076
+ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment';
2077
+ }
2078
+ }
2079
+
2080
+ declare module '@duffel/api/booking/OrderChangeOffers/OrderChangeOfferTypes' {
2081
+ import { OfferSliceSegment } from '@duffel/api/booking/Offers/OfferTypes';
2082
+ import { PlaceType, Place } from '@duffel/api/types';
2083
+ /**
2084
+ * @link https://duffel.com/docs/api/order-change-offers/schema
2085
+ */
2086
+ export interface OrderChangeOffer {
2087
+ /**
2088
+ * The price of this offer as a change to your existing order, excluding taxes
2089
+ */
2090
+ change_total_amount: string | null;
2091
+ /**
2092
+ * The currency of the change_total_amount, as an ISO 4217 currency code.
2093
+ * It will match your organisation's billing currency unless you're using Duffel
2094
+ * as an accredited IATA agent, in which case it will be in the currency provided
2095
+ * by the airline (which will usually be based on the country where your
2096
+ * IATA agency is registered).
2097
+ */
2098
+ change_total_currency: string | null;
2099
+ /**
2100
+ * The ISO 8601 datetime at which the offer was created
2101
+ */
2102
+ created_at: string;
2103
+ /**
2104
+ * The ISO 8601 datetime at which the offer will expire
2105
+ * and no longer be usable to create an order
2106
+ */
2107
+ expires_at: string;
2108
+ /**
2109
+ * Duffel's unique identifier for the order change offer
2110
+ */
2111
+ id: string;
2112
+ /**
2113
+ * The price of this offer if it was newly purchased, excluding taxes
2114
+ */
2115
+ new_total_amount: string | null;
2116
+ /**
2117
+ * The currency of the new_total_amount, as an ISO 4217 currency code.
2118
+ * It will match your organisation's billing currency unless you're using
2119
+ * Duffel as an accredited IATA agent, in which case it will be in the
2120
+ * currency provided by the airline (which will usually be based on the
2121
+ * country where your IATA agency is registered).
2122
+ */
2123
+ new_total_currency: string;
2124
+ /**
2125
+ * The ID for an order change if one has already been created from this order change offer
2126
+ */
2127
+ order_change_id: string;
2128
+ /**
2129
+ * The penalty price imposed by the airline for making this change
2130
+ */
2131
+ penalty_amount: string;
2132
+ /**
2133
+ * The currency of the penalty_amount, as an ISO 4217 currency code.
2134
+ * It will match your organisation's billing currency unless you're using
2135
+ * Duffel as an accredited IATA agent, in which case it will be in the
2136
+ * currency provided by the airline (which will usually be based on
2137
+ * the country where your IATA agency is registered).
2138
+ */
2139
+ penalty_currency: string;
2140
+ /**
2141
+ * Where the refund, once confirmed, will be sent. card is currently a restricted feature.
2142
+ * `awaiting_payment` is for pay later orders where no payment has been made yet.
2143
+ */
2144
+ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment' | 'original_form_of_payment';
2145
+ /**
2146
+ * The slices to be added and/or removed
2147
+ */
2148
+ slices: OrderChangeOfferSlices;
2149
+ /**
2150
+ * The ISO 8601 datetime at which the offer was last updated
2151
+ */
2152
+ updated_at: string;
2153
+ }
2154
+ export interface OrderChangeOfferSlices {
2155
+ /**
2156
+ * The slices that will be added to the order
2157
+ */
2158
+ add: OrderChangeOfferSlice[];
2159
+ /**
2160
+ * The slices that will be removed from the order
2161
+ */
2162
+ remove: OrderChangeOfferSlice[];
2163
+ }
2164
+ export interface OrderChangeOfferSlice {
2165
+ /**
2166
+ * The city or airport where this slice ends
2167
+ */
2168
+ destination: Place;
2169
+ /**
2170
+ * The type of the destination
2171
+ */
2172
+ destination_type: PlaceType;
2173
+ /**
2174
+ * The duration of the slice, represented as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) duration
2175
+ */
2176
+ duration?: string | null;
2177
+ /**
2178
+ * 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.
2179
+ */
2180
+ id: string;
2181
+ /**
2182
+ * The city or airport where this slice begins
2183
+ */
2184
+ origin: Place;
2185
+ /**
2186
+ * The type of the origin
2187
+ */
2188
+ origin_type: PlaceType;
2189
+ /**
2190
+ * The segments - that is, specific flights - that the airline is offering to get the passengers from the `origin` to the `destination`
2191
+ */
2192
+ segments: Array<Omit<OfferSliceSegment, 'passengers'>>;
2193
+ }
2194
+ }
2195
+
2196
+ declare module '@duffel/api/booking/OrderChangeRequests/OrderChangeRequestsTypes' {
2197
+ import { CabinClass, Place } from '@duffel/api/types';
2198
+ import { OrderChangeOfferSlices } from '@duffel/api/booking/OrderChangeOffers/OrderChangeOfferTypes';
2199
+ export interface OrderChangeSliceResponse {
2200
+ remove: {
2201
+ slice_id: string;
2202
+ };
2203
+ add: {
2204
+ /**
2205
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the passengers want to depart
2206
+ */
2207
+ departure_date: string;
2208
+ /**
2209
+ * The city or airport where this slice ends
2210
+ */
2211
+ destination: Place;
2212
+ /**
2213
+ * The city or airport where this slice begins
2214
+ */
2215
+ origin: Place;
2216
+ /**
2217
+ * The cabin that the passengers want to travel in
2218
+ */
2219
+ cabin_class: CabinClass;
2220
+ };
2221
+ }
2222
+ export interface OrderChangeOffers {
2223
+ /**
2224
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer was last updated
2225
+ */
2226
+ updated_at: string;
2227
+ /**
2228
+ * The price of this offer as a change to your existing order, excluding taxes
2229
+ */
2230
+ change_total_amount: string | null;
2231
+ /**
2232
+ * The currency of the `change_total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
2233
+ * 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).
2234
+ */
2235
+ change_total_currency: string | null;
2236
+ /**
2237
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer was created
2238
+ */
2239
+ created_at: string;
2240
+ /**
2241
+ * 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
2242
+ */
2243
+ expires_at: string;
2244
+ /**
2245
+ * Duffel's unique identifier for the order change offer
2246
+ */
2247
+ id: string;
2248
+ /**
2249
+ * The price of this offer if it was newly purchased, excluding taxes
2250
+ */
2251
+ new_total_amount: string | null;
2252
+ /**
2253
+ * 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).
2254
+ */
2255
+ new_total_currency: string;
2256
+ /**
2257
+ * The ID for an `order change` if one has already been created from this `order change offer`
2258
+ */
2259
+ order_change_id: string;
2260
+ /**
2261
+ * The penalty price imposed by the airline for making this change
2262
+ */
2263
+ penalty_amount: string | null;
2264
+ /**
2265
+ * The currency of the `penalty_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
2266
+ * 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).
2267
+ */
2268
+ penalty_currency: string | null;
2269
+ /**
2270
+ * 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.
2271
+ */
2272
+ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment';
2273
+ /**
2274
+ * The slices within an order change that are being added to and/or removed from the order
2275
+ */
2276
+ slices: OrderChangeOfferSlices;
2277
+ }
2278
+ export interface OrderChangeRequestResponse {
2279
+ /**
2280
+ * The ID of your order change request
2281
+ */
2282
+ id: string;
2283
+ /**
2284
+ * 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.
2285
+ */
2286
+ live_mode: boolean;
2287
+ /**
2288
+ * The list of the offers available to perform change on the order.
2289
+ */
2290
+ order_change_offers: OrderChangeOffers[];
2291
+ /**
2292
+ * The order ID that you want to change
2293
+ */
2294
+ order_id: string;
2295
+ /**
2296
+ * The slices to be added and/or removed
2297
+ */
2298
+ slices: OrderChangeSliceResponse;
2299
+ }
2300
+ export interface CreateOrderChangeRequest {
2301
+ /**
2302
+ * The changes you wish to make to your order
2303
+ */
2304
+ changes: {
2305
+ /**
2306
+ * 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.
2307
+ */
2308
+ slices: {
2309
+ /**
2310
+ * The search criteria for slices which you wish to add to your order
2311
+ */
2312
+ add: {
2313
+ /**
2314
+ * The cabin that the passengers want to travel in
2315
+ */
2316
+ cabin_class: CabinClass;
2317
+ /**
2318
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date on which the passengers want to depart
2319
+ */
2320
+ departure_date: string;
2321
+ /**
2322
+ * The 3-letter IATA code for the city or airport where this slice ends
2323
+ */
2324
+ destination: string;
2325
+ /**
2326
+ * The 3-letter IATA code for the city or airport where this slice starts
2327
+ */
2328
+ origin: string;
2329
+ }[];
2330
+ /**
2331
+ * The slices that you wish to remove from your order
2332
+ */
2333
+ remove: {
2334
+ slice_id: string;
2335
+ }[];
2336
+ };
2337
+ };
2338
+ /**
2339
+ * The order ID you wish to change
2340
+ */
2341
+ order_id: string;
2342
+ }
2343
+ }
2344
+
2345
+ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2346
+ import { OrderChangeOfferSlices, PaymentType } from '@duffel/api/types';
2347
+ export interface OrderChange {
2348
+ /**
2349
+ * The price of this offer as a change to your existing order, excluding taxes
2350
+ */
2351
+ change_total_amount: string | null;
2352
+ /**
2353
+ * The currency of the change_total_amount, as an ISO 4217 currency code.
2354
+ * It will match your organisation's billing currency unless you're using Duffel
2355
+ * as an accredited IATA agent, in which case it will be in the currency provided
2356
+ * by the airline (which will usually be based on the country where your
2357
+ * IATA agency is registered).
2358
+ */
2359
+ change_total_currency: string | null;
2360
+ /**
2361
+ * Whether the order was created in live mode. This field will be set to `true`
2362
+ * if the order was created in live mode, or `false` if it was created in test mode.
2363
+ */
2364
+ live_mode: boolean;
2365
+ /**
2366
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer was created
2367
+ */
2368
+ created_at: string;
2369
+ /**
2370
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime that indicates when the order change was confirmed
2371
+ */
2372
+ confirmed_at: string;
2373
+ /**
2374
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer will expire
2375
+ * and no longer be usable to create an order
2376
+ */
2377
+ expires_at: string;
2378
+ /**
2379
+ * Duffel's unique identifier for the order change offer
2380
+ */
2381
+ id: string;
2382
+ /**
2383
+ * The price of this offer if it was newly purchased, excluding taxes
2384
+ */
2385
+ new_total_amount: string | null;
2386
+ /**
2387
+ * The currency of the new_total_amount, as an ISO 4217 currency code.
2388
+ * It will match your organisation's billing currency unless you're using
2389
+ * Duffel as an accredited IATA agent, in which case it will be in the
2390
+ * currency provided by the airline (which will usually be based on the
2391
+ * country where your IATA agency is registered).
2392
+ */
2393
+ new_total_currency: string;
2394
+ /**
2395
+ * Duffel's unique identifier for the order which is being changed
2396
+ */
2397
+ order_id: string;
2398
+ /**
2399
+ * The penalty price imposed by the airline for making this change
2400
+ */
2401
+ penalty_amount: string | null;
2402
+ /**
2403
+ * The currency of the penalty_amount, as an ISO 4217 currency code.
2404
+ * It will match your organisation's billing currency unless you're using
2405
+ * Duffel as an accredited IATA agent, in which case it will be in the
2406
+ * currency provided by the airline (which will usually be based on
2407
+ * the country where your IATA agency is registered).
2408
+ */
2409
+ penalty_currency: string | null;
2410
+ /**
2411
+ * Where the refund, once confirmed, will be sent. card is currently a restricted feature.
2412
+ * `awaiting_payment` is for pay later orders where no payment has been made yet.
2413
+ */
2414
+ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment' | 'original_form_of_payment';
2415
+ /**
2416
+ * The slices to be added and/or removed
2417
+ */
2418
+ slices: OrderChangeOfferSlices;
2419
+ /**
2420
+ * The available payment types to complete the order change.
2421
+ */
2422
+ available_payment_types?: PaymentType[] | null;
2423
+ }
2424
+ export interface CreateOrderChangeParameters {
2425
+ /**
2426
+ * Duffel's unique identifier for the order change offer
2427
+ */
2428
+ selected_order_change_offer: string;
2429
+ }
2430
+ export interface ConfirmOrderChangePayment {
2431
+ /**
2432
+ * The amount of the payment. This should be the same as the change_total_amount of the order change.
2433
+ */
2434
+ amount: string;
2435
+ /**
2436
+ * The currency of the change_total_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
2437
+ */
2438
+ currency: string;
2439
+ /**
2440
+ * The type of payment you want to use for the Order Change.
2441
+ * 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.
2442
+ * Otherwise, you must pay using your Duffel account's balance by specifying balance.
2443
+ * In test mode, your balance is unlimited.
2444
+ * 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).
2445
+ */
2446
+ type: PaymentType;
2447
+ }
2448
+ }
2449
+
2450
+ declare module '@duffel/api/booking/Orders/OrdersTypes' {
2451
+ import { Aircraft, Airline, AirlineInitiatedChange, CabinClass, DuffelPassengerGender, DuffelPassengerTitle, DuffelPassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferAvailableServiceBaggage, OfferAvailableServiceBaggageMetadata, PassengerIdentityDocumentType, PaymentType, Place, PlaceType } from '@duffel/api/types';
2452
+ /**
2453
+ * An object containing metadata about the service, like the designator of the seat.
2454
+ */
2455
+ export interface Seat {
2456
+ /**
2457
+ * The designator used to uniquely identify the seat, usually made up of a row number and a column letter
2458
+ * @example "14B"
2459
+ */
2460
+ designator: string;
2461
+ /**
2462
+ * 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.
2463
+ * @example "["Do not seat children in exit row seats","Do not seat passengers with special needs in exit row seats"]"
2464
+ */
2465
+ disclosures: string[];
2466
+ /**
2467
+ * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features
2468
+ * @example "Exit row seat"
2469
+ */
2470
+ name: string;
2471
+ }
2472
+ /**
2473
+ * An object containing metadata about the service, like the maximum weight and dimensions of the baggage.
2474
+ */
2475
+ export type OrderServiceBaggageMetadata = OfferAvailableServiceBaggageMetadata;
2476
+ export interface OrderSegmentPassengerBaggage {
2477
+ /**
2478
+ * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases.
2479
+ */
2480
+ quantity: number;
2481
+ /**
2482
+ * The type of the baggage allowance
2483
+ */
2484
+ type: 'checked' | 'carry_on';
2485
+ }
2486
+ /**
2487
+ * 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.
2488
+ * @link https://duffel.com/docs/api/orders/schema
2489
+ */
2490
+ export interface OrderService {
2491
+ /**
2492
+ * Duffel's unique identifier for the booked service
2493
+ * @example "ser_00009UhD4ongolulWd9123"
2494
+ */
2495
+ id: string;
2496
+ /**
2497
+ * The metadata varies by the type of service. It includes further data about the service.
2498
+ * For example, for baggages, it may have data about size and weight restrictions.
2499
+ */
2500
+ metadata?: OrderServiceBaggageMetadata | Seat;
2501
+ /**
2502
+ * List of passenger ids the service applies to. The service applies to all the passengers in this list.
2503
+ * @example ["pas_00009hj8USM7Ncg31cBCLL"]
2504
+ */
2505
+ passenger_ids: string[];
2506
+ /**
2507
+ * The quantity of the service that was booked
2508
+ * @example 1
2509
+ */
2510
+ quantity: number;
2511
+ /**
2512
+ * List of segment `ids` the service applies to. The service applies to all the segments in this list.
2513
+ * @example "["seg_00009hj8USM7Ncg31cB456"]"
2514
+ */
2515
+ segment_ids: string[];
2516
+ /**
2517
+ * The total price of the service for all passengers and segments it applies to, accounting for quantity and including taxes
2518
+ * @example "15.00"
2519
+ */
2520
+ total_amount: string;
2521
+ /**
2522
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
2523
+ * 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).
2524
+ * @example "GBP"
2525
+ */
2526
+ total_currency: string;
2527
+ /**
2528
+ * The type of the service.
2529
+ * 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.
2530
+ */
2531
+ type: 'baggage' | 'seat';
2532
+ }
2533
+ export interface OrderSegmentPassenger {
2534
+ /**
2535
+ * The baggage allowances for the passenger on this segment that were included in the original offer.
2536
+ * Any extra baggage items which were booked as services will be listed in the services field instead of here.
2537
+ */
2538
+ baggages: OrderSegmentPassengerBaggage[];
2539
+ /**
2540
+ * The cabin class that the passenger will travel in on this segment
2541
+ */
2542
+ cabin_class: CabinClass;
2543
+ /**
2544
+ * The name that the marketing carrier uses to market this cabin class
2545
+ */
2546
+ cabin_class_marketing_name: string;
2547
+ /**
2548
+ * 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.
2549
+ */
2550
+ passenger_id?: string;
2551
+ /**
2552
+ * An object containing metadata about the service, like the designator of the seat.
2553
+ */
2554
+ seat?: Seat;
2555
+ }
2556
+ export interface OrderPassenger {
2557
+ id: string;
2558
+ /**
2559
+ * The passenger's date of birth
2560
+ * @example "1987-07-24"
2561
+ */
2562
+ born_on: string;
2563
+ /**
2564
+ * The passenger's family name
2565
+ * @example "Earheart"
2566
+ */
2567
+ family_name: string;
2568
+ /**
2569
+ * The passenger's given name
2570
+ * @xample "Amelia"
2571
+ */
2572
+ given_name: string;
2573
+ /**
2574
+ * The passenger's gender
2575
+ * @return "m" or "f"
2576
+ */
2577
+ gender: DuffelPassengerGender;
2578
+ /**
2579
+ * The passenger's title
2580
+ * @returns "mr", "ms", "mrs", or "miss"
2581
+ */
2582
+ title: DuffelPassengerTitle;
2583
+ /**
2584
+ * The type of the passenger
2585
+ * @return "adult", "child", or "infant_without_seat"
2586
+ */
2587
+ type: DuffelPassengerType;
2588
+ /**
2589
+ * The id of the infant associated with this passenger
2590
+ * @return "adult", "child", or "infant_without_seat"
2591
+ */
2592
+ infant_passenger_id?: string | null;
2593
+ /**
2594
+ * The **Loyalty Programme Accounts** for this passenger.
2595
+ */
2596
+ loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
2597
+ }
2598
+ export interface OrderPassengerIdentityDocument {
2599
+ /**
2600
+ * The type of the identity document. This must be one of the allowed_passenger_identity_document_types on the offer.
2601
+ */
2602
+ type: PassengerIdentityDocumentType;
2603
+ /**
2604
+ * The unique identifier of the identity document
2605
+ */
2606
+ unique_identifier: string;
2607
+ /**
2608
+ * The ISO 3166-1 alpha-2 code of the country that issued this identity document
2609
+ */
2610
+ issuing_country_code: string;
2611
+ /**
2612
+ * The date on which the identity document expires
2613
+ */
2614
+ expires_on: string;
2615
+ }
2616
+ export interface CreateOrderPassenger extends Omit<OrderPassenger, 'type'> {
2617
+ /**
2618
+ * 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.
2619
+ */
2620
+ identity_documents?: OrderPassengerIdentityDocument[];
2621
+ /**
2622
+ * The passenger's email address
2623
+ * @example "amelia@duffel.com"
2624
+ */
2625
+ email: string;
2626
+ /**
2627
+ * The passenger's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) (international) format
2628
+ * @example "+442080160509"
2629
+ */
2630
+ phone_number: string;
2631
+ /**
2632
+ * @deprecated This type is here just for the backward-compatibility until the field is officially removed from the API
2633
+ *
2634
+ * The type of the passenger
2635
+ * @example "adult", "child", or "infant_without_seat"
2636
+ */
2637
+ type?: DuffelPassengerType;
2638
+ }
2639
+ export interface OrderSliceSegment {
2640
+ /**
2641
+ * The aircraft that the operating carrier will use to operate this segment
2642
+ */
2643
+ aircraft?: Aircraft;
2644
+ /**
2645
+ * 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)
2646
+ */
2647
+ arriving_at: string;
2648
+ /**
2649
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the segment is scheduled to depart, in the origin airport timezone
2650
+ */
2651
+ departing_at: string;
2652
+ /**
2653
+ * The city or airport where this slice ends
2654
+ */
2655
+ destination: Place;
2656
+ /**
2657
+ * The terminal at the destination airport where the segment is scheduled to arrive
2658
+ * @example "5"
2659
+ */
2660
+ destination_terminal?: string | null;
2661
+ /**
2662
+ * The duration of the segment, represented as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) duration
2663
+ */
2664
+ duration?: string;
2665
+ /**
2666
+ * Duffel's unique identifier for the segment.
2667
+ * It identifies the segment of an order (i.e. the same segment across orders will have different ids.
2668
+ */
2669
+ id: string;
2670
+ /**
2671
+ * 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.
2672
+ */
2673
+ marketing_carrier: Airline;
2674
+ /**
2675
+ * The flight number assigned by the marketing carrier
2676
+ * @example "1234"
2677
+ */
2678
+ marketing_carrier_flight_number: string;
2679
+ /**
2680
+ * 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.
2681
+ */
2682
+ operating_carrier: Airline;
2683
+ /**
2684
+ * 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`.
2685
+ * @example "4321"
2686
+ */
2687
+ operating_carrier_flight_number: string;
2688
+ /**
2689
+ * The city or airport where this slice begins
2690
+ */
2691
+ origin: Place;
2692
+ /**
2693
+ * The terminal at the origin airport from which the segment is scheduled to depart
2694
+ * @example "B"
2695
+ */
2696
+ origin_terminal?: string | null;
2697
+ /**
2698
+ * 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)
2699
+ */
2700
+ passengers: OrderSegmentPassenger[];
2701
+ /**
2702
+ * The distance of the segment in kilometres
2703
+ * @example "424.2"
2704
+ */
2705
+ distance?: string | null;
2706
+ }
2707
+ export interface OrderSlice {
2708
+ /**
2709
+ * Whether this slice can be changed. This can only be true for paid orders.
2710
+ */
2711
+ changeable: boolean | null;
2712
+ /**
2713
+ * The conditions associated with this slice, describing the kinds of modifications you can make and any penalties that will apply to those modifications.
2714
+ * 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.
2715
+ */
2716
+ conditions: FlightsConditions;
2717
+ /**
2718
+ * The city or airport where this slice ends
2719
+ */
2720
+ destination: Place;
2721
+ /**
2722
+ * The type of the destination
2723
+ */
2724
+ destination_type: PlaceType;
2725
+ /**
2726
+ * The city or airport where this slice begins
2727
+ */
2728
+ origin: Place;
2729
+ /**
2730
+ * The type of the origin
2731
+ */
2732
+ origin_type: PlaceType;
2733
+ /**
2734
+ * 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.
2735
+ */
2736
+ id: string;
2737
+ /**
2738
+ * The duration of the slice, represented as a ISO 8601 duration
2739
+ */
2740
+ duration: string | null;
2741
+ /**
2742
+ * The segments - that is, specific flights - that the airline is offering to get the passengers from the origin to the destination
2743
+ */
2744
+ segments: OrderSliceSegment[];
2745
+ }
2746
+ export interface OrderPaymentStatus {
2747
+ /**
2748
+ * Whether a payment has been made, or the airline is waiting for a payment to be made
2749
+ */
2750
+ awaiting_payment: boolean;
2751
+ /**
2752
+ * The ISO 8601 datetime by which you must pay for this order.
2753
+ * At this time, if still unpaid, the reserved space on the flight(s)
2754
+ * will be released and you will have to create a new order.
2755
+ * This will be null only for orders where `awaiting_payment` is `false`.
2756
+ * Payment Required by means it will hold space
2757
+ */
2758
+ payment_required_by?: string;
2759
+ /**
2760
+ * The ISO 8601 datetime at which the price associated
2761
+ * with the order will no longer be guaranteed by the airline
2762
+ * and the order will need to be repriced before payment.
2763
+ * This can be null when there is no price guarantee.
2764
+ * Price Guarantee means it will hold price
2765
+ */
2766
+ price_guarantee_expires_at?: string;
2767
+ }
2768
+ /**
2769
+ * The type of document
2770
+ * @returns "electronic_ticket", "electronic_miscellaneous_document_associated", or "electronic_miscellaneous_document_standalone"
2771
+ */
2772
+ export type OrderDocumentsType = 'electronic_ticket' | 'electronic_miscellaneous_document_associated' | 'electronic_miscellaneous_document_standalone';
2773
+ export interface OrderDocument {
2774
+ /**
2775
+ * The identifier for the document, in the case of electronic
2776
+ * tickets this string represents the payment or the entitlement to fly.
2777
+ * @example "1252106312810"
2778
+ */
2779
+ unique_identifier: string;
2780
+ /**
2781
+ * The type of document
2782
+ */
2783
+ type: OrderDocumentsType;
2784
+ }
2785
+ export interface OrderPayment {
2786
+ /**
2787
+ * The type of payment you want to apply to the order.
2788
+ * 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`.
2789
+ * Otherwise, you must pay using your Duffel account's `balance` by specifying balance. In test mode, your balance is unlimited.
2790
+ * 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).
2791
+ */
2792
+ type: PaymentType;
2793
+ /**
2794
+ * 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`.
2795
+ * @example "30.20"
2796
+ */
2797
+ amount: string;
2798
+ /**
2799
+ * 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.
2800
+ * @example "GBP"
2801
+ */
2802
+ currency: string;
2803
+ }
2804
+ export interface Order {
2805
+ /**
2806
+ * The amount of tax payable on the order for all the flights booked
2807
+ */
2808
+ tax_amount?: string;
2809
+ /**
2810
+ * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
2811
+ */
2812
+ tax_currency: string;
2813
+ /**
2814
+ * The total price of the order for all the flights and services booked, including taxes
2815
+ */
2816
+ total_amount: string;
2817
+ /**
2818
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
2819
+ */
2820
+ total_currency: string;
2821
+ /**
2822
+ * The [slices](https://duffel.com/docs/api/overview/key-principles) that make up the itinerary of this order.
2823
+ * One-way journeys can be expressed using one slice,
2824
+ * whereas return trips will need two.
2825
+ */
2826
+ slices: OrderSlice[];
2827
+ /**
2828
+ * The services booked along with this order
2829
+ */
2830
+ services: OrderService[];
2831
+ /**
2832
+ * The passengers who are travelling
2833
+ */
2834
+ passengers: OrderPassenger[];
2835
+ /**
2836
+ * The payment status for this order
2837
+ *
2838
+ */
2839
+ payment_status: OrderPaymentStatus;
2840
+ /**
2841
+ * The airline who owns the order
2842
+ */
2843
+ owner: Airline;
2844
+ /**
2845
+ * Whether the order was created in live mode.
2846
+ * This field will be set to true if the order was created
2847
+ * in live mode, or false if it was created in test mode.
2848
+ */
2849
+ live_mode: boolean;
2850
+ /**
2851
+ * Duffel's unique identifier for the order
2852
+ */
2853
+ id: string;
2854
+ /**
2855
+ * The documents issued for this order.
2856
+ */
2857
+ documents?: OrderDocument[];
2858
+ /**
2859
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was created
2860
+ */
2861
+ created_at: string;
2862
+ /**
2863
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was cancelled, if it has been cancelled
2864
+ */
2865
+ cancelled_at?: string | null;
2866
+ /**
2867
+ * The airline's reference for the order, sometimes known as a
2868
+ * "passenger name record" (PNR) or "record locator".
2869
+ * Your customers can use this to check in and manage
2870
+ * their booking on the airline's website.
2871
+ */
2872
+ booking_reference: string;
2873
+ /**
2874
+ * The currency of the base_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
2875
+ * It will match your organisation's billing currency unless you're
2876
+ * using Duffel as an accredited IATA agent, in which case it will
2877
+ * be in the currency provided by the airline (which will usually
2878
+ * be based on the country where your IATA agency is registered).
2879
+ */
2880
+ base_currency: string;
2881
+ /**
2882
+ * The base price of the order for all flights and services booked, excluding taxes
2883
+ */
2884
+ base_amount: string;
2885
+ /**
2886
+ * 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.
2887
+ *
2888
+ * 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`.
2889
+ *
2890
+ * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
2891
+ *
2892
+ * In some cases, you may need to contact the Duffel support team or the airline directly.
2893
+ */
2894
+ conditions: FlightsConditions;
2895
+ /**
2896
+ * Metadata contains a set of key-value pairs that you can attach to an object.
2897
+ * It can be useful for storing additional information about the object, in a structured format.
2898
+ * Duffel does not use this information.
2899
+ * You should not store sensitive information in this field.
2900
+ */
2901
+ metadata: Record<string, string>;
2902
+ /**
2903
+ * The airline-initiated changes for this order.
2904
+ */
2905
+ airline_initiated_changes?: AirlineInitiatedChange[];
2906
+ }
2907
+ export interface CreateOrder {
2908
+ /**
2909
+ * The `id`s of the offers you want to book. You must specify an array containing exactly one selected offer.
2910
+ */
2911
+ selected_offers: string[];
2912
+ /**
2913
+ * The services you want to book along with the first selected offer.
2914
+ */
2915
+ services?: Pick<OrderService, 'id' | 'quantity'>[];
2916
+ /**
2917
+ * The personal details of the passengers, expanding on the information initially provided when creating the offer request
2918
+ */
2919
+ passengers: CreateOrderPassenger[];
2920
+ /**
2921
+ * The payment details to use to pay for the order
2922
+ */
2923
+ payments?: OrderPayment[];
2924
+ /**
2925
+ * The payment action you want to take for your order. You can only use pay_later with offers that contain requires_instant_payment: false.
2926
+ */
2927
+ type: 'instant' | 'pay_later';
2928
+ }
2929
+ export interface ListParamsOrders {
2930
+ /**
2931
+ * Whether to filter orders that are awaiting payment or not. If not specified, all orders regardless of their payment state will be returned.
2932
+ */
2933
+ awaiting_payment?: boolean;
2934
+ /**
2935
+ * Whether to filter orders matching a passenger name. Partial and exact matches in given and family names will be returned.
2936
+ */
2937
+ 'passenger_name[]'?: string[];
2938
+ /**
2939
+ * Whether to filter orders matching a given passenger name record (PNR)
2940
+ */
2941
+ booking_reference?: string;
2942
+ }
2943
+ export interface UpdateSingleOrder {
2944
+ metadata: Order['metadata'];
2945
+ }
2946
+ export interface AddServices {
2947
+ payment: OrderPayment;
2948
+ add_services: Pick<OrderService, 'id' | 'quantity'>[];
2949
+ }
2950
+ export type OrderAvailableService = OfferAvailableServiceBaggage;
2951
+ }
2952
+
2953
+ declare module '@duffel/api/booking/Payments/PaymentsTypes' {
2954
+ import { PaymentType } from '@duffel/api/types';
2955
+ /**
2956
+ * To pay for an unpaid order you've previously created, you'll need to create a payment for it.
2957
+ * @link https:/duffel.com/docs/api/payments/schema
2958
+ */
2959
+ export interface Payment {
2960
+ /**
2961
+ * The amount of the payment.
2962
+ * 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.
2963
+ */
2964
+ amount: string;
2965
+ /**
2966
+ * The currency of the amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
2967
+ * For an instant order, this should be the same as the `total_currency` of the offer specified in selected_offers.
2968
+ * For a pay later order, this should be the same as the `total_currency` of the previously created order specified in `order_id`.
2969
+ */
2970
+ currency?: string | null;
2971
+ /**
2972
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the payment was created
2973
+ */
2974
+ created_at: string;
2975
+ /**
2976
+ * Duffel's unique identifier for the payment
2977
+ */
2978
+ id: string;
2979
+ /**
2980
+ * The type of payment you want to apply to the order.
2981
+ * 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`.
2982
+ * 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.
2983
+ * 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).
2984
+ */
2985
+ type: PaymentType;
2986
+ }
2987
+ export interface CreatePayment {
2988
+ /**
2989
+ * The `id` of the order you want to pay for.
2990
+ */
2991
+ order_id: string;
2992
+ /**
2993
+ * The payment details to use to pay for the order
2994
+ */
2995
+ payment: Omit<Payment, 'created_at' | 'id'>;
2996
+ }
2997
+ }
2998
+
2999
+ declare module '@duffel/api/booking/SeatMaps/SeatMapTypes' {
3000
+ /**
3001
+ * Seat maps are used to build a rich experience for your customers so they can select a seat as part of an order.
3002
+ * A seat map includes the data for rendering seats in the relevant cabins, along with their total cost and other information such as disclosures.
3003
+ * @link https://duffel.com/docs/api/seat-maps/schema
3004
+ */
3005
+ export interface SeatMap {
3006
+ /**
3007
+ * Duffel's unique identifier for the seat map
3008
+ */
3009
+ id: string;
3010
+ /**
3011
+ * 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.)
3012
+ */
3013
+ slice_id: string;
3014
+ /**
3015
+ * 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).
3016
+ */
3017
+ segment_id: string;
3018
+ /**
3019
+ * The list of cabins in this seat map.
3020
+ * Cabins are ordered by deck from lowest to highest, and then within each deck from the front to back of the aircraft.
3021
+ */
3022
+ cabins: SeatMapCabin[];
3023
+ }
3024
+ export interface SeatMapCabin {
3025
+ /**
3026
+ * Level 0 is the main deck and level 1 is the upper deck above that, which is found on some large aircraft.
3027
+ */
3028
+ deck: number;
3029
+ /**
3030
+ * The cabin class that the passenger will travel in on this segment
3031
+ */
3032
+ cabin_class: string;
3033
+ /**
3034
+ * Where the wings of the aircraft are in relation to rows in the cabin.
3035
+ * 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.
3036
+ * The indices are 0 th-based and are for all rows, not just those that have seats.
3037
+ * This is null when no rows of the cabin are overwing.
3038
+ */
3039
+ wings: {
3040
+ /**
3041
+ * The index of the first row which is overwing, starting from the front of the aircraft.
3042
+ */
3043
+ first_row_index: number;
3044
+ /**
3045
+ * The index of the last row which is overwing, starting from the front of the aircraft.
3046
+ */
3047
+ last_row_index: number;
3048
+ } | null;
3049
+ /**
3050
+ * The number of aisles in this cabin.
3051
+ * 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.
3052
+ */
3053
+ aisles: number;
3054
+ /**
3055
+ * A list of rows in this cabin.
3056
+ * Row sections are broken up by aisles. Rows are ordered from front to back of the aircraft.
3057
+ */
3058
+ rows: SeatMapCabinRow[];
3059
+ }
3060
+ export interface SeatMapCabinRow {
3061
+ /**
3062
+ * A list of sections.
3063
+ * Each row is divided into sections by one or more aisles.
3064
+ */
3065
+ sections: SeatMapCabinRowSection[];
3066
+ }
3067
+ export interface SeatMapCabinRowSection {
3068
+ /**
3069
+ * The elements that make up this section.
3070
+ */
3071
+ elements: SeatMapCabinRowSectionElement[];
3072
+ }
3073
+ /**
3074
+ * A seat for a passenger. If the available_services list is empty (which will be represented as an empty list : []), the seat is unavailable.
3075
+ * For display, all seats should be displayed with the same static width.
3076
+ */
3077
+ export interface SeatMapCabinRowSectionElementSeat {
3078
+ /**
3079
+ * The type of this element.
3080
+ */
3081
+ type: 'seat';
3082
+ /**
3083
+ * The designator used to uniquely identify the seat, usually made up of a row number and a column letter
3084
+ */
3085
+ designator: string;
3086
+ /**
3087
+ * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features
3088
+ */
3089
+ name?: string;
3090
+ /**
3091
+ * 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.
3092
+ */
3093
+ disclosures: string[];
3094
+ /**
3095
+ * 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.
3096
+ */
3097
+ available_services: SeatMapCabinRowSectionAvailableService[];
3098
+ }
3099
+ export interface SeatMapCabinRowSectionAvailableService {
3100
+ /**
3101
+ * Duffel's unique identifier for the service
3102
+ */
3103
+ id: string;
3104
+ /**
3105
+ * The passenger that this seat is for
3106
+ */
3107
+ passenger_id: string;
3108
+ /**
3109
+ * The total price of the seat, including taxes
3110
+ */
3111
+ total_amount: string;
3112
+ /**
3113
+ * The currency of the total_amount, as an ISO 4217 currency code
3114
+ */
3115
+ total_currency: string;
3116
+ }
3117
+ /**
3118
+ * A bassinet is a child's cradle. This element will be aligned with the corresponding seat in the following row.
3119
+ * For display, this element should have the same width as a seat for proper alignment.
3120
+ */
3121
+ export interface SeatMapCabinRowSectionElementBassinet {
3122
+ /**
3123
+ * The type of this element.
3124
+ */
3125
+ type: 'bassinet';
3126
+ }
3127
+ /**
3128
+ * An empty space used for padding in some non-standard seat arrangements.
3129
+ * For display, this element should have the same dimensions as a seat for proper alignment.
3130
+ */
3131
+ export interface SeatMapCabinRowSectionElementEmpty {
3132
+ /**
3133
+ * The type of this element.
3134
+ */
3135
+ type: 'empty';
3136
+ }
3137
+ /**
3138
+ * An exit row represents the extra wide legroom used to reach aircraft exits. There is one exit_row element per row section.
3139
+ * 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.
3140
+ */
3141
+ export interface SeatMapCabinRowSectionElementExitRow {
3142
+ /**
3143
+ * The type of this element.
3144
+ */
3145
+ type: 'exit_row';
3146
+ }
3147
+ /**
3148
+ * A lavatory for use by passengers.
3149
+ * 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.
3150
+ */
3151
+ export interface SeatMapCabinRowSectionElementLavatory {
3152
+ /**
3153
+ * The type of this element.
3154
+ */
3155
+ type: 'lavatory';
3156
+ }
3157
+ /**
3158
+ * A galley is the compartment where food is cooked or prepared. These are conventionally marked with a teacup symbol.
3159
+ * 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.
3160
+ */
3161
+ export interface SeatMapCabinRowSectionElementGalley {
3162
+ /**
3163
+ * The type of this element.
3164
+ */
3165
+ type: 'galley';
3166
+ }
3167
+ /**
3168
+ * A closet used for storage. These are conventionally marked with a clothes hanger symbol.
3169
+ * 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.
3170
+ */
3171
+ export interface SeatMapCabinRowSectionElementCloset {
3172
+ /**
3173
+ * The type of this element.
3174
+ */
3175
+ type: 'closet';
3176
+ }
3177
+ /**
3178
+ * A set of stairs to another deck.
3179
+ * 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.
3180
+ */
3181
+ export interface SeatMapCabinRowSectionElementStairs {
3182
+ /**
3183
+ * The type of this element.
3184
+ */
3185
+ type: 'stairs';
3186
+ }
3187
+ export type SeatMapCabinRowSectionElement = SeatMapCabinRowSectionElementSeat | SeatMapCabinRowSectionElementBassinet | SeatMapCabinRowSectionElementEmpty | SeatMapCabinRowSectionElementExitRow | SeatMapCabinRowSectionElementLavatory | SeatMapCabinRowSectionElementGalley | SeatMapCabinRowSectionElementCloset | SeatMapCabinRowSectionElementStairs;
3188
+ export type SeatMapCabinRowSectionElementType = SeatMapCabinRowSectionElement['type'];
3189
+ export type SeatMapCabinRowSectionElementAmenity = Exclude<SeatMapCabinRowSectionElementType, 'empty' | 'seat'>;
3190
+ }
3191
+
3192
+ declare module '@duffel/api/supportingResources/Aircraft/AircraftTypes' {
3193
+ /**
3194
+ * Aircraft are used to describe what passengers will fly in for a given trip
3195
+ * @link https://duffel.com/docs/api/aircraft/schema
3196
+ */
3197
+ export interface Aircraft {
3198
+ /**
3199
+ * The name of the aircraft
3200
+ */
3201
+ name: string;
3202
+ /**
3203
+ * Duffel's unique identifier for the aircraft
3204
+ */
3205
+ id: string;
3206
+ /**
3207
+ * The three-character IATA code for the aircraft
3208
+ */
3209
+ iata_code: string;
3210
+ }
3211
+ }
3212
+
3213
+ declare module '@duffel/api/supportingResources/Airlines/AirlinesTypes' {
3214
+ /**
3215
+ * Airlines are used to identify the air travel companies selling and operating flights
3216
+ * @link https://duffel.com/docs/api/airlines/schema
3217
+ */
3218
+ export interface Airline {
3219
+ /**
3220
+ * The three-character IATA code for the airline
3221
+ */
3222
+ name: string;
3223
+ /**
3224
+ * Duffel's unique identifier for the airline
3225
+ */
3226
+ id: string;
3227
+ iata_code: string;
3228
+ logo_lockup_url?: string;
3229
+ logo_symbol_url?: string;
3230
+ }
3231
+ }
3232
+
3233
+ declare module '@duffel/api/supportingResources/Airports/AirportsTypes' {
3234
+ import { City } from '@duffel/api/types';
3235
+ /**
3236
+ * Airports are used to identify origins and destinations in journey slices
3237
+ * @link https://duffel.com/docs/api/airports/schema
3238
+ */
3239
+ export interface Airport {
3240
+ /**
3241
+ * The metropolitan area where the airport is located.
3242
+ * Only present for airports which are registered with IATA as belonging to a metropolitan area.
3243
+ */
3244
+ city?: City | null;
3245
+ /**
3246
+ * The name of the city (or cities separated by a `/`) where the airport is located
3247
+ */
3248
+ city_name: string;
3249
+ /**
3250
+ * The three-character IATA code for the airport
3251
+ */
3252
+ iata_code?: string;
3253
+ /**
3254
+ * The ISO 3166-1 alpha-2 code for the country where the city is located
3255
+ * @link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
3256
+ * @example "GB"
3257
+ */
3258
+ iata_country_code: string;
3259
+ /**
3260
+ * The 3-letter IATA code for the city where the place is located.
3261
+ * 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).
3262
+ */
3263
+ iata_city_code?: string | null;
3264
+ /**
3265
+ * The four-character ICAO code for the airport
3266
+ */
3267
+ icao_code?: string;
3268
+ /**
3269
+ * Duffel's unique identifier for the airport
3270
+ */
3271
+ id: string;
3272
+ /**
3273
+ * The latitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -90° and 90°
3274
+ */
3275
+ latitude: number;
3276
+ /**
3277
+ * The longitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -180° and 180°
3278
+ */
3279
+ longitude: number;
3280
+ /**
3281
+ * The name of the airport
3282
+ */
3283
+ name: string;
3284
+ /**
3285
+ * The time zone of the airport, specified by name from the [tz database](https://en.wikipedia.org/wiki/Tz_database)
3286
+ */
3287
+ time_zone: string;
3288
+ }
3289
+ }
3290
+
3291
+ declare module '@duffel/api/DuffelPayments/PaymentIntents/PaymentIntentsType' {
3292
+ export interface PaymentIntent {
3293
+ /**
3294
+ * The amount of the Payment Intent that covers the cost of the flight being sold and any additional markup.
3295
+ * The card payment will be charged this amount.
3296
+ */
3297
+ amount: string;
3298
+ /**
3299
+ * 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.
3300
+ * It will be null until the Payment Intent is confirmed.
3301
+ */
3302
+ card_country_code: string | null;
3303
+ /**
3304
+ * The last four digits of the card used to confirm the Payment Intent.
3305
+ * It will be null until the Payment Intent is confirmed.
3306
+ */
3307
+ card_last_four_digits: string | null;
3308
+ /**
3309
+ * The card network in which the Payment Intent was processed on.
3310
+ * It will be null until the Payment Intent is confirmed.
3311
+ */
3312
+ card_network: 'amex' | 'cartes_bancaires' | 'diners' | 'discover' | 'interac' | 'jcb' | 'mastercard' | 'unionpay' | 'visa' | 'unknown' | null;
3313
+ /**
3314
+ * This value is used when displaying the payment collection form to securely identify and transmit the values to Duffel.
3315
+ */
3316
+ client_token: string;
3317
+ /**
3318
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the Payment Intent was confirmed
3319
+ */
3320
+ confirmed_at: string;
3321
+ /**
3322
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the Payment Intent was created
3323
+ */
3324
+ created_at: string;
3325
+ /**
3326
+ * The currency of the `amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
3327
+ * The card payment will be charged in this currency.
3328
+ * If it's different to your Balance currency, it will be converted to your Balance currency before the Balance is topped up.
3329
+ */
3330
+ currency: string;
3331
+ /**
3332
+ * The amount of the fees to process the Payment Intent.
3333
+ * It will be `null` until the Payment Intent is confirmed.
3334
+ */
3335
+ fees_amount: string | null;
3336
+ /**
3337
+ * The currency of the fees_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
3338
+ * This currency will match your Balance currency.
3339
+ * It will be null until the Payment Intent is confirmed.
3340
+ */
3341
+ fees_currency: string | null;
3342
+ /**
3343
+ * Duffel's unique identifier for the `Payment Intent`
3344
+ */
3345
+ id: string;
3346
+ /**
3347
+ * 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.
3348
+ */
3349
+ live_mode: boolean;
3350
+ /**
3351
+ * The amount of the Payment Intent that was added to the Balance.
3352
+ * It'll be `amount` (in the Balance currency) less the `fees_amount`.
3353
+ * It will be `null` until the Payment Intent is confirmed.
3354
+ */
3355
+ net_amount: string | null;
3356
+ /**
3357
+ * The currency of the net_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
3358
+ * This currency will match your Balance currency.
3359
+ * It will be null until the Payment Intent is confirmed.
3360
+ */
3361
+ net_currency: string | null;
3362
+ /**
3363
+ * The Refunds for this Payment Intent
3364
+ * @link https://duffel.com/docs/api/payment-intents/schema#payment-intents-schema-refunds
3365
+ */
3366
+ refunds: {
3367
+ amount: string;
3368
+ arrival: string;
3369
+ created_at: string;
3370
+ currency: string;
3371
+ destination: string;
3372
+ id: string;
3373
+ live_mode: boolean;
3374
+ net_amount: string;
3375
+ net_currency: string;
3376
+ payment_intent_id: string;
3377
+ status: 'succeeded' | 'pending' | 'failed';
3378
+ updated_at: string;
3379
+ }[];
3380
+ /**
3381
+ * The status of this Payment Intent
3382
+ */
3383
+ status: null | 'requires_payment_method' | 'requires_confirmation' | 'requires_action' | 'processing' | 'requires_capture' | 'cancelled' | 'succeeded';
3384
+ /**
3385
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the Payment Intent was updated
3386
+ */
3387
+ updated_at: string;
3388
+ }
3389
+ export interface CreatePaymentIntent {
3390
+ /**
3391
+ * This is the amount that the card payment being taken will be charged.
3392
+ * It should be enough to cover the service(s) you want to sell (enough to book an Offer for example) and the processing fees.
3393
+ * If the currency is different from your Balance currency you should also account for foreign exchange.
3394
+ * It can be higher than that, in which case the remainder will be considered your markup.
3395
+ * 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.
3396
+ */
3397
+ amount: string;
3398
+ /**
3399
+ * The currency of the amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
3400
+ * This is going to be the currency that the card payment being taken in will be charged in.
3401
+ */
3402
+ currency: string;
3403
+ }
3404
+ }
3405
+
3406
+ declare module '@duffel/api/Places/Suggestions/SuggestionsType' {
3407
+ import { Airport, City } from '@duffel/api/types';
3408
+ export interface Places {
3409
+ /**
3410
+ * The type of the place
3411
+ */
3412
+ type: string;
3413
+ /**
3414
+ * The time zone of the airport, specified by name from the tz database
3415
+ */
3416
+ time_zone: string | null;
3417
+ /**
3418
+ * The name of the place
3419
+ */
3420
+ name: string;
3421
+ /**
3422
+ * The longitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -180° and 180°
3423
+ */
3424
+ longitude: number | null;
3425
+ /**
3426
+ * The latitude position of the airport represented in Decimal degrees with 6 decimal points with a range between -90° and 90°
3427
+ */
3428
+ latitude: number | null;
3429
+ /**
3430
+ * Duffel's unique identifier for the place
3431
+ */
3432
+ id: string;
3433
+ /**
3434
+ * The four-character ICAO code for the airport
3435
+ */
3436
+ icao_code: string | null;
3437
+ /**
3438
+ * The ISO 3166-1 alpha-2 code for the country where the city is located
3439
+ */
3440
+ iata_country_code: string;
3441
+ /**
3442
+ * The 3-letter IATA code for the place
3443
+ */
3444
+ iata_code: string;
3445
+ /**
3446
+ * 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.
3447
+ */
3448
+ iata_city_code: string | null;
3449
+ /**
3450
+ * The name of the country where the city or airport is located
3451
+ */
3452
+ country_name: string | null;
3453
+ /**
3454
+ * The name of the city (or cities separated by a /) where the airport is located
3455
+ */
3456
+ city_name: string | null;
3457
+ /**
3458
+ * The metropolitan area where the airport is located. Only present for airports which are registered with IATA as belonging to a metropolitan area.
3459
+ */
3460
+ city: City | null;
3461
+ /**
3462
+ * The airports associated to a city. This will only be provided where the type is city.
3463
+ */
3464
+ airports: Airport[] | null;
3465
+ }
3466
+ }
3467
+
3468
+ declare module '@duffel/api/types/shared' {
3469
+ import { Airport } from '@duffel/api/supportingResources/Airports/AirportsTypes';
3470
+ /**
3471
+ * The metropolitan area where the airport is located.
3472
+ * Only present for airports which are registered with IATA as belonging to a metropolitan area.
3473
+ * @link https://portal.iata.org/faq/articles/en_US/FAQ/How-do-I-create-a-new-Metropolitan-Area
3474
+ */
3475
+ export interface City {
3476
+ /**
3477
+ * The type of the place
3478
+ */
3479
+ type?: 'city';
3480
+ /**
3481
+ * The three-character IATA code for the city
3482
+ * @example "LON"
3483
+ */
3484
+ iata_code: string;
3485
+ /**
3486
+ * The ISO 3166-1 alpha-2 code for the country where the city is located
3487
+ * @link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
3488
+ * @example "GB"
3489
+ */
3490
+ iata_country_code: string;
3491
+ /**
3492
+ * Duffel's unique identifier for the city
3493
+ * @example "cit_lon_gb"
3494
+ */
3495
+ id: string;
3496
+ /**
3497
+ * The name of the city
3498
+ * @example "London"
3499
+ */
3500
+ name: string;
3501
+ /**
3502
+ * The time zone of the airport, specified by name from the [tz database](https://en.wikipedia.org/wiki/Tz_database)
3503
+ */
3504
+ time_zone?: string | null;
3505
+ /**
3506
+ * The longitude position of the airport represented in [Decimal degrees](https://en.wikipedia.org/wiki/Decimal_degrees) with 6 decimal points with a range between -180° and 180°
3507
+ */
3508
+ longitude?: number | null;
3509
+ /**
3510
+ * The latitude position of the airport represented in [Decimal degrees](https://en.wikipedia.org/wiki/Decimal_degrees) with 6 decimal points with a range between -90° and 90°
3511
+ */
3512
+ latitude?: number | null;
3513
+ /**
3514
+ * The 3-letter IATA code for the city where the place is located.
3515
+ * 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).
3516
+ */
3517
+ iata_city_code?: string | null;
3518
+ /**
3519
+ * The name of the city (or cities separated by a `/`) where the airport is located
3520
+ */
3521
+ city_name?: string | null;
3522
+ }
3523
+ /**
3524
+ * The cabin class that the passenger will travel in on this segment
3525
+ */
3526
+ export type CabinClass = 'first' | 'business' | 'premium_economy' | 'economy';
3527
+ /**
3528
+ * The type of the passenger
3529
+ */
3530
+ export type DuffelPassengerType = 'adult' | 'child' | 'infant_without_seat';
3531
+ /**
3532
+ * The passenger's title
3533
+ */
3534
+ export type DuffelPassengerTitle = 'mr' | 'ms' | 'mrs' | 'MR' | 'MS' | 'MRS';
3535
+ /**
3536
+ * The passenger's gender
3537
+ */
3538
+ export type DuffelPassengerGender = 'm' | 'f';
3539
+ /**
3540
+ * The type of the identity document.
3541
+ * This must be one of the `allowed_passenger_identity_document_types` on the offer.
3542
+ */
3543
+ export type PassengerIdentityDocumentType = 'passport' | 'tax_id';
3544
+ /**
3545
+ * The type of the origin or destination
3546
+ */
3547
+ export type PlaceType = 'airport' | 'city';
3548
+ export type Place = (Airport & {
3549
+ type?: 'airport';
3550
+ airports?: Airport[] | null;
3551
+ }) | (City & {
3552
+ type?: 'city';
3553
+ });
3554
+ /**
3555
+ * 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.
3556
+ * 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.
3557
+ * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
3558
+ * In some cases, you may need to contact the Duffel support team or the airline directly.
3559
+ */
3560
+ export type FlightsConditions = {
3561
+ /**
3562
+ * Whether the whole order or offer can be refunded before the departure of the first slice.
3563
+ * 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.
3564
+ * If any of the slices on the order or offer can't be refunded then the `allowed` property will be `false`.
3565
+ * If the airline hasn't provided any information about whether this order or offer can be refunded then this property will be `null`.
3566
+ */
3567
+ refund_before_departure?: {
3568
+ /**
3569
+ * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
3570
+ * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer.
3571
+ * If this is `null` then `penalty_amount` will also be `null`.
3572
+ * @example "GBP"
3573
+ */
3574
+ penalty_currency: string;
3575
+ /**
3576
+ * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers.
3577
+ * 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`.
3578
+ * If this is `null` then the `penalty_currency` will also be null.
3579
+ * @example "100.00"
3580
+ */
3581
+ penalty_amount?: string;
3582
+ /**
3583
+ * Whether this kind of modification is allowed post-booking
3584
+ *
3585
+ * @example "true"
3586
+ */
3587
+ allowed: boolean;
3588
+ } | null;
3589
+ /**
3590
+ * Whether the whole order or offer can be changed before the departure of the first slice.
3591
+ * If all of the slices on the order or offer can be changed then the `allowed` property will be `true`.
3592
+ * Refer to the `slices` for information about change penalties.
3593
+ * If any of the slices on the order or offer can't be changed then the `allowed` property will be `false`.
3594
+ * In this case you should refer to the slices conditions to determine if any part of the order or offer is changeable.
3595
+ * If the airline hasn't provided any information about whether this order or offer can be changed then this property will be `null`.
3596
+ */
3597
+ change_before_departure?: {
3598
+ /**
3599
+ * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
3600
+ * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer.
3601
+ * If this is `null` then `penalty_amount` will also be `null`.
3602
+ * @example "GBP"
3603
+ */
3604
+ penalty_currency: string;
3605
+ /**
3606
+ * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers.
3607
+ * 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`.
3608
+ * If this is `null` then the `penalty_currency` will also be null.
3609
+ * @example "100.00"
3610
+ */
3611
+ penalty_amount?: string;
3612
+ /**
3613
+ * Whether this kind of modification is allowed post-booking
3614
+ *
3615
+ * @example "true"
3616
+ */
3617
+ allowed: boolean;
3618
+ } | null;
3619
+ };
3620
+ /**
3621
+ * The type of payment you want to apply to the order.
3622
+ * 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`.
3623
+ * 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).
3624
+ */
3625
+ export type PaymentType = 'arc_bsp_cash' | 'balance';
3626
+ }
3627
+
3628
+ declare module '@duffel/api/types/ClientType' {
3629
+ import { Headers } from 'node-fetch';
3630
+ /**
3631
+ * Our list APIs will only return a limited number of results at a time.
3632
+ * By default, we'll return 50 results per page, but you can set this to any number between 1 and 200.
3633
+ * @link https://duffel.com/docs/api/overview/pagination
3634
+ */
3635
+ export interface PaginationMeta {
3636
+ /**
3637
+ * The number of results to be returned in a page, between 1 and 200 (optional, default is 50)
3638
+ */
3639
+ limit?: number;
3640
+ /**
3641
+ * "Before" cursor for pagination
3642
+ */
3643
+ before?: string;
3644
+ /**
3645
+ * "After" cursor for pagination
3646
+ */
3647
+ after?: string | null;
3648
+ }
3649
+ export interface ApiResponseMeta {
3650
+ /**
3651
+ * The identifier of the request
3652
+ */
3653
+ request_id: string;
3654
+ /**
3655
+ * The [HTTP status](https://httpstatuses.com/) of the request
3656
+ */
3657
+ status: number;
3658
+ }
3659
+ /**
3660
+ * Duffel uses standard [HTTP response codes](https://httpstatuses.com/) to indicate the success or failure of API requests.
3661
+ * @link https://duffel.com/docs/api/overview/errors
3662
+ */
3663
+ export interface ApiResponseError {
3664
+ /**
3665
+ * A machine-readable identifier for this specific error
3666
+ */
3667
+ code: string;
3668
+ /**
3669
+ * A URL pointing to a place in our documentation where you can read about the error
3670
+ */
3671
+ documentation_url: string;
3672
+ /**
3673
+ * A more detailed human-readable description of what went wrong
3674
+ */
3675
+ message: string;
3676
+ /**
3677
+ * A quick and simple description of what went wrong
3678
+ */
3679
+ title: string;
3680
+ /**
3681
+ * A machine-readable identifier for the general category of error
3682
+ */
3683
+ type: string;
3684
+ }
3685
+ export interface DuffelResponse<T_Data> {
3686
+ /**
3687
+ * The body of the response
3688
+ */
3689
+ data: T_Data;
3690
+ /**
3691
+ * Optional metadata for the request
3692
+ */
3693
+ meta?: PaginationMeta;
3694
+ /**
3695
+ * The headers from the http response
3696
+ */
3697
+ headers?: Headers;
3698
+ }
3699
+ export interface SDKOptions {
3700
+ /**
3701
+ * If `true` it will output the path and the method called
3702
+ */
3703
+ verbose?: boolean;
3704
+ }
3705
+ }
3706
+
3707
+ declare module '@duffel/api/notifications/Webhooks/WebhooksType' {
3708
+ import { PaginationMeta } from 'types';
3709
+ export interface Webhooks {
3710
+ /**
3711
+ * Whether the webhook receiver is actively being notified or not
3712
+ */
3713
+ active: boolean;
3714
+ /**
3715
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the webhook was created
3716
+ */
3717
+ created_at: string;
3718
+ /**
3719
+ * The events that this webhook will be subscribed to
3720
+ */
3721
+ events: string[];
3722
+ /**
3723
+ * Duffel's unique identifier for the webhook receiver
3724
+ */
3725
+ id: string;
3726
+ /**
3727
+ * 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.
3728
+ */
3729
+ live_mode: boolean;
3730
+ /**
3731
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the order change was updated
3732
+ */
3733
+ updated_at: string;
3734
+ /**
3735
+ * The URL where your webhook will be received
3736
+ */
3737
+ url: string;
3738
+ }
3739
+ export interface WebhooksListDeliveriesParams extends PaginationMeta {
3740
+ delivery_success: boolean;
3741
+ /**
3742
+ * Filters the returned webhook deliveries by creation datetime.
3743
+ */
3744
+ created_at?: PaginationMeta;
3745
+ /**
3746
+ * Filters webhook deliveries by the type of their related webhook event.
3747
+ */
3748
+ type?: string;
3749
+ /**
3750
+ * Filters webhook deliveries by the ID of the related webhook endpoint.
3751
+ */
3752
+ endpoint_id: string;
3753
+ }
3754
+ export interface WebhooksUpdateParams {
3755
+ /**
3756
+ * The desired active status of the webhook
3757
+ */
3758
+ active: boolean;
3759
+ /**
3760
+ * The desired events that the webhook should subscribe to
3761
+ */
3762
+ events: string[];
3763
+ /**
3764
+ * The desired url of the webhook
3765
+ */
3766
+ url: string;
3767
+ }
3768
+ export interface WebhooksCreateParams {
3769
+ /**
3770
+ * The desired events that the webhook should subscribe to
3771
+ */
3772
+ events: string[];
3773
+ /**
3774
+ * The desired url of the webhook
3775
+ */
3776
+ url: string;
3777
+ }
3778
+ export interface WebhooksListDeliveriesResponse {
3779
+ /**
3780
+ * The URL where your webhook will be received
3781
+ */
3782
+ url: string;
3783
+ endpoint_id: string;
3784
+ /**
3785
+ * Webhook deliveries will be included if they were successful.
3786
+ */
3787
+ delivery_success?: boolean;
3788
+ type: string;
3789
+ response_status_code: 200;
3790
+ response_body: string;
3791
+ event_id: string;
3792
+ /**
3793
+ * 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.
3794
+ */
3795
+ live_mode: boolean;
3796
+ /**
3797
+ * Duffel's unique identifier for the webhook receiver
3798
+ */
3799
+ id: string;
3800
+ /**
3801
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the webhook was created
3802
+ */
3803
+ created_at: string;
3804
+ }
3805
+ export interface WebhooksListResponse extends Webhooks {
3806
+ /**
3807
+ * Webhook deliveries will be included if they were successful.
3808
+ */
3809
+ delivery_success?: boolean;
3810
+ }
3811
+ export interface WebhooksCreateResponse {
3812
+ secret: string;
3813
+ url: string;
3814
+ updated_at: string;
3815
+ live_mode: boolean;
3816
+ id: string;
3817
+ events: string[];
3818
+ created_at: string;
3819
+ active: boolean;
3820
+ }
3821
+ }
3822
+
3823
+ declare module '@duffel/api/supportingResources/Aircraft/Aircraft' {
3824
+ import { Resource } from '@duffel/api/Resource';
3825
+ import { Aircraft as AircraftType, DuffelResponse, PaginationMeta } from '@duffel/api/types';
3826
+ /** Aircraft are used to describe what passengers will fly in for a given trip
3827
+ * @class
3828
+ * @link https://duffel.com/docs/api/aircraft
3829
+ */
3830
+ export class Aircraft extends Resource {
3831
+ /**
3832
+ * Endpoint path
3833
+ */
3834
+ path: string;
3835
+ constructor(args: any);
3836
+ /**
3837
+ * Retrieves an aircraft by its ID
3838
+ * @param {string} id - Duffel's unique identifier for the aircraft
3839
+ * @link https://duffel.com/docs/api/aircraft/get-aircraft-by-id
3840
+ */
3841
+ get: (id: string) => Promise<DuffelResponse<AircraftType>>;
3842
+ /**
3843
+ * Retrieves a page of aircraft. The results may be returned in any order.
3844
+ * @param {Object} [options] - Pagination options (optional: limit, after, before)
3845
+ * @link https://duffel.com/docs/api/aircraft/get-aircraft
3846
+ */
3847
+ list: (options?: PaginationMeta) => Promise<DuffelResponse<AircraftType[]>>;
3848
+ /**
3849
+ * Retrieves a generator of all aircraft. The results may be returned in any order.
3850
+ * @link https://duffel.com/docs/api/aircraft/get-aircraft
3851
+ */
3852
+ listWithGenerator: () => AsyncGenerator<DuffelResponse<AircraftType>, void, unknown>;
3853
+ }
3854
+ }
3855
+
3856
+ declare module '@duffel/api/supportingResources/Airlines/Airlines' {
3857
+ import { Resource } from '@duffel/api/Resource';
3858
+ import { Airline, DuffelResponse, PaginationMeta } from '@duffel/api/types';
3859
+ /** Airlines are used to identify the air travel companies selling and operating flights
3860
+ * @class
3861
+ * @link https://duffel.com/docs/api/airlines */
3862
+ export declare class Airlines extends Resource {
3863
+ /**
3864
+ * Endpoint path
3865
+ */
3866
+ path: string;
3867
+ constructor(args: any);
3868
+ /**
3869
+ * Retrieves an airline by its ID
3870
+ * @param {string} id - Duffel's unique identifier for the airline
3871
+ * @link https://duffel.com/docs/api/airlines/get-airline-by-id
3872
+ */
3873
+ get: (id: string) => Promise<DuffelResponse<Airline>>;
3874
+ /**
3875
+ * Retrieves a page of airlines. The results may be returned in any order.
3876
+ * @param {Object} [options] - Pagination options (optional: limit, after, before)
3877
+ * @link https://duffel.com/docs/api/airlines/get-airlines
3878
+ */
3879
+ list: (options?: PaginationMeta) => Promise<DuffelResponse<Airline[]>>;
3880
+ /**
3881
+ * Retrieves a generator of all airlines. The results may be returned in any order.
3882
+ * @link https://duffel.com/docs/api/airlines/get-airlines
3883
+ */
3884
+ listWithGenerator: () => AsyncGenerator<DuffelResponse<Airline>, void, unknown>;
3885
+ }
3886
+ }
3887
+
3888
+ declare module '@duffel/api/supportingResources/Airports/Airports' {
3889
+ import { Resource } from '@duffel/api/Resource';
3890
+ import { Airport, DuffelResponse, PaginationMeta } from '@duffel/api/types';
3891
+ /** Airports are used to identify origins and destinations in journey slices
3892
+ * @class
3893
+ * @link https://duffel.com/docs/api/airports
3894
+ */
3895
+ export class Airports extends Resource {
3896
+ /**
3897
+ * Endpoint path
3898
+ */
3899
+ path: string;
3900
+ constructor(args: any);
3901
+ /**
3902
+ * Retrieves an airport by its ID
3903
+ * @param {string} id - Duffel's unique identifier for the airport
3904
+ * @link https://duffel.com/docs/api/airports/get-airport-by-id
3905
+ */
3906
+ get: (id: string) => Promise<DuffelResponse<Airport>>;
3907
+ /**
3908
+ * Retrieves a page of airports. The results may be returned in any order.
3909
+ * @param {Object} [options] - Pagination options (optional: limit, after, before)
3910
+ * @link https://duffel.com/docs/api/airports/get-airports
3911
+ */
3912
+ list: (options?: PaginationMeta) => Promise<DuffelResponse<Airport[]>>;
3913
+ /**
3914
+ * Retrieves a generator of all airports. The results may be returned in any order.
3915
+ * @link https://duffel.com/docs/api/airports/get-airports
3916
+ */
3917
+ listWithGenerator: () => AsyncGenerator<DuffelResponse<Airport>, void, unknown>;
3918
+ }
3919
+ }
3920
+
3921
+ declare module '@duffel/api/DuffelPayments/Refunds/RefundsType' {
3922
+ export interface Refund {
3923
+ /**
3924
+ * The amount of the Payment Intent that will be refunded to the customer
3925
+ */
3926
+ amount: string;
3927
+ /**
3928
+ * When the refund is expected to arrive in the destination
3929
+ */
3930
+ arrival: string;
3931
+ /**
3932
+ * The ISO 8601 datetime at which the Refund was created
3933
+ */
3934
+ created_at: string;
3935
+ /**
3936
+ * The currency of the amount, as an ISO 4217 currency code.
3937
+ * It will always match the currency of the Payment Intent.
3938
+ */
3939
+ currency: string;
3940
+ /**
3941
+ * Where the Refund amount will be sent to
3942
+ */
3943
+ destination: 'original_form_of_payment';
3944
+ /**
3945
+ * Duffel's unique identifier for the Refund
3946
+ */
3947
+ id: string;
3948
+ /**
3949
+ * 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.
3950
+ */
3951
+ live_mode: boolean;
3952
+ /**
3953
+ * The amount deducted from your Balance to cover the Refund amount
3954
+ */
3955
+ net_amount: string;
3956
+ /**
3957
+ * The currency of the net_amount, as an ISO 4217 currency code.
3958
+ * This currency will match your Balance currency.
3959
+ */
3960
+ net_currency: string;
3961
+ /**
3962
+ * Duffel's unique identifier for the Payment Intent that the Refund is for
3963
+ */
3964
+ payment_intent_id: string;
3965
+ /**
3966
+ * The status of the Refund.
3967
+ * Succeeded: The refund is on its way to the destination.
3968
+ * Pending: The Refund could not be processed immediately, and is pending processing.
3969
+ * 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.
3970
+ */
3971
+ status: 'succeeded' | 'pending' | 'failed';
3972
+ /**
3973
+ * The ISO 8601 datetime at which the Refund was updated
3974
+ */
3975
+ updated_at: string;
3976
+ }
3977
+ export interface CreateRefund {
3978
+ /**
3979
+ * This amount that will be refunded to the customer's card.
3980
+ */
3981
+ amount: string;
3982
+ /**
3983
+ * The currency of the amount, as an ISO 4217 currency code.
3984
+ * It must match the Payment Intent currency.
3985
+ */
3986
+ currency: string;
3987
+ /**
3988
+ * Duffel's unique identifier for the Payment Intent that the Refund is for
3989
+ */
3990
+ payment_intent_id: string;
3991
+ }
3992
+ }
3993
+
3994
+ declare module '@duffel/api/Links/Sessions/Sessions' {
3995
+ import { Client } from 'Client';
3996
+ import { Resource } from '@duffel/api/Resource';
3997
+ import { DuffelResponse } from '@duffel/api/types';
3998
+ interface SessionParameters {
3999
+ /**
4000
+ * A tracking reference for the booking that may be created within this Duffel Links session
4001
+ */
4002
+ reference: string;
4003
+ /**
4004
+ * A url to return to when a flight is booked via Duffel Links
4005
+ */
4006
+ success_url: string;
4007
+ /**
4008
+ * A url to return to when there is an error within Duffel Links
4009
+ */
4010
+ failure_url: string;
4011
+ /**
4012
+ * A url to return to when the user exits Duffel Links before booking
4013
+ */
4014
+ abandonment_url: string;
4015
+ /**
4016
+ * A primary color to show within Duffel Links
4017
+ */
4018
+ primary_color?: string;
4019
+ /**
4020
+ * A url of the logo to show within Duffel Links
4021
+ */
4022
+ logo_url?: string;
4023
+ /**
4024
+ * A markup amount to be added to the flights shown within Duffel Links
4025
+ */
4026
+ markup_amount?: number;
4027
+ /**
4028
+ * A markup amount to be added to the flights shown within Duffel Links
4029
+ */
4030
+ markup_currency?: string;
4031
+ /**
4032
+ * A markup percentage to be added to the flights shown within Duffel Links
4033
+ */
4034
+ markup_rate?: number;
4035
+ /**
4036
+ * A text to be shown on the checkout page within Duffel Links
4037
+ */
4038
+ checkout_display_text?: string;
4039
+ }
4040
+ interface Session {
4041
+ /**
4042
+ * The Duffel Links url that contains the specified configuration
4043
+ */
4044
+ url: string;
4045
+ }
4046
+ export class Sessions extends Resource {
4047
+ /**
4048
+ * Endpoint path
4049
+ */
4050
+ path: string;
4051
+ constructor(client: Client);
4052
+ /**
4053
+ * Create a Duffel Links Session per the configuration
4054
+ */
4055
+ create: (data: SessionParameters) => Promise<DuffelResponse<Session>>;
4056
+ }
4057
+ export {};
4058
+ }
4059
+
4060
+ declare module '@duffel/api/notifications/Webhooks/Webhooks' {
4061
+ import { DuffelResponse, PaginationMeta, Webhooks as WebhooksType, WebhooksCreateParams, WebhooksCreateResponse, WebhooksListDeliveriesParams, WebhooksListDeliveriesResponse, WebhooksListResponse, WebhooksUpdateParams } from '@duffel/api/types';
4062
+ import { Resource } from '@duffel/api/Resource';
4063
+ import { Client } from 'Client';
4064
+ export class Webhooks extends Resource {
4065
+ /**
4066
+ * Endpoint path
4067
+ */
4068
+ path: string;
4069
+ constructor(client: Client);
4070
+ /**
4071
+ * Trigger a re-delivery of an event to a webhook.
4072
+ * @param {string} id - Duffel's unique identifier for the webhook event
4073
+ * @link https://duffel.com/docs/api/v1/webhooks/schema#webhooks-retry-delivering-a-webhook-event-url-parameters-id
4074
+ */
4075
+ redeliver: (id: string) => Promise<DuffelResponse<unknown>>;
4076
+ /**
4077
+ * Send a ping, a "fake event" notification, to a webhook.
4078
+ * @param {string} id - Duffel's unique identifier for the webhook receiver
4079
+ */
4080
+ ping: (id: string) => Promise<DuffelResponse<unknown>>;
4081
+ /**
4082
+ * Retrieves a webhook event by its ID.
4083
+ * @param {string} id- Duffel's unique identifier for the webhook event
4084
+ */
4085
+ get: (id: string) => Promise<DuffelResponse<WebhooksType>>;
4086
+ /**
4087
+ * Retrieve a paginated list of webhook deliveries
4088
+ * @param {Object.<WebhooksListDeliveriesParams>} params - Endpoint options
4089
+ */
4090
+ listDeliveries: ({ ...params }: WebhooksListDeliveriesParams) => Promise<DuffelResponse<WebhooksListDeliveriesResponse[]>>;
4091
+ /**
4092
+ * Delete a webhook
4093
+ * @param {string} id - Duffel's unique identifier for the webhook receiver
4094
+ */
4095
+ delete: (id: string) => Promise<DuffelResponse<any>>;
4096
+ /**
4097
+ * Update a webhook
4098
+ * @param {string} id - Duffel's unique identifier for the webhook receiver
4099
+ */
4100
+ update: (id: string, { active, events, url }: WebhooksUpdateParams) => Promise<DuffelResponse<any>>;
4101
+ /**
4102
+ * Retrieve a paginated list of webhook
4103
+ * @param {Object.<PaginationMeta>} params - Endpoint options
4104
+ */
4105
+ list: ({ ...params }: PaginationMeta) => Promise<DuffelResponse<WebhooksListResponse[]>>;
4106
+ /**
4107
+ * Create a webhook
4108
+ * @param {Object.<WebhooksCreateParams>} params - Endpoint options
4109
+ */
4110
+ create: ({ events, url, }: WebhooksCreateParams) => Promise<DuffelResponse<WebhooksCreateResponse>>;
4111
+ }
4112
+ }
4113
+
4114
+ declare module '@duffel/api/Stays/Bookings/Bookings' {
4115
+ import { Client } from '@duffel/api/Client';
4116
+ import { StaysBooking } from '@duffel/api/Stays/StaysTypes';
4117
+ import { Resource } from '@duffel/api/Resource';
4118
+ import { DuffelResponse } from '@duffel/api/types';
4119
+ export interface StaysBookingPayload {
4120
+ quote_id: string;
4121
+ guests: Array<{
4122
+ given_name: string;
4123
+ family_name: string;
4124
+ born_on: string;
4125
+ }>;
4126
+ email: string;
4127
+ phone_number: string;
4128
+ accommodation_special_requests?: string;
4129
+ }
4130
+ export class Bookings extends Resource {
4131
+ /**
4132
+ * Endpoint path
4133
+ */
4134
+ path: string;
4135
+ constructor(client: Client);
4136
+ /**
4137
+ * Create a booking
4138
+ * @param {object} payload - The booking payload, including quote id and guest information
4139
+ */
4140
+ create: (payload: StaysBookingPayload) => Promise<DuffelResponse<StaysBooking>>;
4141
+ /**
4142
+ * Get a booking
4143
+ * @param {string} bookingId - The ID of the booking
4144
+ */
4145
+ get: (bookingId: string) => Promise<DuffelResponse<StaysBooking>>;
4146
+ /**
4147
+ * list bookings
4148
+ */
4149
+ list: () => Promise<DuffelResponse<StaysBooking>>;
4150
+ }
4151
+ }
4152
+
4153
+ declare module '@duffel/api/Stays/Quotes/Quotes' {
4154
+ import { Client } from '@duffel/api/Client';
4155
+ import { StaysQuote } from '@duffel/api/Stays/StaysTypes';
4156
+ import { Resource } from '@duffel/api/Resource';
4157
+ import { DuffelResponse } from '@duffel/api/types';
4158
+ export class Quotes extends Resource {
4159
+ /**
4160
+ * Endpoint path
4161
+ */
4162
+ path: string;
4163
+ constructor(client: Client);
4164
+ /**
4165
+ * Create a quote for the selected rate
4166
+ * @param {string} rateId - The ID of the rate to create a quote for
4167
+ */
4168
+ create: (rateId: string) => Promise<DuffelResponse<StaysQuote>>;
4169
+ }
4170
+ }
4171
+
4172
+ declare module '@duffel/api/Stays/SearchResults/SearchResults' {
4173
+ import { Client } from '@duffel/api/Client';
4174
+ import { StaysSearchResult } from '@duffel/api/Stays/StaysTypes';
4175
+ import { Resource } from '@duffel/api/Resource';
4176
+ import { DuffelResponse } from '@duffel/api/types';
4177
+ export class SearchResults extends Resource {
4178
+ /**
4179
+ * Endpoint path
4180
+ */
4181
+ path: string;
4182
+ constructor(client: Client);
4183
+ /**
4184
+ * Fetch all rates for the given search result
4185
+ * @param {string} searchResultId - The ID of the search result to fetch rates for
4186
+ */
4187
+ fetchAllRates: (searchResultId: string) => Promise<DuffelResponse<StaysSearchResult>>;
4188
+ }
4189
+ }
4190
+
4191
+ declare module '@duffel/api/booking/PartialOfferRequests/PartialOfferRequestTypes' {
4192
+ export interface SelectedPartialOffersParams {
4193
+ /**
4194
+ * Whether to filter orders that are awaiting payment or not. If not specified, all orders regardless of their payment state will be returned.
4195
+ */
4196
+ 'selected_partial_offer[]'?: string[];
4197
+ }
4198
+ }
4199
+