@duffel/api 2.5.3 → 2.5.4

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.
Files changed (96) hide show
  1. package/dist/DuffelPayments/PaymentIntents/PaymentIntents.d.ts +28 -28
  2. package/dist/DuffelPayments/PaymentIntents/PaymentIntents.spec.d.ts +1 -1
  3. package/dist/DuffelPayments/PaymentIntents/PaymentIntentsType.d.ts +112 -112
  4. package/dist/DuffelPayments/PaymentIntents/index.d.ts +1 -1
  5. package/dist/DuffelPayments/Refunds/Refunds.d.ts +21 -21
  6. package/dist/DuffelPayments/Refunds/Refunds.spec.d.ts +1 -1
  7. package/dist/DuffelPayments/Refunds/RefundsType.d.ts +70 -70
  8. package/dist/DuffelPayments/Refunds/index.d.ts +1 -1
  9. package/dist/DuffelPayments/index.d.ts +1 -1
  10. package/dist/Links/Sessions/Sessions.d.ts +63 -63
  11. package/dist/Links/Sessions/Sessions.spec.d.ts +1 -1
  12. package/dist/Links/Sessions/index.d.ts +1 -1
  13. package/dist/Links/index.d.ts +1 -1
  14. package/dist/Places/Suggestions/Suggestions.d.ts +42 -42
  15. package/dist/Places/Suggestions/Suggestions.spec.d.ts +1 -1
  16. package/dist/Places/Suggestions/SuggestionsType.d.ts +59 -59
  17. package/dist/Places/Suggestions/index.d.ts +1 -1
  18. package/dist/Places/index.d.ts +1 -1
  19. package/dist/Stays/Bookings/Bookings.d.ts +41 -41
  20. package/dist/Stays/Bookings/Bookings.spec.d.ts +1 -1
  21. package/dist/Stays/Bookings/index.d.ts +1 -1
  22. package/dist/Stays/Quotes/Quotes.d.ts +16 -16
  23. package/dist/Stays/Quotes/Quotes.spec.d.ts +1 -1
  24. package/dist/Stays/Quotes/index.d.ts +1 -1
  25. package/dist/Stays/SearchResults/SearchResults.d.ts +16 -16
  26. package/dist/Stays/SearchResults/SearchResults.spec.d.ts +1 -1
  27. package/dist/Stays/SearchResults/index.d.ts +1 -1
  28. package/dist/Stays/Stays.d.ts +22 -22
  29. package/dist/Stays/Stays.spec.d.ts +1 -1
  30. package/dist/Stays/StaysTypes.d.ts +454 -454
  31. package/dist/booking/AirlineInitiatedChanges/AirlineInitiatedChanges.d.ts +63 -63
  32. package/dist/booking/AirlineInitiatedChanges/AirlineInitiatedChanges.spec.d.ts +1 -1
  33. package/dist/booking/AirlineInitiatedChanges/AirlineInitiatedChangesTypes.d.ts +57 -57
  34. package/dist/booking/AirlineInitiatedChanges/index.d.ts +1 -1
  35. package/dist/booking/OfferRequests/OfferRequests.d.ts +46 -46
  36. package/dist/booking/OfferRequests/OfferRequests.spec.d.ts +1 -1
  37. package/dist/booking/OfferRequests/OfferRequestsTypes.d.ts +240 -240
  38. package/dist/booking/OfferRequests/index.d.ts +1 -1
  39. package/dist/booking/Offers/OfferTypes.d.ts +495 -495
  40. package/dist/booking/Offers/Offers.d.ts +53 -53
  41. package/dist/booking/Offers/Offers.spec.d.ts +1 -1
  42. package/dist/booking/Offers/index.d.ts +1 -1
  43. package/dist/booking/OrderCancellations/OrderCancellations.d.ts +41 -41
  44. package/dist/booking/OrderCancellations/OrderCancellations.spec.d.ts +1 -1
  45. package/dist/booking/OrderCancellations/OrderCancellationsTypes.d.ts +53 -53
  46. package/dist/booking/OrderCancellations/index.d.ts +1 -1
  47. package/dist/booking/OrderChangeOffers/OrderChangeOfferTypes.d.ts +113 -113
  48. package/dist/booking/OrderChangeOffers/OrderChangeOffers.d.ts +31 -31
  49. package/dist/booking/OrderChangeOffers/OrderChangeOffers.spec.d.ts +1 -1
  50. package/dist/booking/OrderChangeOffers/index.d.ts +1 -1
  51. package/dist/booking/OrderChangeRequests/OrderChangeRequests.d.ts +29 -29
  52. package/dist/booking/OrderChangeRequests/OrderChangeRequestsTypes.d.ts +141 -141
  53. package/dist/booking/OrderChangeRequests/OrderRequestChanges.spec.d.ts +1 -1
  54. package/dist/booking/OrderChangeRequests/index.d.ts +1 -1
  55. package/dist/booking/OrderChanges/OrderChanges.d.ts +31 -31
  56. package/dist/booking/OrderChanges/OrderChanges.spec.d.ts +1 -1
  57. package/dist/booking/OrderChanges/OrderChangesTypes.d.ts +102 -102
  58. package/dist/booking/OrderChanges/index.d.ts +1 -1
  59. package/dist/booking/Orders/Orders.d.ts +52 -52
  60. package/dist/booking/Orders/Orders.spec.d.ts +1 -1
  61. package/dist/booking/Orders/OrdersTypes.d.ts +500 -500
  62. package/dist/booking/Orders/index.d.ts +1 -1
  63. package/dist/booking/PartialOfferRequests/PartialOfferRequestTypes.d.ts +6 -6
  64. package/dist/booking/PartialOfferRequests/PartialOfferRequests.d.ts +40 -40
  65. package/dist/booking/PartialOfferRequests/PartialOfferRequests.spec.d.ts +1 -1
  66. package/dist/booking/PartialOfferRequests/index.d.ts +1 -1
  67. package/dist/booking/Payments/Payments.d.ts +16 -16
  68. package/dist/booking/Payments/Payments.spec.d.ts +1 -1
  69. package/dist/booking/Payments/PaymentsTypes.d.ts +43 -43
  70. package/dist/booking/Payments/index.d.ts +1 -1
  71. package/dist/booking/SeatMaps/SeatMapTypes.d.ts +190 -190
  72. package/dist/booking/SeatMaps/SeatMaps.d.ts +17 -17
  73. package/dist/booking/SeatMaps/SeatMaps.spec.d.ts +1 -1
  74. package/dist/booking/SeatMaps/index.d.ts +1 -1
  75. package/dist/booking/index.d.ts +11 -11
  76. package/dist/index.es.js +1 -1
  77. package/dist/index.js +1 -1
  78. package/dist/notifications/Webhooks/Webhooks.d.ts +51 -51
  79. package/dist/notifications/Webhooks/Webhooks.spec.d.ts +1 -1
  80. package/dist/notifications/Webhooks/WebhooksType.d.ts +113 -113
  81. package/dist/notifications/Webhooks/index.d.ts +1 -1
  82. package/dist/notifications/index.d.ts +1 -1
  83. package/dist/supportingResources/Aircraft/Aircraft.d.ts +30 -30
  84. package/dist/supportingResources/Aircraft/Aircraft.spec.d.ts +1 -1
  85. package/dist/supportingResources/Aircraft/AircraftTypes.d.ts +18 -18
  86. package/dist/supportingResources/Aircraft/index.d.ts +1 -1
  87. package/dist/supportingResources/Airlines/Airlines.d.ts +29 -29
  88. package/dist/supportingResources/Airlines/Airlines.spec.d.ts +1 -1
  89. package/dist/supportingResources/Airlines/AirlinesTypes.d.ts +17 -17
  90. package/dist/supportingResources/Airlines/index.d.ts +2 -2
  91. package/dist/supportingResources/Airports/Airports.d.ts +30 -30
  92. package/dist/supportingResources/Airports/Airports.spec.d.ts +1 -1
  93. package/dist/supportingResources/Airports/AirportsTypes.d.ts +55 -55
  94. package/dist/supportingResources/Airports/index.d.ts +2 -2
  95. package/dist/supportingResources/index.d.ts +3 -3
  96. package/package.json +15 -15
