@duffel/api 3.0.0 → 3.1.1

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.
package/dist/typings.d.ts CHANGED
@@ -1617,6 +1617,15 @@ declare module '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChan
1617
1617
  import { OrderSlice } from '@duffel/api/types';
1618
1618
  export type AirlineInitiatedChangeActionTaken = 'accepted' | 'cancelled' | 'changed';
1619
1619
  export type AirlineInitiatedChangeAvailableAction = 'accept' | 'cancel' | 'change' | 'update';
1620
+ /**
1621
+ * The associated Travel Agent Ticket, if any, for this Airline-Initiated Change.
1622
+ * This value will be present for Airline-Initiated changes that take some time to be processed.
1623
+ */
1624
+ export interface TravelAgentTicket {
1625
+ id: string;
1626
+ external_ticket_id: string;
1627
+ }
1628
+ type EmptyObject = Record<string, unknown>;
1620
1629
  export interface AirlineInitiatedChange {
1621
1630
  /**
1622
1631
  * The action taken in response to this airline-initiated change. Accepted,
@@ -1664,17 +1673,18 @@ declare module '@duffel/api/booking/AirlineInitiatedChanges/AirlineInitiatedChan
1664
1673
  * Change. This value will be present for Airline-Initiated changes that take
1665
1674
  * some time to be processed.
1666
1675
  */
1667
- travel_agent_ticket: any | null;
1676
+ travel_agent_ticket: TravelAgentTicket | EmptyObject | null;
1668
1677
  /**
1669
1678
  * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which
1670
1679
  * the airline-initiated change was last updated.
1671
1680
  */
1672
1681
  updated_at: string;
1673
1682
  }
1683
+ export {};
1674
1684
  }
1675
1685
 
1676
1686
  declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' {
1677
- import { Airline, CabinClass, DuffelPassengerType, Place, PlaceType } from '@duffel/api/types';
1687
+ import { Airline, CabinClass, PassengerType, Place, PlaceType } from '@duffel/api/types';
1678
1688
  import { Offer } from '@duffel/api/booking/Offers/OfferTypes';
1679
1689
  export interface OfferRequestSlice {
1680
1690
  /**
@@ -1735,7 +1745,7 @@ declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' {
1735
1745
  * specify their `age` instead of a `type`. A passenger can have only a type
1736
1746
  * or an age, but not both.
1737
1747
  */
1738
- type: Extract<DuffelPassengerType, 'adult'>;
1748
+ type: Extract<PassengerType, 'adult'>;
1739
1749
  }
1740
1750
  export interface CreateOfferRequestNonAdultPassenger extends CreateOfferRequestPassengerCommon {
1741
1751
  /**
@@ -1786,7 +1796,7 @@ declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' {
1786
1796
  /**
1787
1797
  * The type of the passenger.
1788
1798
  */
1789
- type?: DuffelPassengerType;
1799
+ type?: PassengerType;
1790
1800
  /**
1791
1801
  * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
1792
1802
  * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
@@ -1904,6 +1914,10 @@ declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' {
1904
1914
  */
1905
1915
  slices: CreateOfferRequestSlice[];
1906
1916
  }
1917
+ export type TimeRangeFilter = {
1918
+ from: string;
1919
+ to: string;
1920
+ };
1907
1921
  export interface CreateOfferRequestSlice {
1908
1922
  /**
1909
1923
  * The 3-letter IATA code for the city or airport where this slice ends
@@ -1923,11 +1937,11 @@ declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' {
1923
1937
  /**
1924
1938
  * The inclusive time range for the arrival of the slice
1925
1939
  */
1926
- arrival_time?: string | null;
1940
+ arrival_time: TimeRangeFilter | null;
1927
1941
  /**
1928
1942
  * The inclusive time range for the departure of the slice
1929
1943
  */
1930
- departure_time?: string | null;
1944
+ departure_time: TimeRangeFilter | null;
1931
1945
  }
