@voyant-travel/storefront-sdk 0.120.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.
@@ -0,0 +1,2311 @@
1
+ import { bootstrapBookingEnginePayment, confirmBookingEngineSession, expireBookingEngineSession, getBookingEngineOverview, previewBookingEnginePayment, repriceBookingEngineSession, reserveBookingEngineSession, startBookingEnginePayment, updateBookingEngineProgress, updateBookingEngineSession, updateBookingEngineTravelers } from "./booking-engine.js";
2
+ import { type VoyantStorefrontClientOptions } from "./client.js";
3
+ import { canRunBookingEngineAction, createBookingEngineSnapshot, deriveBookingEngineState } from "./engine-state.js";
4
+ import { bootstrapBookingSession, bootstrapCheckoutCollection, confirmPublicBookingSession, createPublicBookingSession, createStorefrontLead, expirePublicBookingSession, getPublicBookingOverview, getStorefrontOfferBySlug, getStorefrontProductAvailability, initiateCheckoutCollection, listStorefrontProductDepartures, listStorefrontProductExtensions, listStorefrontProductOffers, previewCheckoutCollection, previewStorefrontDeparturePrice, repricePublicBookingSession, subscribeStorefrontNewsletter, updatePublicBookingSession, updatePublicBookingSessionState } from "./operations.js";
5
+ export * from "./booking-engine.js";
6
+ export type { StorefrontQueryParamValue, StorefrontRequestOptions, VoyantStorefrontClientOptions, VoyantStorefrontFetcher, } from "./client.js";
7
+ export { defaultStorefrontFetcher, storefrontFetchWithValidation, VoyantStorefrontApiError, withStorefrontQueryParams, } from "./client.js";
8
+ export type { BookingEngineAction, BookingEngineSnapshot, BookingEngineState, } from "./engine-state.js";
9
+ export { bookingEngineActions, bookingEngineStates, canRunBookingEngineAction, createBookingEngineSnapshot, deriveBookingEngineState, getAllowedBookingEngineActions, } from "./engine-state.js";
10
+ export * from "./errors.js";
11
+ export * from "./operations.js";
12
+ export * from "./schemas.js";
13
+ export declare function createVoyantStorefrontClient(options: VoyantStorefrontClientOptions): {
14
+ storefront: {
15
+ getSettings: () => Promise<{
16
+ branding: {
17
+ logoUrl: string | null;
18
+ faviconUrl: string | null;
19
+ brandMarkUrl: string | null;
20
+ primaryColor: string | null;
21
+ accentColor: string | null;
22
+ supportedLanguages: string[];
23
+ };
24
+ support: {
25
+ email: string | null;
26
+ phone: string | null;
27
+ links: {
28
+ label: string;
29
+ url: string;
30
+ }[];
31
+ };
32
+ legal: {
33
+ termsUrl: string | null;
34
+ privacyUrl: string | null;
35
+ cancellationUrl: string | null;
36
+ defaultContractTemplateId: string | null;
37
+ };
38
+ localization: {
39
+ defaultLocale: string | null;
40
+ currencyDisplay: "symbol" | "code" | "name";
41
+ };
42
+ forms: {
43
+ billing: {
44
+ fields: {
45
+ key: string;
46
+ label: string;
47
+ type: "email" | "date" | "text" | "tel" | "textarea" | "select" | "checkbox" | "country";
48
+ required: boolean;
49
+ placeholder: string | null;
50
+ description: string | null;
51
+ autocomplete: string | null;
52
+ options: {
53
+ value: string;
54
+ label: string;
55
+ }[];
56
+ }[];
57
+ };
58
+ travelers: {
59
+ fields: {
60
+ key: string;
61
+ label: string;
62
+ type: "email" | "date" | "text" | "tel" | "textarea" | "select" | "checkbox" | "country";
63
+ required: boolean;
64
+ placeholder: string | null;
65
+ description: string | null;
66
+ autocomplete: string | null;
67
+ options: {
68
+ value: string;
69
+ label: string;
70
+ }[];
71
+ }[];
72
+ };
73
+ };
74
+ payment: {
75
+ defaultMethod: "voucher" | "card" | "bank_transfer" | "invoice" | "cash" | null;
76
+ methods: {
77
+ code: "voucher" | "card" | "bank_transfer" | "invoice" | "cash";
78
+ label: string;
79
+ description: string | null;
80
+ enabled: boolean;
81
+ }[];
82
+ structure: "split" | "full";
83
+ schedule: {
84
+ percent: number;
85
+ dueInDays: number;
86
+ dueCondition: "after_booking" | "before_departure";
87
+ }[];
88
+ defaultSchedule: {
89
+ depositPercent: number | null;
90
+ balanceDueDaysBeforeDeparture: number | null;
91
+ } | null;
92
+ bankTransfer: {
93
+ dueDays: number | null;
94
+ account: {
95
+ provider: string | null;
96
+ currency: string | null;
97
+ iban: string;
98
+ beneficiary: string;
99
+ bank: string;
100
+ } | null;
101
+ accountHolder: string | null;
102
+ bankName: string | null;
103
+ iban: string | null;
104
+ bic: string | null;
105
+ paymentReference: string | null;
106
+ instructions: string | null;
107
+ } | null;
108
+ };
109
+ }>;
110
+ createLead: (input: Parameters<typeof createStorefrontLead>[1], requestOptions?: Parameters<typeof createStorefrontLead>[2]) => Promise<{
111
+ id: string;
112
+ personId: string;
113
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
114
+ source: "phone" | "booking" | "form" | "admin" | "abandoned_cart" | "website";
115
+ status: "expired" | "new" | "contacted" | "qualified" | "converted" | "lost";
116
+ duplicate: boolean;
117
+ }>;
118
+ subscribeNewsletter: (input: Parameters<typeof subscribeStorefrontNewsletter>[1], requestOptions?: Parameters<typeof subscribeStorefrontNewsletter>[2]) => Promise<{
119
+ id: string;
120
+ personId: string;
121
+ kind: "wishlist" | "notify" | "inquiry" | "request_offer" | "referral";
122
+ source: "phone" | "booking" | "form" | "admin" | "abandoned_cart" | "website";
123
+ status: "expired" | "new" | "contacted" | "qualified" | "converted" | "lost";
124
+ duplicate: boolean;
125
+ doubleOptIn: "not_configured" | "requested";
126
+ }>;
127
+ getDeparture: (departureId: string) => Promise<{
128
+ id: string;
129
+ productId: string;
130
+ itineraryId: string;
131
+ optionId: string | null;
132
+ dateLocal: string | null;
133
+ startAt: string | null;
134
+ endAt: string | null;
135
+ timezone: string;
136
+ startTime: {
137
+ id: string;
138
+ label: string | null;
139
+ startTimeLocal: string;
140
+ durationMinutes: number | null;
141
+ } | null;
142
+ meetingPoint: string | null;
143
+ capacity: number | null;
144
+ remaining: number | null;
145
+ departureStatus: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
146
+ nights: number | null;
147
+ days: number | null;
148
+ ratePlans: {
149
+ id: string;
150
+ active: boolean;
151
+ name: string;
152
+ pricingModel: string;
153
+ basePrices: {
154
+ amount: number;
155
+ currencyCode: string;
156
+ }[];
157
+ roomPrices: {
158
+ amount: number;
159
+ currencyCode: string;
160
+ roomType: {
161
+ id: string;
162
+ name: string;
163
+ occupancy: {
164
+ adultsMin: number;
165
+ adultsMax: number;
166
+ childrenMax: number;
167
+ };
168
+ };
169
+ }[];
170
+ }[];
171
+ }>;
172
+ listProductDepartures: (productId: string, query?: Parameters<typeof listStorefrontProductDepartures>[2]) => Promise<{
173
+ data: {
174
+ id: string;
175
+ productId: string;
176
+ itineraryId: string;
177
+ optionId: string | null;
178
+ dateLocal: string | null;
179
+ startAt: string | null;
180
+ endAt: string | null;
181
+ timezone: string;
182
+ startTime: {
183
+ id: string;
184
+ label: string | null;
185
+ startTimeLocal: string;
186
+ durationMinutes: number | null;
187
+ } | null;
188
+ meetingPoint: string | null;
189
+ capacity: number | null;
190
+ remaining: number | null;
191
+ departureStatus: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
192
+ nights: number | null;
193
+ days: number | null;
194
+ ratePlans: {
195
+ id: string;
196
+ active: boolean;
197
+ name: string;
198
+ pricingModel: string;
199
+ basePrices: {
200
+ amount: number;
201
+ currencyCode: string;
202
+ }[];
203
+ roomPrices: {
204
+ amount: number;
205
+ currencyCode: string;
206
+ roomType: {
207
+ id: string;
208
+ name: string;
209
+ occupancy: {
210
+ adultsMin: number;
211
+ adultsMax: number;
212
+ childrenMax: number;
213
+ };
214
+ };
215
+ }[];
216
+ }[];
217
+ }[];
218
+ total: number;
219
+ limit: number;
220
+ offset: number;
221
+ }>;
222
+ getProductAvailability: (productId: string, query?: Parameters<typeof getStorefrontProductAvailability>[2]) => Promise<{
223
+ productId: string;
224
+ availabilityState: "cancelled" | "closed" | "sold_out" | "on_request" | "available" | "past_cutoff" | "too_early" | "unavailable";
225
+ counts: {
226
+ total: number;
227
+ open: number;
228
+ closed: number;
229
+ soldOut: number;
230
+ cancelled: number;
231
+ onRequest: number;
232
+ pastCutoff: number;
233
+ tooEarly: number;
234
+ available: number;
235
+ };
236
+ departures: {
237
+ id: string;
238
+ productId: string;
239
+ optionId: string | null;
240
+ dateLocal: string | null;
241
+ startAt: string | null;
242
+ endAt: string | null;
243
+ timezone: string;
244
+ status: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
245
+ availabilityState: "cancelled" | "closed" | "sold_out" | "on_request" | "available" | "past_cutoff" | "too_early" | "unavailable";
246
+ capacity: number | null;
247
+ remaining: number | null;
248
+ pastCutoff: boolean;
249
+ tooEarly: boolean;
250
+ }[];
251
+ total: number;
252
+ limit: number;
253
+ offset: number;
254
+ }>;
255
+ previewDeparturePrice: (departureId: string, input: Parameters<typeof previewStorefrontDeparturePrice>[2], requestOptions?: Parameters<typeof previewStorefrontDeparturePrice>[3]) => Promise<{
256
+ departureId: string;
257
+ productId: string;
258
+ optionId: string | null;
259
+ currencyCode: string;
260
+ basePrice: number;
261
+ taxAmount: number;
262
+ total: number;
263
+ notes: string | null;
264
+ lineItems: {
265
+ name: string;
266
+ total: number;
267
+ quantity: number;
268
+ unitPrice: number;
269
+ }[];
270
+ allocation: {
271
+ slot: {
272
+ id: string;
273
+ productId: string;
274
+ optionId: string | null;
275
+ dateLocal: string | null;
276
+ startAt: string | null;
277
+ endAt: string | null;
278
+ timezone: string;
279
+ status: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
280
+ availabilityState: "cancelled" | "closed" | "sold_out" | "on_request" | "available" | "past_cutoff" | "too_early" | "unavailable";
281
+ capacity: number | null;
282
+ remaining: number | null;
283
+ pastCutoff: boolean;
284
+ tooEarly: boolean;
285
+ };
286
+ pax: {
287
+ adults: number;
288
+ children: number;
289
+ infants: number;
290
+ total: number;
291
+ };
292
+ requestedUnits: {
293
+ unitId: string | null;
294
+ requestRef: string | null;
295
+ name: string;
296
+ unitType: string | null;
297
+ quantity: number;
298
+ pricingMode: string | null;
299
+ unitPrice: number;
300
+ total: number;
301
+ currencyCode: string;
302
+ tierId: string | null;
303
+ }[];
304
+ rooms: {
305
+ unitId: string;
306
+ name: string;
307
+ occupancy: number;
308
+ quantity: number;
309
+ pax: number;
310
+ pricingMode: string | null;
311
+ unitPrice: number;
312
+ total: number;
313
+ currencyCode: string;
314
+ tierId: string | null;
315
+ }[];
316
+ };
317
+ units: {
318
+ unitId: string | null;
319
+ requestRef: string | null;
320
+ name: string;
321
+ unitType: string | null;
322
+ quantity: number;
323
+ pricingMode: string | null;
324
+ unitPrice: number;
325
+ total: number;
326
+ currencyCode: string;
327
+ tierId: string | null;
328
+ }[];
329
+ rooms: {
330
+ unitId: string;
331
+ name: string;
332
+ occupancy: number;
333
+ quantity: number;
334
+ pax: number;
335
+ pricingMode: string | null;
336
+ unitPrice: number;
337
+ total: number;
338
+ currencyCode: string;
339
+ tierId: string | null;
340
+ }[];
341
+ extras: {
342
+ extraId: string;
343
+ name: string;
344
+ required: boolean;
345
+ selectable: boolean;
346
+ selected: boolean;
347
+ pricingMode: "on_request" | "included" | "per_person" | "per_booking" | "quantity_based" | "free";
348
+ quantity: number;
349
+ unitPrice: number;
350
+ total: number;
351
+ currencyCode: string;
352
+ }[];
353
+ offers: {
354
+ available: {
355
+ offer: {
356
+ id: string;
357
+ name: string;
358
+ slug: string | null;
359
+ description: string | null;
360
+ discountType: "percentage" | "fixed_amount";
361
+ discountValue: string;
362
+ currency: string | null;
363
+ applicableProductIds: string[];
364
+ applicableDepartureIds: string[];
365
+ validFrom: string | null;
366
+ validTo: string | null;
367
+ minTravelers: number | null;
368
+ imageMobileUrl: string | null;
369
+ imageDesktopUrl: string | null;
370
+ stackable: boolean;
371
+ createdAt: string;
372
+ updatedAt: string;
373
+ };
374
+ status: "applied" | "not_applicable" | "conflict";
375
+ reason: "currency" | "conflict" | "min_pax" | "eligibility" | "no_discount" | null;
376
+ selected: boolean;
377
+ discountAppliedCents: number;
378
+ discountedPriceCents: number;
379
+ }[];
380
+ requested: {
381
+ kind: "code" | "slug";
382
+ value: string;
383
+ result: {
384
+ status: "applied" | "not_applicable" | "conflict" | "invalid";
385
+ reason: "currency" | "scope" | "conflict" | "min_pax" | "eligibility" | "no_discount" | "offer_not_found" | "offer_expired" | "offer_not_yet_valid" | "code_not_found" | "code_required" | "code_expired" | "code_not_yet_valid" | "booking_mismatch" | "session_mismatch" | null;
386
+ offer: {
387
+ id: string;
388
+ name: string;
389
+ slug: string | null;
390
+ description: string | null;
391
+ discountType: "percentage" | "fixed_amount";
392
+ discountValue: string;
393
+ currency: string | null;
394
+ applicableProductIds: string[];
395
+ applicableDepartureIds: string[];
396
+ validFrom: string | null;
397
+ validTo: string | null;
398
+ minTravelers: number | null;
399
+ imageMobileUrl: string | null;
400
+ imageDesktopUrl: string | null;
401
+ stackable: boolean;
402
+ createdAt: string;
403
+ updatedAt: string;
404
+ } | null;
405
+ target: {
406
+ bookingId: string | null;
407
+ sessionId: string | null;
408
+ productId: string;
409
+ departureId: string | null;
410
+ };
411
+ pricing: {
412
+ basePriceCents: number;
413
+ currency: string;
414
+ discountAppliedCents: number;
415
+ discountedPriceCents: number;
416
+ };
417
+ appliedOffers: {
418
+ offerId: string;
419
+ offerName: string;
420
+ discountAppliedCents: number;
421
+ discountedPriceCents: number;
422
+ currency: string;
423
+ discountKind: "percentage" | "fixed_amount";
424
+ discountPercent: number | null;
425
+ discountAmountCents: number | null;
426
+ appliedCode: string | null;
427
+ stackable: boolean;
428
+ }[];
429
+ conflict: {
430
+ policy: "best_discount_wins" | "stackable_compose";
431
+ autoAppliedOfferIds: string[];
432
+ manualOfferId: string | null;
433
+ selectedOfferIds: string[];
434
+ message: string;
435
+ } | null;
436
+ } | null;
437
+ }[];
438
+ applied: {
439
+ offerId: string;
440
+ offerName: string;
441
+ discountAppliedCents: number;
442
+ discountedPriceCents: number;
443
+ currency: string;
444
+ discountKind: "percentage" | "fixed_amount";
445
+ discountPercent: number | null;
446
+ discountAmountCents: number | null;
447
+ appliedCode: string | null;
448
+ stackable: boolean;
449
+ }[];
450
+ conflict: {
451
+ policy: "best_discount_wins" | "stackable_compose";
452
+ autoAppliedOfferIds: string[];
453
+ manualOfferId: string | null;
454
+ selectedOfferIds: string[];
455
+ message: string;
456
+ } | null;
457
+ discountTotal: number;
458
+ discountTotalCents: number;
459
+ totalAfterDiscount: number;
460
+ currencyCode: string;
461
+ };
462
+ totals: {
463
+ currencyCode: string;
464
+ base: number;
465
+ extras: number;
466
+ subtotal: number;
467
+ discount: number;
468
+ tax: number;
469
+ total: number;
470
+ perPerson: number;
471
+ perBooking: number;
472
+ };
473
+ }>;
474
+ listProductExtensions: (productId: string, query?: Parameters<typeof listStorefrontProductExtensions>[2]) => Promise<{
475
+ extensions: {
476
+ id: string;
477
+ name: string;
478
+ label: string;
479
+ required: boolean;
480
+ selectable: boolean;
481
+ hasOptions: boolean;
482
+ refProductId: string | null;
483
+ thumb: string | null;
484
+ pricePerPerson: number | null;
485
+ currencyCode: string;
486
+ pricingMode: "on_request" | "included" | "per_person" | "per_booking" | "quantity_based" | "free";
487
+ defaultQuantity: number | null;
488
+ minQuantity: number | null;
489
+ maxQuantity: number | null;
490
+ }[];
491
+ items: {
492
+ id: string;
493
+ name: string;
494
+ label: string;
495
+ required: boolean;
496
+ selectable: boolean;
497
+ hasOptions: boolean;
498
+ refProductId: string | null;
499
+ thumb: string | null;
500
+ pricePerPerson: number | null;
501
+ currencyCode: string;
502
+ pricingMode: "on_request" | "included" | "per_person" | "per_booking" | "quantity_based" | "free";
503
+ defaultQuantity: number | null;
504
+ minQuantity: number | null;
505
+ maxQuantity: number | null;
506
+ }[];
507
+ details: Record<string, {
508
+ description: string | null;
509
+ media: {
510
+ url: string;
511
+ alt: string | null;
512
+ }[];
513
+ }>;
514
+ currencyCode: string;
515
+ }>;
516
+ getDepartureItinerary: (productId: string, departureId: string) => Promise<{
517
+ id: string;
518
+ itineraryId: string;
519
+ days: {
520
+ id: string;
521
+ title: string;
522
+ description: string | null;
523
+ thumbnail: {
524
+ url: string;
525
+ } | null;
526
+ segments: {
527
+ id: string;
528
+ title: string;
529
+ description: string | null;
530
+ }[];
531
+ }[];
532
+ }>;
533
+ listProductOffers: (productId: string, query?: Parameters<typeof listStorefrontProductOffers>[2]) => Promise<{
534
+ id: string;
535
+ name: string;
536
+ slug: string | null;
537
+ description: string | null;
538
+ discountType: "percentage" | "fixed_amount";
539
+ discountValue: string;
540
+ currency: string | null;
541
+ applicableProductIds: string[];
542
+ applicableDepartureIds: string[];
543
+ validFrom: string | null;
544
+ validTo: string | null;
545
+ minTravelers: number | null;
546
+ imageMobileUrl: string | null;
547
+ imageDesktopUrl: string | null;
548
+ stackable: boolean;
549
+ createdAt: string;
550
+ updatedAt: string;
551
+ }[]>;
552
+ getOfferBySlug: (slug: string, query?: Parameters<typeof getStorefrontOfferBySlug>[2]) => Promise<{
553
+ id: string;
554
+ name: string;
555
+ slug: string | null;
556
+ description: string | null;
557
+ discountType: "percentage" | "fixed_amount";
558
+ discountValue: string;
559
+ currency: string | null;
560
+ applicableProductIds: string[];
561
+ applicableDepartureIds: string[];
562
+ validFrom: string | null;
563
+ validTo: string | null;
564
+ minTravelers: number | null;
565
+ imageMobileUrl: string | null;
566
+ imageDesktopUrl: string | null;
567
+ stackable: boolean;
568
+ createdAt: string;
569
+ updatedAt: string;
570
+ }>;
571
+ };
572
+ booking: {
573
+ bootstrapSession: (input: Parameters<typeof bootstrapBookingSession>[1], requestOptions?: Parameters<typeof bootstrapBookingSession>[2]) => Promise<{
574
+ paymentPlan: {
575
+ source: "storefront_default";
576
+ depositKind: "none" | "percent" | "fixed_cents";
577
+ depositPercent: number | null;
578
+ depositAmountCents: number | null;
579
+ requiresFullPayment: boolean;
580
+ };
581
+ paymentSchedule: {
582
+ id: string;
583
+ scheduleType: "other" | "deposit" | "balance" | "installment" | "hold";
584
+ status: "expired" | "cancelled" | "pending" | "paid" | "due" | "waived";
585
+ dueDate: string;
586
+ currency: string;
587
+ amountCents: number;
588
+ notes: string | null;
589
+ }[];
590
+ repricing: {
591
+ originalQuote: {
592
+ currencyCode: string;
593
+ totalSellAmountCents: number;
594
+ quotedAt?: string | null | undefined;
595
+ expiresAt?: string | null | undefined;
596
+ };
597
+ current: {
598
+ sessionId: string;
599
+ catalogId: string | null;
600
+ currencyCode: string;
601
+ totalSellAmountCents: number;
602
+ items: {
603
+ itemId: string;
604
+ title: string;
605
+ productId: string | null;
606
+ optionId: string | null;
607
+ optionUnitId: string | null;
608
+ optionUnitName: string | null;
609
+ optionUnitType: string | null;
610
+ pricingCategoryId: string | null;
611
+ quantity: number;
612
+ pricingMode: string;
613
+ unitSellAmountCents: number | null;
614
+ totalSellAmountCents: number | null;
615
+ warnings: string[];
616
+ }[];
617
+ warnings: string[];
618
+ appliedToSession: boolean;
619
+ };
620
+ deltaAmountCents: number;
621
+ staleQuote: boolean;
622
+ };
623
+ availability: {
624
+ departureId: string;
625
+ slotId: string;
626
+ productId: string;
627
+ optionId: string | null;
628
+ dateLocal: string | null;
629
+ startsAt: string | null;
630
+ endsAt: string | null;
631
+ timezone: string;
632
+ status: "cancelled" | "open" | "closed" | "sold_out" | "on_request";
633
+ capacity: number | null;
634
+ remaining: number | null;
635
+ };
636
+ allocation: {
637
+ id: string;
638
+ bookingItemId: string | null;
639
+ productId: string | null;
640
+ optionId: string | null;
641
+ optionUnitId: string | null;
642
+ pricingCategoryId: string | null;
643
+ availabilitySlotId: string | null;
644
+ quantity: number;
645
+ allocationType: "unit" | "pickup" | "resource";
646
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
647
+ holdExpiresAt: string | null;
648
+ confirmedAt: string | null;
649
+ releasedAt: string | null;
650
+ }[];
651
+ currency: string;
652
+ session: {
653
+ sessionId: string;
654
+ bookingNumber: string;
655
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
656
+ externalBookingRef: string | null;
657
+ communicationLanguage: string | null;
658
+ sellCurrency: string;
659
+ sellAmountCents: number | null;
660
+ startDate: string | null;
661
+ endDate: string | null;
662
+ pax: number | null;
663
+ holdExpiresAt: string | null;
664
+ confirmedAt: string | null;
665
+ expiredAt: string | null;
666
+ cancelledAt: string | null;
667
+ completedAt: string | null;
668
+ travelers: {
669
+ id: string;
670
+ participantType: "traveler" | "occupant" | "other";
671
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
672
+ firstName: string;
673
+ lastName: string;
674
+ email: string | null;
675
+ phone: string | null;
676
+ preferredLanguage: string | null;
677
+ specialRequests: string | null;
678
+ isPrimary: boolean;
679
+ notes: string | null;
680
+ }[];
681
+ items: {
682
+ id: string;
683
+ title: string;
684
+ description: string | null;
685
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
686
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
687
+ serviceDate: string | null;
688
+ startsAt: string | null;
689
+ endsAt: string | null;
690
+ quantity: number;
691
+ sellCurrency: string;
692
+ unitSellAmountCents: number | null;
693
+ totalSellAmountCents: number | null;
694
+ costCurrency: string | null;
695
+ unitCostAmountCents: number | null;
696
+ totalCostAmountCents: number | null;
697
+ notes: string | null;
698
+ productId: string | null;
699
+ optionId: string | null;
700
+ optionUnitId: string | null;
701
+ pricingCategoryId: string | null;
702
+ travelerLinks: {
703
+ id: string;
704
+ travelerId: string;
705
+ role: "traveler" | "occupant" | "other" | "beneficiary";
706
+ isPrimary: boolean;
707
+ }[];
708
+ }[];
709
+ allocations: {
710
+ id: string;
711
+ bookingItemId: string | null;
712
+ productId: string | null;
713
+ optionId: string | null;
714
+ optionUnitId: string | null;
715
+ pricingCategoryId: string | null;
716
+ availabilitySlotId: string | null;
717
+ quantity: number;
718
+ allocationType: "unit" | "pickup" | "resource";
719
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
720
+ holdExpiresAt: string | null;
721
+ confirmedAt: string | null;
722
+ releasedAt: string | null;
723
+ }[];
724
+ checklist: {
725
+ hasTravelers: boolean;
726
+ hasPrimaryTraveler: boolean;
727
+ hasItems: boolean;
728
+ hasAllocations: boolean;
729
+ readyForConfirmation: boolean;
730
+ };
731
+ state: {
732
+ sessionId: string;
733
+ stateKey: "wizard";
734
+ currentStep: string | null;
735
+ completedSteps: string[];
736
+ payload: Record<string, unknown>;
737
+ version: number;
738
+ createdAt: string;
739
+ updatedAt: string;
740
+ } | null;
741
+ checkoutCapability: {
742
+ token: string;
743
+ expiresAt: string;
744
+ actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
745
+ };
746
+ };
747
+ }>;
748
+ createSession: (input: Parameters<typeof createPublicBookingSession>[1], requestOptions?: Parameters<typeof createPublicBookingSession>[2]) => Promise<{
749
+ sessionId: string;
750
+ bookingNumber: string;
751
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
752
+ externalBookingRef: string | null;
753
+ communicationLanguage: string | null;
754
+ sellCurrency: string;
755
+ sellAmountCents: number | null;
756
+ startDate: string | null;
757
+ endDate: string | null;
758
+ pax: number | null;
759
+ holdExpiresAt: string | null;
760
+ confirmedAt: string | null;
761
+ expiredAt: string | null;
762
+ cancelledAt: string | null;
763
+ completedAt: string | null;
764
+ travelers: {
765
+ id: string;
766
+ participantType: "traveler" | "occupant" | "other";
767
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
768
+ firstName: string;
769
+ lastName: string;
770
+ email: string | null;
771
+ phone: string | null;
772
+ preferredLanguage: string | null;
773
+ specialRequests: string | null;
774
+ isPrimary: boolean;
775
+ notes: string | null;
776
+ }[];
777
+ items: {
778
+ id: string;
779
+ title: string;
780
+ description: string | null;
781
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
782
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
783
+ serviceDate: string | null;
784
+ startsAt: string | null;
785
+ endsAt: string | null;
786
+ quantity: number;
787
+ sellCurrency: string;
788
+ unitSellAmountCents: number | null;
789
+ totalSellAmountCents: number | null;
790
+ costCurrency: string | null;
791
+ unitCostAmountCents: number | null;
792
+ totalCostAmountCents: number | null;
793
+ notes: string | null;
794
+ productId: string | null;
795
+ optionId: string | null;
796
+ optionUnitId: string | null;
797
+ pricingCategoryId: string | null;
798
+ travelerLinks: {
799
+ id: string;
800
+ travelerId: string;
801
+ role: "traveler" | "occupant" | "other" | "beneficiary";
802
+ isPrimary: boolean;
803
+ }[];
804
+ }[];
805
+ allocations: {
806
+ id: string;
807
+ bookingItemId: string | null;
808
+ productId: string | null;
809
+ optionId: string | null;
810
+ optionUnitId: string | null;
811
+ pricingCategoryId: string | null;
812
+ availabilitySlotId: string | null;
813
+ quantity: number;
814
+ allocationType: "unit" | "pickup" | "resource";
815
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
816
+ holdExpiresAt: string | null;
817
+ confirmedAt: string | null;
818
+ releasedAt: string | null;
819
+ }[];
820
+ checklist: {
821
+ hasTravelers: boolean;
822
+ hasPrimaryTraveler: boolean;
823
+ hasItems: boolean;
824
+ hasAllocations: boolean;
825
+ readyForConfirmation: boolean;
826
+ };
827
+ state: {
828
+ sessionId: string;
829
+ stateKey: "wizard";
830
+ currentStep: string | null;
831
+ completedSteps: string[];
832
+ payload: Record<string, unknown>;
833
+ version: number;
834
+ createdAt: string;
835
+ updatedAt: string;
836
+ } | null;
837
+ checkoutCapability?: {
838
+ token: string;
839
+ expiresAt: string;
840
+ actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
841
+ } | undefined;
842
+ }>;
843
+ getSession: (sessionId: string) => Promise<{
844
+ sessionId: string;
845
+ bookingNumber: string;
846
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
847
+ externalBookingRef: string | null;
848
+ communicationLanguage: string | null;
849
+ sellCurrency: string;
850
+ sellAmountCents: number | null;
851
+ startDate: string | null;
852
+ endDate: string | null;
853
+ pax: number | null;
854
+ holdExpiresAt: string | null;
855
+ confirmedAt: string | null;
856
+ expiredAt: string | null;
857
+ cancelledAt: string | null;
858
+ completedAt: string | null;
859
+ travelers: {
860
+ id: string;
861
+ participantType: "traveler" | "occupant" | "other";
862
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
863
+ firstName: string;
864
+ lastName: string;
865
+ email: string | null;
866
+ phone: string | null;
867
+ preferredLanguage: string | null;
868
+ specialRequests: string | null;
869
+ isPrimary: boolean;
870
+ notes: string | null;
871
+ }[];
872
+ items: {
873
+ id: string;
874
+ title: string;
875
+ description: string | null;
876
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
877
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
878
+ serviceDate: string | null;
879
+ startsAt: string | null;
880
+ endsAt: string | null;
881
+ quantity: number;
882
+ sellCurrency: string;
883
+ unitSellAmountCents: number | null;
884
+ totalSellAmountCents: number | null;
885
+ costCurrency: string | null;
886
+ unitCostAmountCents: number | null;
887
+ totalCostAmountCents: number | null;
888
+ notes: string | null;
889
+ productId: string | null;
890
+ optionId: string | null;
891
+ optionUnitId: string | null;
892
+ pricingCategoryId: string | null;
893
+ travelerLinks: {
894
+ id: string;
895
+ travelerId: string;
896
+ role: "traveler" | "occupant" | "other" | "beneficiary";
897
+ isPrimary: boolean;
898
+ }[];
899
+ }[];
900
+ allocations: {
901
+ id: string;
902
+ bookingItemId: string | null;
903
+ productId: string | null;
904
+ optionId: string | null;
905
+ optionUnitId: string | null;
906
+ pricingCategoryId: string | null;
907
+ availabilitySlotId: string | null;
908
+ quantity: number;
909
+ allocationType: "unit" | "pickup" | "resource";
910
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
911
+ holdExpiresAt: string | null;
912
+ confirmedAt: string | null;
913
+ releasedAt: string | null;
914
+ }[];
915
+ checklist: {
916
+ hasTravelers: boolean;
917
+ hasPrimaryTraveler: boolean;
918
+ hasItems: boolean;
919
+ hasAllocations: boolean;
920
+ readyForConfirmation: boolean;
921
+ };
922
+ state: {
923
+ sessionId: string;
924
+ stateKey: "wizard";
925
+ currentStep: string | null;
926
+ completedSteps: string[];
927
+ payload: Record<string, unknown>;
928
+ version: number;
929
+ createdAt: string;
930
+ updatedAt: string;
931
+ } | null;
932
+ checkoutCapability?: {
933
+ token: string;
934
+ expiresAt: string;
935
+ actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
936
+ } | undefined;
937
+ }>;
938
+ updateSession: (sessionId: string, input: Parameters<typeof updatePublicBookingSession>[2], requestOptions?: Parameters<typeof updatePublicBookingSession>[3]) => Promise<{
939
+ sessionId: string;
940
+ bookingNumber: string;
941
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
942
+ externalBookingRef: string | null;
943
+ communicationLanguage: string | null;
944
+ sellCurrency: string;
945
+ sellAmountCents: number | null;
946
+ startDate: string | null;
947
+ endDate: string | null;
948
+ pax: number | null;
949
+ holdExpiresAt: string | null;
950
+ confirmedAt: string | null;
951
+ expiredAt: string | null;
952
+ cancelledAt: string | null;
953
+ completedAt: string | null;
954
+ travelers: {
955
+ id: string;
956
+ participantType: "traveler" | "occupant" | "other";
957
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
958
+ firstName: string;
959
+ lastName: string;
960
+ email: string | null;
961
+ phone: string | null;
962
+ preferredLanguage: string | null;
963
+ specialRequests: string | null;
964
+ isPrimary: boolean;
965
+ notes: string | null;
966
+ }[];
967
+ items: {
968
+ id: string;
969
+ title: string;
970
+ description: string | null;
971
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
972
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
973
+ serviceDate: string | null;
974
+ startsAt: string | null;
975
+ endsAt: string | null;
976
+ quantity: number;
977
+ sellCurrency: string;
978
+ unitSellAmountCents: number | null;
979
+ totalSellAmountCents: number | null;
980
+ costCurrency: string | null;
981
+ unitCostAmountCents: number | null;
982
+ totalCostAmountCents: number | null;
983
+ notes: string | null;
984
+ productId: string | null;
985
+ optionId: string | null;
986
+ optionUnitId: string | null;
987
+ pricingCategoryId: string | null;
988
+ travelerLinks: {
989
+ id: string;
990
+ travelerId: string;
991
+ role: "traveler" | "occupant" | "other" | "beneficiary";
992
+ isPrimary: boolean;
993
+ }[];
994
+ }[];
995
+ allocations: {
996
+ id: string;
997
+ bookingItemId: string | null;
998
+ productId: string | null;
999
+ optionId: string | null;
1000
+ optionUnitId: string | null;
1001
+ pricingCategoryId: string | null;
1002
+ availabilitySlotId: string | null;
1003
+ quantity: number;
1004
+ allocationType: "unit" | "pickup" | "resource";
1005
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
1006
+ holdExpiresAt: string | null;
1007
+ confirmedAt: string | null;
1008
+ releasedAt: string | null;
1009
+ }[];
1010
+ checklist: {
1011
+ hasTravelers: boolean;
1012
+ hasPrimaryTraveler: boolean;
1013
+ hasItems: boolean;
1014
+ hasAllocations: boolean;
1015
+ readyForConfirmation: boolean;
1016
+ };
1017
+ state: {
1018
+ sessionId: string;
1019
+ stateKey: "wizard";
1020
+ currentStep: string | null;
1021
+ completedSteps: string[];
1022
+ payload: Record<string, unknown>;
1023
+ version: number;
1024
+ createdAt: string;
1025
+ updatedAt: string;
1026
+ } | null;
1027
+ checkoutCapability?: {
1028
+ token: string;
1029
+ expiresAt: string;
1030
+ actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
1031
+ } | undefined;
1032
+ }>;
1033
+ getSessionState: (sessionId: string) => Promise<{
1034
+ sessionId: string;
1035
+ stateKey: "wizard";
1036
+ currentStep: string | null;
1037
+ completedSteps: string[];
1038
+ payload: Record<string, unknown>;
1039
+ version: number;
1040
+ createdAt: string;
1041
+ updatedAt: string;
1042
+ }>;
1043
+ updateSessionState: (sessionId: string, input: Parameters<typeof updatePublicBookingSessionState>[2], requestOptions?: Parameters<typeof updatePublicBookingSessionState>[3]) => Promise<{
1044
+ sessionId: string;
1045
+ stateKey: "wizard";
1046
+ currentStep: string | null;
1047
+ completedSteps: string[];
1048
+ payload: Record<string, unknown>;
1049
+ version: number;
1050
+ createdAt: string;
1051
+ updatedAt: string;
1052
+ }>;
1053
+ reprice: (sessionId: string, input: Parameters<typeof repricePublicBookingSession>[2], requestOptions?: Parameters<typeof repricePublicBookingSession>[3]) => Promise<{
1054
+ pricing: {
1055
+ sessionId: string;
1056
+ catalogId: string | null;
1057
+ currencyCode: string;
1058
+ totalSellAmountCents: number;
1059
+ items: {
1060
+ itemId: string;
1061
+ title: string;
1062
+ productId: string | null;
1063
+ optionId: string | null;
1064
+ optionUnitId: string | null;
1065
+ optionUnitName: string | null;
1066
+ optionUnitType: string | null;
1067
+ pricingCategoryId: string | null;
1068
+ quantity: number;
1069
+ pricingMode: string;
1070
+ unitSellAmountCents: number | null;
1071
+ totalSellAmountCents: number | null;
1072
+ warnings: string[];
1073
+ }[];
1074
+ warnings: string[];
1075
+ appliedToSession: boolean;
1076
+ };
1077
+ session: {
1078
+ sessionId: string;
1079
+ bookingNumber: string;
1080
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
1081
+ externalBookingRef: string | null;
1082
+ communicationLanguage: string | null;
1083
+ sellCurrency: string;
1084
+ sellAmountCents: number | null;
1085
+ startDate: string | null;
1086
+ endDate: string | null;
1087
+ pax: number | null;
1088
+ holdExpiresAt: string | null;
1089
+ confirmedAt: string | null;
1090
+ expiredAt: string | null;
1091
+ cancelledAt: string | null;
1092
+ completedAt: string | null;
1093
+ travelers: {
1094
+ id: string;
1095
+ participantType: "traveler" | "occupant" | "other";
1096
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
1097
+ firstName: string;
1098
+ lastName: string;
1099
+ email: string | null;
1100
+ phone: string | null;
1101
+ preferredLanguage: string | null;
1102
+ specialRequests: string | null;
1103
+ isPrimary: boolean;
1104
+ notes: string | null;
1105
+ }[];
1106
+ items: {
1107
+ id: string;
1108
+ title: string;
1109
+ description: string | null;
1110
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
1111
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
1112
+ serviceDate: string | null;
1113
+ startsAt: string | null;
1114
+ endsAt: string | null;
1115
+ quantity: number;
1116
+ sellCurrency: string;
1117
+ unitSellAmountCents: number | null;
1118
+ totalSellAmountCents: number | null;
1119
+ costCurrency: string | null;
1120
+ unitCostAmountCents: number | null;
1121
+ totalCostAmountCents: number | null;
1122
+ notes: string | null;
1123
+ productId: string | null;
1124
+ optionId: string | null;
1125
+ optionUnitId: string | null;
1126
+ pricingCategoryId: string | null;
1127
+ travelerLinks: {
1128
+ id: string;
1129
+ travelerId: string;
1130
+ role: "traveler" | "occupant" | "other" | "beneficiary";
1131
+ isPrimary: boolean;
1132
+ }[];
1133
+ }[];
1134
+ allocations: {
1135
+ id: string;
1136
+ bookingItemId: string | null;
1137
+ productId: string | null;
1138
+ optionId: string | null;
1139
+ optionUnitId: string | null;
1140
+ pricingCategoryId: string | null;
1141
+ availabilitySlotId: string | null;
1142
+ quantity: number;
1143
+ allocationType: "unit" | "pickup" | "resource";
1144
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
1145
+ holdExpiresAt: string | null;
1146
+ confirmedAt: string | null;
1147
+ releasedAt: string | null;
1148
+ }[];
1149
+ checklist: {
1150
+ hasTravelers: boolean;
1151
+ hasPrimaryTraveler: boolean;
1152
+ hasItems: boolean;
1153
+ hasAllocations: boolean;
1154
+ readyForConfirmation: boolean;
1155
+ };
1156
+ state: {
1157
+ sessionId: string;
1158
+ stateKey: "wizard";
1159
+ currentStep: string | null;
1160
+ completedSteps: string[];
1161
+ payload: Record<string, unknown>;
1162
+ version: number;
1163
+ createdAt: string;
1164
+ updatedAt: string;
1165
+ } | null;
1166
+ checkoutCapability?: {
1167
+ token: string;
1168
+ expiresAt: string;
1169
+ actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
1170
+ } | undefined;
1171
+ } | null;
1172
+ }>;
1173
+ confirm: (sessionId: string, input?: Parameters<typeof confirmPublicBookingSession>[2], requestOptions?: Parameters<typeof confirmPublicBookingSession>[3]) => Promise<{
1174
+ sessionId: string;
1175
+ bookingNumber: string;
1176
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
1177
+ externalBookingRef: string | null;
1178
+ communicationLanguage: string | null;
1179
+ sellCurrency: string;
1180
+ sellAmountCents: number | null;
1181
+ startDate: string | null;
1182
+ endDate: string | null;
1183
+ pax: number | null;
1184
+ holdExpiresAt: string | null;
1185
+ confirmedAt: string | null;
1186
+ expiredAt: string | null;
1187
+ cancelledAt: string | null;
1188
+ completedAt: string | null;
1189
+ travelers: {
1190
+ id: string;
1191
+ participantType: "traveler" | "occupant" | "other";
1192
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
1193
+ firstName: string;
1194
+ lastName: string;
1195
+ email: string | null;
1196
+ phone: string | null;
1197
+ preferredLanguage: string | null;
1198
+ specialRequests: string | null;
1199
+ isPrimary: boolean;
1200
+ notes: string | null;
1201
+ }[];
1202
+ items: {
1203
+ id: string;
1204
+ title: string;
1205
+ description: string | null;
1206
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
1207
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
1208
+ serviceDate: string | null;
1209
+ startsAt: string | null;
1210
+ endsAt: string | null;
1211
+ quantity: number;
1212
+ sellCurrency: string;
1213
+ unitSellAmountCents: number | null;
1214
+ totalSellAmountCents: number | null;
1215
+ costCurrency: string | null;
1216
+ unitCostAmountCents: number | null;
1217
+ totalCostAmountCents: number | null;
1218
+ notes: string | null;
1219
+ productId: string | null;
1220
+ optionId: string | null;
1221
+ optionUnitId: string | null;
1222
+ pricingCategoryId: string | null;
1223
+ travelerLinks: {
1224
+ id: string;
1225
+ travelerId: string;
1226
+ role: "traveler" | "occupant" | "other" | "beneficiary";
1227
+ isPrimary: boolean;
1228
+ }[];
1229
+ }[];
1230
+ allocations: {
1231
+ id: string;
1232
+ bookingItemId: string | null;
1233
+ productId: string | null;
1234
+ optionId: string | null;
1235
+ optionUnitId: string | null;
1236
+ pricingCategoryId: string | null;
1237
+ availabilitySlotId: string | null;
1238
+ quantity: number;
1239
+ allocationType: "unit" | "pickup" | "resource";
1240
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
1241
+ holdExpiresAt: string | null;
1242
+ confirmedAt: string | null;
1243
+ releasedAt: string | null;
1244
+ }[];
1245
+ checklist: {
1246
+ hasTravelers: boolean;
1247
+ hasPrimaryTraveler: boolean;
1248
+ hasItems: boolean;
1249
+ hasAllocations: boolean;
1250
+ readyForConfirmation: boolean;
1251
+ };
1252
+ state: {
1253
+ sessionId: string;
1254
+ stateKey: "wizard";
1255
+ currentStep: string | null;
1256
+ completedSteps: string[];
1257
+ payload: Record<string, unknown>;
1258
+ version: number;
1259
+ createdAt: string;
1260
+ updatedAt: string;
1261
+ } | null;
1262
+ checkoutCapability?: {
1263
+ token: string;
1264
+ expiresAt: string;
1265
+ actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
1266
+ } | undefined;
1267
+ }>;
1268
+ expire: (sessionId: string, input?: Parameters<typeof expirePublicBookingSession>[2], requestOptions?: Parameters<typeof expirePublicBookingSession>[3]) => Promise<{
1269
+ sessionId: string;
1270
+ bookingNumber: string;
1271
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
1272
+ externalBookingRef: string | null;
1273
+ communicationLanguage: string | null;
1274
+ sellCurrency: string;
1275
+ sellAmountCents: number | null;
1276
+ startDate: string | null;
1277
+ endDate: string | null;
1278
+ pax: number | null;
1279
+ holdExpiresAt: string | null;
1280
+ confirmedAt: string | null;
1281
+ expiredAt: string | null;
1282
+ cancelledAt: string | null;
1283
+ completedAt: string | null;
1284
+ travelers: {
1285
+ id: string;
1286
+ participantType: "traveler" | "occupant" | "other";
1287
+ travelerCategory: "other" | "adult" | "child" | "infant" | "senior" | null;
1288
+ firstName: string;
1289
+ lastName: string;
1290
+ email: string | null;
1291
+ phone: string | null;
1292
+ preferredLanguage: string | null;
1293
+ specialRequests: string | null;
1294
+ isPrimary: boolean;
1295
+ notes: string | null;
1296
+ }[];
1297
+ items: {
1298
+ id: string;
1299
+ title: string;
1300
+ description: string | null;
1301
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
1302
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
1303
+ serviceDate: string | null;
1304
+ startsAt: string | null;
1305
+ endsAt: string | null;
1306
+ quantity: number;
1307
+ sellCurrency: string;
1308
+ unitSellAmountCents: number | null;
1309
+ totalSellAmountCents: number | null;
1310
+ costCurrency: string | null;
1311
+ unitCostAmountCents: number | null;
1312
+ totalCostAmountCents: number | null;
1313
+ notes: string | null;
1314
+ productId: string | null;
1315
+ optionId: string | null;
1316
+ optionUnitId: string | null;
1317
+ pricingCategoryId: string | null;
1318
+ travelerLinks: {
1319
+ id: string;
1320
+ travelerId: string;
1321
+ role: "traveler" | "occupant" | "other" | "beneficiary";
1322
+ isPrimary: boolean;
1323
+ }[];
1324
+ }[];
1325
+ allocations: {
1326
+ id: string;
1327
+ bookingItemId: string | null;
1328
+ productId: string | null;
1329
+ optionId: string | null;
1330
+ optionUnitId: string | null;
1331
+ pricingCategoryId: string | null;
1332
+ availabilitySlotId: string | null;
1333
+ quantity: number;
1334
+ allocationType: "unit" | "pickup" | "resource";
1335
+ status: "confirmed" | "expired" | "cancelled" | "fulfilled" | "held" | "released";
1336
+ holdExpiresAt: string | null;
1337
+ confirmedAt: string | null;
1338
+ releasedAt: string | null;
1339
+ }[];
1340
+ checklist: {
1341
+ hasTravelers: boolean;
1342
+ hasPrimaryTraveler: boolean;
1343
+ hasItems: boolean;
1344
+ hasAllocations: boolean;
1345
+ readyForConfirmation: boolean;
1346
+ };
1347
+ state: {
1348
+ sessionId: string;
1349
+ stateKey: "wizard";
1350
+ currentStep: string | null;
1351
+ completedSteps: string[];
1352
+ payload: Record<string, unknown>;
1353
+ version: number;
1354
+ createdAt: string;
1355
+ updatedAt: string;
1356
+ } | null;
1357
+ checkoutCapability?: {
1358
+ token: string;
1359
+ expiresAt: string;
1360
+ actions: ("session:read" | "session:update" | "session:reprice" | "session:finalize" | "payment:read" | "payment:start")[];
1361
+ } | undefined;
1362
+ }>;
1363
+ getOverview: (query: Parameters<typeof getPublicBookingOverview>[1]) => Promise<{
1364
+ bookingId: string;
1365
+ bookingNumber: string;
1366
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
1367
+ sellCurrency: string;
1368
+ sellAmountCents: number | null;
1369
+ startDate: string | null;
1370
+ endDate: string | null;
1371
+ pax: number | null;
1372
+ confirmedAt: string | null;
1373
+ cancelledAt: string | null;
1374
+ completedAt: string | null;
1375
+ travelers: {
1376
+ id: string;
1377
+ participantType: "traveler" | "occupant" | "other";
1378
+ firstName: string;
1379
+ lastName: string;
1380
+ isPrimary: boolean;
1381
+ }[];
1382
+ items: {
1383
+ id: string;
1384
+ title: string;
1385
+ description: string | null;
1386
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
1387
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
1388
+ serviceDate: string | null;
1389
+ startsAt: string | null;
1390
+ endsAt: string | null;
1391
+ quantity: number;
1392
+ sellCurrency: string;
1393
+ unitSellAmountCents: number | null;
1394
+ totalSellAmountCents: number | null;
1395
+ costCurrency: string | null;
1396
+ unitCostAmountCents: number | null;
1397
+ totalCostAmountCents: number | null;
1398
+ notes: string | null;
1399
+ productId: string | null;
1400
+ optionId: string | null;
1401
+ optionUnitId: string | null;
1402
+ pricingCategoryId: string | null;
1403
+ travelerLinks: {
1404
+ id: string;
1405
+ travelerId: string;
1406
+ role: "traveler" | "occupant" | "other" | "beneficiary";
1407
+ isPrimary: boolean;
1408
+ }[];
1409
+ }[];
1410
+ documents: {
1411
+ id: string;
1412
+ travelerId: string | null;
1413
+ type: "other" | "visa" | "insurance" | "health" | "passport_copy";
1414
+ fileName: string;
1415
+ fileUrl: string;
1416
+ }[];
1417
+ fulfillments: {
1418
+ id: string;
1419
+ bookingItemId: string | null;
1420
+ travelerId: string | null;
1421
+ fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
1422
+ deliveryChannel: "other" | "email" | "download" | "api" | "wallet";
1423
+ status: "pending" | "issued" | "reissued" | "revoked" | "failed";
1424
+ artifactUrl: string | null;
1425
+ }[];
1426
+ }>;
1427
+ deriveState: typeof deriveBookingEngineState;
1428
+ createSnapshot: typeof createBookingEngineSnapshot;
1429
+ canRunAction: typeof canRunBookingEngineAction;
1430
+ };
1431
+ bookingEngine: {
1432
+ reserve: (input: Parameters<typeof reserveBookingEngineSession>[1], requestOptions?: Parameters<typeof reserveBookingEngineSession>[2]) => Promise<import("./booking-engine.js").BookingEngineSessionSnapshot>;
1433
+ getSnapshot: (sessionId: string) => Promise<import("./booking-engine.js").BookingEngineSessionSnapshot>;
1434
+ updateSession: (sessionId: string, input: Parameters<typeof updateBookingEngineSession>[2], requestOptions?: Parameters<typeof updateBookingEngineSession>[3]) => Promise<import("./booking-engine.js").BookingEngineSessionSnapshot>;
1435
+ updateTravelers: (sessionId: string, input: Parameters<typeof updateBookingEngineTravelers>[2], requestOptions?: Parameters<typeof updateBookingEngineTravelers>[3]) => Promise<import("./booking-engine.js").BookingEngineSessionSnapshot>;
1436
+ getProgress: (sessionId: string) => Promise<{
1437
+ sessionId: string;
1438
+ stateKey: "wizard";
1439
+ currentStep: string | null;
1440
+ completedSteps: string[];
1441
+ payload: Record<string, unknown>;
1442
+ version: number;
1443
+ createdAt: string;
1444
+ updatedAt: string;
1445
+ }>;
1446
+ updateProgress: (sessionId: string, input: Parameters<typeof updateBookingEngineProgress>[2], requestOptions?: Parameters<typeof updateBookingEngineProgress>[3]) => Promise<{
1447
+ sessionId: string;
1448
+ stateKey: "wizard";
1449
+ currentStep: string | null;
1450
+ completedSteps: string[];
1451
+ payload: Record<string, unknown>;
1452
+ version: number;
1453
+ createdAt: string;
1454
+ updatedAt: string;
1455
+ }>;
1456
+ reprice: (sessionId: string, input: Parameters<typeof repriceBookingEngineSession>[2], requestOptions?: Parameters<typeof repriceBookingEngineSession>[3]) => Promise<import("./booking-engine.js").BookingEngineRepriceResult>;
1457
+ confirm: (sessionId: string, input?: Parameters<typeof confirmBookingEngineSession>[2], requestOptions?: Parameters<typeof confirmBookingEngineSession>[3]) => Promise<import("./booking-engine.js").BookingEngineSessionSnapshot>;
1458
+ expire: (sessionId: string, input?: Parameters<typeof expireBookingEngineSession>[2], requestOptions?: Parameters<typeof expireBookingEngineSession>[3]) => Promise<import("./booking-engine.js").BookingEngineSessionSnapshot>;
1459
+ getOverview: (query: Parameters<typeof getBookingEngineOverview>[1]) => Promise<{
1460
+ bookingId: string;
1461
+ bookingNumber: string;
1462
+ status: "draft" | "on_hold" | "awaiting_payment" | "confirmed" | "in_progress" | "completed" | "expired" | "cancelled";
1463
+ sellCurrency: string;
1464
+ sellAmountCents: number | null;
1465
+ startDate: string | null;
1466
+ endDate: string | null;
1467
+ pax: number | null;
1468
+ confirmedAt: string | null;
1469
+ cancelledAt: string | null;
1470
+ completedAt: string | null;
1471
+ travelers: {
1472
+ id: string;
1473
+ participantType: "traveler" | "occupant" | "other";
1474
+ firstName: string;
1475
+ lastName: string;
1476
+ isPrimary: boolean;
1477
+ }[];
1478
+ items: {
1479
+ id: string;
1480
+ title: string;
1481
+ description: string | null;
1482
+ itemType: "other" | "unit" | "extra" | "service" | "fee" | "tax" | "discount" | "adjustment" | "accommodation" | "transport";
1483
+ status: "draft" | "on_hold" | "confirmed" | "expired" | "cancelled" | "fulfilled";
1484
+ serviceDate: string | null;
1485
+ startsAt: string | null;
1486
+ endsAt: string | null;
1487
+ quantity: number;
1488
+ sellCurrency: string;
1489
+ unitSellAmountCents: number | null;
1490
+ totalSellAmountCents: number | null;
1491
+ costCurrency: string | null;
1492
+ unitCostAmountCents: number | null;
1493
+ totalCostAmountCents: number | null;
1494
+ notes: string | null;
1495
+ productId: string | null;
1496
+ optionId: string | null;
1497
+ optionUnitId: string | null;
1498
+ pricingCategoryId: string | null;
1499
+ travelerLinks: {
1500
+ id: string;
1501
+ travelerId: string;
1502
+ role: "traveler" | "occupant" | "other" | "beneficiary";
1503
+ isPrimary: boolean;
1504
+ }[];
1505
+ }[];
1506
+ documents: {
1507
+ id: string;
1508
+ travelerId: string | null;
1509
+ type: "other" | "visa" | "insurance" | "health" | "passport_copy";
1510
+ fileName: string;
1511
+ fileUrl: string;
1512
+ }[];
1513
+ fulfillments: {
1514
+ id: string;
1515
+ bookingItemId: string | null;
1516
+ travelerId: string | null;
1517
+ fulfillmentType: "other" | "voucher" | "ticket" | "pdf" | "qr_code" | "barcode" | "mobile";
1518
+ deliveryChannel: "other" | "email" | "download" | "api" | "wallet";
1519
+ status: "pending" | "issued" | "reissued" | "revoked" | "failed";
1520
+ artifactUrl: string | null;
1521
+ }[];
1522
+ }>;
1523
+ previewPayment: (bookingId: string, input: Parameters<typeof previewBookingEnginePayment>[2], requestOptions?: Parameters<typeof previewBookingEnginePayment>[3]) => Promise<{
1524
+ bookingId: string;
1525
+ method: "card" | "bank_transfer";
1526
+ stage: "initial" | "reminder" | "manual";
1527
+ paymentSessionTarget: "schedule" | "invoice" | null;
1528
+ documentType: "invoice" | "proforma" | null;
1529
+ willCreateDefaultPaymentPlan: boolean;
1530
+ selectedSchedule: {
1531
+ id: string;
1532
+ bookingId: string;
1533
+ bookingItemId: string | null;
1534
+ scheduleType: string;
1535
+ status: string;
1536
+ dueDate: string;
1537
+ currency: string;
1538
+ amountCents: number;
1539
+ notes: string | null;
1540
+ } | null;
1541
+ selectedInvoice: {
1542
+ id: string;
1543
+ invoiceNumber: string;
1544
+ invoiceType: string;
1545
+ bookingId: string;
1546
+ personId: string | null;
1547
+ organizationId: string | null;
1548
+ status: string;
1549
+ currency: string;
1550
+ totalCents: number;
1551
+ paidCents: number;
1552
+ balanceDueCents: number;
1553
+ issueDate: string;
1554
+ dueDate: string;
1555
+ notes: string | null;
1556
+ createdAt: string;
1557
+ updatedAt: string;
1558
+ } | null;
1559
+ amountCents: number;
1560
+ currency: string;
1561
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
1562
+ }>;
1563
+ startPayment: (bookingId: string, input: Parameters<typeof startBookingEnginePayment>[2], requestOptions?: Parameters<typeof startBookingEnginePayment>[3]) => Promise<{
1564
+ plan: {
1565
+ bookingId: string;
1566
+ method: "card" | "bank_transfer";
1567
+ stage: "initial" | "reminder" | "manual";
1568
+ paymentSessionTarget: "schedule" | "invoice" | null;
1569
+ documentType: "invoice" | "proforma" | null;
1570
+ willCreateDefaultPaymentPlan: boolean;
1571
+ selectedSchedule: {
1572
+ id: string;
1573
+ bookingId: string;
1574
+ bookingItemId: string | null;
1575
+ scheduleType: string;
1576
+ status: string;
1577
+ dueDate: string;
1578
+ currency: string;
1579
+ amountCents: number;
1580
+ notes: string | null;
1581
+ } | null;
1582
+ selectedInvoice: {
1583
+ id: string;
1584
+ invoiceNumber: string;
1585
+ invoiceType: string;
1586
+ bookingId: string;
1587
+ personId: string | null;
1588
+ organizationId: string | null;
1589
+ status: string;
1590
+ currency: string;
1591
+ totalCents: number;
1592
+ paidCents: number;
1593
+ balanceDueCents: number;
1594
+ issueDate: string;
1595
+ dueDate: string;
1596
+ notes: string | null;
1597
+ createdAt: string;
1598
+ updatedAt: string;
1599
+ } | null;
1600
+ amountCents: number;
1601
+ currency: string;
1602
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
1603
+ };
1604
+ invoice: {
1605
+ id: string;
1606
+ invoiceNumber: string;
1607
+ invoiceType: string;
1608
+ bookingId: string;
1609
+ personId: string | null;
1610
+ organizationId: string | null;
1611
+ status: string;
1612
+ currency: string;
1613
+ totalCents: number;
1614
+ paidCents: number;
1615
+ balanceDueCents: number;
1616
+ issueDate: string;
1617
+ dueDate: string;
1618
+ notes: string | null;
1619
+ createdAt: string;
1620
+ updatedAt: string;
1621
+ } | null;
1622
+ paymentSession: {
1623
+ legacyOrderId: string | null;
1624
+ target: {
1625
+ type: "booking";
1626
+ bookingId: string;
1627
+ } | {
1628
+ type: "invoice";
1629
+ invoiceId: string;
1630
+ } | {
1631
+ type: "booking_payment_schedule";
1632
+ bookingPaymentScheduleId: string;
1633
+ } | {
1634
+ type: "booking_guarantee";
1635
+ bookingGuaranteeId: string;
1636
+ } | {
1637
+ type: "flight_order";
1638
+ flightOrderId: string;
1639
+ } | {
1640
+ type: "program";
1641
+ programId: string;
1642
+ } | {
1643
+ type: "supplier_settlement";
1644
+ supplierSettlementId: string;
1645
+ } | {
1646
+ type: "channel_settlement";
1647
+ channelSettlementId: string;
1648
+ } | {
1649
+ type: "provider_reference";
1650
+ provider: string;
1651
+ reference: string;
1652
+ } | {
1653
+ type: "legacy_order";
1654
+ legacyOrderId: string;
1655
+ } | null;
1656
+ provenance: {
1657
+ source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
1658
+ provider?: string | null | undefined;
1659
+ reference?: string | null | undefined;
1660
+ idempotencyKey?: string | null | undefined;
1661
+ } | null;
1662
+ id: string;
1663
+ targetType: "other" | "invoice" | "booking" | "booking_payment_schedule" | "booking_guarantee" | "flight_order" | "order";
1664
+ targetId: string | null;
1665
+ bookingId: string | null;
1666
+ invoiceId: string | null;
1667
+ bookingPaymentScheduleId: string | null;
1668
+ bookingGuaranteeId: string | null;
1669
+ status: "expired" | "cancelled" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "paid";
1670
+ provider: string | null;
1671
+ providerSessionId: string | null;
1672
+ providerPaymentId: string | null;
1673
+ externalReference: string | null;
1674
+ clientReference: string | null;
1675
+ currency: string;
1676
+ amountCents: number;
1677
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1678
+ payerEmail: string | null;
1679
+ payerName: string | null;
1680
+ redirectUrl: string | null;
1681
+ returnUrl: string | null;
1682
+ cancelUrl: string | null;
1683
+ expiresAt: string | null;
1684
+ completedAt: string | null;
1685
+ failureCode: string | null;
1686
+ failureMessage: string | null;
1687
+ notes: string | null;
1688
+ } | null;
1689
+ invoiceNotification: {
1690
+ id: string;
1691
+ templateSlug: string | null;
1692
+ channel: "email" | "sms";
1693
+ provider: string;
1694
+ status: "cancelled" | "pending" | "failed" | "sent";
1695
+ toAddress: string;
1696
+ subject: string | null;
1697
+ sentAt: string | null;
1698
+ failedAt: string | null;
1699
+ errorMessage: string | null;
1700
+ } | null;
1701
+ paymentSessionNotification: {
1702
+ id: string;
1703
+ templateSlug: string | null;
1704
+ channel: "email" | "sms";
1705
+ provider: string;
1706
+ status: "cancelled" | "pending" | "failed" | "sent";
1707
+ toAddress: string;
1708
+ subject: string | null;
1709
+ sentAt: string | null;
1710
+ failedAt: string | null;
1711
+ errorMessage: string | null;
1712
+ } | null;
1713
+ bankTransferInstructions: {
1714
+ provider: string | null;
1715
+ invoiceId: string;
1716
+ invoiceNumber: string;
1717
+ documentType: "invoice" | "proforma";
1718
+ amountCents: number;
1719
+ currency: string;
1720
+ dueDate: string | null;
1721
+ beneficiary: string;
1722
+ iban: string;
1723
+ bankName: string | null;
1724
+ notes: string | null;
1725
+ } | null;
1726
+ providerStart: {
1727
+ provider: string;
1728
+ paymentSessionId: string;
1729
+ redirectUrl: string | null;
1730
+ externalReference: string | null;
1731
+ providerSessionId: string | null;
1732
+ providerPaymentId: string | null;
1733
+ response: Record<string, unknown> | null;
1734
+ } | null;
1735
+ }>;
1736
+ bootstrapPayment: (input: Parameters<typeof bootstrapBookingEnginePayment>[1], requestOptions?: Parameters<typeof bootstrapBookingEnginePayment>[2]) => Promise<{
1737
+ plan: {
1738
+ bookingId: string;
1739
+ method: "card" | "bank_transfer";
1740
+ stage: "initial" | "reminder" | "manual";
1741
+ paymentSessionTarget: "schedule" | "invoice" | null;
1742
+ documentType: "invoice" | "proforma" | null;
1743
+ willCreateDefaultPaymentPlan: boolean;
1744
+ selectedSchedule: {
1745
+ id: string;
1746
+ bookingId: string;
1747
+ bookingItemId: string | null;
1748
+ scheduleType: string;
1749
+ status: string;
1750
+ dueDate: string;
1751
+ currency: string;
1752
+ amountCents: number;
1753
+ notes: string | null;
1754
+ } | null;
1755
+ selectedInvoice: {
1756
+ id: string;
1757
+ invoiceNumber: string;
1758
+ invoiceType: string;
1759
+ bookingId: string;
1760
+ personId: string | null;
1761
+ organizationId: string | null;
1762
+ status: string;
1763
+ currency: string;
1764
+ totalCents: number;
1765
+ paidCents: number;
1766
+ balanceDueCents: number;
1767
+ issueDate: string;
1768
+ dueDate: string;
1769
+ notes: string | null;
1770
+ createdAt: string;
1771
+ updatedAt: string;
1772
+ } | null;
1773
+ amountCents: number;
1774
+ currency: string;
1775
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
1776
+ };
1777
+ invoice: {
1778
+ id: string;
1779
+ invoiceNumber: string;
1780
+ invoiceType: string;
1781
+ bookingId: string;
1782
+ personId: string | null;
1783
+ organizationId: string | null;
1784
+ status: string;
1785
+ currency: string;
1786
+ totalCents: number;
1787
+ paidCents: number;
1788
+ balanceDueCents: number;
1789
+ issueDate: string;
1790
+ dueDate: string;
1791
+ notes: string | null;
1792
+ createdAt: string;
1793
+ updatedAt: string;
1794
+ } | null;
1795
+ paymentSession: {
1796
+ legacyOrderId: string | null;
1797
+ target: {
1798
+ type: "booking";
1799
+ bookingId: string;
1800
+ } | {
1801
+ type: "invoice";
1802
+ invoiceId: string;
1803
+ } | {
1804
+ type: "booking_payment_schedule";
1805
+ bookingPaymentScheduleId: string;
1806
+ } | {
1807
+ type: "booking_guarantee";
1808
+ bookingGuaranteeId: string;
1809
+ } | {
1810
+ type: "flight_order";
1811
+ flightOrderId: string;
1812
+ } | {
1813
+ type: "program";
1814
+ programId: string;
1815
+ } | {
1816
+ type: "supplier_settlement";
1817
+ supplierSettlementId: string;
1818
+ } | {
1819
+ type: "channel_settlement";
1820
+ channelSettlementId: string;
1821
+ } | {
1822
+ type: "provider_reference";
1823
+ provider: string;
1824
+ reference: string;
1825
+ } | {
1826
+ type: "legacy_order";
1827
+ legacyOrderId: string;
1828
+ } | null;
1829
+ provenance: {
1830
+ source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
1831
+ provider?: string | null | undefined;
1832
+ reference?: string | null | undefined;
1833
+ idempotencyKey?: string | null | undefined;
1834
+ } | null;
1835
+ id: string;
1836
+ targetType: "other" | "invoice" | "booking" | "booking_payment_schedule" | "booking_guarantee" | "flight_order" | "order";
1837
+ targetId: string | null;
1838
+ bookingId: string | null;
1839
+ invoiceId: string | null;
1840
+ bookingPaymentScheduleId: string | null;
1841
+ bookingGuaranteeId: string | null;
1842
+ status: "expired" | "cancelled" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "paid";
1843
+ provider: string | null;
1844
+ providerSessionId: string | null;
1845
+ providerPaymentId: string | null;
1846
+ externalReference: string | null;
1847
+ clientReference: string | null;
1848
+ currency: string;
1849
+ amountCents: number;
1850
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
1851
+ payerEmail: string | null;
1852
+ payerName: string | null;
1853
+ redirectUrl: string | null;
1854
+ returnUrl: string | null;
1855
+ cancelUrl: string | null;
1856
+ expiresAt: string | null;
1857
+ completedAt: string | null;
1858
+ failureCode: string | null;
1859
+ failureMessage: string | null;
1860
+ notes: string | null;
1861
+ } | null;
1862
+ invoiceNotification: {
1863
+ id: string;
1864
+ templateSlug: string | null;
1865
+ channel: "email" | "sms";
1866
+ provider: string;
1867
+ status: "cancelled" | "pending" | "failed" | "sent";
1868
+ toAddress: string;
1869
+ subject: string | null;
1870
+ sentAt: string | null;
1871
+ failedAt: string | null;
1872
+ errorMessage: string | null;
1873
+ } | null;
1874
+ paymentSessionNotification: {
1875
+ id: string;
1876
+ templateSlug: string | null;
1877
+ channel: "email" | "sms";
1878
+ provider: string;
1879
+ status: "cancelled" | "pending" | "failed" | "sent";
1880
+ toAddress: string;
1881
+ subject: string | null;
1882
+ sentAt: string | null;
1883
+ failedAt: string | null;
1884
+ errorMessage: string | null;
1885
+ } | null;
1886
+ bankTransferInstructions: {
1887
+ provider: string | null;
1888
+ invoiceId: string;
1889
+ invoiceNumber: string;
1890
+ documentType: "invoice" | "proforma";
1891
+ amountCents: number;
1892
+ currency: string;
1893
+ dueDate: string | null;
1894
+ beneficiary: string;
1895
+ iban: string;
1896
+ bankName: string | null;
1897
+ notes: string | null;
1898
+ } | null;
1899
+ providerStart: {
1900
+ provider: string;
1901
+ paymentSessionId: string;
1902
+ redirectUrl: string | null;
1903
+ externalReference: string | null;
1904
+ providerSessionId: string | null;
1905
+ providerPaymentId: string | null;
1906
+ response: Record<string, unknown> | null;
1907
+ } | null;
1908
+ bookingId: string;
1909
+ sessionId: string;
1910
+ sourceType: "session" | "booking";
1911
+ intent: "custom" | "deposit" | "balance";
1912
+ }>;
1913
+ deriveState: typeof deriveBookingEngineState;
1914
+ createSnapshot: typeof createBookingEngineSnapshot;
1915
+ canRunAction: typeof canRunBookingEngineAction;
1916
+ };
1917
+ checkout: {
1918
+ previewCollection: (bookingId: string, input: Parameters<typeof previewCheckoutCollection>[2], requestOptions?: Parameters<typeof previewCheckoutCollection>[3]) => Promise<{
1919
+ bookingId: string;
1920
+ method: "card" | "bank_transfer";
1921
+ stage: "initial" | "reminder" | "manual";
1922
+ paymentSessionTarget: "schedule" | "invoice" | null;
1923
+ documentType: "invoice" | "proforma" | null;
1924
+ willCreateDefaultPaymentPlan: boolean;
1925
+ selectedSchedule: {
1926
+ id: string;
1927
+ bookingId: string;
1928
+ bookingItemId: string | null;
1929
+ scheduleType: string;
1930
+ status: string;
1931
+ dueDate: string;
1932
+ currency: string;
1933
+ amountCents: number;
1934
+ notes: string | null;
1935
+ } | null;
1936
+ selectedInvoice: {
1937
+ id: string;
1938
+ invoiceNumber: string;
1939
+ invoiceType: string;
1940
+ bookingId: string;
1941
+ personId: string | null;
1942
+ organizationId: string | null;
1943
+ status: string;
1944
+ currency: string;
1945
+ totalCents: number;
1946
+ paidCents: number;
1947
+ balanceDueCents: number;
1948
+ issueDate: string;
1949
+ dueDate: string;
1950
+ notes: string | null;
1951
+ createdAt: string;
1952
+ updatedAt: string;
1953
+ } | null;
1954
+ amountCents: number;
1955
+ currency: string;
1956
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
1957
+ }>;
1958
+ initiateCollection: (bookingId: string, input: Parameters<typeof initiateCheckoutCollection>[2], requestOptions?: Parameters<typeof initiateCheckoutCollection>[3]) => Promise<{
1959
+ plan: {
1960
+ bookingId: string;
1961
+ method: "card" | "bank_transfer";
1962
+ stage: "initial" | "reminder" | "manual";
1963
+ paymentSessionTarget: "schedule" | "invoice" | null;
1964
+ documentType: "invoice" | "proforma" | null;
1965
+ willCreateDefaultPaymentPlan: boolean;
1966
+ selectedSchedule: {
1967
+ id: string;
1968
+ bookingId: string;
1969
+ bookingItemId: string | null;
1970
+ scheduleType: string;
1971
+ status: string;
1972
+ dueDate: string;
1973
+ currency: string;
1974
+ amountCents: number;
1975
+ notes: string | null;
1976
+ } | null;
1977
+ selectedInvoice: {
1978
+ id: string;
1979
+ invoiceNumber: string;
1980
+ invoiceType: string;
1981
+ bookingId: string;
1982
+ personId: string | null;
1983
+ organizationId: string | null;
1984
+ status: string;
1985
+ currency: string;
1986
+ totalCents: number;
1987
+ paidCents: number;
1988
+ balanceDueCents: number;
1989
+ issueDate: string;
1990
+ dueDate: string;
1991
+ notes: string | null;
1992
+ createdAt: string;
1993
+ updatedAt: string;
1994
+ } | null;
1995
+ amountCents: number;
1996
+ currency: string;
1997
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
1998
+ };
1999
+ invoice: {
2000
+ id: string;
2001
+ invoiceNumber: string;
2002
+ invoiceType: string;
2003
+ bookingId: string;
2004
+ personId: string | null;
2005
+ organizationId: string | null;
2006
+ status: string;
2007
+ currency: string;
2008
+ totalCents: number;
2009
+ paidCents: number;
2010
+ balanceDueCents: number;
2011
+ issueDate: string;
2012
+ dueDate: string;
2013
+ notes: string | null;
2014
+ createdAt: string;
2015
+ updatedAt: string;
2016
+ } | null;
2017
+ paymentSession: {
2018
+ legacyOrderId: string | null;
2019
+ target: {
2020
+ type: "booking";
2021
+ bookingId: string;
2022
+ } | {
2023
+ type: "invoice";
2024
+ invoiceId: string;
2025
+ } | {
2026
+ type: "booking_payment_schedule";
2027
+ bookingPaymentScheduleId: string;
2028
+ } | {
2029
+ type: "booking_guarantee";
2030
+ bookingGuaranteeId: string;
2031
+ } | {
2032
+ type: "flight_order";
2033
+ flightOrderId: string;
2034
+ } | {
2035
+ type: "program";
2036
+ programId: string;
2037
+ } | {
2038
+ type: "supplier_settlement";
2039
+ supplierSettlementId: string;
2040
+ } | {
2041
+ type: "channel_settlement";
2042
+ channelSettlementId: string;
2043
+ } | {
2044
+ type: "provider_reference";
2045
+ provider: string;
2046
+ reference: string;
2047
+ } | {
2048
+ type: "legacy_order";
2049
+ legacyOrderId: string;
2050
+ } | null;
2051
+ provenance: {
2052
+ source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
2053
+ provider?: string | null | undefined;
2054
+ reference?: string | null | undefined;
2055
+ idempotencyKey?: string | null | undefined;
2056
+ } | null;
2057
+ id: string;
2058
+ targetType: "other" | "invoice" | "booking" | "booking_payment_schedule" | "booking_guarantee" | "flight_order" | "order";
2059
+ targetId: string | null;
2060
+ bookingId: string | null;
2061
+ invoiceId: string | null;
2062
+ bookingPaymentScheduleId: string | null;
2063
+ bookingGuaranteeId: string | null;
2064
+ status: "expired" | "cancelled" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "paid";
2065
+ provider: string | null;
2066
+ providerSessionId: string | null;
2067
+ providerPaymentId: string | null;
2068
+ externalReference: string | null;
2069
+ clientReference: string | null;
2070
+ currency: string;
2071
+ amountCents: number;
2072
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
2073
+ payerEmail: string | null;
2074
+ payerName: string | null;
2075
+ redirectUrl: string | null;
2076
+ returnUrl: string | null;
2077
+ cancelUrl: string | null;
2078
+ expiresAt: string | null;
2079
+ completedAt: string | null;
2080
+ failureCode: string | null;
2081
+ failureMessage: string | null;
2082
+ notes: string | null;
2083
+ } | null;
2084
+ invoiceNotification: {
2085
+ id: string;
2086
+ templateSlug: string | null;
2087
+ channel: "email" | "sms";
2088
+ provider: string;
2089
+ status: "cancelled" | "pending" | "failed" | "sent";
2090
+ toAddress: string;
2091
+ subject: string | null;
2092
+ sentAt: string | null;
2093
+ failedAt: string | null;
2094
+ errorMessage: string | null;
2095
+ } | null;
2096
+ paymentSessionNotification: {
2097
+ id: string;
2098
+ templateSlug: string | null;
2099
+ channel: "email" | "sms";
2100
+ provider: string;
2101
+ status: "cancelled" | "pending" | "failed" | "sent";
2102
+ toAddress: string;
2103
+ subject: string | null;
2104
+ sentAt: string | null;
2105
+ failedAt: string | null;
2106
+ errorMessage: string | null;
2107
+ } | null;
2108
+ bankTransferInstructions: {
2109
+ provider: string | null;
2110
+ invoiceId: string;
2111
+ invoiceNumber: string;
2112
+ documentType: "invoice" | "proforma";
2113
+ amountCents: number;
2114
+ currency: string;
2115
+ dueDate: string | null;
2116
+ beneficiary: string;
2117
+ iban: string;
2118
+ bankName: string | null;
2119
+ notes: string | null;
2120
+ } | null;
2121
+ providerStart: {
2122
+ provider: string;
2123
+ paymentSessionId: string;
2124
+ redirectUrl: string | null;
2125
+ externalReference: string | null;
2126
+ providerSessionId: string | null;
2127
+ providerPaymentId: string | null;
2128
+ response: Record<string, unknown> | null;
2129
+ } | null;
2130
+ }>;
2131
+ bootstrapCollection: (input: Parameters<typeof bootstrapCheckoutCollection>[1], requestOptions?: Parameters<typeof bootstrapCheckoutCollection>[2]) => Promise<{
2132
+ plan: {
2133
+ bookingId: string;
2134
+ method: "card" | "bank_transfer";
2135
+ stage: "initial" | "reminder" | "manual";
2136
+ paymentSessionTarget: "schedule" | "invoice" | null;
2137
+ documentType: "invoice" | "proforma" | null;
2138
+ willCreateDefaultPaymentPlan: boolean;
2139
+ selectedSchedule: {
2140
+ id: string;
2141
+ bookingId: string;
2142
+ bookingItemId: string | null;
2143
+ scheduleType: string;
2144
+ status: string;
2145
+ dueDate: string;
2146
+ currency: string;
2147
+ amountCents: number;
2148
+ notes: string | null;
2149
+ } | null;
2150
+ selectedInvoice: {
2151
+ id: string;
2152
+ invoiceNumber: string;
2153
+ invoiceType: string;
2154
+ bookingId: string;
2155
+ personId: string | null;
2156
+ organizationId: string | null;
2157
+ status: string;
2158
+ currency: string;
2159
+ totalCents: number;
2160
+ paidCents: number;
2161
+ balanceDueCents: number;
2162
+ issueDate: string;
2163
+ dueDate: string;
2164
+ notes: string | null;
2165
+ createdAt: string;
2166
+ updatedAt: string;
2167
+ } | null;
2168
+ amountCents: number;
2169
+ currency: string;
2170
+ recommendedAction: "none" | "create_bank_transfer_document" | "create_payment_session" | "create_invoice_then_payment_session";
2171
+ };
2172
+ invoice: {
2173
+ id: string;
2174
+ invoiceNumber: string;
2175
+ invoiceType: string;
2176
+ bookingId: string;
2177
+ personId: string | null;
2178
+ organizationId: string | null;
2179
+ status: string;
2180
+ currency: string;
2181
+ totalCents: number;
2182
+ paidCents: number;
2183
+ balanceDueCents: number;
2184
+ issueDate: string;
2185
+ dueDate: string;
2186
+ notes: string | null;
2187
+ createdAt: string;
2188
+ updatedAt: string;
2189
+ } | null;
2190
+ paymentSession: {
2191
+ legacyOrderId: string | null;
2192
+ target: {
2193
+ type: "booking";
2194
+ bookingId: string;
2195
+ } | {
2196
+ type: "invoice";
2197
+ invoiceId: string;
2198
+ } | {
2199
+ type: "booking_payment_schedule";
2200
+ bookingPaymentScheduleId: string;
2201
+ } | {
2202
+ type: "booking_guarantee";
2203
+ bookingGuaranteeId: string;
2204
+ } | {
2205
+ type: "flight_order";
2206
+ flightOrderId: string;
2207
+ } | {
2208
+ type: "program";
2209
+ programId: string;
2210
+ } | {
2211
+ type: "supplier_settlement";
2212
+ supplierSettlementId: string;
2213
+ } | {
2214
+ type: "channel_settlement";
2215
+ channelSettlementId: string;
2216
+ } | {
2217
+ type: "provider_reference";
2218
+ provider: string;
2219
+ reference: string;
2220
+ } | {
2221
+ type: "legacy_order";
2222
+ legacyOrderId: string;
2223
+ } | null;
2224
+ provenance: {
2225
+ source: "other" | "operator" | "storefront" | "customer_portal" | "payment_provider" | "supplier_channel" | "migration";
2226
+ provider?: string | null | undefined;
2227
+ reference?: string | null | undefined;
2228
+ idempotencyKey?: string | null | undefined;
2229
+ } | null;
2230
+ id: string;
2231
+ targetType: "other" | "invoice" | "booking" | "booking_payment_schedule" | "booking_guarantee" | "flight_order" | "order";
2232
+ targetId: string | null;
2233
+ bookingId: string | null;
2234
+ invoiceId: string | null;
2235
+ bookingPaymentScheduleId: string | null;
2236
+ bookingGuaranteeId: string | null;
2237
+ status: "expired" | "cancelled" | "pending" | "failed" | "requires_redirect" | "processing" | "authorized" | "paid";
2238
+ provider: string | null;
2239
+ providerSessionId: string | null;
2240
+ providerPaymentId: string | null;
2241
+ externalReference: string | null;
2242
+ clientReference: string | null;
2243
+ currency: string;
2244
+ amountCents: number;
2245
+ paymentMethod: "other" | "voucher" | "wallet" | "bank_transfer" | "credit_card" | "debit_card" | "cash" | "cheque" | "direct_bill" | null;
2246
+ payerEmail: string | null;
2247
+ payerName: string | null;
2248
+ redirectUrl: string | null;
2249
+ returnUrl: string | null;
2250
+ cancelUrl: string | null;
2251
+ expiresAt: string | null;
2252
+ completedAt: string | null;
2253
+ failureCode: string | null;
2254
+ failureMessage: string | null;
2255
+ notes: string | null;
2256
+ } | null;
2257
+ invoiceNotification: {
2258
+ id: string;
2259
+ templateSlug: string | null;
2260
+ channel: "email" | "sms";
2261
+ provider: string;
2262
+ status: "cancelled" | "pending" | "failed" | "sent";
2263
+ toAddress: string;
2264
+ subject: string | null;
2265
+ sentAt: string | null;
2266
+ failedAt: string | null;
2267
+ errorMessage: string | null;
2268
+ } | null;
2269
+ paymentSessionNotification: {
2270
+ id: string;
2271
+ templateSlug: string | null;
2272
+ channel: "email" | "sms";
2273
+ provider: string;
2274
+ status: "cancelled" | "pending" | "failed" | "sent";
2275
+ toAddress: string;
2276
+ subject: string | null;
2277
+ sentAt: string | null;
2278
+ failedAt: string | null;
2279
+ errorMessage: string | null;
2280
+ } | null;
2281
+ bankTransferInstructions: {
2282
+ provider: string | null;
2283
+ invoiceId: string;
2284
+ invoiceNumber: string;
2285
+ documentType: "invoice" | "proforma";
2286
+ amountCents: number;
2287
+ currency: string;
2288
+ dueDate: string | null;
2289
+ beneficiary: string;
2290
+ iban: string;
2291
+ bankName: string | null;
2292
+ notes: string | null;
2293
+ } | null;
2294
+ providerStart: {
2295
+ provider: string;
2296
+ paymentSessionId: string;
2297
+ redirectUrl: string | null;
2298
+ externalReference: string | null;
2299
+ providerSessionId: string | null;
2300
+ providerPaymentId: string | null;
2301
+ response: Record<string, unknown> | null;
2302
+ } | null;
2303
+ bookingId: string;
2304
+ sessionId: string;
2305
+ sourceType: "session" | "booking";
2306
+ intent: "custom" | "deposit" | "balance";
2307
+ }>;
2308
+ };
2309
+ };
2310
+ export type VoyantStorefrontClient = ReturnType<typeof createVoyantStorefrontClient>;
2311
+ //# sourceMappingURL=index.d.ts.map