generated from peter-evans/swagger-github-pages
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathcampaign-api-doc.yaml
1613 lines (1528 loc) · 61.7 KB
/
campaign-api-doc.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.0
info:
version: 4.4.3
title: goTom Campaign API
x-explorer-enabled: false # this disables the "try me" button for test requests on readme.com
paths:
/app-api/primary-keys/{entity}:
get:
tags: [Primary-Keys]
summary: Get a list of goTom primary keys with names
description: >
Get a list of goTom primary keys with associated names to the provided entity.
The primary keys provided here are needed in other calls like to create CampaignFlight.
It contains pagination after a 1000 max result limit. E-mail field is displayed only if user entity is requested.
parameters:
- in: path
name: entity
description: This is the entity name. Typically if looking for say, 'tarifId', the entity is called 'tarif'. And the `id` value returned is what one would enter as `tarifId`.
schema:
type: string
enum:
- user
- tarif
- priceType
- adServer
- campaignType
- extraPriceLevel
- platform
- channel
- media
- advertising
required: true
- in: query
name: page
description: From 1 to the last page number found in the pagination part of the response.
schema:
type: integer
default: 1
responses:
'200':
description: Returns pagination, items
content:
application/json:
schema:
$ref: '#/components/schemas/PrimaryKeysRead'
'422':
description: Invalid entity provided.
content:
application/json:
schema:
type: object
properties:
error:
type: object
properties:
msg:
type: string
example: "'tarifffff' is not a valid entity. Valid entities are: 'user','adServer','tarif','priceType','campaignType','extraPriceLevel','platform','channel','media','advertising'"
/app-api/campaign:
post:
tags: [Campaign]
summary: Create a campaign
description:
Create the campaign by its external ID. Flights that will be created on this campaign will have the agency or intermediator commission as well discounts applied to them.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CampaignCreate'
responses:
'201':
description: Campaign has been created
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `1f06b2d7-49b4-4b8b-aa66-5172aeb01e97` - The externalId is already in use
* `5658b9ca-ce50-4a98-a0da-97d9361845e3` - An invalid ID field has been given (for example the `entityId`
in the customer object could not be found), here you have to refer to the `propertyPath` value to
find out which property caused the error
* `8d6a458b-362a-4b13-b3bb-fe0772a4fc7e` - If you have supplied a currency which is not configured for
your goTom instance you will get this error
* `6b3befbc-2f01-4ddf-be21-b57898905284` - If a dynamic expression constraint failed. Check the error message for further info.
content:
application/json:
schema:
$ref: '#/components/schemas/ConstraintViolationResponse'
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
get:
tags: [Campaign]
summary: Retrieve a campaign
responses:
'200':
description: Return the campaign data
content:
application/json:
schema:
$ref: '#/components/schemas/CampaignRead'
'404':
description: Campaign has not been found
post:
tags: [Campaign]
summary: Update a campaign
description: |
All the properties are optional, only the supplied properties are changed.
Notice that when changing the customer, it will apply the new customer discounts automatically.
When changing or setting agency/intermediator, by default, commissions will be set to the values found in the agency/intermediator again. Even if the commission was set on the flight. Updating agency/intermediator to `null` will, by default, set the commissions to `0` and the `commissionStatus` as well to `0`.
When agency/intermediator are sent in the body and you don't want to update the commissions you can use the query parameter `update_commissions=0`.
parameters:
- in: query
name: update_commissions
schema:
type: boolean
default: 1
enum: [ 0, 1 ]
description: >
Whether to update commissions or not
* **0**: commissions will not be updated and stay the same even if agency and/or intermediator are changed. Flights created hereafter will use the old commissions.
* **1**: commissions will be updated only if the payload as well has values set for the intermediator or agency. Flights created hereafter will always use those commissions as well. If you have set custom flight commissions manually on flights, they will be reset to the values of the agency/intermediator.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CampaignUpdate'
responses:
'204':
description: Campaign has been updated
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `5658b9ca-ce50-4a98-a0da-97d9361845e3` - An invalid ID field has been given (for example the `entityId`
in the customer object could not be found), here you have to refer to the `propertyPath` value to
find out which property caused the error
* `fa0401a7-6720-44dd-b443-2389aab8c8b7` - Cannot change campaign status from booking to reservation because flights were already invoiced in this campaign.
* `b31b973d-8238-467c-bf01-1e9a4ded9631` - Cannot change campaign customer because flights were already invoiced in this campaign.
* `ec75ef78-1db7-4469-a7fc-b14a71e5dbee` - Cannot change campaign agency because flights were already invoiced in this campaign.
* `9e8d02a8-f693-4df3-869e-a16d196d9d8a` - Cannot change campaign intermediator because flights were already invoiced in this campaign.
* `800b5cad-7f13-4b27-b3d6-74fa3c47b4e1` - Cannot change campaign currency because flights were already invoiced in this campaign.
content:
application/json:
schema:
$ref: '#/components/schemas/ConstraintViolationResponse'
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/flight:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
post:
tags: [CampaignFlight]
summary: Create a new flight
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FlightCreate'
responses:
'201':
description: Flight has been created
'404':
description: The campaign does not exist
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `1f06b2d7-49b4-4b8b-aa66-5172aeb01e97` - The externalId is already in use
* `5658b9ca-ce50-4a98-a0da-97d9361845e3` - An invalid ID field has been given (for example the `platformId`
in the customer object could not be found), here you have to refer to the `propertyPath` value to
find out which property caused the error
* `e3a1d7f7-4fcf-4b7d-8d87-38a60126462f` - The combination of `platformId`, `channelId` and `advertisingId` does not exist
* `409d70bf-376e-4a21-a8d0-f75a4a6a7abc` - There is no price entry found for the combination of `platformId`, `channelId`, `advertisingId`, `tarifId`, `extraPriceLevelId` and `priceTypeId` does not exist
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/flight-lineitemid/{flightExternalId}:
get:
tags: [CampaignFlight]
summary: Retrieve a flight LineItem IDs and Strategy IDs
parameters:
- in: path
name: campaignExternalId
schema:
type: string
required: true
- in: path
name: flightExternalId
schema:
type: string
required: true
responses:
'200':
description: Return the adserver strategyId and lineitemid
content:
application/json:
schema:
$ref: '#/components/schemas/FlightLineItemId'
'404':
description: Flight has not been found
/app-api/campaign/{campaignExternalId}/flight/{flightExternalId}:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
- $ref: '#/components/parameters/ParamFlightExternalId'
get:
tags: [CampaignFlight]
summary: Retrieve a flight
responses:
'200':
description: Return the campaign data
content:
application/json:
schema:
$ref: '#/components/schemas/FlightRead'
'404':
description: Flight has not been found
post:
tags: [CampaignFlight]
summary: Update the flight
description: Update the flight. All the properties are optional, only the supplied properties are changed.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FlightUpdate'
responses:
'204':
description: Flight has been updated
'404':
description: The campaign does not exist
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `5658b9ca-ce50-4a98-a0da-97d9361845e3` - An invalid ID field has been given (for example the `platformId`
in the customer object could not be found), here you have to refer to the `propertyPath` value to
find out which property caused the error
* `e3a1d7f7-4fcf-4b7d-8d87-38a60126462f` - The combination of `platformId`, `channelId` and `advertisingId` does not exist
* `409d70bf-376e-4a21-a8d0-f75a4a6a7abc` - There is no price entry found for the combination of `platformId`, `channelId`, `advertisingId`, `tarifId`, `extraPriceLevelId` and `priceTypeId` does not exist
* `24a9375a-0b22-4676-9a29-9c9e7f2c195f` - The adServerId provided in the KeyValueSet is invalid
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
delete:
tags: [CampaignFlight]
summary: Delete a flight
responses:
'204':
description: Flight has been deleted
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
Campaign errors:
* `60e2547e-bac4-4738-bcfc-6b38fa847a16` - Delete failed because campaign is already archived.
* `1b97b080-933c-40df-8768-e08473736005` - Campaign does not have the status 'reservation' and therefore flights cannot be deleted.
Flight errors:
* `cc8b37d1-8c9f-491e-aaf4-05510935b492` - Delete failed because flight is already invoiced.
* `ac23616c-a625-47b4-9e58-909c66df5f6d` - Flight already has ad server data and therefore cannot be deleted.
* `8665dee6-e755-4904-9df4-93ef5bd64d29` - Flight already has deferred data and therefore cannot be deleted.
* `33042bd6-05f3-4691-ba27-4f5cef93f697` - Flight already has publisher payouts and therefore cannot be deleted.
content:
application/json:
schema:
$ref: '#/components/schemas/ConstraintViolationResponse'
'404':
description: Flight has not been found
/app-api/campaign/{campaignExternalId}/campaign-discount:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
get:
tags: [CampaignDiscount]
summary: Retrieve campaign discounts and their flight discounts
description: |
Retrieves campaign discounts and their associated flight discounts for a specific campaign.
responses:
'200':
description: Campaign discounts and flight discounts have been returned.
content:
application/json:
schema:
$ref: '#/components/schemas/CampaignDiscountsRead'
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
post:
tags: [CampaignDiscount]
summary: Create a campaign discount
description: A reason for a campaign discount is to e.g. be able to collect all flight discounts to a single column in finance documents.
responses:
'201':
description: Campaign discount has been created.
content:
application/json:
schema:
$ref: '#/components/schemas/CampaignDiscountWrite'
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected errors:
* `450ae979-312c-45b9-b61a-dfcde745b8e7` - Cannot create campaign discount with an external id that is already in use. Campaign discount external id: "{{ campaignDiscountExternalId }}" is already in use in campaign with external id "{{ campaignExternalId }}". Use update instead or use a different external id.
* `0e31a231-9575-4430-8ab2-937bbd9e771d` - Flight with external ID '{{ flightExternalId }}' is already partly invoiced.
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/campaign-discount/{cDiscountEID}:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
- $ref: '#/components/parameters/ParamCampaignDiscountExternalId'
patch:
tags: [CampaignDiscount]
summary: Update a campaign discount
responses:
'204':
description: Campaign discount has been updated.
content:
application/json:
schema:
type: object
properties:
name:
description: This name will appear e.g. in finance documents
type: string
example: "Great discount for john doe"
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected errors:
* `504d6c75-bacb-4319-ad0a-e942a30904f7` - Fehler: Delta-Rechnung vorhanden. (Kampagne: #{{ campaignInternalId }})
* `fb5f05f4-ee4e-41a9-9370-14415bdc12ea` - Fehler: min. 1 Flight ist bereits fakturiert.
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
delete:
tags: [CampaignDiscount]
summary: Delete a campaign discount
responses:
'204':
description: Campaign discount has been deleted.
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected errors:
* `d4c8a1b5-7492-4c65-833f-d3473dd76854` - Cannot delete a campaign discount that still has active flight discounts. Delete the flight discounts first. Flight discounts: {{ flightDiscountIdentifiers }}
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/campaign-discount/{cDiscountEID}/flight-discount:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
- $ref: '#/components/parameters/ParamCampaignDiscountExternalId'
post:
tags: [CampaignDiscount]
summary: Create a flight discount
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FlightDiscountCreate'
responses:
'204':
description: Flight discount has been created.
'404':
description: A flight does not exist with that external id.
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected:
* `b3b2187f-b34a-489e-ae7e-e171e7776bd4` - Neither amountPercent nor amountSum was specified, need to set at least one
* `5268ee13-0ad7-4393-a4be-6e17fbeb9569` - Flight discount cannot set both percentage and amount - send only one.
* `504d6c75-bacb-4319-ad0a-e942a30904f7` - Error: Delta-Invoice exists
* `fb5f05f4-ee4e-41a9-9370-14415bdc12ea` - Error: At least one Flight has already been invoiced.
* `586bec40-0170-4a20-81a3-328afcef65a5` - Flight discount external id: "exampleExternalId1" is already in use with flight with external id "exampleExternalId2".
* `0e31a231-9575-4430-8ab2-937bbd9e771d` - Flight with external ID 'exampleExternalId' is already partly invoiced.
content:
application/json:
schema:
$ref: '#/components/schemas/ConstraintViolationResponse'
'501':
$ref: '#/components/responses/SumUpCaseNotImplemented'
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/campaign-discount/{cDiscountEID}/flight-discount/{fDiscountEID}:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
- $ref: '#/components/parameters/ParamCampaignDiscountExternalId'
- $ref: '#/components/parameters/ParamFlightDiscountExternalId'
get:
tags: [CampaignDiscount]
summary: Read a flight discount
description: Read a flight discount of a flight that was created via API and has an externalId
responses:
'200':
description: Flight discount has been returned.
content:
application/json:
schema:
$ref: '#/components/schemas/FlightDiscountRead'
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
patch:
tags: [CampaignDiscount]
summary: Update a flight discount
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FlightDiscountUpdate'
responses:
'204':
description: Flight discount has been updated
'404':
description: A flight discount does not exist with that external id.
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected:
* `5268ee13-0ad7-4393-a4be-6e17fbeb9569` - Flight discount cannot set both percentage and amount - send only one.
* `504d6c75-bacb-4319-ad0a-e942a30904f7` - Error: Delta-Invoice exists
* `fb5f05f4-ee4e-41a9-9370-14415bdc12ea` - Error: At least one Flight has already been invoiced.
* `bdba6ce3-3884-450d-a3b3-0e790ba2cbc8` - Flight discount external id: "exampleExternalId1" is already in use with flight with external id "exampleExternalId2".
* `0e31a231-9575-4430-8ab2-937bbd9e771d` - Flight with external ID 'exampleExternalId' is already partly invoiced.
content:
application/json:
schema:
$ref: '#/components/schemas/ConstraintViolationResponse'
'501':
$ref: '#/components/responses/SumUpCaseNotImplemented'
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
delete:
tags: [CampaignDiscount]
summary: Delete a flight discount
responses:
'204':
description: Flight discount has been deleted
'404':
description: A flight discount does not exist with that external id.
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected:
* `cfa53928-478d-4c37-b844-d0643be2b2b4` - Error: At least one Flight has already been invoiced.
* `26415fc8-24d2-4cd7-8561-a62fe636f3c4` - Changes not allowed. Flight already deferred.
* `0e31a231-9575-4430-8ab2-937bbd9e771d` - Flight with external ID 'exampleExternalId' is already partly invoiced.
content:
application/json:
schema:
$ref: '#/components/schemas/ConstraintViolationResponse'
'501':
$ref: '#/components/responses/SumUpCaseNotImplemented'
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/flight/{flightExternalId}/sublines:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
- $ref: '#/components/parameters/ParamFlightExternalId'
get:
tags: [CampaignFlightSubline]
summary: Retrieve the flight's sublines
description: Retrieve the flight's sublines. This endpoint only available if the marketer network module is active.
responses:
'200':
description: Return the campaign data
content:
application/json:
schema:
$ref: '#/components/schemas/FlightSublines'
'404':
description: Flight has not been found
post:
tags: [CampaignFlightSubline]
summary: Create/Update the flight's sublines
description: Create/Update the sublines for a flight. This endpoint only available if the marketer network module is active.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FlightSublines'
responses:
'204':
description: Sublines have been updated
'404':
description: The campaign or flight does not exist
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `d368a263-4bd7-4f21-bccf-1188df46991c` - The `platformId` of the given subline does not belong to the network defined in the flight's `platformId`.
* `3b254c3d-590c-4edc-b763-c49f5a703355` - The `percentage` values of all `sublines` do not add up to 100%
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/document:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
post:
tags: [Campaign]
summary: Create a new campaign document
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/Document'
responses:
'201':
description: Document has been created
'404':
description: The campaign does not exist
/app-api/campaign/{campaignExternalId}/archive-status:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
post:
tags: [Campaign]
summary: Set archive status of a campaign
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/ArchiveStatus'
responses:
'204':
description: Archive status was updated successfully
'404':
description: The campaign does not exist
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `28a27691-46f0-4bc2-9806-100587d7a962` - The campaign was already billed, cannot archive / unarchive
* `e0a1561a-631e-4d1b-99fe-6a7e7f89b4dd` - The campaign was partially invoiced, cannot archive
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/commission-status:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
post:
tags: [Campaign]
summary: Set the commission status of a campaign
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/CommissionStatus'
responses:
'204':
description: Commission status was updated successfully
'404':
description: The campaign does not exist
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `48f7f665-0181-431c-a094-d6a09842690f` - Cannot change commission because flights were already invoiced in this campaign
* `9bf0acca-73cf-448f-8907-bc70ae240b16` - The provided commission status value is invalid
* `16a35de8-46dd-454d-9150-b11280782ff9` - Changes not allowed. Flight already deferred
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
/app-api/campaign/{campaignExternalId}/flight/{flightExternalId}/commission:
parameters:
- $ref: '#/components/parameters/ParamCampaignExternalId'
- $ref: '#/components/parameters/ParamFlightExternalId'
get:
tags: [ CampaignFlight ]
summary: Retrieve the flight's commission
responses:
'200':
description: Returns the commission data
content:
application/json:
schema:
$ref: '#/components/schemas/FlightCommission'
'404':
description: Flight has not been found
post:
tags: [CampaignFlight]
summary: Set the flight's commission
description: |
Careful: Updating the campaign with a new agency/intermediator or with the same agency/intermediator will recalculate the commissions of that agency/intermediator and overwrite the flight commission set here.
Read details in the update campaign endpoint.
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/FlightCommission'
responses:
'204':
description: Commission was updated successfully
'404':
description: The campaign does not exist
'400':
description: >
Returns a list of errors in the input data. For this call the following violation codes can be expected
* `6e40c9b1-7f75-4a3a-8149-26adecd9a5d4` - Commission update failed: Please provide either a percentage or amount for the commissions but not both
* `504d6c75-bacb-4319-ad0a-e942a30904f7` - Error: Delta-Invoice exists
* `407eebae-cb0c-49fd-9708-4312452133ee` - Cannot change commission because flight is already invoiced
'500':
$ref: '#/components/responses/InternalServerErrorDefault'
components:
schemas:
ContactRef: # if you update this, be sure to update the equivalent in the other yaml files
description: This entity represents either a customer, agency, intermediator or publisher, either the external ID or the external CRM ID or the goTom ID can be set
type: object
nullable: true
properties:
entityId:
description: ID of the entity (might be a customer, agency, intermediator of publisher) for this contact (corresponds to the "Kunde", "Vermittler", "Agentur" field)
type: integer
entityExternalId:
description: External ID of the entity (might be a customer, agency, intermediator of publisher) for this contact (corresponds to the "Kunde", "Vermittler", "Agentur" field)
type: string
entityExternalCrmId:
description: External CRM ID of the entity (might be a customer, agency, intermediator of publisher) for this contact (corresponds to the "Kunde", "Vermittler", "Agentur" field)
type: string
addressId:
description: ID of the address for this contact (corresponds to the "Adresse" field in the UI)
type: integer
nullable: true
addressExternalId:
description: External ID of the address for this contact (corresponds to the "Adresse" field in the UI)
type: string
nullable: true
addressExternalCrmId:
description: External CRM ID of the address for this contact (corresponds to the "Adresse" field in the UI)
type: string
nullable: true
personId:
description: ID of the person for this contact (corresponds to the "Kontakt" field)
type: integer
nullable: true
personExternalId:
description: External ID of the person for this contact (corresponds to the "Kontakt" field)
type: string
nullable: true
personExternalCrmId:
description: External CRM ID of the person for this contact (corresponds to the "Kontakt" field)
type: string
nullable: true
Customer: # if you update this, be sure to update as well the other yaml files
properties:
customer:
description: Customer Object
type: object
required: [ externalCrmId, firm, status, statusEc, language, mainAddress ]
properties:
externalCrmId:
description: External CRM Id for referencing the customer
type: string
firm:
description: Name of the customer
type: string
mwst:
description: VAT Number
type: string
note:
description: Note on the client
type: string
status:
description: States if the customer is active or inactive. 1 = active, 0 = inactive
type: integer
enum: [ 1, 0 ]
statusEc:
description: Customer type. 1 = Customer, 2 = Intermediator, 3 = Agency, 5 = Publisher (Only available with marketer module activated)
type: integer
enum: [ 1, 2, 3, 5 ]
language:
description: Preferred language for this customer
type: string
enum: [ de, en, fr, it ]
bankAccountNumber:
description: Bank Account Number for this customer
type: string
bankIBANNumber:
description: IBAN for this customer
type: string
bankClearingNumber:
description: Bank Clearing for this customer
type: string
bankName:
description: Bank name for this customer
type: string
searchstring:
description: Search help to find this customer easier with other name(s)
type: string
vatType:
description: VAT Type (0 = Standard, 2 = VAT exempt, 3 = VAT reduced, 7 = VAT exempt embassy)
type: integer
default: 0
enum: [ 0, 2, 3, 7 ]
softDeleted:
description: If this customer should be treated as deleted.
example: false
type: boolean
default: false
commission:
description: Defines the default commissions for an agency or intermediator. Has no effect on statusEc != 2 or 3.
type: object
required: [ bkCommission, vmkCommission, type ]
properties:
bkCommission:
description: Agency Commission aka BK (Beraterkommission) aka AP (Agenturprovision) in percent
type: number
vmkCommission:
description: Intermediator Commission aka VMK (Vermittlerkommission) aka DBE (Direktbuchungsentschädigung) aka 2. Provision aka 2. Agentur-Provision in percent
type: number
type:
description: |
Type of commission.
0 = Standard (default) = bkCommission direct / vmkCommission direct
2 = bkCommission direct / vmkCommission indirect (Accrual / Rückstellung)
3 = bkCommission separate / vmkCommission indirect (Accrual / Rückstellung)
4 = vmkCommission separate
type: integer
enum: [ 0, 2, 3, 4 ]
industry:
description: Customer industry
type: object
required: [ externalCrmId ]
properties:
externalCrmId:
description: External CRM Id for referencing the industry
type: string
name:
description: Name of the industry. Will update the industry name for every customer that uses the same industry.
type: string
addresses:
description: Customer addresses
type: array
items:
type: object
required: [ externalCrmId, title, firm, zip, place, country ]
properties:
externalCrmId:
description: External CRM Id for referencing the address
type: string
title:
description: Name/Label
type: string
firm:
description: Company
type: string
department:
description: Departement
type: string
street:
description: Street
type: string
number:
description: Street number
type: string
adresstext:
description: Addition
type: string
zip:
description: Zip code
type: string
place:
description: City/Place
type: string
country:
description: |
Country (ISO 3166-1 alpha-2 Code) like "CH" / "DE" / "AT"
https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
type: string
externalId:
description: External Id
type: integer
sendingRule:
description: Invoice sending rule. Default is defined via admin center setting
type: string
enum: [ 'email', 'post' ]
sendingRuleAddresses:
description: E-Mail addresses for invoice sending. Only useful with sendingRule "email".
type: array
items:
type: string
softDeleted:
description: If this address should be treated as deleted.
example: false
type: boolean
default: false
mainAddress:
description: Reference to the main address for this customer
type: object
required: [ externalCrmId ]
properties:
externalCrmId:
description: External CRM Id for referencing the address. If a record with this externalCrmId does not exist, an empty one will be created.
type: string
contactPersons:
description: Customer contactPersons
type: array
items:
type: object
required: [ externalCrmId, peopleGender, peopleLastname, peopleName ]
properties:
externalCrmId:
description: External CRM Id for referencing the contact
type: string
peopleGender:
description: Gender. "M" = male, "F" = female, "D" = divers
type: string
enum: [ 'M', 'F', 'D' ]
peopleLastname:
description: Lastname
type: string
peopleName:
description: Surname
type: string
peoplePhone:
description: Phone Number
type: string
peopleNatel:
description: Mobile Number
type: string
peopleEmail:
description: E-Mail
type: string
peopleStatus:
description: Status active/inactive. "A" = active. "N" = not active.
type: string
default: A
enum: [ 'A', 'N' ]
jobFunctions:
description: Function name
type: array
items:
type: object
required: [ lang, function ]
properties:
lang:
description: Language in which the function is saved (deprecated). Use "de" always
type: string
enum: [ 'de' ]
function:
description: The function name
type: string
tags:
description: Customer tags
type: array
items:
type: object
required: [ externalCrmId ]
properties:
externalCrmId:
description: External CRM Id for referencing the tag
type: string
name:
description: Name of the tag (if this property is set, it will update the name of the tag for every customer)
type: string
references:
description: Customer references
type: array
items:
type: object
required: [ externalCrmId ]
properties:
externalCrmId:
description: External CRM Id for referencing the customer reference
type: string
referenceType:
description: Type of the reference
type: string
referenceValue:
description: Value of the reference
type: string
consultants:
description: Customer consultants
type: array
items:
type: object
required: [ email ]
properties:
email:
description: E-Mail address of consultant
type: string
paymentTerm:
description: Payment term for customer
type: object
required: [ externalCrmId ]
properties:
externalCrmId:
description: External CRM Id for referencing the payment term
type: string
days:
description: Amount of days until the invoice has to be paid
type: integer
name:
description: Name of the payment term
type: string
cashDiscountDays:
description: How many days that a cash discount (skonto) can be applied
type: integer
cashDiscountPercent:
description: Percentage of cash discount (skonto) that can be applied
type: number
billingPhrases:
description: Text to print on invoice in different languages
type: object
properties:
de:
description: German text
type: string
en:
description: English text
type: string
fr:
description: French text
type: string
it:
description: Italian text
type: string
Campaign:
description: A goTom campaign
type: object
properties:
name:
description: Corresponds with the field "Kampagne"
type: string
status:
description: Corresponds with the field "Status"
type: string
default: booking
enum: [booking, reservation]
bookingDate:
description: Corresponds with the field "Buchungsdatum"
type: string
format: date
campaignTypeId:
description: Corresponds with the field "Kampagnentyp"
type: integer
example: 1
campaignTypeReference:
description: Corresponds with the field "Kampagnentyp Referenz"
type: string
customer:
description: Corresponds with the field "Kunde"
allOf:
- $ref: "#/components/schemas/ContactRef"
intermediator:
description: Corresponds with the field "Vermittler"
allOf:
- $ref: "#/components/schemas/ContactRef"
agency:
description: Corresponds with the field "Agentur"
allOf:
- $ref: "#/components/schemas/ContactRef"
note:
description: Corresponds with the Field "Bemerkungen"
type: string
noteInternal:
description: Corresponds with the Field "Interne Bemerkungen"
type: string
noteReservation:
description: Corresponds with the Field "Reservationsabklärung"
type: string
CampaignUpdate:
allOf:
- $ref: "#/components/schemas/Campaign"
- $ref: "#/components/schemas/CampaignSalesMixin"
FlightUpdate:
allOf:
- $ref: "#/components/schemas/Flight"
- type: object
properties:
adServerPushChanges:
type: object
properties:
adServerId:
type: string
types:
type: array
items:
type: string
enum:
- runtime
- units
- other
- placements
remarks:
type: string
FlightDiscount:
type: object
properties:
flightExternalId: