@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,500 +1,500 @@
1
- import { Aircraft, Airline, AirlineInitiatedChange, CabinClass, DuffelPassengerGender, DuffelPassengerTitle, DuffelPassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferAvailableServiceBaggage, OfferAvailableServiceBaggageMetadata, PassengerIdentityDocumentType, PaymentType, Place, PlaceType } from '../../types';
2
- /**
3
- * An object containing metadata about the service, like the designator of the seat.
4
- */
5
- export interface Seat {
6
- /**
7
- * The designator used to uniquely identify the seat, usually made up of a row number and a column letter
8
- * @example "14B"
9
- */
10
- designator: string;
11
- /**
12
- * 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.
13
- * @example "["Do not seat children in exit row seats","Do not seat passengers with special needs in exit row seats"]"
14
- */
15
- disclosures: string[];
16
- /**
17
- * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features
18
- * @example "Exit row seat"
19
- */
20
- name: string;
21
- }
22
- /**
23
- * An object containing metadata about the service, like the maximum weight and dimensions of the baggage.
24
- */
25
- export type OrderServiceBaggageMetadata = OfferAvailableServiceBaggageMetadata;
26
- export interface OrderSegmentPassengerBaggage {
27
- /**
28
- * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases.
29
- */
30
- quantity: number;
31
- /**
32
- * The type of the baggage allowance
33
- */
34
- type: 'checked' | 'carry_on';
35
- }
36
- /**
37
- * 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.
38
- * @link https://duffel.com/docs/api/orders/schema
39
- */
40
- export interface OrderService {
41
- /**
42
- * Duffel's unique identifier for the booked service
43
- * @example "ser_00009UhD4ongolulWd9123"
44
- */
45
- id: string;
46
- /**
47
- * The metadata varies by the type of service. It includes further data about the service.
48
- * For example, for baggages, it may have data about size and weight restrictions.
49
- */
50
- metadata?: OrderServiceBaggageMetadata | Seat;
51
- /**
52
- * List of passenger ids the service applies to. The service applies to all the passengers in this list.
53
- * @example ["pas_00009hj8USM7Ncg31cBCLL"]
54
- */
55
- passenger_ids: string[];
56
- /**
57
- * The quantity of the service that was booked
58
- * @example 1
59
- */
60
- quantity: number;
61
- /**
62
- * List of segment `ids` the service applies to. The service applies to all the segments in this list.
63
- * @example "["seg_00009hj8USM7Ncg31cB456"]"
64
- */
65
- segment_ids: string[];
66
- /**
67
- * The total price of the service for all passengers and segments it applies to, accounting for quantity and including taxes
68
- * @example "15.00"
69
- */
70
- total_amount: string;
71
- /**
72
- * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
73
- * 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).
74
- * @example "GBP"
75
- */
76
- total_currency: string;
77
- /**
78
- * The type of the service.
79
- * 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.
80
- */
81
- type: 'baggage' | 'seat';
82
- }
83
- export interface OrderSegmentPassenger {
84
- /**
85
- * The baggage allowances for the passenger on this segment that were included in the original offer.
86
- * Any extra baggage items which were booked as services will be listed in the services field instead of here.
87
- */
88
- baggages: OrderSegmentPassengerBaggage[];
89
- /**
90
- * The cabin class that the passenger will travel in on this segment
91
- */
92
- cabin_class: CabinClass;
93
- /**
94
- * The name that the marketing carrier uses to market this cabin class
95
- */
96
- cabin_class_marketing_name: string;
97
- /**
98
- * 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.
99
- */
100
- passenger_id?: string;
101
- /**
102
- * An object containing metadata about the service, like the designator of the seat.
103
- */
104
- seat?: Seat;
105
- }
106
- export interface OrderPassenger {
107
- id: string;
108
- /**
109
- * The passenger's date of birth
110
- * @example "1987-07-24"
111
- */
112
- born_on: string;
113
- /**
114
- * The passenger's family name
115
- * @example "Earheart"
116
- */
117
- family_name: string;
118
- /**
119
- * The passenger's given name
120
- * @xample "Amelia"
121
- */
122
- given_name: string;
123
- /**
124
- * The passenger's gender
125
- * @return "m" or "f"
126
- */
127
- gender: DuffelPassengerGender;
128
- /**
129
- * The passenger's title
130
- * @returns "mr", "ms", "mrs", or "miss"
131
- */
132
- title: DuffelPassengerTitle;
133
- /**
134
- * The type of the passenger
135
- * @return "adult", "child", or "infant_without_seat"
136
- */
137
- type: DuffelPassengerType;
138
- /**
139
- * The id of the infant associated with this passenger
140
- * @return "adult", "child", or "infant_without_seat"
141
- */
142
- infant_passenger_id?: string | null;
143
- /**
144
- * The **Loyalty Programme Accounts** for this passenger.
145
- */
146
- loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
147
- }
148
- export interface OrderPassengerIdentityDocument {
149
- /**
150
- * The type of the identity document. This must be one of the allowed_passenger_identity_document_types on the offer.
151
- */
152
- type: PassengerIdentityDocumentType;
153
- /**
154
- * The unique identifier of the identity document
155
- */
156
- unique_identifier: string;
157
- /**
158
- * The ISO 3166-1 alpha-2 code of the country that issued this identity document
159
- */
160
- issuing_country_code: string;
161
- /**
162
- * The date on which the identity document expires
163
- */
164
- expires_on: string;
165
- }
166
- export interface CreateOrderPassenger extends Omit<OrderPassenger, 'type'> {
167
- /**
168
- * 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.
169
- */
170
- identity_documents?: OrderPassengerIdentityDocument[];
171
- /**
172
- * The passenger's email address
173
- * @example "amelia@duffel.com"
174
- */
175
- email: string;
176
- /**
177
- * The passenger's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) (international) format
178
- * @example "+442080160509"
179
- */
180
- phone_number: string;
181
- /**
182
- * @deprecated This type is here just for the backward-compatibility until the field is officially removed from the API
183
- *
184
- * The type of the passenger
185
- * @example "adult", "child", or "infant_without_seat"
186
- */
187
- type?: DuffelPassengerType;
188
- }
189
- export interface OrderSliceSegment {
190
- /**
191
- * The aircraft that the operating carrier will use to operate this segment
192
- */
193
- aircraft?: Aircraft;
194
- /**
195
- * 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)
196
- */
197
- arriving_at: string;
198
- /**
199
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the segment is scheduled to depart, in the origin airport timezone
200
- */
201
- departing_at: string;
202
- /**
203
- * The city or airport where this slice ends
204
- */
205
- destination: Place;
206
- /**
207
- * The terminal at the destination airport where the segment is scheduled to arrive
208
- * @example "5"
209
- */
210
- destination_terminal?: string | null;
211
- /**
212
- * The duration of the segment, represented as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) duration
213
- */
214
- duration?: string;
215
- /**
216
- * Duffel's unique identifier for the segment.
217
- * It identifies the segment of an order (i.e. the same segment across orders will have different ids.
218
- */
219
- id: string;
220
- /**
221
- * 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.
222
- */
223
- marketing_carrier: Airline;
224
- /**
225
- * The flight number assigned by the marketing carrier
226
- * @example "1234"
227
- */
228
- marketing_carrier_flight_number: string;
229
- /**
230
- * 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.
231
- */
232
- operating_carrier: Airline;
233
- /**
234
- * 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`.
235
- * @example "4321"
236
- */
237
- operating_carrier_flight_number: string;
238
- /**
239
- * The city or airport where this slice begins
240
- */
241
- origin: Place;
242
- /**
243
- * The terminal at the origin airport from which the segment is scheduled to depart
244
- * @example "B"
245
- */
246
- origin_terminal?: string | null;
247
- /**
248
- * 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)
249
- */
250
- passengers: OrderSegmentPassenger[];
251
- /**
252
- * The distance of the segment in kilometres
253
- * @example "424.2"
254
- */
255
- distance?: string | null;
256
- }
257
- export interface OrderSlice {
258
- /**
259
- * Whether this slice can be changed. This can only be true for paid orders.
260
- */
261
- changeable: boolean | null;
262
- /**
263
- * The conditions associated with this slice, describing the kinds of modifications you can make and any penalties that will apply to those modifications.
264
- * 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.
265
- */
266
- conditions: FlightsConditions;
267
- /**
268
- * The city or airport where this slice ends
269
- */
270
- destination: Place;
271
- /**
272
- * The type of the destination
273
- */
274
- destination_type: PlaceType;
275
- /**
276
- * The city or airport where this slice begins
277
- */
278
- origin: Place;
279
- /**
280
- * The type of the origin
281
- */
282
- origin_type: PlaceType;
283
- /**
284
- * 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.
285
- */
286
- id: string;
287
- /**
288
- * The duration of the slice, represented as a ISO 8601 duration
289
- */
290
- duration: string | null;
291
- /**
292
- * The segments - that is, specific flights - that the airline is offering to get the passengers from the origin to the destination
293
- */
294
- segments: OrderSliceSegment[];
295
- }
296
- export interface OrderPaymentStatus {
297
- /**
298
- * Whether a payment has been made, or the airline is waiting for a payment to be made
299
- */
300
- awaiting_payment: boolean;
301
- /**
302
- * The ISO 8601 datetime by which you must pay for this order.
303
- * At this time, if still unpaid, the reserved space on the flight(s)
304
- * will be released and you will have to create a new order.
305
- * This will be null only for orders where `awaiting_payment` is `false`.
306
- * Payment Required by means it will hold space
307
- */
308
- payment_required_by?: string;
309
- /**
310
- * The ISO 8601 datetime at which the price associated
311
- * with the order will no longer be guaranteed by the airline
312
- * and the order will need to be repriced before payment.
313
- * This can be null when there is no price guarantee.
314
- * Price Guarantee means it will hold price
315
- */
316
- price_guarantee_expires_at?: string;
317
- }
318
- /**
319
- * The type of document
320
- * @returns "electronic_ticket", "electronic_miscellaneous_document_associated", or "electronic_miscellaneous_document_standalone"
321
- */
322
- export type OrderDocumentsType = 'electronic_ticket' | 'electronic_miscellaneous_document_associated' | 'electronic_miscellaneous_document_standalone';
323
- export interface OrderDocument {
324
- /**
325
- * The identifier for the document, in the case of electronic
326
- * tickets this string represents the payment or the entitlement to fly.
327
- * @example "1252106312810"
328
- */
329
- unique_identifier: string;
330
- /**
331
- * The type of document
332
- */
333
- type: OrderDocumentsType;
334
- }
335
- export interface OrderPayment {
336
- /**
337
- * The type of payment you want to apply to the order.
338
- * 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`.
339
- * Otherwise, you must pay using your Duffel account's `balance` by specifying balance. In test mode, your balance is unlimited.
340
- * 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).
341
- */
342
- type: PaymentType;
343
- /**
344
- * 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`.
345
- * @example "30.20"
346
- */
347
- amount: string;
348
- /**
349
- * 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.
350
- * @example "GBP"
351
- */
352
- currency: string;
353
- }
354
- export interface Order {
355
- /**
356
- * The amount of tax payable on the order for all the flights booked
357
- */
358
- tax_amount?: string;
359
- /**
360
- * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
361
- */
362
- tax_currency: string;
363
- /**
364
- * The total price of the order for all the flights and services booked, including taxes
365
- */
366
- total_amount: string;
367
- /**
368
- * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
369
- */
370
- total_currency: string;
371
- /**
372
- * The [slices](https://duffel.com/docs/api/overview/key-principles) that make up the itinerary of this order.
373
- * One-way journeys can be expressed using one slice,
374
- * whereas return trips will need two.
375
- */
376
- slices: OrderSlice[];
377
- /**
378
- * The services booked along with this order
379
- */
380
- services: OrderService[];
381
- /**
382
- * The passengers who are travelling
383
- */
384
- passengers: OrderPassenger[];
385
- /**
386
- * The payment status for this order
387
- *
388
- */
389
- payment_status: OrderPaymentStatus;
390
- /**
391
- * The airline who owns the order
392
- */
393
- owner: Airline;
394
- /**
395
- * Whether the order was created in live mode.
396
- * This field will be set to true if the order was created
397
- * in live mode, or false if it was created in test mode.
398
- */
399
- live_mode: boolean;
400
- /**
401
- * Duffel's unique identifier for the order
402
- */
403
- id: string;
404
- /**
405
- * The documents issued for this order.
406
- */
407
- documents?: OrderDocument[];
408
- /**
409
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was created
410
- */
411
- created_at: string;
412
- /**
413
- * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was cancelled, if it has been cancelled
414
- */
415
- cancelled_at?: string | null;
416
- /**
417
- * The airline's reference for the order, sometimes known as a
418
- * "passenger name record" (PNR) or "record locator".
419
- * Your customers can use this to check in and manage
420
- * their booking on the airline's website.
421
- */
422
- booking_reference: string;
423
- /**
424
- * The currency of the base_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
425
- * It will match your organisation's billing currency unless you're
426
- * using Duffel as an accredited IATA agent, in which case it will
427
- * be in the currency provided by the airline (which will usually
428
- * be based on the country where your IATA agency is registered).
429
- */
430
- base_currency: string;
431
- /**
432
- * The base price of the order for all flights and services booked, excluding taxes
433
- */
434
- base_amount: string;
435
- /**
436
- * 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.
437
- *
438
- * 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`.
439
- *
440
- * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
441
- *
442
- * In some cases, you may need to contact the Duffel support team or the airline directly.
443
- */
444
- conditions: FlightsConditions;
445
- /**
446
- * Metadata contains a set of key-value pairs that you can attach to an object.
447
- * It can be useful for storing additional information about the object, in a structured format.
448
- * Duffel does not use this information.
449
- * You should not store sensitive information in this field.
450
- */
451
- metadata: Record<string, string>;
452
- /**
453
- * The airline-initiated changes for this order.
454
- */
455
- airline_initiated_changes?: AirlineInitiatedChange[];
456
- }
457
- export interface CreateOrder {
458
- /**
459
- * The `id`s of the offers you want to book. You must specify an array containing exactly one selected offer.
460
- */
461
- selected_offers: string[];
462
- /**
463
- * The services you want to book along with the first selected offer.
464
- */
465
- services?: Pick<OrderService, 'id' | 'quantity'>[];
466
- /**
467
- * The personal details of the passengers, expanding on the information initially provided when creating the offer request
468
- */
469
- passengers: CreateOrderPassenger[];
470
- /**
471
- * The payment details to use to pay for the order
472
- */
473
- payments?: OrderPayment[];
474
- /**
475
- * The payment action you want to take for your order. You can only use pay_later with offers that contain requires_instant_payment: false.
476
- */
477
- type: 'instant' | 'pay_later';
478
- }
479
- export interface ListParamsOrders {
480
- /**
481
- * Whether to filter orders that are awaiting payment or not. If not specified, all orders regardless of their payment state will be returned.
482
- */
483
- awaiting_payment?: boolean;
484
- /**
485
- * Whether to filter orders matching a passenger name. Partial and exact matches in given and family names will be returned.
486
- */
487
- 'passenger_name[]'?: string[];
488
- /**
489
- * Whether to filter orders matching a given passenger name record (PNR)
490
- */
491
- booking_reference?: string;
492
- }
493
- export interface UpdateSingleOrder {
494
- metadata: Order['metadata'];
495
- }
496
- export interface AddServices {
497
- payment: OrderPayment;
498
- add_services: Pick<OrderService, 'id' | 'quantity'>[];
499
- }
500
- export type OrderAvailableService = OfferAvailableServiceBaggage;
1
+ import { Aircraft, Airline, AirlineInitiatedChange, CabinClass, DuffelPassengerGender, DuffelPassengerTitle, DuffelPassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferAvailableServiceBaggage, OfferAvailableServiceBaggageMetadata, PassengerIdentityDocumentType, PaymentType, Place, PlaceType } from '../../types';
2
+ /**
3
+ * An object containing metadata about the service, like the designator of the seat.
4
+ */
5
+ export interface Seat {
6
+ /**
7
+ * The designator used to uniquely identify the seat, usually made up of a row number and a column letter
8
+ * @example "14B"
9
+ */
10
+ designator: string;
11
+ /**
12
+ * 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.
13
+ * @example "["Do not seat children in exit row seats","Do not seat passengers with special needs in exit row seats"]"
14
+ */
15
+ disclosures: string[];
16
+ /**
17
+ * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features
18
+ * @example "Exit row seat"
19
+ */
20
+ name: string;
21
+ }
22
+ /**
23
+ * An object containing metadata about the service, like the maximum weight and dimensions of the baggage.
24
+ */
25
+ export type OrderServiceBaggageMetadata = OfferAvailableServiceBaggageMetadata;
26
+ export interface OrderSegmentPassengerBaggage {
27
+ /**
28
+ * The number of this type of bag allowed on the segment. Note that this can currently be 0 in some cases.
29
+ */
30
+ quantity: number;
31
+ /**
32
+ * The type of the baggage allowance
33
+ */
34
+ type: 'checked' | 'carry_on';
35
+ }
36
+ /**
37
+ * 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.
38
+ * @link https://duffel.com/docs/api/orders/schema
39
+ */
40
+ export interface OrderService {
41
+ /**
42
+ * Duffel's unique identifier for the booked service
43
+ * @example "ser_00009UhD4ongolulWd9123"
44
+ */
45
+ id: string;
46
+ /**
47
+ * The metadata varies by the type of service. It includes further data about the service.
48
+ * For example, for baggages, it may have data about size and weight restrictions.
49
+ */
50
+ metadata?: OrderServiceBaggageMetadata | Seat;
51
+ /**
52
+ * List of passenger ids the service applies to. The service applies to all the passengers in this list.
53
+ * @example ["pas_00009hj8USM7Ncg31cBCLL"]
54
+ */
55
+ passenger_ids: string[];
56
+ /**
57
+ * The quantity of the service that was booked
58
+ * @example 1
59
+ */
60
+ quantity: number;
61
+ /**
62
+ * List of segment `ids` the service applies to. The service applies to all the segments in this list.
63
+ * @example "["seg_00009hj8USM7Ncg31cB456"]"
64
+ */
65
+ segment_ids: string[];
66
+ /**
67
+ * The total price of the service for all passengers and segments it applies to, accounting for quantity and including taxes
68
+ * @example "15.00"
69
+ */
70
+ total_amount: string;
71
+ /**
72
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
73
+ * 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).
74
+ * @example "GBP"
75
+ */
76
+ total_currency: string;
77
+ /**
78
+ * The type of the service.
79
+ * 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.
80
+ */
81
+ type: 'baggage' | 'seat';
82
+ }
83
+ export interface OrderSegmentPassenger {
84
+ /**
85
+ * The baggage allowances for the passenger on this segment that were included in the original offer.
86
+ * Any extra baggage items which were booked as services will be listed in the services field instead of here.
87
+ */
88
+ baggages: OrderSegmentPassengerBaggage[];
89
+ /**
90
+ * The cabin class that the passenger will travel in on this segment
91
+ */
92
+ cabin_class: CabinClass;
93
+ /**
94
+ * The name that the marketing carrier uses to market this cabin class
95
+ */
96
+ cabin_class_marketing_name: string;
97
+ /**
98
+ * 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.
99
+ */
100
+ passenger_id?: string;
101
+ /**
102
+ * An object containing metadata about the service, like the designator of the seat.
103
+ */
104
+ seat?: Seat;
105
+ }
106
+ export interface OrderPassenger {
107
+ id: string;
108
+ /**
109
+ * The passenger's date of birth
110
+ * @example "1987-07-24"
111
+ */
112
+ born_on: string;
113
+ /**
114
+ * The passenger's family name
115
+ * @example "Earheart"
116
+ */
117
+ family_name: string;
118
+ /**
119
+ * The passenger's given name
120
+ * @xample "Amelia"
121
+ */
122
+ given_name: string;
123
+ /**
124
+ * The passenger's gender
125
+ * @return "m" or "f"
126
+ */
127
+ gender: DuffelPassengerGender;
128
+ /**
129
+ * The passenger's title
130
+ * @returns "mr", "ms", "mrs", or "miss"
131
+ */
132
+ title: DuffelPassengerTitle;
133
+ /**
134
+ * The type of the passenger
135
+ * @return "adult", "child", or "infant_without_seat"
136
+ */
137
+ type: DuffelPassengerType;
138
+ /**
139
+ * The id of the infant associated with this passenger
140
+ * @return "adult", "child", or "infant_without_seat"
141
+ */
142
+ infant_passenger_id?: string | null;
143
+ /**
144
+ * The **Loyalty Programme Accounts** for this passenger.
145
+ */
146
+ loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
147
+ }
148
+ export interface OrderPassengerIdentityDocument {
149
+ /**
150
+ * The type of the identity document. This must be one of the allowed_passenger_identity_document_types on the offer.
151
+ */
152
+ type: PassengerIdentityDocumentType;
153
+ /**
154
+ * The unique identifier of the identity document
155
+ */
156
+ unique_identifier: string;
157
+ /**
158
+ * The ISO 3166-1 alpha-2 code of the country that issued this identity document
159
+ */
160
+ issuing_country_code: string;
161
+ /**
162
+ * The date on which the identity document expires
163
+ */
164
+ expires_on: string;
165
+ }
166
+ export interface CreateOrderPassenger extends Omit<OrderPassenger, 'type'> {
167
+ /**
168
+ * 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.
169
+ */
170
+ identity_documents?: OrderPassengerIdentityDocument[];
171
+ /**
172
+ * The passenger's email address
173
+ * @example "amelia@duffel.com"
174
+ */
175
+ email: string;
176
+ /**
177
+ * The passenger's phone number in [E.164](https://www.twilio.com/docs/glossary/what-e164) (international) format
178
+ * @example "+442080160509"
179
+ */
180
+ phone_number: string;
181
+ /**
182
+ * @deprecated This type is here just for the backward-compatibility until the field is officially removed from the API
183
+ *
184
+ * The type of the passenger
185
+ * @example "adult", "child", or "infant_without_seat"
186
+ */
187
+ type?: DuffelPassengerType;
188
+ }
189
+ export interface OrderSliceSegment {
190
+ /**
191
+ * The aircraft that the operating carrier will use to operate this segment
192
+ */
193
+ aircraft?: Aircraft;
194
+ /**
195
+ * 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)
196
+ */
197
+ arriving_at: string;
198
+ /**
199
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the segment is scheduled to depart, in the origin airport timezone
200
+ */
201
+ departing_at: string;
202
+ /**
203
+ * The city or airport where this slice ends
204
+ */
205
+ destination: Place;
206
+ /**
207
+ * The terminal at the destination airport where the segment is scheduled to arrive
208
+ * @example "5"
209
+ */
210
+ destination_terminal?: string | null;
211
+ /**
212
+ * The duration of the segment, represented as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) duration
213
+ */
214
+ duration?: string;
215
+ /**
216
+ * Duffel's unique identifier for the segment.
217
+ * It identifies the segment of an order (i.e. the same segment across orders will have different ids.
218
+ */
219
+ id: string;
220
+ /**
221
+ * 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.
222
+ */
223
+ marketing_carrier: Airline;
224
+ /**
225
+ * The flight number assigned by the marketing carrier
226
+ * @example "1234"
227
+ */
228
+ marketing_carrier_flight_number: string;
229
+ /**
230
+ * 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.
231
+ */
232
+ operating_carrier: Airline;
233
+ /**
234
+ * 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`.
235
+ * @example "4321"
236
+ */
237
+ operating_carrier_flight_number: string;
238
+ /**
239
+ * The city or airport where this slice begins
240
+ */
241
+ origin: Place;
242
+ /**
243
+ * The terminal at the origin airport from which the segment is scheduled to depart
244
+ * @example "B"
245
+ */
246
+ origin_terminal?: string | null;
247
+ /**
248
+ * 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)
249
+ */
250
+ passengers: OrderSegmentPassenger[];
251
+ /**
252
+ * The distance of the segment in kilometres
253
+ * @example "424.2"
254
+ */
255
+ distance?: string | null;
256
+ }
257
+ export interface OrderSlice {
258
+ /**
259
+ * Whether this slice can be changed. This can only be true for paid orders.
260
+ */
261
+ changeable: boolean | null;
262
+ /**
263
+ * The conditions associated with this slice, describing the kinds of modifications you can make and any penalties that will apply to those modifications.
264
+ * 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.
265
+ */
266
+ conditions: FlightsConditions;
267
+ /**
268
+ * The city or airport where this slice ends
269
+ */
270
+ destination: Place;
271
+ /**
272
+ * The type of the destination
273
+ */
274
+ destination_type: PlaceType;
275
+ /**
276
+ * The city or airport where this slice begins
277
+ */
278
+ origin: Place;
279
+ /**
280
+ * The type of the origin
281
+ */
282
+ origin_type: PlaceType;
283
+ /**
284
+ * 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.
285
+ */
286
+ id: string;
287
+ /**
288
+ * The duration of the slice, represented as a ISO 8601 duration
289
+ */
290
+ duration: string | null;
291
+ /**
292
+ * The segments - that is, specific flights - that the airline is offering to get the passengers from the origin to the destination
293
+ */
294
+ segments: OrderSliceSegment[];
295
+ }
296
+ export interface OrderPaymentStatus {
297
+ /**
298
+ * Whether a payment has been made, or the airline is waiting for a payment to be made
299
+ */
300
+ awaiting_payment: boolean;
301
+ /**
302
+ * The ISO 8601 datetime by which you must pay for this order.
303
+ * At this time, if still unpaid, the reserved space on the flight(s)
304
+ * will be released and you will have to create a new order.
305
+ * This will be null only for orders where `awaiting_payment` is `false`.
306
+ * Payment Required by means it will hold space
307
+ */
308
+ payment_required_by?: string;
309
+ /**
310
+ * The ISO 8601 datetime at which the price associated
311
+ * with the order will no longer be guaranteed by the airline
312
+ * and the order will need to be repriced before payment.
313
+ * This can be null when there is no price guarantee.
314
+ * Price Guarantee means it will hold price
315
+ */
316
+ price_guarantee_expires_at?: string;
317
+ }
318
+ /**
319
+ * The type of document
320
+ * @returns "electronic_ticket", "electronic_miscellaneous_document_associated", or "electronic_miscellaneous_document_standalone"
321
+ */
322
+ export type OrderDocumentsType = 'electronic_ticket' | 'electronic_miscellaneous_document_associated' | 'electronic_miscellaneous_document_standalone';
323
+ export interface OrderDocument {
324
+ /**
325
+ * The identifier for the document, in the case of electronic
326
+ * tickets this string represents the payment or the entitlement to fly.
327
+ * @example "1252106312810"
328
+ */
329
+ unique_identifier: string;
330
+ /**
331
+ * The type of document
332
+ */
333
+ type: OrderDocumentsType;
334
+ }
335
+ export interface OrderPayment {
336
+ /**
337
+ * The type of payment you want to apply to the order.
338
+ * 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`.
339
+ * Otherwise, you must pay using your Duffel account's `balance` by specifying balance. In test mode, your balance is unlimited.
340
+ * 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).
341
+ */
342
+ type: PaymentType;
343
+ /**
344
+ * 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`.
345
+ * @example "30.20"
346
+ */
347
+ amount: string;
348
+ /**
349
+ * 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.
350
+ * @example "GBP"
351
+ */
352
+ currency: string;
353
+ }
354
+ export interface Order {
355
+ /**
356
+ * The amount of tax payable on the order for all the flights booked
357
+ */
358
+ tax_amount?: string;
359
+ /**
360
+ * The currency of the `tax_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
361
+ */
362
+ tax_currency: string;
363
+ /**
364
+ * The total price of the order for all the flights and services booked, including taxes
365
+ */
366
+ total_amount: string;
367
+ /**
368
+ * The currency of the `total_amount`, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code
369
+ */
370
+ total_currency: string;
371
+ /**
372
+ * The [slices](https://duffel.com/docs/api/overview/key-principles) that make up the itinerary of this order.
373
+ * One-way journeys can be expressed using one slice,
374
+ * whereas return trips will need two.
375
+ */
376
+ slices: OrderSlice[];
377
+ /**
378
+ * The services booked along with this order
379
+ */
380
+ services: OrderService[];
381
+ /**
382
+ * The passengers who are travelling
383
+ */
384
+ passengers: OrderPassenger[];
385
+ /**
386
+ * The payment status for this order
387
+ *
388
+ */
389
+ payment_status: OrderPaymentStatus;
390
+ /**
391
+ * The airline who owns the order
392
+ */
393
+ owner: Airline;
394
+ /**
395
+ * Whether the order was created in live mode.
396
+ * This field will be set to true if the order was created
397
+ * in live mode, or false if it was created in test mode.
398
+ */
399
+ live_mode: boolean;
400
+ /**
401
+ * Duffel's unique identifier for the order
402
+ */
403
+ id: string;
404
+ /**
405
+ * The documents issued for this order.
406
+ */
407
+ documents?: OrderDocument[];
408
+ /**
409
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was created
410
+ */
411
+ created_at: string;
412
+ /**
413
+ * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) datetime at which the order was cancelled, if it has been cancelled
414
+ */
415
+ cancelled_at?: string | null;
416
+ /**
417
+ * The airline's reference for the order, sometimes known as a
418
+ * "passenger name record" (PNR) or "record locator".
419
+ * Your customers can use this to check in and manage
420
+ * their booking on the airline's website.
421
+ */
422
+ booking_reference: string;
423
+ /**
424
+ * The currency of the base_amount, as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
425
+ * It will match your organisation's billing currency unless you're
426
+ * using Duffel as an accredited IATA agent, in which case it will
427
+ * be in the currency provided by the airline (which will usually
428
+ * be based on the country where your IATA agency is registered).
429
+ */
430
+ base_currency: string;
431
+ /**
432
+ * The base price of the order for all flights and services booked, excluding taxes
433
+ */
434
+ base_amount: string;
435
+ /**
436
+ * 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.
437
+ *
438
+ * 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`.
439
+ *
440
+ * If a particular kind of modification is allowed, you may not always be able to take action through the Duffel API.
441
+ *
442
+ * In some cases, you may need to contact the Duffel support team or the airline directly.
443
+ */
444
+ conditions: FlightsConditions;
445
+ /**
446
+ * Metadata contains a set of key-value pairs that you can attach to an object.
447
+ * It can be useful for storing additional information about the object, in a structured format.
448
+ * Duffel does not use this information.
449
+ * You should not store sensitive information in this field.
450
+ */
451
+ metadata: Record<string, string>;
452
+ /**
453
+ * The airline-initiated changes for this order.
454
+ */
455
+ airline_initiated_changes?: AirlineInitiatedChange[];
456
+ }
457
+ export interface CreateOrder {
458
+ /**
459
+ * The `id`s of the offers you want to book. You must specify an array containing exactly one selected offer.
460
+ */
461
+ selected_offers: string[];
462
+ /**
463
+ * The services you want to book along with the first selected offer.
464
+ */
465
+ services?: Pick<OrderService, 'id' | 'quantity'>[];
466
+ /**
467
+ * The personal details of the passengers, expanding on the information initially provided when creating the offer request
468
+ */
469
+ passengers: CreateOrderPassenger[];
470
+ /**
471
+ * The payment details to use to pay for the order
472
+ */
473
+ payments?: OrderPayment[];
474
+ /**
475
+ * The payment action you want to take for your order. You can only use pay_later with offers that contain requires_instant_payment: false.
476
+ */
477
+ type: 'instant' | 'pay_later';
478
+ }
479
+ export interface ListParamsOrders {
480
+ /**
481
+ * Whether to filter orders that are awaiting payment or not. If not specified, all orders regardless of their payment state will be returned.
482
+ */
483
+ awaiting_payment?: boolean;
484
+ /**
485
+ * Whether to filter orders matching a passenger name. Partial and exact matches in given and family names will be returned.
486
+ */
487
+ 'passenger_name[]'?: string[];
488
+ /**
489
+ * Whether to filter orders matching a given passenger name record (PNR)
490
+ */
491
+ booking_reference?: string;
492
+ }
493
+ export interface UpdateSingleOrder {
494
+ metadata: Order['metadata'];
495
+ }
496
+ export interface AddServices {
497
+ payment: OrderPayment;
498
+ add_services: Pick<OrderService, 'id' | 'quantity'>[];
499
+ }
500
+ export type OrderAvailableService = OfferAvailableServiceBaggage;