1932
1946
  export interface CreateOfferRequestQueryParameters {
1933
1947
  /**
@@ -1955,7 +1969,7 @@ declare module '@duffel/api/booking/OfferRequests/OfferRequestsTypes' {
1955
1969
  }
1956
1970
 
1957
1971
  declare module '@duffel/api/booking/Offers/OfferTypes' {
1958
- import { Aircraft, Airline, Airport, CabinClass, CreateOfferRequestPassengerFareType, DuffelPassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferSliceConditions, PaginationMeta, Place, PlaceType } from '@duffel/api/types';
1972
+ import { Aircraft, Airline, Airport, CabinClass, CreateOfferRequestPassengerFareType, PassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferSliceConditions, PaginationMeta, Place, PlaceType, Stop } from '@duffel/api/types';
1959
1973
  /**
1960
1974
  * Each offer represents flights you can buy from an airline at a particular price that meet your search criteria.
1961
1975
  * @link https://duffel.com/docs/api/offers/schema
@@ -2217,11 +2231,11 @@ declare module '@duffel/api/booking/Offers/OfferTypes' {
2217
2231
  /**
2218
2232
  * The age of the passenger on the departure_date of the final slice.
2219
2233
  */
2220
- age?: number;
2234
+ age: number | null;
2221
2235
  /**
2222
2236
  * The type of the passenger.
2223
2237
  */
2224
- type?: DuffelPassengerType;
2238
+ type: PassengerType | null;
2225
2239
  /**
2226
2240
  * The passenger's family name. Only `space`, `-`, `'`, and letters from the `ASCII`, `Latin-1 Supplement` and `Latin
2227
2241
  * Extended-A` (with the exceptions of `Æ`, `æ`, `IJ`, `ij`, `Œ`, `œ`, `Þ`, , and `ð`) Unicode charts are accepted. All
@@ -2320,7 +2334,7 @@ declare module '@duffel/api/booking/Offers/OfferTypes' {
2320
2334
  * - `"4"`: premium seating, additional legroom and recline. Situated in business class or higher.
2321
2335
  * - `"5"`: deluxe seating, additional legroom and reclines to lie flat position. Situated in business class or higher.
2322
2336
  */
2323
- ngs_shelf: number;
2337
+ ngs_shelf: number | null;
2324
2338
  }
2325
2339
  export interface OfferSliceSegment {
2326
2340
  /**
@@ -2388,29 +2402,7 @@ declare module '@duffel/api/booking/Offers/OfferTypes' {
2388
2402
  /**
2389
2403
  * Additional segment-specific information about the stops, if any, included in the segment
2390
2404
  */
2391
- stops?: OfferSliceSegmentStop[];
2392
- }
2393
- export interface OfferSliceSegmentStop {
2394
- /**
2395
- * Duffel's unique identifier for the Stop
2396
- */
2397
- id: string;
2398
- /**
2399
- * The airport at which the Stop happens
2400
- */
2401
- airport: Airport;
2402
- /**
2403
- * The ISO 8601 datetime at which the Stop is scheduled to arrive, in the airport's timezone (see destination.timezone)
2404
- */
2405
- arriving_at: string;
2406
- /**
2407
- * The ISO 8601 datetime at which the Stop is scheduled to depart, in the airport's timezone (see origin.timezone)
2408
- */
2409
- departing_at: string;
2410
- /**
2411
- * The duration of the Stop, represented as a ISO 8601 duration
2412
- */
2413
- duration: string;
2405
+ stops: Array<Stop>;
2414
2406
  }
2415
2407
  export type WiFiAmenityCost = 'free' | 'paid' | 'free or paid' | 'n/a';
2416
2408
  export type SeatPitch = 'less' | 'more' | 'standard' | 'n/a';
@@ -2442,64 +2434,65 @@ declare module '@duffel/api/booking/Offers/OfferTypes' {
2442
2434
  /**
2443
2435
  * Data about the cabin that the passenger will be flying in for this segment
2444
2436
  */
2445
- cabin: {
2446
- /**
2447
- * The name of the cabin class
2448
- */
2449
- name: CabinClass;
2437
+ cabin: OfferSliceSegmentPassengerCabin | null;
2438
+ }
2439
+ export interface OfferSliceSegmentPassengerCabin {
2440
+ /**
2441
+ * The name of the cabin class
2442
+ */
2443
+ name: CabinClass;
2444
+ /**
2445
+ * TThe name that the marketing carrier uses to market this cabin class
2446
+ */
2447
+ marketing_name: string;
2448
+ /**
2449
+ * The amenities specific to this cabin class on this plane
2450
+ */
2451
+ amenities: {
2450
2452
  /**
2451
- * TThe name that the marketing carrier uses to market this cabin class
2453
+ * If Wi-Fi is available, information on its cost, availability, etc
2452
2454
  */
2453
- marketing_name: string;
2455
+ wifi: {
2456
+ /**
2457
+ * Whether Wi-Fi is available in this cabin
2458
+ */
2459
+ available: boolean;
2460
+ /**
2461
+ * The cost, if any, to use the Wi-Fi
2462
+ */
2463
+ cost: WiFiAmenityCost;
2464
+ } | null;
2454
2465
  /**
2455
- * The amenities specific to this cabin class on this plane
2466
+ * Information on the standard seat in this cabin class. Exceptions may apply, such as on exit rows.
2456
2467
  */
2457
- amenities: {
2468
+ seat: {
2458
2469
  /**
2459
- * If Wi-Fi is available, information on its cost, availability, etc
2470
+ * The distance from a point on a seat to the seat front/behind it, in inches, or "n/a" if not available
2460
2471
  */
2461
- wifi: {
2462
- /**
2463
- * Whether Wi-Fi is available in this cabin
2464
- */
2465
- available: boolean;
2466
- /**
2467
- * The cost, if any, to use the Wi-Fi
2468
- */
2469
- cost: WiFiAmenityCost;
2470
- } | null;
2472
+ pitch: SeatPitch;
2471
2473
  /**
2472
- * Information on the standard seat in this cabin class. Exceptions may apply, such as on exit rows.
2474
+ * A summary of the seat characteristics for the cabin.
2475
+ * Includes the following:
2476
+ * - `"standard"` - typical seating with regular legroom / recline
2477
+ * - `"extra_legroom"` - typical seating with additional legroom
2478
+ * - `"skycouch"` - a row of seats converted into a couch layout
2479
+ * - `"recliner"` - seating with additional legroom and recline
2480
+ * - `"angle_flat"` - seating with additional legroom and near flat recline
2481
+ * - `"full_flat_pod"` - seating with full flat recline and enclosing privacy screens
2482
+ * - `"private_suite"` - a full suite, typically including a bed and recliner seat
2473
2483
  */
2474
- seat: {
2475
- /**
2476
- * The distance from a point on a seat to the seat front/behind it, in inches, or "n/a" if not available
2477
- */
2478
- pitch: SeatPitch;
2479
- /**
2480
- * A summary of the seat characteristics for the cabin.
2481
- * Includes the following:
2482
- * - `"standard"` - typical seating with regular legroom / recline
2483
- * - `"extra_legroom"` - typical seating with additional legroom
2484
- * - `"skycouch"` - a row of seats converted into a couch layout
2485
- * - `"recliner"` - seating with additional legroom and recline
2486
- * - `"angle_flat"` - seating with additional legroom and near flat recline
2487
- * - `"full_flat_pod"` - seating with full flat recline and enclosing privacy screens
2488
- * - `"private_suite"` - a full suite, typically including a bed and recliner seat
2489
- */
2490
- type: SeatType;
2491
- } | null;
2484
+ type: SeatType;
2485
+ } | null;
2486
+ /**
2487
+ * If power (AC and/or USB) is available, information on what is available
2488
+ */
2489
+ power: {
2492
2490
  /**
2493
- * If power (AC and/or USB) is available, information on what is available
2491
+ * Whether there is power available or not in this cabin
2494
2492
  */
2495
- power: {
2496
- /**
2497
- * Whether there is power available or not in this cabin
2498
- */
2499
- available: boolean;
2500
- } | null;
2501
- };
2502
- } | null;
2493
+ available: boolean;
2494
+ } | null;
2495
+ };
2503
2496
  }
2504
2497
  export type BaggageType = 'carry_on' | 'checked';
2505
2498
  export interface OfferSliceSegmentPassengerBaggage {
@@ -2562,6 +2555,36 @@ declare module '@duffel/api/booking/OrderCancellations/OrderCancellationsTypes'
2562
2555
  */
2563
2556
  order_id?: string;
2564
2557
  }