@@ -1,495 +1,495 @@
1
- import { CabinClass, FlightsConditions, LoyaltyProgrammeAccount, PassengerIdentityDocumentType, Place, PlaceType, Aircraft, Airline, Airport, PaginationMeta, DuffelPassengerType } from '../../types';
2
- /**
3
- * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria.
4
- * @link https://duffel.com/docs/api/offers/schema
5
- */
6
- export interface Offer {
7
- /**
8
- * The types of identity documents that may be provided for the passengers when creating an order based on this offer.
9
- * If this is `[]`, then you must not provide identity documents.
10
- */
11
- allowed_passenger_identity_document_types: PassengerIdentityDocumentType[];
12
- /**
13
- * The services that can be booked along with the offer but are not included by default, for example an additional checked bag.
14
- * This field is only returned in the Get single offer endpoint.
15
- * When there are no services available, or we don't support services for the airline, this list will be empty.
16
- */
17
- available_services: OfferAvailableService[];
18
- /**
19
- * The base price of the offer for all passengers, excluding taxes.
20
- * It does not include the base amount of any service(s) that might be booked with the offer.
21
- */
22
- base_amount: string;
23
- /**
24
- * The currency of the `base_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
25
- */
26
- base_currency: string;
27
- /**
28
- * 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.
29
- * 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`.
30
- * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
31
- * In some cases, you may need to contact the Duffel support team or the airline directly.
32
- */
33
- conditions: FlightsConditions;
34
- /**
35
- * The ISO 8601 datetime at which the offer was created
36
- */
37
- created_at: string;
38
- /**
39
- * The ISO 8601 datetime at which the offer will expire and no longer be usable to create an order
40
- */
41
- expires_at: string;
42
- /**
43
- * Duffel's unique identifier for the offer
44
- */
45
- id: string;
46
- /**
47
- * Whether the offer request was created in live mode.
48
- * 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.
49
- */
50
- live_mode: boolean;
51
- /**
52
- * The airline which provided the offer
53
- */
54
- owner: Airline;
55
- /**
56
- * Whether identity documents must be provided for each of the passengers when creating an order based on this offer.
57
- * If this is `true`, you must provide an identity document for every passenger.
58
- */
59
- passenger_identity_documents_required: boolean;
60
- /**
61
- * The passengers included in the offer
62
- */
63
- passengers: OfferPassenger[];
64
- /**
65
- * The payment requirements for this offer
66
- */
67
- payment_requirements: PaymentRequirements;
68
- /**
69
- * The private fares applied on this offer.
70
- */
71
- private_fares: OfferPrivateFare[];
72
- /**
73
- * The slices that make up this offer. Each slice will include one or more segments,
74
- * the specific flights that the airline is offering to take the passengers from the slice's `origin` to its `destination`.
75
- */
76
- slices: OfferSlice[];
77
- /**
78
- * The amount of tax payable on the offer for all passengers
79
- */
80
- tax_amount: string | null;
81
- /**
82
- * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
83
- */
84
- tax_currency: string | null;
85
- /**
86
- * The total price of the offer for all passengers, including taxes.
87
- * It does not include the total price of any service(s) that might be booked with the offer.
88
- */
89
- total_amount: string;
90
- /**
91
- * An estimate of the total carbon dioxide (CO₂) emissions when
92
- * all of the passengers fly this offer's itinerary, measured in kilograms
93
- */
94
- total_emissions_kg: string;
95
- /**
96
- * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
97
- */
98
- total_currency: string;
99
- /**
100
- * The ISO 8601 datetime at which the offer was last updated
101
- */
102
- updated_at: string;
103
- /**
104
- * Whether this is a partial or full offer.
105
- * A partial offer can't be booked directly, but it can be combined with other partial offers to form a full offer.
106
- * Partial offers are only ever returned through the multi-step search flow.
107
- */
108
- partial: boolean;
109
- }
110
- export interface OfferAvailableServiceBaggageMetadata {
111
- /**
112
- * The maximum weight that the baggage can have in kilograms.
113
- */
114
- maximum_weight_kg: number | null;
115
- /**
116
- * The maximum height that the baggage can have in centimetres.
117
- */
118
- maximum_height_cm: number | null;
119
- /**
120
- * The maximum length that the baggage can have in centimetres.
121
- */
122
- maximum_length_cm: number | null;
123
- /**
124
- * The maximum depth that the baggage can have in centimetres.
125
- */
126
- maximum_depth_cm: number | null;
127
- /**
128
- * The type of the baggage
129
- */
130
- type: BaggageType;
131
- }
132
- export interface OfferAvailableServiceCFARMetadata {
133
- /**
134
- * The amount the customer will receive back if the service is used, in
135
- * `offer.total_currency`.
136
- */
137
- refund_amount: string;
138
- /**
139
- * Information to display to customers.
140
- */
141
- merchant_copy: string;
142
- /**
143
- * URL with the T&Cs for customers.
144
- */
145
- terms_and_conditions_url: string;
146
- type: 'cancel_for_any_reason';
147
- }
148
- export interface OfferAvailableServiceCommon {
149
- /**
150
- * Duffel's unique identifier for the service.
151
- */
152
- id: string;
153
- /**
154
- * The maximum quantity of this service that can be booked with an order.
155
- */
156
- maximum_quantity: number;
157
- /**
158
- * The list of passenger `id`s the service applies to. If you add this
159
- * service to an order it will apply to all the passengers in this list.
160
- * For services where the type is `baggage`, this list will include only a
161
- * single passenger.
162
- */
163
- passenger_ids: string[];
164
- /**
165
- * The list of segment `id`s the service applies to. If you add this
166
- * service to an order it will apply to all the segments in this list. For
167
- * services where the type is `baggage`, depending on the airline, this
168
- * list includes all the segments of all slices or all the segments of a
169
- * single slice.
170
- */
171
- segment_ids: string[];
172
- /**
173
- * The total price of the service for all passengers and segments it
174
- * applies to, including taxes. This price is for a single unit of the
175
- * service.
176
- */
177
- total_amount: string;
178
- /**
179
- * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
180
- * currency code. It will match your organisation's billing currency unless
181
- * you’re using Duffel as an accredited IATA agent, in which case it will be
182
- * in the currency provided by the airline (which will usually be based on the
183
- * country where your IATA agency is registered).
184
- */
185
- total_currency: string;
186
- }
187
- export interface OfferAvailableServiceBaggage extends OfferAvailableServiceCommon {
188
- /**
189
- * The metadata varies by the type of service. It includes further data
190
- * about the service. For example, for baggages, it may have data about
191
- * size and weight restrictions.
192
- */
193
- metadata: OfferAvailableServiceBaggageMetadata;
194
- /**
195
- * The type of the service.
196
- */
197
- type: 'baggage';
198
- }
199
- export interface OfferAvailableServiceCFAR extends OfferAvailableServiceCommon {
200
- /**
201
- * The metadata varies by the type of service. It includes further data
202
- * about the service. For example, for baggages, it may have data about
203
- * size and weight restrictions.
204
- */
205
- metadata: OfferAvailableServiceCFARMetadata;
206
- /**
207
- * The type of the service.
208
- */
209
- type: 'cancel_for_any_reason';
210
- }
211
- export type OfferAvailableService = OfferAvailableServiceBaggage | OfferAvailableServiceCFAR;
212
- export interface PaymentRequirements {
213
- /**
214
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime by which
215
- * you must pay for this order. At this time, if still unpaid, the reserved
216
- * space on the flight(s) will be released and you will have to create a new
217
- * order. This will be null only for orders where `awaiting_payment` is
218
- * `false`.
219
- */
220
- payment_required_by: string | null;
221
- /**
222
- * The ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the
223
- * price associated with the order will no longer be guaranteed by the airline
224
- * and may change before payment. This will be null when
225
- * `requires_instant_payment` is `true`.
226
- */
227
- price_guarantee_expires_at: string | null;
228
- /**
229
- * When payment is required at the time of booking this will be true and
230
- * `payment_required_by` and `price_guarantee_expires_at` will be `null`. When
231
- * payment can be made at a time after booking, this will be `false` and the
232
- * time limits on the payment will be provided in `payment_required_by` and
233
- * `price_guarantee_expires_at`.
234
- */
235
- requires_instant_payment: boolean;
236
- }
237
- export interface OfferPrivateFare {
238
- /**
239
- * The corporate code that was applied, if any.
240
- */
241
- corporate_code?: string;
242
- /**
243
- * The tracking reference that was applied, if any.
244
- */
245
- tracking_reference?: string;
246
- /**
247
- * The type of private fare applied.
248
- */
249
- type: 'corporate' | 'leisure' | 'negotiated';
250
- }
251
- export interface OfferPassenger {
252
- /**
253
- * The age of the passenger on the departure_date of the final slice.
254
- */
255
- age?: number;
256
- /**
257
- * The type of the passenger.
258
- */
259
- type?: DuffelPassengerType;
260
- /**
261
- * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
262
- * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
263
- * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
264
- * characters.
265
- *
266
- * This is only required if you're also including **Loyalty Programme Accounts**.
267
- */
268
- family_name?: string;
269
- /**
270
- * The passenger's given name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
271
- * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
272
- * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
273
- * characters.
274
- *
275
- * This is only required if you're also including **Loyalty Programme Accounts**.
276
- */
277
- given_name?: string;
278
- /**
279
- * The **Loyalty Programme Accounts** for this passenger.
280
- */
281
- loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
282
- /**
283
- * The identifier for the passenger, unique within this Offer Request and across all Offer Requests.
284
- * This ID will be generated by Duffel unless you had optionally provided one.
285
- * Optionally providing one has been deprecated.
286
- */
287
- id: string;
288
- }
289
- export interface OfferSlice {
290
- /**
291
- * The type of the destination
292
- */
293
- destination_type: PlaceType;
294
- /**
295
- * The city or airport where this slice ends
296
- */
297
- destination: Place;
298
- /**
299
- * The type of the origin
300
- */
301
- origin_type: PlaceType;
302
- /**
303
- * The city or airport where this slice begins
304
- */
305
- origin: Place;
306
- /**
307
- * The duration of the slice, represented as a ISO 8601 duration
308
- */
309
- duration: string | null;
310
- /**
311
- * The name of the fare brand associated with this slice.
312
- * A fare brand specifies the travel conditions you get on your slice made available
313
- * by the airline. e.g. a British Airways Economy Basic fare will only include a hand baggage allowance.
314
- * It is worth noting that the fare brand names are defined by the airlines themselves and therefore they
315
- * are subject to change without any prior notice. We're in the process of adding support for fare_brand_name across
316
- * all our airlines, so for now, this field may be null in some offers.
317
- * This will become a non-nullable attribute in the near future.
318
- */
319
- fare_brand_name: string | null;
320
- /**
321
- * 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
322
- */
323
- id: string;
324
- /**
325
- * The segments - that is, specific flights - that the airline is offering to get the passengers from the `origin` to the `destination`
326
- */
327
- segments: OfferSliceSegment[];
328
- /**
329
- * 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.
330
- * 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.
331
- * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
332
- * In some cases, you may need to contact the Duffel support team or the airline directly.
333
- */
334
- conditions: FlightsConditions;
335
- }
336
- export interface OfferSliceSegment {
337
- /**
338
- * The aircraft that the operating carrier will use to operate this segment
339
- */
340
- aircraft: Aircraft;
341
- /**
342
- * The ISO 8601 datetime at which the segment is scheduled to arrive
343
- */
344
- arriving_at: string;
345
- /**
346
- * The terminal at the destination airport where the segment is scheduled to arrive
347
- */
348
- destination_terminal: string | null;
349
- /**
350
- * The ISO 8601 datetime at which the segment is scheduled to depart
351
- */
352
- departing_at: string;
353
- /**
354
- * The terminal at the origin airport from which the segment is scheduled to depart
355
- */
356
- origin_terminal: string | null;
357
- /**
358
- * The airport at which the segment is scheduled to arrive
359
- */
360
- destination: Airport;
361
- /**
362
- * The distance of the segment in kilometres
363
- */
364
- distance: string | null;
365
- /**
366
- * The duration of the segment, represented as a ISO 8601 duration
367
- */
368
- duration: string | null;
369
- /**
370
- * 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
371
- */
372
- id: string;
373
- /**
374
- * The airline selling the tickets for this segment.
375
- * This may differ from the `operating_carrier` in the case of a "codeshare", where one airline sells flights operated by another airline.
376
- */
377
- marketing_carrier: Airline;
378
- /**
379
- * The flight number assigned by the marketing carrier
380
- */
381
- marketing_carrier_flight_number: string;
382
- /**
383
- * The airport from which the flight is scheduled to depart
384
- */
385
- origin: Airport;
386
- /**
387
- * The airline actually operating this segment.
388
- * This may differ from the marketing_carrier in the case of a "codeshare", where one airline sells flights operated by another airline.
389
- */
390
- operating_carrier: Airline;
391
- /**
392
- * The flight number assigned by the operating carrier
393
- */
394
- operating_carrier_flight_number: string;
395
- /**
396
- * 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)
397
- */
398
- passengers: OfferSliceSegmentPassenger[];
399
- /**
400
- * Additional segment-specific information about the stops, if any, included in the segment
401
- */
402
- stops?: OfferSliceSegmentStop[];
403
- }
404
- export interface OfferSliceSegmentStop {
405
- /**
406
- * Duffel's unique identifier for the Stop
407
- */
408
- id: string;
409
- /**
410
- * The airport at which the Stop happens
411
- */
412
- airport: Airport;
413
- /**
414
- * The ISO 8601 datetime at which the Stop is scheduled to arrive, in the airport's timezone (see destination.timezone)
415
- */
416
- arrivingAt: string;
417
- /**
418
- * The ISO 8601 datetime at which the Stop is scheduled to depart, in the airport's timezone (see origin.timezone)
419
- */
420
- departingAt: string;
421
- /**
422
- * The duration of the Stop, represented as a ISO 8601 duration
423
- */
424
- duration: string;
425
- }
426
- export interface OfferSliceSegmentPassenger {
427
- /**
428
- * The baggage allowances for the passenger on this segment included in the offer.
429
- * Some airlines may allow additional baggage to be booked as a service - see the offer's available_services.
430
- */
431
- baggages: OfferSliceSegmentPassengerBaggage[];
432
- /**
433
- * The cabin class that the passenger will travel in on this segment
434
- */
435
- cabin_class: CabinClass;
436
- /**
437
- * The name that the marketing carrier uses to market this cabin class
438
- */
439
- cabin_class_marketing_name: string;
440
- /**
441
- * The identifier for the passenger.
442
- * You may have specified this ID yourself when creating the offer request, or otherwise, Duffel will have generated its own random ID.
443
- */
444
- passenger_id: string;
445
- /**
446
- * The airline's alphanumeric code for the fare that the passenger is using to travel. Where this is `null`, it means that either the
447
- * fare basis code is not available or the airline does not use fare basis codes.
448
- */
449
- fare_basis_code: string;
450
- }
451
- export type BaggageType = 'carry_on' | 'checked';
452
- export interface OfferSliceSegmentPassengerBaggage {
453
- /**
454
- * The type of the baggage allowance
455
- */
456
- type: BaggageType;
457
- /**
458
- * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases.
459
- */
460
- quantity: number;
461
- }
462
- export interface ListOffersParams extends PaginationMeta {
463
- /**
464
- * Duffel's unique identifier for the offer request, returned when it was created
465
- */
466
- offer_request_id: string;
467
- /**
468
- * 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.
469
- */
470
- max_connections?: number;
471
- /**
472
- * By default, the offers will be returned sorted by ID in ascending order.
473
- * This parameter allows you to sort the list of offers by `total_amount` or `total_duration`.
474
- * 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`).
475
- */
476
- sort?: 'total_amount' | 'total_duration';
477
- }
478
- export interface LoyaltyProgrammeAccounts {
479
- /**
480
- * The passenger's account number for this Loyalty Programme Account
481
- */
482
- account_number: string;
483
- /**
484
- * The IATA code for the airline that this Loyalty Programme Account belongs to
485
- */
486
- airline_iata_code: string;
487
- }
488
- export interface UpdateOffer {
489
- type: string;
490
- loyalty_programme_accounts: LoyaltyProgrammeAccounts;
491
- id: string;
492
- given_name: string;
493
- family_name: string;
494
- age: number;
495
- }
1
+ import { CabinClass, FlightsConditions, LoyaltyProgrammeAccount, PassengerIdentityDocumentType, Place, PlaceType, Aircraft, Airline, Airport, PaginationMeta, DuffelPassengerType } from '../../types';
2
+ /**
3
+ * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria.
4
+ * @link https://duffel.com/docs/api/offers/schema
5
+ */
6
+ export interface Offer {
7
+ /**
8
+ * The types of identity documents that may be provided for the passengers when creating an order based on this offer.
9
+ * If this is `[]`, then you must not provide identity documents.
10
+ */
11
+ allowed_passenger_identity_document_types: PassengerIdentityDocumentType[];
12
+ /**
13
+ * The services that can be booked along with the offer but are not included by default, for example an additional checked bag.
14
+ * This field is only returned in the Get single offer endpoint.
15
+ * When there are no services available, or we don't support services for the airline, this list will be empty.
16
+ */
17
+ available_services: OfferAvailableService[];
18
+ /**
19
+ * The base price of the offer for all passengers, excluding taxes.
20
+ * It does not include the base amount of any service(s) that might be booked with the offer.
21
+ */
22
+ base_amount: string;
23
+ /**
24
+ * The currency of the `base_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
25
+ */
26
+ base_currency: string;
27
+ /**
28
+ * 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.
29
+ * 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`.
30
+ * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
31
+ * In some cases, you may need to contact the Duffel support team or the airline directly.
32
+ */
33
+ conditions: FlightsConditions;
34
+ /**
35
+ * The ISO 8601 datetime at which the offer was created
36
+ */
37
+ created_at: string;
38
+ /**
39
+ * The ISO 8601 datetime at which the offer will expire and no longer be usable to create an order
40
+ */
41
+ expires_at: string;
42
+ /**
43
+ * Duffel's unique identifier for the offer
44
+ */
45
+ id: string;
46
+ /**
47
+ * Whether the offer request was created in live mode.
48
+ * 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.
49
+ */
50
+ live_mode: boolean;
51
+ /**
52
+ * The airline which provided the offer
53
+ */
54
+ owner: Airline;
55
+ /**
56
+ * Whether identity documents must be provided for each of the passengers when creating an order based on this offer.
57
+ * If this is `true`, you must provide an identity document for every passenger.
58
+ */
59
+ passenger_identity_documents_required: boolean;
60
+ /**
61
+ * The passengers included in the offer
62
+ */
63
+ passengers: OfferPassenger[];
64
+ /**
65
+ * The payment requirements for this offer
66
+ */
67
+ payment_requirements: PaymentRequirements;
68
+ /**
69
+ * The private fares applied on this offer.
70
+ */
71
+ private_fares: OfferPrivateFare[];
72
+ /**
73
+ * The slices that make up this offer. Each slice will include one or more segments,
74
+ * the specific flights that the airline is offering to take the passengers from the slice's `origin` to its `destination`.
75
+ */
76
+ slices: OfferSlice[];
77
+ /**
78
+ * The amount of tax payable on the offer for all passengers
79
+ */
80
+ tax_amount: string | null;
81
+ /**
82
+ * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
83
+ */
84
+ tax_currency: string | null;
85
+ /**
86
+ * The total price of the offer for all passengers, including taxes.
87
+ * It does not include the total price of any service(s) that might be booked with the offer.
88
+ */
89
+ total_amount: string;
90
+ /**
91
+ * An estimate of the total carbon dioxide (CO₂) emissions when
92
+ * all of the passengers fly this offer's itinerary, measured in kilograms
93
+ */
94
+ total_emissions_kg: string;
95
+ /**
96
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
97
+ */
98
+ total_currency: string;
99
+ /**
100
+ * The ISO 8601 datetime at which the offer was last updated
101
+ */
102
+ updated_at: string;
103
+ /**
104
+ * Whether this is a partial or full offer.
105
+ * A partial offer can't be booked directly, but it can be combined with other partial offers to form a full offer.
106
+ * Partial offers are only ever returned through the multi-step search flow.
107
+ */
108
+ partial: boolean;
109
+ }
110
+ export interface OfferAvailableServiceBaggageMetadata {
111
+ /**
112
+ * The maximum weight that the baggage can have in kilograms.
113
+ */
114
+ maximum_weight_kg: number | null;
115
+ /**
116
+ * The maximum height that the baggage can have in centimetres.
117
+ */
118
+ maximum_height_cm: number | null;
119
+ /**
120
+ * The maximum length that the baggage can have in centimetres.
121
+ */
122
+ maximum_length_cm: number | null;
123
+ /**
124
+ * The maximum depth that the baggage can have in centimetres.
125
+ */
126
+ maximum_depth_cm: number | null;
127
+ /**
128
+ * The type of the baggage
129
+ */
130
+ type: BaggageType;
131
+ }
132
+ export interface OfferAvailableServiceCFARMetadata {
133
+ /**
134
+ * The amount the customer will receive back if the service is used, in
135
+ * `offer.total_currency`.
136
+ */
137
+ refund_amount: string;
138
+ /**
139
+ * Information to display to customers.
140
+ */
141
+ merchant_copy: string;
142
+ /**
143
+ * URL with the T&Cs for customers.
144
+ */
145
+ terms_and_conditions_url: string;
146
+ type: 'cancel_for_any_reason';
147
+ }
148
+ export interface OfferAvailableServiceCommon {
149
+ /**
150
+ * Duffel's unique identifier for the service.
151
+ */
152
+ id: string;
153
+ /**
154
+ * The maximum quantity of this service that can be booked with an order.
155
+ */
156
+ maximum_quantity: number;
157
+ /**
158
+ * The list of passenger `id`s the service applies to. If you add this
159
+ * service to an order it will apply to all the passengers in this list.
160
+ * For services where the type is `baggage`, this list will include only a
161
+ * single passenger.
162
+ */
163
+ passenger_ids: string[];
164
+ /**
165
+ * The list of segment `id`s the service applies to. If you add this
166
+ * service to an order it will apply to all the segments in this list. For
167
+ * services where the type is `baggage`, depending on the airline, this
168
+ * list includes all the segments of all slices or all the segments of a
169
+ * single slice.
170
+ */
171
+ segment_ids: string[];
172
+ /**
173
+ * The total price of the service for all passengers and segments it
174
+ * applies to, including taxes. This price is for a single unit of the
175
+ * service.
176
+ */
177
+ total_amount: string;
178
+ /**
179
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
180
+ * currency code. It will match your organisation's billing currency unless
181
+ * you’re using Duffel as an accredited IATA agent, in which case it will be
182
+ * in the currency provided by the airline (which will usually be based on the
183
+ * country where your IATA agency is registered).
184
+ */
185
+ total_currency: string;
186
+ }
187
+ export interface OfferAvailableServiceBaggage extends OfferAvailableServiceCommon {
188
+ /**
189
+ * The metadata varies by the type of service. It includes further data
190
+ * about the service. For example, for baggages, it may have data about
191
+ * size and weight restrictions.
192
+ */
193
+ metadata: OfferAvailableServiceBaggageMetadata;
194
+ /**
195
+ * The type of the service.
196
+ */
197
+ type: 'baggage';
198
+ }
199
+ export interface OfferAvailableServiceCFAR extends OfferAvailableServiceCommon {
200
+ /**
201
+ * The metadata varies by the type of service. It includes further data
202
+ * about the service. For example, for baggages, it may have data about
203
+ * size and weight restrictions.
204
+ */
205
+ metadata: OfferAvailableServiceCFARMetadata;
206
+ /**
207
+ * The type of the service.
208
+ */
209
+ type: 'cancel_for_any_reason';
210
+ }
211
+ export type OfferAvailableService = OfferAvailableServiceBaggage | OfferAvailableServiceCFAR;
212
+ export interface PaymentRequirements {
213
+ /**
214
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime by which
215
+ * you must pay for this order. At this time, if still unpaid, the reserved
216
+ * space on the flight(s) will be released and you will have to create a new
217
+ * order. This will be null only for orders where `awaiting_payment` is
218
+ * `false`.
219
+ */
220
+ payment_required_by: string | null;
221
+ /**
222
+ * The ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the
223
+ * price associated with the order will no longer be guaranteed by the airline
224
+ * and may change before payment. This will be null when
225
+ * `requires_instant_payment` is `true`.
226
+ */
227
+ price_guarantee_expires_at: string | null;
228
+ /**
229
+ * When payment is required at the time of booking this will be true and
230
+ * `payment_required_by` and `price_guarantee_expires_at` will be `null`. When
231
+ * payment can be made at a time after booking, this will be `false` and the
232
+ * time limits on the payment will be provided in `payment_required_by` and
233
+ * `price_guarantee_expires_at`.
234
+ */
235
+ requires_instant_payment: boolean;
236
+ }
237
+ export interface OfferPrivateFare {
238
+ /**
239
+ * The corporate code that was applied, if any.
240
+ */
241
+ corporate_code?: string;
242
+ /**
243
+ * The tracking reference that was applied, if any.
244
+ */
245
+ tracking_reference?: string;
246
+ /**
247
+ * The type of private fare applied.
248
+ */
249
+ type: 'corporate' | 'leisure' | 'negotiated';
250
+ }
251
+ export interface OfferPassenger {
252
+ /**
253
+ * The age of the passenger on the departure_date of the final slice.
254
+ */
255
+ age?: number;
256
+ /**
257
+ * The type of the passenger.
258
+ */
259
+ type?: DuffelPassengerType;
260
+ /**
261
+ * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
262
+ * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
263
+ * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
264
+ * characters.
265
+ *
266
+ * This is only required if you're also including **Loyalty Programme Accounts**.
267
+ */
268
+ family_name?: string;
269
+ /**
270
+ * The passenger's given name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
271
+ * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
272
+ * other characters will result in a validation error. The minimum length is 1 character, and the maximum is 20
273
+ * characters.
274
+ *
275
+ * This is only required if you're also including **Loyalty Programme Accounts**.
276
+ */
277
+ given_name?: string;
278
+ /**
279
+ * The **Loyalty Programme Accounts** for this passenger.
280
+ */
281
+ loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
282
+ /**
283
+ * The identifier for the passenger, unique within this Offer Request and across all Offer Requests.
284
+ * This ID will be generated by Duffel unless you had optionally provided one.
285
+ * Optionally providing one has been deprecated.
286
+ */
287
+ id: string;
288
+ }
289
+ export interface OfferSlice {
290
+ /**
291
+ * The type of the destination
292
+ */
293
+ destination_type: PlaceType;
294
+ /**
295
+ * The city or airport where this slice ends
296
+ */
297
+ destination: Place;
298
+ /**
299
+ * The type of the origin
300
+ */
301
+ origin_type: PlaceType;
302
+ /**
303
+ * The city or airport where this slice begins
304
+ */
305
+ origin: Place;
306
+ /**
307
+ * The duration of the slice, represented as a ISO 8601 duration
308
+ */
309
+ duration: string | null;
310
+ /**
311
+ * The name of the fare brand associated with this slice.
312
+ * A fare brand specifies the travel conditions you get on your slice made available
313
+ * by the airline. e.g. a British Airways Economy Basic fare will only include a hand baggage allowance.
314
+ * It is worth noting that the fare brand names are defined by the airlines themselves and therefore they
315
+ * are subject to change without any prior notice. We're in the process of adding support for fare_brand_name across
316
+ * all our airlines, so for now, this field may be null in some offers.
317
+ * This will become a non-nullable attribute in the near future.
318
+ */
319
+ fare_brand_name: string | null;
320
+ /**
321
+ * 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
322
+ */
323
+ id: string;
324
+ /**
325
+ * The segments - that is, specific flights - that the airline is offering to get the passengers from the `origin` to the `destination`
326
+ */
327
+ segments: OfferSliceSegment[];
328
+ /**
329
+ * 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.
330
+ * 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.
331
+ * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
332
+ * In some cases, you may need to contact the Duffel support team or the airline directly.
333
+ */
334
+ conditions: FlightsConditions;
335
+ }
336
+ export interface OfferSliceSegment {
337
+ /**
338
+ * The aircraft that the operating carrier will use to operate this segment
339
+ */
340
+ aircraft: Aircraft;
341
+ /**
342
+ * The ISO 8601 datetime at which the segment is scheduled to arrive
343
+ */
344
+ arriving_at: string;
345
+ /**
346
+ * The terminal at the destination airport where the segment is scheduled to arrive
347
+ */
348
+ destination_terminal: string | null;
349
+ /**
350
+ * The ISO 8601 datetime at which the segment is scheduled to depart
351
+ */
352
+ departing_at: string;
353
+ /**
354
+ * The terminal at the origin airport from which the segment is scheduled to depart
355
+ */
356
+ origin_terminal: string | null;
357
+ /**
358
+ * The airport at which the segment is scheduled to arrive
359
+ */
360
+ destination: Airport;
361
+ /**
362
+ * The distance of the segment in kilometres
363
+ */
364
+ distance: string | null;
365
+ /**
366
+ * The duration of the segment, represented as a ISO 8601 duration
367
+ */
368
+ duration: string | null;
369
+ /**
370
+ * 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
371
+ */
372
+ id: string;
373
+ /**
374
+ * The airline selling the tickets for this segment.
375
+ * This may differ from the `operating_carrier` in the case of a "codeshare", where one airline sells flights operated by another airline.
376
+ */
377
+ marketing_carrier: Airline;
378
+ /**
379
+ * The flight number assigned by the marketing carrier
380
+ */
381
+ marketing_carrier_flight_number: string;
382
+ /**
383
+ * The airport from which the flight is scheduled to depart
384
+ */
385
+ origin: Airport;
386
+ /**
387
+ * The airline actually operating this segment.
388
+ * This may differ from the marketing_carrier in the case of a "codeshare", where one airline sells flights operated by another airline.
389
+ */
390
+ operating_carrier: Airline;
391
+ /**
392
+ * The flight number assigned by the operating carrier
393
+ */
394
+ operating_carrier_flight_number: string;
395
+ /**
396
+ * 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)
397
+ */
398
+ passengers: OfferSliceSegmentPassenger[];
399
+ /**
400
+ * Additional segment-specific information about the stops, if any, included in the segment
401
+ */
402
+ stops?: OfferSliceSegmentStop[];
403
+ }
404
+ export interface OfferSliceSegmentStop {
405
+ /**
406
+ * Duffel's unique identifier for the Stop
407
+ */
408
+ id: string;
409
+ /**
410
+ * The airport at which the Stop happens
411
+ */
412
+ airport: Airport;
413
+ /**
414
+ * The ISO 8601 datetime at which the Stop is scheduled to arrive, in the airport's timezone (see destination.timezone)
415
+ */
416
+ arrivingAt: string;
417
+ /**
418
+ * The ISO 8601 datetime at which the Stop is scheduled to depart, in the airport's timezone (see origin.timezone)
419
+ */
420
+ departingAt: string;
421
+ /**
422
+ * The duration of the Stop, represented as a ISO 8601 duration
423
+ */
424
+ duration: string;
425
+ }
426
+ export interface OfferSliceSegmentPassenger {
427
+ /**
428
+ * The baggage allowances for the passenger on this segment included in the offer.
429
+ * Some airlines may allow additional baggage to be booked as a service - see the offer's available_services.
430
+ */
431
+ baggages: OfferSliceSegmentPassengerBaggage[];
432
+ /**
433
+ * The cabin class that the passenger will travel in on this segment
434
+ */
435
+ cabin_class: CabinClass;
436
+ /**
437
+ * The name that the marketing carrier uses to market this cabin class
438
+ */
439
+ cabin_class_marketing_name: string;
440
+ /**
441
+ * The identifier for the passenger.
442
+ * You may have specified this ID yourself when creating the offer request, or otherwise, Duffel will have generated its own random ID.
443
+ */
444
+ passenger_id: string;
445
+ /**
446
+ * The airline's alphanumeric code for the fare that the passenger is using to travel. Where this is `null`, it means that either the
447
+ * fare basis code is not available or the airline does not use fare basis codes.
448
+ */
449
+ fare_basis_code: string;
450
+ }
451
+ export type BaggageType = 'carry_on' | 'checked';
452
+ export interface OfferSliceSegmentPassengerBaggage {
453
+ /**
454
+ * The type of the baggage allowance
455
+ */
456
+ type: BaggageType;
457
+ /**
458
+ * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases.
459
+ */
460
+ quantity: number;
461
+ }
462
+ export interface ListOffersParams extends PaginationMeta {
463
+ /**
464
+ * Duffel's unique identifier for the offer request, returned when it was created
465
+ */
466
+ offer_request_id: string;
467
+ /**
468
+ * 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.
469
+ */
470
+ max_connections?: number;
471
+ /**
472
+ * By default, the offers will be returned sorted by ID in ascending order.
473
+ * This parameter allows you to sort the list of offers by `total_amount` or `total_duration`.
474
+ * 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`).
475
+ */
476
+ sort?: 'total_amount' | 'total_duration';
477
+ }
478
+ export interface LoyaltyProgrammeAccounts {
479
+ /**
480
+ * The passenger's account number for this Loyalty Programme Account
481
+ */
482
+ account_number: string;
483
+ /**
484
+ * The IATA code for the airline that this Loyalty Programme Account belongs to
485
+ */
486
+ airline_iata_code: string;
487
+ }
488
+ export interface UpdateOffer {
489
+ type: string;
490
+ loyalty_programme_accounts: LoyaltyProgrammeAccounts;
491
+ id: string;
492
+ given_name: string;
493
+ family_name: string;
494
+ age: number;
495
+ }