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