2558
+ export interface OrderCancellationAirlineCredit {
2559
+ /**
2560
+ * Duffel's unique identifier for the airline credit
2561
+ */
2562
+ id: string;
2563
+ /**
2564
+ * The human-readable name used by the airline to categorize the type of credit being offered. This name should help when trying to understand the airline's conditions of use which apply to this credit.
2565
+ */
2566
+ credit_name: string;
2567
+ /**
2568
+ * The code which identifies the airline credit to the airline and will be used to redeem the airline credit
2569
+ */
2570
+ credit_code: string;
2571
+ /**
2572
+ * The monetary value associated with this airline credit
2573
+ */
2574
+ credit_amount: string;
2575
+ /**
2576
+ * The currency in which this airline credit is issued, as an ISO 4217 currency code
2577
+ */
2578
+ credit_currency: string;
2579
+ /**
2580
+ * The date the credit was issued. It is important to note that this date might not be the same as the date of cancellation. Often airlines associate credits with tickets, in which case the date of issue is considered to be the date the ticket was originally issued. Airline credits may have expiration dates which are based on the date of issue. Airlines don't always reliably disclose the expiration date in their APIs at the time of cancellation, so we are unable to return this information on airline credits. To get the latest info on expiration dates for airline credits we recommend checking directly with the airlines to determine the specific conditions of use for the credit.
2581
+ */
2582
+ issued_on: string;
2583
+ /**
2584
+ * Duffel's unique identifier for the passenger on the order that the credit is associated with
2585
+ */
2586
+ passenger_id: string;
2587
+ }
2565
2588
  export interface OrderCancellation {
2566
2589
  /**
2567
2590
  * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime that indicates when the order cancellation was confirmed
@@ -2604,7 +2627,11 @@ declare module '@duffel/api/booking/OrderCancellations/OrderCancellationsTypes'
2604
2627
  /**
2605
2628
  * 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.
2606
2629
  */
2607
- refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment';
2630
+ refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment' | 'airline_credits';
2631
+ /**
2632
+ * The airline credits for this OrderCancellation
2633
+ */
2634
+ airline_credits: OrderCancellationAirlineCredit[];
2608
2635
  }
2609
2636
  }
2610
2637
 
@@ -2874,7 +2901,7 @@ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2874
2901
  /**
2875
2902
  * The price of this offer as a change to your existing order, excluding taxes
2876
2903
  */
2877
- change_total_amount: string | null;
2904
+ change_total_amount: string;
2878
2905
  /**
2879
2906
  * The currency of the change_total_amount, as an ISO 4217 currency code.
2880
2907
  * It will match your organisation's billing currency unless you're using Duffel
@@ -2882,7 +2909,7 @@ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2882
2909
  * by the airline (which will usually be based on the country where your
2883
2910
  * IATA agency is registered).
2884
2911
  */
2885
- change_total_currency: string | null;
2912
+ change_total_currency: string;
2886
2913
  /**
2887
2914
  * Whether the order was created in live mode. This field will be set to `true`
2888
2915
  * if the order was created in live mode, or `false` if it was created in test mode.
@@ -2895,7 +2922,7 @@ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2895
2922
  /**
2896
2923
  * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime that indicates when the order change was confirmed
2897
2924
  */
2898
- confirmed_at: string;
2925
+ confirmed_at: string | null;
2899
2926
  /**
2900
2927
  * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) datetime at which the offer will expire
2901
2928
  * and no longer be usable to create an order
@@ -2908,7 +2935,7 @@ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2908
2935
  /**
2909
2936
  * The price of this offer if it was newly purchased, excluding taxes
2910
2937
  */
2911
- new_total_amount: string | null;
2938
+ new_total_amount: string;
2912
2939
  /**
2913
2940
  * The currency of the new_total_amount, as an ISO 4217 currency code.
2914
2941
  * It will match your organisation's billing currency unless you're using
@@ -2924,7 +2951,7 @@ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2924
2951
  /**
2925
2952
  * The penalty price imposed by the airline for making this change
2926
2953
  */
2927
- penalty_amount: string | null;
2954
+ penalty_total_amount: string | null;
2928
2955
  /**
2929
2956
  * The currency of the penalty_amount, as an ISO 4217 currency code.
2930
2957
  * It will match your organisation's billing currency unless you're using
@@ -2932,12 +2959,14 @@ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2932
2959
  * currency provided by the airline (which will usually be based on
2933
2960
  * the country where your IATA agency is registered).
2934
2961
  */
2935
- penalty_currency: string | null;
2962
+ penalty_total_currency: string | null;
2936
2963
  /**
2937
- * Where the refund, once confirmed, will be sent. card is currently a restricted feature.
2938
- * `awaiting_payment` is for pay later orders where no payment has been made yet.
2964
+ * Where the refund, once confirmed, will be sent.
2965
+ * Refunds are indicated by a negative change_total_amount.
2966
+ * If the change does not require a refund, this field will be null.
2967
+ * original_form_of_payment refers to the form of payment used to create the order.
2939
2968
  */
2940
- refund_to: 'arc_bsp_cash' | 'balance' | 'card' | 'voucher' | 'awaiting_payment' | 'original_form_of_payment';
2969
+ refund_to: 'voucher' | 'original_form_of_payment';
2941
2970
  /**
2942
2971
  * The slices to be added and/or removed
2943
2972
  */
@@ -2974,7 +3003,7 @@ declare module '@duffel/api/booking/OrderChanges/OrderChangesTypes' {
2974
3003
  }
2975
3004
 
2976
3005
  declare module '@duffel/api/booking/Orders/OrdersTypes' {
2977
- import { Aircraft, Airline, AirlineInitiatedChange, Airport, CabinClass, DuffelPassengerGender, DuffelPassengerTitle, DuffelPassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferAvailableServiceBaggage, OfferAvailableServiceBaggageMetadata, PassengerIdentityDocumentType, PaymentType, Place, PlaceType } from '@duffel/api/types';
3006
+ import { Aircraft, Airline, AirlineInitiatedChange, Airport, CabinClass, DuffelPassengerGender, DuffelPassengerTitle, PassengerType, FlightsConditions, LoyaltyProgrammeAccount, OfferAvailableServiceBaggage, OfferAvailableServiceBaggageMetadata, PassengerIdentityDocumentType, PaymentType, Place, PlaceType } from '@duffel/api/types';
2978
3007
  /**
2979
3008
  * An object containing metadata about the service, like the designator of the seat.
2980
3009
  */
@@ -2993,7 +3022,7 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
2993
3022
  * A name which describes the type of seat, which you can display in your user interface to help customers to understand its features
2994
3023
  * @example "Exit row seat"
2995
3024
  */
2996
- name: string;
3025
+ name: string | null;
2997
3026
  }
2998
3027
  /**
2999
3028
  * An object containing metadata about the service, like the maximum weight and dimensions of the baggage.
@@ -3110,7 +3139,7 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3110
3139
  * The type of the passenger
3111
3140
  * @return "adult", "child", or "infant_without_seat"
3112
3141
  */
3113
- type: DuffelPassengerType;
3142
+ type: PassengerType;
3114
3143
  /**
3115
3144
  * The id of the infant associated with this passenger
3116
3145
  * @return "adult", "child", or "infant_without_seat"
@@ -3120,6 +3149,18 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3120
3149
  * The **Loyalty Programme Accounts** for this passenger.
3121
3150
  */
3122
3151
  loyalty_programme_accounts?: LoyaltyProgrammeAccount[];
3152
+ /**
3153
+ * The passenger's email address.
3154
+ * Note that this data may differ from the airline's records if it was updated directly with the airline since the order was created.
3155
+ * @xample "amelia@duffel.com"
3156
+ */
3157
+ email: string;
3158
+ /**
3159
+ * The passenger's phone number in E.164 (international) format.
3160
+ * Note that this data may differ from the airline's records if it was updated directly with the airline since the order was created.
3161
+ * @xample "442080160509"
3162
+ */
3163
+ phone_number: string;
3123
3164
  }
3124
3165
  export interface OrderPassengerIdentityDocument {
3125
3166
  /**
@@ -3159,7 +3200,7 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3159
3200
  /**
3160
3201
  * The aircraft that the operating carrier will use to operate this segment
3161
3202
  */
3162
- aircraft?: Aircraft;
3203
+ aircraft: Aircraft;
3163
3204
  /**
3164
3205
  * 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)
3165
3206
  */
@@ -3176,11 +3217,11 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3176
3217
  * The terminal at the destination airport where the segment is scheduled to arrive
3177
3218
  * @example "5"
3178
3219
  */
3179
- destination_terminal?: string | null;
3220
+ destination_terminal: string;
3180
3221
  /**
3181
3222
  * The duration of the segment, represented as a [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601#Durations) duration
3182
3223
  */
3183
- duration?: string;
3224
+ duration: string;
3184
3225
  /**
3185
3226
  * Duffel's unique identifier for the segment.
3186
3227
  * It identifies the segment of an order (i.e. the same segment across orders will have different ids.
@@ -3212,7 +3253,7 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3212
3253
  * The terminal at the origin airport from which the segment is scheduled to depart
3213
3254
  * @example "B"
3214
3255
  */
3215
- origin_terminal?: string | null;
3256
+ origin_terminal: string;
3216
3257
  /**
3217
3258
  * 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)
3218
3259
  */
@@ -3221,7 +3262,41 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3221
3262
  * The distance of the segment in kilometres
3222
3263
  * @example "424.2"
3223
3264
  */
3224
- distance?: string | null;
3265
+ distance: string;
3266
+ /**
3267
+ * Additional segment-specific information about the stops, if any, included in the segment
3268
+ */
3269
+ stops: Array<Stop>;
3270
+ }
3271
+ export interface Stop {
3272
+ /**
3273
+ * The airport at which the stop happens
3274
+ */
3275
+ airport: Airport;
3276
+ /**
3277
+ * The ISO 8601 datetime at which the stop is scheduled to arrive, in the airport's timezone (see destination.timezone)
3278
+ *
3279
+ * @example "2020-06-13T16:38:02"
3280
+ */
3281
+ arriving_at: string;
3282
+ /**
3283
+ * The ISO 8601 datetime at which the stop is scheduled to depart, in the airport's timezone (see origin.timezone)
3284
+ *
3285
+ * @example "2020-06-13T16:38:02"
3286
+ */
3287
+ departing_at: string;
3288
+ /**
3289
+ * The duration of the stop, represented as a ISO 8601 duration
3290
+ *
3291
+ * @example "PT02H26M"
3292
+ */
3293
+ duration: string;
3294
+ /**
3295
+ * Duffel's unique identifier for the resource
3296
+ *
3297
+ * @example "sto_00009htYpSCXrwaB9Dn456"
3298
+ */
3299
+ id: string;
3225
3300
  }
