@duffel/api 1.29.0 → 2.0.0

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