@voyant-travel/openapi 0.2.6 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/package.json +8 -5
  2. package/spec/admin/accommodations.json +1443 -0
  3. package/spec/admin/action-ledger.json +6285 -0
  4. package/spec/admin/booking-requirements.json +5975 -0
  5. package/spec/admin/bookings.json +19276 -0
  6. package/spec/admin/catalog.json +703 -0
  7. package/spec/admin/distribution.json +20434 -0
  8. package/spec/admin/external-refs.json +1437 -0
  9. package/spec/admin/extras.json +4787 -0
  10. package/spec/admin/finance.json +36583 -0
  11. package/spec/admin/identity.json +4141 -0
  12. package/spec/admin/legal.json +14821 -0
  13. package/spec/admin/markets.json +5551 -0
  14. package/spec/admin/notifications.json +8667 -0
  15. package/spec/admin/operations.json +41627 -0
  16. package/spec/admin/operator-settings.json +1451 -0
  17. package/spec/admin/pricing.json +11136 -0
  18. package/spec/admin/products.json +23257 -0
  19. package/spec/admin/promotions.json +2778 -0
  20. package/spec/admin/quotes.json +7333 -0
  21. package/spec/admin/relationships.json +14512 -0
  22. package/spec/admin/sellability.json +5056 -0
  23. package/spec/admin/storefront.json +1973 -0
  24. package/spec/admin/suppliers.json +6094 -0
  25. package/spec/admin/trips.json +9531 -0
  26. package/spec/framework-admin.json +12715 -1375
  27. package/spec/framework-openapi.json +13731 -1482
  28. package/spec/framework-storefront.json +1022 -107
  29. package/spec/storefront/booking-requirements.json +380 -0
  30. package/spec/storefront/bookings.json +6213 -0
  31. package/spec/storefront/catalog.json +703 -0
  32. package/spec/storefront/customer-portal.json +6177 -0
  33. package/spec/storefront/finance.json +4914 -0
  34. package/spec/storefront/legal.json +2165 -0
  35. package/spec/storefront/markets.json +269 -0
  36. package/spec/storefront/operator-settings.json +329 -0
  37. package/spec/storefront/pricing.json +598 -0
  38. package/spec/storefront/products.json +2965 -0
  39. package/spec/storefront/storefront-verification.json +943 -0
  40. package/spec/storefront/storefront.json +4157 -0
  41. package/spec/storefront/trips.json +9531 -0