3226
3301
  export interface OrderSlice {
3227
3302
  /**
@@ -3279,6 +3354,10 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3279
3354
  * Price Guarantee means it will hold price
3280
3355
  */
3281
3356
  price_guarantee_expires_at?: string;
3357
+ /**
3358
+ * The ISO 8601 datetime at which the Order was paid for, if at all
3359
+ */
3360
+ paid_at: string | null;
3282
3361
  }
3283
3362
  /**
3284
3363
  * The type of document
@@ -3296,6 +3375,11 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3296
3375
  * The type of document
3297
3376
  */
3298
3377
  type: OrderDocumentsType;
3378
+ /**
3379
+ * The list of passenger ids the document applies to
3380
+ * @example ["pas_00009hj8USM7Ncg31cBCLL"]
3381
+ */
3382
+ passenger_ids: string[];
3299
3383
  }
3300
3384
  export interface OrderPayment {
3301
3385
  /**
@@ -3417,7 +3501,7 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3417
3501
  /**
3418
3502
  * The airline-initiated changes for this order.
3419
3503
  */
3420
- airline_initiated_changes?: AirlineInitiatedChange[];
3504
+ airline_initiated_changes: AirlineInitiatedChange[];
3421
3505
  /**
3422
3506
  * The available actions you can take on this order through our API.
3423
3507
  * It's a list of zero or more of the following values:
@@ -3429,6 +3513,14 @@ declare module '@duffel/api/booking/Orders/OrdersTypes' {
3429
3513
  * @example: ["cancel","update"]
3430
3514
  */
3431
3515
  available_actions: OrderAvailableAction[];
3516
+ /**
3517
+ * Airlines are always the source of truth for orders. The orders returned in the Duffel API
3518
+ * are a view of those orders. This field is the ISO 8601 datetime at which the order was
3519
+ * last synced with the airline. If this datetime is in the last minute you can consider the order up to date.
3520
+ *
3521
+ * @example "2020-04-11T15:48:11Z"
3522
+ */
3523
+ synced_at: string;
3432
3524
  }
3433
3525
  export type OrderAvailableAction = 'cancel' | 'change' | 'update';
