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