@@ -0,0 +1,2778 @@
1
+ {
2
+ "openapi": "3.1.0",
3
+ "info": {
4
+ "title": "Voyant Framework API",
5
+ "version": "0.0.0",
6
+ "description": "Generated from the Voyant framework's standard module composition. Do not edit by hand."
7
+ },
8
+ "servers": [
9
+ {
10
+ "url": "/",
11
+ "description": "This deployment (same origin)"
12
+ }
13
+ ],
14
+ "components": {
15
+ "schemas": {
16
+ "CatalogSearchFilter": {
17
+ "anyOf": [
18
+ {
19
+ "type": "object",
20
+ "properties": {
21
+ "kind": {
22
+ "type": "string",
23
+ "enum": [
24
+ "eq"
25
+ ]
26
+ },
27
+ "field": {
28
+ "type": "string",
29
+ "minLength": 1
30
+ },
31
+ "value": {
32
+ "anyOf": [
33
+ {
34
+ "type": "string"
35
+ },
36
+ {
37
+ "type": "number"
38
+ },
39
+ {
40
+ "type": "boolean"
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ "required": [
46
+ "kind",
47
+ "field",
48
+ "value"
49
+ ]
50
+ },
51
+ {
52
+ "type": "object",
53
+ "properties": {
54
+ "kind": {
55
+ "type": "string",
56
+ "enum": [
57
+ "in"
58
+ ]
59
+ },
60
+ "field": {
61
+ "type": "string",
62
+ "minLength": 1
63
+ },
64
+ "values": {
65
+ "type": "array",
66
+ "items": {
67
+ "anyOf": [
68
+ {
69
+ "type": "string"
70
+ },
71
+ {
72
+ "type": "number"
73
+ }
74
+ ]
75
+ }
76
+ }
77
+ },
78
+ "required": [
79
+ "kind",
80
+ "field",
81
+ "values"
82
+ ]
83
+ },
84
+ {
85
+ "type": "object",
86
+ "properties": {
87
+ "kind": {
88
+ "type": "string",
89
+ "enum": [
90
+ "range"
91
+ ]
92
+ },
93
+ "field": {
94
+ "type": "string",
95
+ "minLength": 1
96
+ },
97
+ "gte": {
98
+ "type": "number"
99
+ },
100
+ "lte": {
101
+ "type": "number"
102
+ }
103
+ },
104
+ "required": [
105
+ "kind",
106
+ "field"
107
+ ]
108
+ },
109
+ {
110
+ "type": "object",
111
+ "properties": {
112
+ "kind": {
113
+ "type": "string",
114
+ "enum": [
115
+ "and"
116
+ ]
117
+ },
118
+ "clauses": {
119
+ "type": "array",
120
+ "items": {
121
+ "$ref": "#/components/schemas/CatalogSearchFilter"
122
+ }
123
+ }
124
+ },
125
+ "required": [
126
+ "kind",
127
+ "clauses"
128
+ ]
129
+ },
130
+ {
131
+ "type": "object",
132
+ "properties": {
133
+ "kind": {
134
+ "type": "string",
135
+ "enum": [
136
+ "or"
137
+ ]
138
+ },
139
+ "clauses": {
140
+ "type": "array",
141
+ "items": {
142
+ "$ref": "#/components/schemas/CatalogSearchFilter"
143
+ }
144
+ }
145
+ },
146
+ "required": [
147
+ "kind",
148
+ "clauses"
149
+ ]
150
+ }
151
+ ]
152
+ }
153
+ },
154
+ "parameters": {}
155
+ },
156
+ "paths": {
157
+ "/v1/admin/promotions": {
158
+ "get": {
159
+ "parameters": [
160
+ {
161
+ "schema": {
162
+ "anyOf": [
163
+ {
164
+ "type": "string",
165
+ "enum": [
166
+ "true"
167
+ ]
168
+ },
169
+ {
170
+ "type": "string",
171
+ "enum": [
172
+ "false"
173
+ ]
174
+ }
175
+ ]
176
+ },
177
+ "required": false,
178
+ "name": "active",
179
+ "in": "query"
180
+ },
181
+ {
182
+ "schema": {
183
+ "type": "string",
184
+ "minLength": 1,
185
+ "maxLength": 80
186
+ },
187
+ "required": false,
188
+ "name": "code",
189
+ "in": "query"
190
+ },
191
+ {
192
+ "schema": {
193
+ "type": "string",
194
+ "minLength": 1,
195
+ "maxLength": 200
196
+ },
197
+ "required": false,
198
+ "name": "search",
199
+ "in": "query"
200
+ },
201
+ {
202
+ "schema": {
203
+ "type": "string",
204
+ "enum": [
205
+ "auto",
206
+ "code"
207
+ ]
208
+ },
209
+ "required": false,
210
+ "name": "applicationMode",
211
+ "in": "query"
212
+ },
213
+ {
214
+ "schema": {
215
+ "type": "string",
216
+ "enum": [
217
+ "active",
218
+ "scheduled",
219
+ "expired",
220
+ "archived"
221
+ ]
222
+ },
223
+ "required": false,
224
+ "name": "status",
225
+ "in": "query"
226
+ },
227
+ {
228
+ "schema": {
229
+ "type": "string",
230
+ "enum": [
231
+ "global",
232
+ "products",
233
+ "categories",
234
+ "destinations",
235
+ "markets",
236
+ "audiences",
237
+ "fare_codes",
238
+ "cabin_grades"
239
+ ]
240
+ },
241
+ "required": false,
242
+ "name": "scopeKind",
243
+ "in": "query"
244
+ },
245
+ {
246
+ "schema": {
247
+ "type": "string",
248
+ "format": "date"
249
+ },
250
+ "required": false,
251
+ "name": "validFrom",
252
+ "in": "query"
253
+ },
254
+ {
255
+ "schema": {
256
+ "type": "string",
257
+ "format": "date"
258
+ },
259
+ "required": false,
260
+ "name": "validUntil",
261
+ "in": "query"
262
+ },
263
+ {
264
+ "schema": {
265
+ "type": "integer",
266
+ "exclusiveMinimum": 0,
267
+ "maximum": 200,
268
+ "default": 50
269
+ },
270
+ "required": false,
271
+ "name": "limit",
272
+ "in": "query"
273
+ },
274
+ {
275
+ "schema": {
276
+ "type": [
277
+ "integer",
278
+ "null"
279
+ ],
280
+ "minimum": 0,
281
+ "default": 0
282
+ },
283
+ "required": false,
284
+ "name": "offset",
285
+ "in": "query"
286
+ }
287
+ ],
288
+ "responses": {
289
+ "200": {
290
+ "description": "Paginated list of promotional offers",
291
+ "content": {
292
+ "application/json": {
293
+ "schema": {
294
+ "type": "object",
295
+ "properties": {
296
+ "data": {
297
+ "type": "array",
298
+ "items": {
299
+ "type": "object",
300
+ "properties": {
301
+ "id": {
302
+ "type": "string"
303
+ },
304
+ "name": {
305
+ "type": "string"
306
+ },
307
+ "slug": {
308
+ "type": "string"
309
+ },
310
+ "description": {
311
+ "type": [
312
+ "string",
313
+ "null"
314
+ ]
315
+ },
316
+ "discountType": {
317
+ "type": "string",
318
+ "enum": [
319
+ "percentage",
320
+ "fixed_amount"
321
+ ]
322
+ },
323
+ "discountPercent": {
324
+ "type": [
325
+ "string",
326
+ "null"
327
+ ]
328
+ },
329
+ "discountAmountCents": {
330
+ "type": [
331
+ "integer",
332
+ "null"
333
+ ]
334
+ },
335
+ "currency": {
336
+ "type": [
337
+ "string",
338
+ "null"
339
+ ]
340
+ },
341
+ "scope": {
342
+ "oneOf": [
343
+ {
344
+ "type": "object",
345
+ "properties": {
346
+ "kind": {
347
+ "type": "string",
348
+ "enum": [
349
+ "global"
350
+ ]
351
+ }
352
+ },
353
+ "required": [
354
+ "kind"
355
+ ]
356
+ },
357
+ {
358
+ "type": "object",
359
+ "properties": {
360
+ "kind": {
361
+ "type": "string",
362
+ "enum": [
363
+ "products"
364
+ ]
365
+ },
366
+ "productIds": {
367
+ "type": "array",
368
+ "items": {
369
+ "type": "string",
370
+ "minLength": 1
371
+ },
372
+ "minItems": 1
373
+ }
374
+ },
375
+ "required": [
376
+ "kind",
377
+ "productIds"
378
+ ]
379
+ },
380
+ {
381
+ "type": "object",
382
+ "properties": {
383
+ "kind": {
384
+ "type": "string",
385
+ "enum": [
386
+ "categories"
387
+ ]
388
+ },
389
+ "categoryIds": {
390
+ "type": "array",
391
+ "items": {
392
+ "type": "string",
393
+ "minLength": 1
394
+ },
395
+ "minItems": 1
396
+ }
397
+ },
398
+ "required": [
399
+ "kind",
400
+ "categoryIds"
401
+ ]
402
+ },
403
+ {
404
+ "type": "object",
405
+ "properties": {
406
+ "kind": {
407
+ "type": "string",
408
+ "enum": [
409
+ "destinations"
410
+ ]
411
+ },
412
+ "destinationIds": {
413
+ "type": "array",
414
+ "items": {
415
+ "type": "string",
416
+ "minLength": 1
417
+ },
418
+ "minItems": 1
419
+ }
420
+ },
421
+ "required": [
422
+ "kind",
423
+ "destinationIds"
424
+ ]
425
+ },
426
+ {
427
+ "type": "object",
428
+ "properties": {
429
+ "kind": {
430
+ "type": "string",
431
+ "enum": [
432
+ "markets"
433
+ ]
434
+ },
435
+ "marketIds": {
436
+ "type": "array",
437
+ "items": {
438
+ "type": "string",
439
+ "minLength": 1
440
+ },
441
+ "minItems": 1
442
+ }
443
+ },
444
+ "required": [
445
+ "kind",
446
+ "marketIds"
447
+ ]
448
+ },
449
+ {
450
+ "type": "object",
451
+ "properties": {
452
+ "kind": {
453
+ "type": "string",
454
+ "enum": [
455
+ "audiences"
456
+ ]
457
+ },
458
+ "audiences": {
459
+ "type": "array",
460
+ "items": {
461
+ "type": "string",
462
+ "enum": [
463
+ "staff",
464
+ "customer",
465
+ "partner",
466
+ "supplier"
467
+ ]
468
+ },
469
+ "minItems": 1
470
+ }
471
+ },
472
+ "required": [
473
+ "kind",
474
+ "audiences"
475
+ ]
476
+ },
477
+ {
478
+ "type": "object",
479
+ "properties": {
480
+ "kind": {
481
+ "type": "string",
482
+ "enum": [
483
+ "fare_codes"
484
+ ]
485
+ },
486
+ "fareCodes": {
487
+ "type": "array",
488
+ "items": {
489
+ "type": "string",
490
+ "minLength": 1
491
+ },
492
+ "minItems": 1
493
+ }
494
+ },
495
+ "required": [
496
+ "kind",
497
+ "fareCodes"
498
+ ]
499
+ },
500
+ {
501
+ "type": "object",
502
+ "properties": {
503
+ "kind": {
504
+ "type": "string",
505
+ "enum": [
506
+ "cabin_grades"
507
+ ]
508
+ },
509
+ "cabinGradeCodes": {
510
+ "type": "array",
511
+ "items": {
512
+ "type": "string",
513
+ "minLength": 1
514
+ },
515
+ "minItems": 1
516
+ }
517
+ },
518
+ "required": [
519
+ "kind",
520
+ "cabinGradeCodes"
521
+ ]
522
+ }
523
+ ]
524
+ },
525
+ "conditions": {
526
+ "type": "object",
527
+ "properties": {
528
+ "minPax": {
529
+ "type": "integer",
530
+ "exclusiveMinimum": 0
531
+ },
532
+ "pastGuestOnly": {
533
+ "type": "boolean"
534
+ },
535
+ "soloTravelerOnly": {
536
+ "type": "boolean"
537
+ },
538
+ "childTravelerOnly": {
539
+ "type": "boolean"
540
+ },
541
+ "familyOnly": {
542
+ "type": "boolean"
543
+ }
544
+ }
545
+ },
546
+ "validFrom": {
547
+ "type": [
548
+ "string",
549
+ "null"
550
+ ]
551
+ },
552
+ "validUntil": {
553
+ "type": [
554
+ "string",
555
+ "null"
556
+ ]
557
+ },
558
+ "code": {
559
+ "type": [
560
+ "string",
561
+ "null"
562
+ ]
563
+ },
564
+ "stackable": {
565
+ "type": "boolean"
566
+ },
567
+ "active": {
568
+ "type": "boolean"
569
+ },
570
+ "metadata": {},
571
+ "createdAt": {
572
+ "type": "string"
573
+ },
574
+ "updatedAt": {
575
+ "type": "string"
576
+ }
577
+ },
578
+ "required": [
579
+ "id",
580
+ "name",
581
+ "slug",
582
+ "description",
583
+ "discountType",
584
+ "discountPercent",
585
+ "discountAmountCents",
586
+ "currency",
587
+ "scope",
588
+ "conditions",
589
+ "validFrom",
590
+ "validUntil",
591
+ "code",
592
+ "stackable",
593
+ "active",
594
+ "createdAt",
595
+ "updatedAt"
596
+ ]
597
+ }
598
+ },
599
+ "total": {
600
+ "type": "integer"
601
+ },
602
+ "limit": {
603
+ "type": "integer"
604
+ },
605
+ "offset": {
606
+ "type": "integer"
607
+ }
608
+ },
609
+ "required": [
610
+ "data",
611
+ "total",
612
+ "limit",
613
+ "offset"
614
+ ]
615
+ }
616
+ }
617
+ }
618
+ }
619
+ },
620
+ "operationId": "getAdminPromotions",
621
+ "summary": "GET /v1/admin/promotions",
622
+ "tags": [
623
+ "promotions"
624
+ ],
625
+ "x-voyant-module": "promotions",
626
+ "x-voyant-surface": "admin"
627
+ },
628
+ "post": {
629
+ "requestBody": {
630
+ "required": true,
631
+ "description": "Discount fields are conditional on `discountType` (enforced server-side; violations return a 400 `invalid_request`): `percentage` requires `discountPercent` and must omit `discountAmountCents`/`currency`; `fixed_amount` requires `discountAmountCents` + `currency` and must omit `discountPercent`. These cross-field rules can't be expressed structurally in JSON Schema, so the body schema is a permissive superset.",
632
+ "content": {
633
+ "application/json": {
634
+ "schema": {
635
+ "type": "object",
636
+ "properties": {
637
+ "name": {
638
+ "type": "string",
639
+ "minLength": 1,
640
+ "maxLength": 200
641
+ },
642
+ "slug": {
643
+ "type": "string",
644
+ "minLength": 1,
645
+ "maxLength": 200,
646
+ "pattern": "^[a-z0-9-]+$"
647
+ },
648
+ "description": {
649
+ "type": [
650
+ "string",
651
+ "null"
652
+ ]
653
+ },
654
+ "discountType": {
655
+ "type": "string",
656
+ "enum": [
657
+ "percentage",
658
+ "fixed_amount"
659
+ ]
660
+ },
661
+ "discountPercent": {
662
+ "type": [
663
+ "number",
664
+ "null"
665
+ ],
666
+ "exclusiveMinimum": 0,
667
+ "maximum": 100
668
+ },
669
+ "discountAmountCents": {
670
+ "type": [
671
+ "integer",
672
+ "null"
673
+ ],
674
+ "exclusiveMinimum": 0
675
+ },
676
+ "currency": {
677
+ "type": [
678
+ "string",
679
+ "null"
680
+ ],
681
+ "minLength": 3,
682
+ "maxLength": 3,
683
+ "pattern": "^[A-Z]{3}$"
684
+ },
685
+ "scope": {
686
+ "oneOf": [
687
+ {
688
+ "type": "object",
689
+ "properties": {
690
+ "kind": {
691
+ "type": "string",
692
+ "enum": [
693
+ "global"
694
+ ]
695
+ }
696
+ },
697
+ "required": [
698
+ "kind"
699
+ ]
700
+ },
701
+ {
702
+ "type": "object",
703
+ "properties": {
704
+ "kind": {
705
+ "type": "string",
706
+ "enum": [
707
+ "products"
708
+ ]
709
+ },
710
+ "productIds": {
711
+ "type": "array",
712
+ "items": {
713
+ "type": "string",
714
+ "minLength": 1
715
+ },
716
+ "minItems": 1
717
+ }
718
+ },
719
+ "required": [
720
+ "kind",
721
+ "productIds"
722
+ ]
723
+ },
724
+ {
725
+ "type": "object",
726
+ "properties": {
727
+ "kind": {
728
+ "type": "string",
729
+ "enum": [
730
+ "categories"
731
+ ]
732
+ },
733
+ "categoryIds": {
734
+ "type": "array",
735
+ "items": {
736
+ "type": "string",
737
+ "minLength": 1
738
+ },
739
+ "minItems": 1
740
+ }
741
+ },
742
+ "required": [
743
+ "kind",
744
+ "categoryIds"
745
+ ]
746
+ },
747
+ {
748
+ "type": "object",
749
+ "properties": {
750
+ "kind": {
751
+ "type": "string",
752
+ "enum": [
753
+ "destinations"
754
+ ]
755
+ },
756
+ "destinationIds": {
757
+ "type": "array",
758
+ "items": {
759
+ "type": "string",
760
+ "minLength": 1
761
+ },
762
+ "minItems": 1
763
+ }
764
+ },
765
+ "required": [
766
+ "kind",
767
+ "destinationIds"
768
+ ]
769
+ },
770
+ {
771
+ "type": "object",
772
+ "properties": {
773
+ "kind": {
774
+ "type": "string",
775
+ "enum": [
776
+ "markets"
777
+ ]
778
+ },
779
+ "marketIds": {
780
+ "type": "array",
781
+ "items": {
782
+ "type": "string",
783
+ "minLength": 1
784
+ },
785
+ "minItems": 1
786
+ }
787
+ },
788
+ "required": [
789
+ "kind",
790
+ "marketIds"
791
+ ]
792
+ },
793
+ {
794
+ "type": "object",
795
+ "properties": {
796
+ "kind": {
797
+ "type": "string",
798
+ "enum": [
799
+ "audiences"
800
+ ]
801
+ },
802
+ "audiences": {
803
+ "type": "array",
804
+ "items": {
805
+ "type": "string",
806
+ "enum": [
807
+ "staff",
808
+ "customer",
809
+ "partner",
810
+ "supplier"
811
+ ]
812
+ },
813
+ "minItems": 1
814
+ }
815
+ },
816
+ "required": [
817
+ "kind",
818
+ "audiences"
819
+ ]
820
+ },
821
+ {
822
+ "type": "object",
823
+ "properties": {
824
+ "kind": {
825
+ "type": "string",
826
+ "enum": [
827
+ "fare_codes"
828
+ ]
829
+ },
830
+ "fareCodes": {
831
+ "type": "array",
832
+ "items": {
833
+ "type": "string",
834
+ "minLength": 1
835
+ },
836
+ "minItems": 1
837
+ }
838
+ },
839
+ "required": [
840
+ "kind",
841
+ "fareCodes"
842
+ ]
843
+ },
844
+ {
845
+ "type": "object",
846
+ "properties": {
847
+ "kind": {
848
+ "type": "string",
849
+ "enum": [
850
+ "cabin_grades"
851
+ ]
852
+ },
853
+ "cabinGradeCodes": {
854
+ "type": "array",
855
+ "items": {
856
+ "type": "string",
857
+ "minLength": 1
858
+ },
859
+ "minItems": 1
860
+ }
861
+ },
862
+ "required": [
863
+ "kind",
864
+ "cabinGradeCodes"
865
+ ]
866
+ }
867
+ ]
868
+ },
869
+ "conditions": {
870
+ "type": "object",
871
+ "properties": {
872
+ "minPax": {
873
+ "type": "integer",
874
+ "exclusiveMinimum": 0
875
+ },
876
+ "pastGuestOnly": {
877
+ "type": "boolean"
878
+ },
879
+ "soloTravelerOnly": {
880
+ "type": "boolean"
881
+ },
882
+ "childTravelerOnly": {
883
+ "type": "boolean"
884
+ },
885
+ "familyOnly": {
886
+ "type": "boolean"
887
+ }
888
+ },
889
+ "default": {}
890
+ },
891
+ "validFrom": {
892
+ "type": [
893
+ "string",
894
+ "null"
895
+ ],
896
+ "format": "date-time"
897
+ },
898
+ "validUntil": {
899
+ "type": [
900
+ "string",
901
+ "null"
902
+ ],
903
+ "format": "date-time"
904
+ },
905
+ "code": {
906
+ "type": [
907
+ "string",
908
+ "null"
909
+ ],
910
+ "minLength": 1,
911
+ "maxLength": 80,
912
+ "pattern": "^[A-Za-z0-9_-]+$"
913
+ },
914
+ "stackable": {
915
+ "type": "boolean",
916
+ "default": false
917
+ },
918
+ "active": {
919
+ "type": "boolean",
920
+ "default": true
921
+ },
922
+ "metadata": {
923
+ "type": [
924
+ "object",
925
+ "null"
926
+ ],
927
+ "additionalProperties": {}
928
+ }
929
+ },
930
+ "required": [
931
+ "name",
932
+ "slug",
933
+ "discountType",
934
+ "scope"
935
+ ]
936
+ }
937
+ }
938
+ }
939
+ },
940
+ "responses": {
941
+ "201": {
942
+ "description": "The created promotional offer",
943
+ "content": {
944
+ "application/json": {
945
+ "schema": {
946
+ "type": "object",
947
+ "properties": {
948
+ "data": {
949
+ "type": "object",
950
+ "properties": {
951
+ "id": {
952
+ "type": "string"
953
+ },
954
+ "name": {
955
+ "type": "string"
956
+ },
957
+ "slug": {
958
+ "type": "string"
959
+ },
960
+ "description": {
961
+ "type": [
962
+ "string",
963
+ "null"
964
+ ]
965
+ },
966
+ "discountType": {
967
+ "type": "string",
968
+ "enum": [
969
+ "percentage",
970
+ "fixed_amount"
971
+ ]
972
+ },
973
+ "discountPercent": {
974
+ "type": [
975
+ "string",
976
+ "null"
977
+ ]
978
+ },
979
+ "discountAmountCents": {
980
+ "type": [
981
+ "integer",
982
+ "null"
983
+ ]
984
+ },
985
+ "currency": {
986
+ "type": [
987
+ "string",
988
+ "null"
989
+ ]
990
+ },
991
+ "scope": {
992
+ "oneOf": [
993
+ {
994
+ "type": "object",
995
+ "properties": {
996
+ "kind": {
997
+ "type": "string",
998
+ "enum": [
999
+ "global"
1000
+ ]
1001
+ }
1002
+ },
1003
+ "required": [
1004
+ "kind"
1005
+ ]
1006
+ },
1007
+ {
1008
+ "type": "object",
1009
+ "properties": {
1010
+ "kind": {
1011
+ "type": "string",
1012
+ "enum": [
1013
+ "products"
1014
+ ]
1015
+ },
1016
+ "productIds": {
1017
+ "type": "array",
1018
+ "items": {
1019
+ "type": "string",
1020
+ "minLength": 1
1021
+ },
1022
+ "minItems": 1
1023
+ }
1024
+ },
1025
+ "required": [
1026
+ "kind",
1027
+ "productIds"
1028
+ ]
1029
+ },
1030
+ {
1031
+ "type": "object",
1032
+ "properties": {
1033
+ "kind": {
1034
+ "type": "string",
1035
+ "enum": [
1036
+ "categories"
1037
+ ]
1038
+ },
1039
+ "categoryIds": {
1040
+ "type": "array",
1041
+ "items": {
1042
+ "type": "string",
1043
+ "minLength": 1
1044
+ },
1045
+ "minItems": 1
1046
+ }
1047
+ },
1048
+ "required": [
1049
+ "kind",
1050
+ "categoryIds"
1051
+ ]
1052
+ },
1053
+ {
1054
+ "type": "object",
1055
+ "properties": {
1056
+ "kind": {
1057
+ "type": "string",
1058
+ "enum": [
1059
+ "destinations"
1060
+ ]
1061
+ },
1062
+ "destinationIds": {
1063
+ "type": "array",
1064
+ "items": {
1065
+ "type": "string",
1066
+ "minLength": 1
1067
+ },
1068
+ "minItems": 1
1069
+ }
1070
+ },
1071
+ "required": [
1072
+ "kind",
1073
+ "destinationIds"
1074
+ ]
1075
+ },
1076
+ {
1077
+ "type": "object",
1078
+ "properties": {
1079
+ "kind": {
1080
+ "type": "string",
1081
+ "enum": [
1082
+ "markets"
1083
+ ]
1084
+ },
1085
+ "marketIds": {
1086
+ "type": "array",
1087
+ "items": {
1088
+ "type": "string",
1089
+ "minLength": 1
1090
+ },
1091
+ "minItems": 1
1092
+ }
1093
+ },
1094
+ "required": [
1095
+ "kind",
1096
+ "marketIds"
1097
+ ]
1098
+ },
1099
+ {
1100
+ "type": "object",
1101
+ "properties": {
1102
+ "kind": {
1103
+ "type": "string",
1104
+ "enum": [
1105
+ "audiences"
1106
+ ]
1107
+ },
1108
+ "audiences": {
1109
+ "type": "array",
1110
+ "items": {
1111
+ "type": "string",
1112
+ "enum": [
1113
+ "staff",
1114
+ "customer",
1115
+ "partner",
1116
+ "supplier"
1117
+ ]
1118
+ },
1119
+ "minItems": 1
1120
+ }
1121
+ },
1122
+ "required": [
1123
+ "kind",
1124
+ "audiences"
1125
+ ]
1126
+ },
1127
+ {
1128
+ "type": "object",
1129
+ "properties": {
1130
+ "kind": {
1131
+ "type": "string",
1132
+ "enum": [
1133
+ "fare_codes"
1134
+ ]
1135
+ },
1136
+ "fareCodes": {
1137
+ "type": "array",
1138
+ "items": {
1139
+ "type": "string",
1140
+ "minLength": 1
1141
+ },
1142
+ "minItems": 1
1143
+ }
1144
+ },
1145
+ "required": [
1146
+ "kind",
1147
+ "fareCodes"
1148
+ ]
1149
+ },
1150
+ {
1151
+ "type": "object",
1152
+ "properties": {
1153
+ "kind": {
1154
+ "type": "string",
1155
+ "enum": [
1156
+ "cabin_grades"
1157
+ ]
1158
+ },
1159
+ "cabinGradeCodes": {
1160
+ "type": "array",
1161
+ "items": {
1162
+ "type": "string",
1163
+ "minLength": 1
1164
+ },
1165
+ "minItems": 1
1166
+ }
1167
+ },
1168
+ "required": [
1169
+ "kind",
1170
+ "cabinGradeCodes"
1171
+ ]
1172
+ }
1173
+ ]
1174
+ },
1175
+ "conditions": {
1176
+ "type": "object",
1177
+ "properties": {
1178
+ "minPax": {
1179
+ "type": "integer",
1180
+ "exclusiveMinimum": 0
1181
+ },
1182
+ "pastGuestOnly": {
1183
+ "type": "boolean"
1184
+ },
1185
+ "soloTravelerOnly": {
1186
+ "type": "boolean"
1187
+ },
1188
+ "childTravelerOnly": {
1189
+ "type": "boolean"
1190
+ },
1191
+ "familyOnly": {
1192
+ "type": "boolean"
1193
+ }
1194
+ }
1195
+ },
1196
+ "validFrom": {
1197
+ "type": [
1198
+ "string",
1199
+ "null"
1200
+ ]
1201
+ },
1202
+ "validUntil": {
1203
+ "type": [
1204
+ "string",
1205
+ "null"
1206
+ ]
1207
+ },
1208
+ "code": {
1209
+ "type": [
1210
+ "string",
1211
+ "null"
1212
+ ]
1213
+ },
1214
+ "stackable": {
1215
+ "type": "boolean"
1216
+ },
1217
+ "active": {
1218
+ "type": "boolean"
1219
+ },
1220
+ "metadata": {},
1221
+ "createdAt": {
1222
+ "type": "string"
1223
+ },
1224
+ "updatedAt": {
1225
+ "type": "string"
1226
+ }
1227
+ },
1228
+ "required": [
1229
+ "id",
1230
+ "name",
1231
+ "slug",
1232
+ "description",
1233
+ "discountType",
1234
+ "discountPercent",
1235
+ "discountAmountCents",
1236
+ "currency",
1237
+ "scope",
1238
+ "conditions",
1239
+ "validFrom",
1240
+ "validUntil",
1241
+ "code",
1242
+ "stackable",
1243
+ "active",
1244
+ "createdAt",
1245
+ "updatedAt"
1246
+ ]
1247
+ }
1248
+ },
1249
+ "required": [
1250
+ "data"
1251
+ ]
1252
+ }
1253
+ }
1254
+ }
1255
+ },
1256
+ "409": {
1257
+ "description": "Active promotional offer slug or code already exists",
1258
+ "content": {
1259
+ "application/json": {
1260
+ "schema": {
1261
+ "type": "object",
1262
+ "properties": {
1263
+ "error": {
1264
+ "type": "string"
1265
+ },
1266
+ "code": {
1267
+ "type": "string"
1268
+ },
1269
+ "requestId": {
1270
+ "type": "string"
1271
+ },
1272
+ "details": {
1273
+ "type": "object",
1274
+ "additionalProperties": {}
1275
+ }
1276
+ },
1277
+ "required": [
1278
+ "error"
1279
+ ]
1280
+ }
1281
+ }
1282
+ }
1283
+ }
1284
+ },
1285
+ "operationId": "postAdminPromotions",
1286
+ "summary": "POST /v1/admin/promotions",
1287
+ "tags": [
1288
+ "promotions"
1289
+ ],
1290
+ "x-voyant-module": "promotions",
1291
+ "x-voyant-surface": "admin"
1292
+ }
1293
+ },
1294
+ "/v1/admin/promotions/{id}": {
1295
+ "get": {
1296
+ "parameters": [
1297
+ {
1298
+ "schema": {
1299
+ "type": "string"
1300
+ },
1301
+ "required": true,
1302
+ "name": "id",
1303
+ "in": "path"
1304
+ }
1305
+ ],
1306
+ "responses": {
1307
+ "200": {
1308
+ "description": "A promotional offer by id",
1309
+ "content": {
1310
+ "application/json": {
1311
+ "schema": {
1312
+ "type": "object",
1313
+ "properties": {
1314
+ "data": {
1315
+ "type": "object",
1316
+ "properties": {
1317
+ "id": {
1318
+ "type": "string"
1319
+ },
1320
+ "name": {
1321
+ "type": "string"
1322
+ },
1323
+ "slug": {
1324
+ "type": "string"
1325
+ },
1326
+ "description": {
1327
+ "type": [
1328
+ "string",
1329
+ "null"
1330
+ ]
1331
+ },
1332
+ "discountType": {
1333
+ "type": "string",
1334
+ "enum": [
1335
+ "percentage",
1336
+ "fixed_amount"
1337
+ ]
1338
+ },
1339
+ "discountPercent": {
1340
+ "type": [
1341
+ "string",
1342
+ "null"
1343
+ ]
1344
+ },
1345
+ "discountAmountCents": {
1346
+ "type": [
1347
+ "integer",
1348
+ "null"
1349
+ ]
1350
+ },
1351
+ "currency": {
1352
+ "type": [
1353
+ "string",
1354
+ "null"
1355
+ ]
1356
+ },
1357
+ "scope": {
1358
+ "oneOf": [
1359
+ {
1360
+ "type": "object",
1361
+ "properties": {
1362
+ "kind": {
1363
+ "type": "string",
1364
+ "enum": [
1365
+ "global"
1366
+ ]
1367
+ }
1368
+ },
1369
+ "required": [
1370
+ "kind"
1371
+ ]
1372
+ },
1373
+ {
1374
+ "type": "object",
1375
+ "properties": {
1376
+ "kind": {
1377
+ "type": "string",
1378
+ "enum": [
1379
+ "products"
1380
+ ]
1381
+ },
1382
+ "productIds": {
1383
+ "type": "array",
1384
+ "items": {
1385
+ "type": "string",
1386
+ "minLength": 1
1387
+ },
1388
+ "minItems": 1
1389
+ }
1390
+ },
1391
+ "required": [
1392
+ "kind",
1393
+ "productIds"
1394
+ ]
1395
+ },
1396
+ {
1397
+ "type": "object",
1398
+ "properties": {
1399
+ "kind": {
1400
+ "type": "string",
1401
+ "enum": [
1402
+ "categories"
1403
+ ]
1404
+ },
1405
+ "categoryIds": {
1406
+ "type": "array",
1407
+ "items": {
1408
+ "type": "string",
1409
+ "minLength": 1
1410
+ },
1411
+ "minItems": 1
1412
+ }
1413
+ },
1414
+ "required": [
1415
+ "kind",
1416
+ "categoryIds"
1417
+ ]
1418
+ },
1419
+ {
1420
+ "type": "object",
1421
+ "properties": {
1422
+ "kind": {
1423
+ "type": "string",
1424
+ "enum": [
1425
+ "destinations"
1426
+ ]
1427
+ },
1428
+ "destinationIds": {
1429
+ "type": "array",
1430
+ "items": {
1431
+ "type": "string",
1432
+ "minLength": 1
1433
+ },
1434
+ "minItems": 1
1435
+ }
1436
+ },
1437
+ "required": [
1438
+ "kind",
1439
+ "destinationIds"
1440
+ ]
1441
+ },
1442
+ {
1443
+ "type": "object",
1444
+ "properties": {
1445
+ "kind": {
1446
+ "type": "string",
1447
+ "enum": [
1448
+ "markets"
1449
+ ]
1450
+ },
1451
+ "marketIds": {
1452
+ "type": "array",
1453
+ "items": {
1454
+ "type": "string",
1455
+ "minLength": 1
1456
+ },
1457
+ "minItems": 1
1458
+ }
1459
+ },
1460
+ "required": [
1461
+ "kind",
1462
+ "marketIds"
1463
+ ]
1464
+ },
1465
+ {
1466
+ "type": "object",
1467
+ "properties": {
1468
+ "kind": {
1469
+ "type": "string",
1470
+ "enum": [
1471
+ "audiences"
1472
+ ]
1473
+ },
1474
+ "audiences": {
1475
+ "type": "array",
1476
+ "items": {
1477
+ "type": "string",
1478
+ "enum": [
1479
+ "staff",
1480
+ "customer",
1481
+ "partner",
1482
+ "supplier"
1483
+ ]
1484
+ },
1485
+ "minItems": 1
1486
+ }
1487
+ },
1488
+ "required": [
1489
+ "kind",
1490
+ "audiences"
1491
+ ]
1492
+ },
1493
+ {
1494
+ "type": "object",
1495
+ "properties": {
1496
+ "kind": {
1497
+ "type": "string",
1498
+ "enum": [
1499
+ "fare_codes"
1500
+ ]
1501
+ },
1502
+ "fareCodes": {
1503
+ "type": "array",
1504
+ "items": {
1505
+ "type": "string",
1506
+ "minLength": 1
1507
+ },
1508
+ "minItems": 1
1509
+ }
1510
+ },
1511
+ "required": [
1512
+ "kind",
1513
+ "fareCodes"
1514
+ ]
1515
+ },
1516
+ {
1517
+ "type": "object",
1518
+ "properties": {
1519
+ "kind": {
1520
+ "type": "string",
1521
+ "enum": [
1522
+ "cabin_grades"
1523
+ ]
1524
+ },
1525
+ "cabinGradeCodes": {
1526
+ "type": "array",
1527
+ "items": {
1528
+ "type": "string",
1529
+ "minLength": 1
1530
+ },
1531
+ "minItems": 1
1532
+ }
1533
+ },
1534
+ "required": [
1535
+ "kind",
1536
+ "cabinGradeCodes"
1537
+ ]
1538
+ }
1539
+ ]
1540
+ },
1541
+ "conditions": {
1542
+ "type": "object",
1543
+ "properties": {
1544
+ "minPax": {
1545
+ "type": "integer",
1546
+ "exclusiveMinimum": 0
1547
+ },
1548
+ "pastGuestOnly": {
1549
+ "type": "boolean"
1550
+ },
1551
+ "soloTravelerOnly": {
1552
+ "type": "boolean"
1553
+ },
1554
+ "childTravelerOnly": {
1555
+ "type": "boolean"
1556
+ },
1557
+ "familyOnly": {
1558
+ "type": "boolean"
1559
+ }
1560
+ }
1561
+ },
1562
+ "validFrom": {
1563
+ "type": [
1564
+ "string",
1565
+ "null"
1566
+ ]
1567
+ },
1568
+ "validUntil": {
1569
+ "type": [
1570
+ "string",
1571
+ "null"
1572
+ ]
1573
+ },
1574
+ "code": {
1575
+ "type": [
1576
+ "string",
1577
+ "null"
1578
+ ]
1579
+ },
1580
+ "stackable": {
1581
+ "type": "boolean"
1582
+ },
1583
+ "active": {
1584
+ "type": "boolean"
1585
+ },
1586
+ "metadata": {},
1587
+ "createdAt": {
1588
+ "type": "string"
1589
+ },
1590
+ "updatedAt": {
1591
+ "type": "string"
1592
+ }
1593
+ },
1594
+ "required": [
1595
+ "id",
1596
+ "name",
1597
+ "slug",
1598
+ "description",
1599
+ "discountType",
1600
+ "discountPercent",
1601
+ "discountAmountCents",
1602
+ "currency",
1603
+ "scope",
1604
+ "conditions",
1605
+ "validFrom",
1606
+ "validUntil",
1607
+ "code",
1608
+ "stackable",
1609
+ "active",
1610
+ "createdAt",
1611
+ "updatedAt"
1612
+ ]
1613
+ }
1614
+ },
1615
+ "required": [
1616
+ "data"
1617
+ ]
1618
+ }
1619
+ }
1620
+ }
1621
+ },
1622
+ "404": {
1623
+ "description": "Promotional offer not found",
1624
+ "content": {
1625
+ "application/json": {
1626
+ "schema": {
1627
+ "type": "object",
1628
+ "properties": {
1629
+ "error": {
1630
+ "type": "string"
1631
+ }
1632
+ },
1633
+ "required": [
1634
+ "error"
1635
+ ]
1636
+ }
1637
+ }
1638
+ }
1639
+ }
1640
+ },
1641
+ "operationId": "getAdminPromotionsById",
1642
+ "summary": "GET /v1/admin/promotions/{id}",
1643
+ "tags": [
1644
+ "promotions"
1645
+ ],
1646
+ "x-voyant-module": "promotions",
1647
+ "x-voyant-surface": "admin"
1648
+ },
1649
+ "patch": {
1650
+ "parameters": [
1651
+ {
1652
+ "schema": {
1653
+ "type": "string"
1654
+ },
1655
+ "required": true,
1656
+ "name": "id",
1657
+ "in": "path"
1658
+ }
1659
+ ],
1660
+ "requestBody": {
1661
+ "required": true,
1662
+ "description": "Partial update. When `discountType` is supplied, the same conditional rules as create apply (enforced server-side, 400 `invalid_request` on violation): `percentage` requires `discountPercent` and omits `discountAmountCents`/`currency`; `fixed_amount` requires `discountAmountCents` + `currency` and omits `discountPercent`. These cross-field rules aren't structurally representable in JSON Schema.",
1663
+ "content": {
1664
+ "application/json": {
1665
+ "schema": {
1666
+ "type": "object",
1667
+ "properties": {
1668
+ "name": {
1669
+ "type": "string",
1670
+ "minLength": 1,
1671
+ "maxLength": 200
1672
+ },
1673
+ "slug": {
1674
+ "type": "string",
1675
+ "minLength": 1,
1676
+ "maxLength": 200,
1677
+ "pattern": "^[a-z0-9-]+$"
1678
+ },
1679
+ "description": {
1680
+ "type": [
1681
+ "string",
1682
+ "null"
1683
+ ]
1684
+ },
1685
+ "discountType": {
1686
+ "type": "string",
1687
+ "enum": [
1688
+ "percentage",
1689
+ "fixed_amount"
1690
+ ]
1691
+ },
1692
+ "discountPercent": {
1693
+ "type": [
1694
+ "number",
1695
+ "null"
1696
+ ],
1697
+ "exclusiveMinimum": 0,
1698
+ "maximum": 100
1699
+ },
1700
+ "discountAmountCents": {
1701
+ "type": [
1702
+ "integer",
1703
+ "null"
1704
+ ],
1705
+ "exclusiveMinimum": 0
1706
+ },
1707
+ "currency": {
1708
+ "type": [
1709
+ "string",
1710
+ "null"
1711
+ ],
1712
+ "minLength": 3,
1713
+ "maxLength": 3,
1714
+ "pattern": "^[A-Z]{3}$"
1715
+ },
1716
+ "scope": {
1717
+ "oneOf": [
1718
+ {
1719
+ "type": "object",
1720
+ "properties": {
1721
+ "kind": {
1722
+ "type": "string",
1723
+ "enum": [
1724
+ "global"
1725
+ ]
1726
+ }
1727
+ },
1728
+ "required": [
1729
+ "kind"
1730
+ ]
1731
+ },
1732
+ {
1733
+ "type": "object",
1734
+ "properties": {
1735
+ "kind": {
1736
+ "type": "string",
1737
+ "enum": [
1738
+ "products"
1739
+ ]
1740
+ },
1741
+ "productIds": {
1742
+ "type": "array",
1743
+ "items": {
1744
+ "type": "string",
1745
+ "minLength": 1
1746
+ },
1747
+ "minItems": 1
1748
+ }
1749
+ },
1750
+ "required": [
1751
+ "kind",
1752
+ "productIds"
1753
+ ]
1754
+ },
1755
+ {
1756
+ "type": "object",
1757
+ "properties": {
1758
+ "kind": {
1759
+ "type": "string",
1760
+ "enum": [
1761
+ "categories"
1762
+ ]
1763
+ },
1764
+ "categoryIds": {
1765
+ "type": "array",
1766
+ "items": {
1767
+ "type": "string",
1768
+ "minLength": 1
1769
+ },
1770
+ "minItems": 1
1771
+ }
1772
+ },
1773
+ "required": [
1774
+ "kind",
1775
+ "categoryIds"
1776
+ ]
1777
+ },
1778
+ {
1779
+ "type": "object",
1780
+ "properties": {
1781
+ "kind": {
1782
+ "type": "string",
1783
+ "enum": [
1784
+ "destinations"
1785
+ ]
1786
+ },
1787
+ "destinationIds": {
1788
+ "type": "array",
1789
+ "items": {
1790
+ "type": "string",
1791
+ "minLength": 1
1792
+ },
1793
+ "minItems": 1
1794
+ }
1795
+ },
1796
+ "required": [
1797
+ "kind",
1798
+ "destinationIds"
1799
+ ]
1800
+ },
1801
+ {
1802
+ "type": "object",
1803
+ "properties": {
1804
+ "kind": {
1805
+ "type": "string",
1806
+ "enum": [
1807
+ "markets"
1808
+ ]
1809
+ },
1810
+ "marketIds": {
1811
+ "type": "array",
1812
+ "items": {
1813
+ "type": "string",
1814
+ "minLength": 1
1815
+ },
1816
+ "minItems": 1
1817
+ }
1818
+ },
1819
+ "required": [
1820
+ "kind",
1821
+ "marketIds"
1822
+ ]
1823
+ },
1824
+ {
1825
+ "type": "object",
1826
+ "properties": {
1827
+ "kind": {
1828
+ "type": "string",
1829
+ "enum": [
1830
+ "audiences"
1831
+ ]
1832
+ },
1833
+ "audiences": {
1834
+ "type": "array",
1835
+ "items": {
1836
+ "type": "string",
1837
+ "enum": [
1838
+ "staff",
1839
+ "customer",
1840
+ "partner",
1841
+ "supplier"
1842
+ ]
1843
+ },
1844
+ "minItems": 1
1845
+ }
1846
+ },
1847
+ "required": [
1848
+ "kind",
1849
+ "audiences"
1850
+ ]
1851
+ },
1852
+ {
1853
+ "type": "object",
1854
+ "properties": {
1855
+ "kind": {
1856
+ "type": "string",
1857
+ "enum": [
1858
+ "fare_codes"
1859
+ ]
1860
+ },
1861
+ "fareCodes": {
1862
+ "type": "array",
1863
+ "items": {
1864
+ "type": "string",
1865
+ "minLength": 1
1866
+ },
1867
+ "minItems": 1
1868
+ }
1869
+ },
1870
+ "required": [
1871
+ "kind",
1872
+ "fareCodes"
1873
+ ]
1874
+ },
1875
+ {
1876
+ "type": "object",
1877
+ "properties": {
1878
+ "kind": {
1879
+ "type": "string",
1880
+ "enum": [
1881
+ "cabin_grades"
1882
+ ]
1883
+ },
1884
+ "cabinGradeCodes": {
1885
+ "type": "array",
1886
+ "items": {
1887
+ "type": "string",
1888
+ "minLength": 1
1889
+ },
1890
+ "minItems": 1
1891
+ }
1892
+ },
1893
+ "required": [
1894
+ "kind",
1895
+ "cabinGradeCodes"
1896
+ ]
1897
+ }
1898
+ ]
1899
+ },
1900
+ "conditions": {
1901
+ "type": "object",
1902
+ "properties": {
1903
+ "minPax": {
1904
+ "type": "integer",
1905
+ "exclusiveMinimum": 0
1906
+ },
1907
+ "pastGuestOnly": {
1908
+ "type": "boolean"
1909
+ },
1910
+ "soloTravelerOnly": {
1911
+ "type": "boolean"
1912
+ },
1913
+ "childTravelerOnly": {
1914
+ "type": "boolean"
1915
+ },
1916
+ "familyOnly": {
1917
+ "type": "boolean"
1918
+ }
1919
+ },
1920
+ "default": {}
1921
+ },
1922
+ "validFrom": {
1923
+ "type": [
1924
+ "string",
1925
+ "null"
1926
+ ],
1927
+ "format": "date-time"
1928
+ },
1929
+ "validUntil": {
1930
+ "type": [
1931
+ "string",
1932
+ "null"
1933
+ ],
1934
+ "format": "date-time"
1935
+ },
1936
+ "code": {
1937
+ "type": [
1938
+ "string",
1939
+ "null"
1940
+ ],
1941
+ "minLength": 1,
1942
+ "maxLength": 80,
1943
+ "pattern": "^[A-Za-z0-9_-]+$"
1944
+ },
1945
+ "stackable": {
1946
+ "type": "boolean",
1947
+ "default": false
1948
+ },
1949
+ "active": {
1950
+ "type": "boolean",
1951
+ "default": true
1952
+ },
1953
+ "metadata": {
1954
+ "type": [
1955
+ "object",
1956
+ "null"
1957
+ ],
1958
+ "additionalProperties": {}
1959
+ }
1960
+ }
1961
+ }
1962
+ }
1963
+ }
1964
+ },
1965
+ "responses": {
1966
+ "200": {
1967
+ "description": "The updated promotional offer",
1968
+ "content": {
1969
+ "application/json": {
1970
+ "schema": {
1971
+ "type": "object",
1972
+ "properties": {
1973
+ "data": {
1974
+ "type": "object",
1975
+ "properties": {
1976
+ "id": {
1977
+ "type": "string"
1978
+ },
1979
+ "name": {
1980
+ "type": "string"
1981
+ },
1982
+ "slug": {
1983
+ "type": "string"
1984
+ },
1985
+ "description": {
1986
+ "type": [
1987
+ "string",
1988
+ "null"
1989
+ ]
1990
+ },
1991
+ "discountType": {
1992
+ "type": "string",
1993
+ "enum": [
1994
+ "percentage",
1995
+ "fixed_amount"
1996
+ ]
1997
+ },
1998
+ "discountPercent": {
1999
+ "type": [
2000
+ "string",
2001
+ "null"
2002
+ ]
2003
+ },
2004
+ "discountAmountCents": {
2005
+ "type": [
2006
+ "integer",
2007
+ "null"
2008
+ ]
2009
+ },
2010
+ "currency": {
2011
+ "type": [
2012
+ "string",
2013
+ "null"
2014
+ ]
2015
+ },
2016
+ "scope": {
2017
+ "oneOf": [
2018
+ {
2019
+ "type": "object",
2020
+ "properties": {
2021
+ "kind": {
2022
+ "type": "string",
2023
+ "enum": [
2024
+ "global"
2025
+ ]
2026
+ }
2027
+ },
2028
+ "required": [
2029
+ "kind"
2030
+ ]
2031
+ },
2032
+ {
2033
+ "type": "object",
2034
+ "properties": {
2035
+ "kind": {
2036
+ "type": "string",
2037
+ "enum": [
2038
+ "products"
2039
+ ]
2040
+ },
2041
+ "productIds": {
2042
+ "type": "array",
2043
+ "items": {
2044
+ "type": "string",
2045
+ "minLength": 1
2046
+ },
2047
+ "minItems": 1
2048
+ }
2049
+ },
2050
+ "required": [
2051
+ "kind",
2052
+ "productIds"
2053
+ ]
2054
+ },
2055
+ {
2056
+ "type": "object",
2057
+ "properties": {
2058
+ "kind": {
2059
+ "type": "string",
2060
+ "enum": [
2061
+ "categories"
2062
+ ]
2063
+ },
2064
+ "categoryIds": {
2065
+ "type": "array",
2066
+ "items": {
2067
+ "type": "string",
2068
+ "minLength": 1
2069
+ },
2070
+ "minItems": 1
2071
+ }
2072
+ },
2073
+ "required": [
2074
+ "kind",
2075
+ "categoryIds"
2076
+ ]
2077
+ },
2078
+ {
2079
+ "type": "object",
2080
+ "properties": {
2081
+ "kind": {
2082
+ "type": "string",
2083
+ "enum": [
2084
+ "destinations"
2085
+ ]
2086
+ },
2087
+ "destinationIds": {
2088
+ "type": "array",
2089
+ "items": {
2090
+ "type": "string",
2091
+ "minLength": 1
2092
+ },
2093
+ "minItems": 1
2094
+ }
2095
+ },
2096
+ "required": [
2097
+ "kind",
2098
+ "destinationIds"
2099
+ ]
2100
+ },
2101
+ {
2102
+ "type": "object",
2103
+ "properties": {
2104
+ "kind": {
2105
+ "type": "string",
2106
+ "enum": [
2107
+ "markets"
2108
+ ]
2109
+ },
2110
+ "marketIds": {
2111
+ "type": "array",
2112
+ "items": {
2113
+ "type": "string",
2114
+ "minLength": 1
2115
+ },
2116
+ "minItems": 1
2117
+ }
2118
+ },
2119
+ "required": [
2120
+ "kind",
2121
+ "marketIds"
2122
+ ]
2123
+ },
2124
+ {
2125
+ "type": "object",
2126
+ "properties": {
2127
+ "kind": {
2128
+ "type": "string",
2129
+ "enum": [
2130
+ "audiences"
2131
+ ]
2132
+ },
2133
+ "audiences": {
2134
+ "type": "array",
2135
+ "items": {
2136
+ "type": "string",
2137
+ "enum": [
2138
+ "staff",
2139
+ "customer",
2140
+ "partner",
2141
+ "supplier"
2142
+ ]
2143
+ },
2144
+ "minItems": 1
2145
+ }
2146
+ },
2147
+ "required": [
2148
+ "kind",
2149
+ "audiences"
2150
+ ]
2151
+ },
2152
+ {
2153
+ "type": "object",
2154
+ "properties": {
2155
+ "kind": {
2156
+ "type": "string",
2157
+ "enum": [
2158
+ "fare_codes"
2159
+ ]
2160
+ },
2161
+ "fareCodes": {
2162
+ "type": "array",
2163
+ "items": {
2164
+ "type": "string",
2165
+ "minLength": 1
2166
+ },
2167
+ "minItems": 1
2168
+ }
2169
+ },
2170
+ "required": [
2171
+ "kind",
2172
+ "fareCodes"
2173
+ ]
2174
+ },
2175
+ {
2176
+ "type": "object",
2177
+ "properties": {
2178
+ "kind": {
2179
+ "type": "string",
2180
+ "enum": [
2181
+ "cabin_grades"
2182
+ ]
2183
+ },
2184
+ "cabinGradeCodes": {
2185
+ "type": "array",
2186
+ "items": {
2187
+ "type": "string",
2188
+ "minLength": 1
2189
+ },
2190
+ "minItems": 1
2191
+ }
2192
+ },
2193
+ "required": [
2194
+ "kind",
2195
+ "cabinGradeCodes"
2196
+ ]
2197
+ }
2198
+ ]
2199
+ },
2200
+ "conditions": {
2201
+ "type": "object",
2202
+ "properties": {
2203
+ "minPax": {
2204
+ "type": "integer",
2205
+ "exclusiveMinimum": 0
2206
+ },
2207
+ "pastGuestOnly": {
2208
+ "type": "boolean"
2209
+ },
2210
+ "soloTravelerOnly": {
2211
+ "type": "boolean"
2212
+ },
2213
+ "childTravelerOnly": {
2214
+ "type": "boolean"
2215
+ },
2216
+ "familyOnly": {
2217
+ "type": "boolean"
2218
+ }
2219
+ }
2220
+ },
2221
+ "validFrom": {
2222
+ "type": [
2223
+ "string",
2224
+ "null"
2225
+ ]
2226
+ },
2227
+ "validUntil": {
2228
+ "type": [
2229
+ "string",
2230
+ "null"
2231
+ ]
2232
+ },
2233
+ "code": {
2234
+ "type": [
2235
+ "string",
2236
+ "null"
2237
+ ]
2238
+ },
2239
+ "stackable": {
2240
+ "type": "boolean"
2241
+ },
2242
+ "active": {
2243
+ "type": "boolean"
2244
+ },
2245
+ "metadata": {},
2246
+ "createdAt": {
2247
+ "type": "string"
2248
+ },
2249
+ "updatedAt": {
2250
+ "type": "string"
2251
+ }
2252
+ },
2253
+ "required": [
2254
+ "id",
2255
+ "name",
2256
+ "slug",
2257
+ "description",
2258
+ "discountType",
2259
+ "discountPercent",
2260
+ "discountAmountCents",
2261
+ "currency",
2262
+ "scope",
2263
+ "conditions",
2264
+ "validFrom",
2265
+ "validUntil",
2266
+ "code",
2267
+ "stackable",
2268
+ "active",
2269
+ "createdAt",
2270
+ "updatedAt"
2271
+ ]
2272
+ }
2273
+ },
2274
+ "required": [
2275
+ "data"
2276
+ ]
2277
+ }
2278
+ }
2279
+ }
2280
+ },
2281
+ "404": {
2282
+ "description": "Promotional offer not found",
2283
+ "content": {
2284
+ "application/json": {
2285
+ "schema": {
2286
+ "type": "object",
2287
+ "properties": {
2288
+ "error": {
2289
+ "type": "string"
2290
+ }
2291
+ },
2292
+ "required": [
2293
+ "error"
2294
+ ]
2295
+ }
2296
+ }
2297
+ }
2298
+ },
2299
+ "409": {
2300
+ "description": "Active promotional offer slug or code already exists",
2301
+ "content": {
2302
+ "application/json": {
2303
+ "schema": {
2304
+ "type": "object",
2305
+ "properties": {
2306
+ "error": {
2307
+ "type": "string"
2308
+ },
2309
+ "code": {
2310
+ "type": "string"
2311
+ },
2312
+ "requestId": {
2313
+ "type": "string"
2314
+ },
2315
+ "details": {
2316
+ "type": "object",
2317
+ "additionalProperties": {}
2318
+ }
2319
+ },
2320
+ "required": [
2321
+ "error"
2322
+ ]
2323
+ }
2324
+ }
2325
+ }
2326
+ }
2327
+ },
2328
+ "operationId": "patchAdminPromotionsById",
2329
+ "summary": "PATCH /v1/admin/promotions/{id}",
2330
+ "tags": [
2331
+ "promotions"
2332
+ ],
2333
+ "x-voyant-module": "promotions",
2334
+ "x-voyant-surface": "admin"
2335
+ },
2336
+ "delete": {
2337
+ "parameters": [
2338
+ {
2339
+ "schema": {
2340
+ "type": "string"
2341
+ },
2342
+ "required": true,
2343
+ "name": "id",
2344
+ "in": "path"
2345
+ }
2346
+ ],
2347
+ "responses": {
2348
+ "200": {
2349
+ "description": "The id of the deleted promotional offer",
2350
+ "content": {
2351
+ "application/json": {
2352
+ "schema": {
2353
+ "type": "object",
2354
+ "properties": {
2355
+ "data": {
2356
+ "type": "object",
2357
+ "properties": {
2358
+ "id": {
2359
+ "type": "string"
2360
+ }
2361
+ },
2362
+ "required": [
2363
+ "id"
2364
+ ]
2365
+ }
2366
+ },
2367
+ "required": [
2368
+ "data"
2369
+ ]
2370
+ }
2371
+ }
2372
+ }
2373
+ },
2374
+ "404": {
2375
+ "description": "Promotional offer not found",
2376
+ "content": {
2377
+ "application/json": {
2378
+ "schema": {
2379
+ "type": "object",
2380
+ "properties": {
2381
+ "error": {
2382
+ "type": "string"
2383
+ }
2384
+ },
2385
+ "required": [
2386
+ "error"
2387
+ ]
2388
+ }
2389
+ }
2390
+ }
2391
+ },
2392
+ "409": {
2393
+ "description": "Offer has redemptions and cannot be deleted",
2394
+ "content": {
2395
+ "application/json": {
2396
+ "schema": {
2397
+ "type": "object",
2398
+ "properties": {
2399
+ "error": {
2400
+ "type": "string"
2401
+ }
2402
+ },
2403
+ "required": [
2404
+ "error"
2405
+ ]
2406
+ }
2407
+ }
2408
+ }
2409
+ }
2410
+ },
2411
+ "operationId": "deleteAdminPromotionsById",
2412
+ "summary": "DELETE /v1/admin/promotions/{id}",
2413
+ "tags": [
2414
+ "promotions"
2415
+ ],
2416
+ "x-voyant-module": "promotions",
2417
+ "x-voyant-surface": "admin"
2418
+ }
2419
+ },
2420
+ "/v1/admin/promotions/{id}/archive": {
2421
+ "post": {
2422
+ "parameters": [
2423
+ {
2424
+ "schema": {
2425
+ "type": "string"
2426
+ },
2427
+ "required": true,
2428
+ "name": "id",
2429
+ "in": "path"
2430
+ }
2431
+ ],
2432
+ "responses": {
2433
+ "200": {
2434
+ "description": "The archived promotional offer",
2435
+ "content": {
2436
+ "application/json": {
2437
+ "schema": {
2438
+ "type": "object",
2439
+ "properties": {
2440
+ "data": {
2441
+ "type": "object",
2442
+ "properties": {
2443
+ "id": {
2444
+ "type": "string"
2445
+ },
2446
+ "name": {
2447
+ "type": "string"
2448
+ },
2449
+ "slug": {
2450
+ "type": "string"
2451
+ },
2452
+ "description": {
2453
+ "type": [
2454
+ "string",
2455
+ "null"
2456
+ ]
2457
+ },
2458
+ "discountType": {
2459
+ "type": "string",
2460
+ "enum": [
2461
+ "percentage",
2462
+ "fixed_amount"
2463
+ ]
2464
+ },
2465
+ "discountPercent": {
2466
+ "type": [
2467
+ "string",
2468
+ "null"
2469
+ ]
2470
+ },
2471
+ "discountAmountCents": {
2472
+ "type": [
2473
+ "integer",
2474
+ "null"
2475
+ ]
2476
+ },
2477
+ "currency": {
2478
+ "type": [
2479
+ "string",
2480
+ "null"
2481
+ ]
2482
+ },
2483
+ "scope": {
2484
+ "oneOf": [
2485
+ {
2486
+ "type": "object",
2487
+ "properties": {
2488
+ "kind": {
2489
+ "type": "string",
2490
+ "enum": [
2491
+ "global"
2492
+ ]
2493
+ }
2494
+ },
2495
+ "required": [
2496
+ "kind"
2497
+ ]
2498
+ },
2499
+ {
2500
+ "type": "object",
2501
+ "properties": {
2502
+ "kind": {
2503
+ "type": "string",
2504
+ "enum": [
2505
+ "products"
2506
+ ]
2507
+ },
2508
+ "productIds": {
2509
+ "type": "array",
2510
+ "items": {
2511
+ "type": "string",
2512
+ "minLength": 1
2513
+ },
2514
+ "minItems": 1
2515
+ }
2516
+ },
2517
+ "required": [
2518
+ "kind",
2519
+ "productIds"
2520
+ ]
2521
+ },
2522
+ {
2523
+ "type": "object",
2524
+ "properties": {
2525
+ "kind": {
2526
+ "type": "string",
2527
+ "enum": [
2528
+ "categories"
2529
+ ]
2530
+ },
2531
+ "categoryIds": {
2532
+ "type": "array",
2533
+ "items": {
2534
+ "type": "string",
2535
+ "minLength": 1
2536
+ },
2537
+ "minItems": 1
2538
+ }
2539
+ },
2540
+ "required": [
2541
+ "kind",
2542
+ "categoryIds"
2543
+ ]
2544
+ },
2545
+ {
2546
+ "type": "object",
2547
+ "properties": {
2548
+ "kind": {
2549
+ "type": "string",
2550
+ "enum": [
2551
+ "destinations"
2552
+ ]
2553
+ },
2554
+ "destinationIds": {
2555
+ "type": "array",
2556
+ "items": {
2557
+ "type": "string",
2558
+ "minLength": 1
2559
+ },
2560
+ "minItems": 1
2561
+ }
2562
+ },
2563
+ "required": [
2564
+ "kind",
2565
+ "destinationIds"
2566
+ ]
2567
+ },
2568
+ {
2569
+ "type": "object",
2570
+ "properties": {
2571
+ "kind": {
2572
+ "type": "string",
2573
+ "enum": [
2574
+ "markets"
2575
+ ]
2576
+ },
2577
+ "marketIds": {
2578
+ "type": "array",
2579
+ "items": {
2580
+ "type": "string",
2581
+ "minLength": 1
2582
+ },
2583
+ "minItems": 1
2584
+ }
2585
+ },
2586
+ "required": [
2587
+ "kind",
2588
+ "marketIds"
2589
+ ]
2590
+ },
2591
+ {
2592
+ "type": "object",
2593
+ "properties": {
2594
+ "kind": {
2595
+ "type": "string",
2596
+ "enum": [
2597
+ "audiences"
2598
+ ]
2599
+ },
2600
+ "audiences": {
2601
+ "type": "array",
2602
+ "items": {
2603
+ "type": "string",
2604
+ "enum": [
2605
+ "staff",
2606
+ "customer",
2607
+ "partner",
2608
+ "supplier"
2609
+ ]
2610
+ },
2611
+ "minItems": 1
2612
+ }
2613
+ },
2614
+ "required": [
2615
+ "kind",
2616
+ "audiences"
2617
+ ]
2618
+ },
2619
+ {
2620
+ "type": "object",
2621
+ "properties": {
2622
+ "kind": {
2623
+ "type": "string",
2624
+ "enum": [
2625
+ "fare_codes"
2626
+ ]
2627
+ },
2628
+ "fareCodes": {
2629
+ "type": "array",
2630
+ "items": {
2631
+ "type": "string",
2632
+ "minLength": 1
2633
+ },
2634
+ "minItems": 1
2635
+ }
2636
+ },
2637
+ "required": [
2638
+ "kind",
2639
+ "fareCodes"
2640
+ ]
2641
+ },
2642
+ {
2643
+ "type": "object",
2644
+ "properties": {
2645
+ "kind": {
2646
+ "type": "string",
2647
+ "enum": [
2648
+ "cabin_grades"
2649
+ ]
2650
+ },
2651
+ "cabinGradeCodes": {
2652
+ "type": "array",
2653
+ "items": {
2654
+ "type": "string",
2655
+ "minLength": 1
2656
+ },
2657
+ "minItems": 1
2658
+ }
2659
+ },
2660
+ "required": [
2661
+ "kind",
2662
+ "cabinGradeCodes"
2663
+ ]
2664
+ }
2665
+ ]
2666
+ },
2667
+ "conditions": {
2668
+ "type": "object",
2669
+ "properties": {
2670
+ "minPax": {
2671
+ "type": "integer",
2672
+ "exclusiveMinimum": 0
2673
+ },
2674
+ "pastGuestOnly": {
2675
+ "type": "boolean"
2676
+ },
2677
+ "soloTravelerOnly": {
2678
+ "type": "boolean"
2679
+ },
2680
+ "childTravelerOnly": {
2681
+ "type": "boolean"
2682
+ },
2683
+ "familyOnly": {
2684
+ "type": "boolean"
2685
+ }
2686
+ }
2687
+ },
2688
+ "validFrom": {
2689
+ "type": [
2690
+ "string",
2691
+ "null"
2692
+ ]
2693
+ },
2694
+ "validUntil": {
2695
+ "type": [
2696
+ "string",
2697
+ "null"
2698
+ ]
2699
+ },
2700
+ "code": {
2701
+ "type": [
2702
+ "string",
2703
+ "null"
2704
+ ]
2705
+ },
2706
+ "stackable": {
2707
+ "type": "boolean"
2708
+ },
2709
+ "active": {
2710
+ "type": "boolean"
2711
+ },
2712
+ "metadata": {},
2713
+ "createdAt": {
2714
+ "type": "string"
2715
+ },
2716
+ "updatedAt": {
2717
+ "type": "string"
2718
+ }
2719
+ },
2720
+ "required": [
2721
+ "id",
2722
+ "name",
2723
+ "slug",
2724
+ "description",
2725
+ "discountType",
2726
+ "discountPercent",
2727
+ "discountAmountCents",
2728
+ "currency",
2729
+ "scope",
2730
+ "conditions",
2731
+ "validFrom",
2732
+ "validUntil",
2733
+ "code",
2734
+ "stackable",
2735
+ "active",
2736
+ "createdAt",
2737
+ "updatedAt"
2738
+ ]
2739
+ }
2740
+ },
2741
+ "required": [
2742
+ "data"
2743
+ ]
2744
+ }
2745
+ }
2746
+ }
2747
+ },
2748
+ "404": {
2749
+ "description": "Promotional offer not found",
2750
+ "content": {
2751
+ "application/json": {
2752
+ "schema": {
2753
+ "type": "object",
2754
+ "properties": {
2755
+ "error": {
2756
+ "type": "string"
2757
+ }
2758
+ },
2759
+ "required": [
2760
+ "error"
2761
+ ]
2762
+ }
2763
+ }
2764
+ }
2765
+ }
2766
+ },
2767
+ "operationId": "postAdminPromotionsByIdArchive",
2768
+ "summary": "POST /v1/admin/promotions/{id}/archive",
2769
+ "tags": [
2770
+ "promotions"
2771
+ ],
2772
+ "x-voyant-module": "promotions",
2773
+ "x-voyant-surface": "admin"
2774
+ }
2775
+ }
2776
+ },
2777
+ "webhooks": {}
2778
+ }