3434
3526
  export interface CreateOrder {
@@ -3894,7 +3986,7 @@ declare module '@duffel/api/supportingResources/Airports/AirportsTypes' {
3894
3986
  * The metropolitan area where the airport is located.
3895
3987
  * Only present for airports which are registered with IATA as belonging to a metropolitan area.
3896
3988
  */
3897
- city?: City | null;
3989
+ city: City | null;
3898
3990
  /**
3899
3991
  * The name of the city (or cities separated by a `/`) where the airport is located
3900
3992
  */
@@ -3902,7 +3994,7 @@ declare module '@duffel/api/supportingResources/Airports/AirportsTypes' {
3902
3994
  /**
3903
3995
  * The three-character IATA code for the airport
3904
3996
  */
3905
- iata_code?: string;
3997
+ iata_code: string | null;
3906
3998
  /**
3907
3999
  * The ISO 3166-1 alpha-2 code for the country where the city is located
3908
4000
  * @link https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
@@ -3913,11 +4005,11 @@ declare module '@duffel/api/supportingResources/Airports/AirportsTypes' {
3913
4005
  * The 3-letter IATA code for the city where the place is located.
3914
4006
  * 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).
3915
4007
  */
3916
- iata_city_code?: string | null;
4008
+ iata_city_code: string | null;
3917
4009
  /**
3918
4010
  * The four-character ICAO code for the airport
3919
4011
  */
3920
- icao_code?: string;
4012
+ icao_code: string;
3921
4013
  /**
3922
4014
  * Duffel's unique identifier for the airport
3923
4015
  */
@@ -3938,6 +4030,10 @@ declare module '@duffel/api/supportingResources/Airports/AirportsTypes' {
3938
4030
  * The time zone of the airport, specified by name from the [tz database](https://en.wikipedia.org/wiki/Tz_database)
3939
4031
  */
3940
4032
  time_zone: string;
4033
+ /**
4034
+ * The type of the place
4035
+ */
4036
+ type: 'airport';
3941
4037
  }
3942
4038
  }
3943
4039
 
@@ -4146,10 +4242,6 @@ declare module '@duffel/api/types/shared' {
4146
4242
  * @link https://portal.iata.org/faq/articles/en_US/FAQ/How-do-I-create-a-new-Metropolitan-Area
4147
4243
  */
4148
4244
  export interface City {
4149
- /**
4150
- * The type of the place
4151
- */
4152
- type?: 'city';
4153
4245
  /**
4154
4246
  * The three-character IATA code for the city
4155
4247
  * @example "LON"
@@ -4171,6 +4263,14 @@ declare module '@duffel/api/types/shared' {
4171
4263
  * @example "London"
4172
4264
  */
4173
4265
  name: string;
4266
+ /**
4267
+ * "The airports associated to a city. This will only be provided where the `type` is `city`."
4268
+ */
4269
+ airports?: Airport[];
4270
+ /**
4271
+ * The type of the place
4272
+ */
4273
+ type: 'city';
4174
4274
  }
4175
4275
  /**
4176
4276
  * The cabin class that the passenger will travel in on this segment
@@ -4179,7 +4279,7 @@ declare module '@duffel/api/types/shared' {
4179
4279
  /**
4180
4280
  * The type of the passenger
4181
4281
  */
4182
- export type DuffelPassengerType = 'adult' | 'child' | 'infant_without_seat';
4282
+ export type PassengerType = 'adult' | 'child' | 'infant_without_seat';
4183
4283
  /**
4184
4284
  * The passenger's title
4185
4285
  */
@@ -4193,16 +4293,64 @@ declare module '@duffel/api/types/shared' {
4193
4293
  * This must be one of the `allowed_passenger_identity_document_types` on the offer.
4194
4294
  */
4195
4295
  export type PassengerIdentityDocumentType = 'passport' | 'tax_id';
4196
- /**
4197
- * The type of the origin or destination
4198
- */
4199
- export type PlaceType = 'airport' | 'city';
4200
4296
  export type Place = (Airport & {
4201
- type?: 'airport';
4202
- airports?: Airport[] | null;
4297
+ type: 'airport';
4203
4298
  }) | (City & {
4204
- type?: 'city';
4299
+ type: 'city';
4205
4300
  });
4301
+ /**
4302
+ * The type of the origin or destination
4303
+ */
4304
+ export type PlaceType = Place['type'];
4305
+ export type FlightsConditionAllowed = {
4306
+ /**
4307
+ * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
4308
+ * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer.
4309
+ * If this is `null` then `penalty_amount` will also be `null`.
4310
+ *
4311
+ * @example "GBP"
4312
+ */
4313
+ penalty_currency: string;
4314
+ /**
4315
+ * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers.
4316
+ * 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`.
4317
+ * If this is `null` then the `penalty_currency` will also be null.
4318
+ *
4319
+ * @example "100.00"
4320
+ */
4321
+ penalty_amount: string;
4322
+ /**
4323
+ * Whether this kind of modification is allowed post-booking
4324
+ *
4325
+ * @example "true"
4326
+ */
4327
+ allowed: true;
4328
+ };
4329
+ export type FlightsConditionNotAllowed = {
4330
+ /**
4331
+ * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
4332
+ * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer.
4333
+ * If this is `null` then `penalty_amount` will also be `null`.
4334
+ *
4335
+ * @example "GBP"
4336
+ */
4337
+ penalty_currency: null;
4338
+ /**
4339
+ * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers.
4340
+ * 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`.
4341
+ * If this is `null` then the `penalty_currency` will also be null.
4342
+ *
4343
+ * @example "100.00"
4344
+ */
4345
+ penalty_amount: null;
4346
+ /**
4347
+ * Whether this kind of modification is allowed post-booking
4348
+ *
4349
+ * @example "true"
4350
+ */
4351
+ allowed: false;
4352
+ };
4353
+ export type FlightsCondition = FlightsConditionAllowed | FlightsConditionNotAllowed;
4206
4354
  /**
4207
4355
  * 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.
4208
4356
  * 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.
@@ -4216,28 +4364,7 @@ declare module '@duffel/api/types/shared' {
4216
4364
  * If any of the slices on the order or offer can't be refunded then the `allowed` property will be `false`.
4217
4365
  * If the airline hasn't provided any information about whether this order or offer can be refunded then this property will be `null`.
4218
4366
  */
4219
- refund_before_departure?: {
4220
- /**
4221
- * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
4222
- * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer.
4223
- * If this is `null` then `penalty_amount` will also be `null`.
4224
- * @example "GBP"
4225
- */
4226
- penalty_currency?: string | null;
4227
- /**
4228
- * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers.
4229
- * 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`.
4230
- * If this is `null` then the `penalty_currency` will also be null.
4231
- * @example "100.00"
4232
- */
4233
- penalty_amount?: string | null;
4234
- /**
4235
- * Whether this kind of modification is allowed post-booking
4236
- *
4237
- * @example "true"
4238
- */
4239
- allowed: boolean;
4240
- } | null;
4367
+ refund_before_departure: FlightsCondition | null;
4241
4368
  /**
4242
4369
  * Whether the whole order or offer can be changed before the departure of the first slice.
4243
4370
  * If all of the slices on the order or offer can be changed then the `allowed` property will be `true`.
@@ -4246,28 +4373,7 @@ declare module '@duffel/api/types/shared' {
4246
4373
  * In this case you should refer to the slices conditions to determine if any part of the order or offer is changeable.
4247
4374
  * If the airline hasn't provided any information about whether this order or offer can be changed then this property will be `null`.
4248
4375
  */
4249
- change_before_departure?: {
4250
- /**
4251
- * The currency of the `penalty_amount` as an [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code.
4252
- * This will be in a currency determined by the airline, which is not necessarily the same as the currency of the order or offer.
4253
- * If this is `null` then `penalty_amount` will also be `null`.
4254
- * @example "GBP"
4255
- */
4256
- penalty_currency?: string | null;
4257
- /**
4258
- * If the modification is `allowed` then this is the amount payable to apply the modification to all passengers.
4259
- * 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`.
4260
- * If this is `null` then the `penalty_currency` will also be null.
4261
- * @example "100.00"
4262
- */
4263
- penalty_amount?: string | null;
4264
- /**
4265
- * Whether this kind of modification is allowed post-booking
4266
- *
4267
- * @example "true"
4268
- */
4269
- allowed: boolean;
4270
- } | null;
4376
+ change_before_departure: FlightsCondition | null;
4271
4377
  };
4272
4378
  /**
4273
4379
  * 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.
@@ -4284,15 +4390,15 @@ declare module '@duffel/api/types/shared' {
4284
4390
  /**
4285
4391
  * Whether passengers are able to select a seat prior to check in.
4286
4392
  */
4287
- advance_seat_selection: boolean;
4393
+ advance_seat_selection: boolean | null;
4288
4394
  /**
4289
4395
  * Whether passengers are given preferential boarding over others passengers in their cabin.
4290
4396
  */
4291
- priority_boarding: boolean;
4397
+ priority_boarding: boolean | null;
4292
4398
  /**
4293
4399
  * Whether passengers are given access to a fast track lane during check in.
4294
4400
  */
4295
- priority_check_in: boolean;
4401
+ priority_check_in: boolean | null;
4296
4402
  };
4297
4403
  /**
4298
4404
  * The type of payment you want to apply to the order.
@@ -4653,6 +4759,8 @@ declare module '@duffel/api/Stays/Bookings/Bookings' {
4653
4759
  accommodation_special_requests?: string;
4654
4760
  payment?: {
4655
4761
  card_id: string;
4762
+ } | {
4763
+ three_d_secure_session_id: string;
4656
4764
  };
4657
4765
  }
4658
4766
  export class Bookings extends Resource {