forked from gotom-io/api-doc-swagger
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcampaign-api-doc.yaml
More file actions
1696 lines (1592 loc) · 63.5 KB
/
Copy pathcampaign-api-doc.yaml
File metadata and controls
1696 lines (1592 loc) · 63.5 KB
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.12
title: 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
- flightPositionType
- flightTags
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.
* `7e44e734-3535-4172-8e32-0efa8b33a5e0` - The value of the billingType is not valid, only supported billingTypes can be used
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.
* `7e44e734-3535-4172-8e32-0efa8b33a5e0` - The value of the billingType is not valid, only supported billingTypes can be used
* `43452cb6-8850-4036-b1f5-971c8328e10b` - The update payload contains a billingType update but the campaign is already invoiced so the billingType can't be changed.
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
* `3d3b78ef-1595-47a3-b85d-20a5ee9a873c` - Flight is already fully invoiced
'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.
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'
/app-api/export/price/tarif/{tarifId}:
get:
tags: [ Export ]
summary: List prices for a tarif
description: >
Returns the price rows for a given `tarifId` with pagination.
parameters:
- in: path
name: tarifId
description: The ID of the tarif.
required: true
schema:
type: integer
example: 1
- in: query
name: page
description: From 1 to the last page number found in the pagination part of the response.
required: false
schema:
type: integer
default: 1
# - in: query
# name: responseType
# description: >
# Optional response type. Use `csv` to retrieve CSV export instead of JSON.
# required: false
# schema:
# type: string
# enum: [ json, csv ]
# default: json
responses:
'200':
description: Returns pagination and items with price information.
content:
application/json:
schema:
$ref: '#/components/schemas/TarifPriceList'
'404':
description: Tarif has not been found
'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
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
nullable: true
noteInternal:
description: Corresponds with the Field "Interne Bemerkungen"
type: string
noteReservation:
description: Corresponds with the Field "Reservationsabklärung"
type: string
pdfInvoiceWithAttachment:
description: Corresponds to the "Dokumente" field. If true, the invoice will be created with an appendix e.g. the Order Confirmation; if false, it will be created without one, as default it would be true.
type: boolean
default: true
billingType:
type: integer
enum: [ 0, 1, 2, 3 ]
example: 0
description: >
Corresponds with the field "Billing type" / "Abrechnungsart" on the "Invoicing" / "Billing type" view of the campaign.
Use this value only if you want to explicitly define the billing type of the campaign. You can safely omit this value
to let goTom apply the rules for finding the right billing type for this campaign.
Billing type possible values and their meaning:
* `0` - Custom - The user must explicitly set up the invoices and assign flights
* `1` - End / Nach Ablauf - All flights are automatically assigned to one invoice
* `2` - Monthly to daily value / Monatlich nach Tageswert - Automatic assignment on a monthly basis, distributed by time
* `3` - Monthly to delivery value / Monatlich nach Lieferwert - Automatic assignment on a monthly basis, distributed by delivery value
Please note, that your instance may not support all values. If your instance does not have an
ad-server integration the value for "Monthly to delivery value" can't be used.
If you use a value that is not supported by your instance, you will get an
API error (code `7e44e734-3535-4172-8e32-0efa8b33a5e0`) with the list of the possible values
for your instance.
If the campaign has at least one invoice that has already been invoiced it is also not possible
to change this value to something different. If this is the case you will get the API
error code `43452cb6-8850-4036-b1f5-971c8328e10b` and *none* of the updates in the payload
will be applied.
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:
description: this is the external id of the flight associated with this flight discount
type: string
example: flightExternalId12345
externalId:
description: this is the external id of this flight discount
type: string
example: flightDiscountExternalId1234
amountPercent:
type: number
example: 33.33
amountSum:
type: number
example: 0
oneOf:
- required:
- amountPercent
- required:
- amountSum
CampaignDiscountWrite:
type: object
properties:
name:
description: This name will appear e.g. in finance documents
type: string
example: "Great discount for john doe"
externalId:
type: string
example: "campaignDiscount12345"
required:
- name
- externalId
CampaignDiscountRead:
type: object
properties:
flightDiscounts:
type: array
items:
$ref: "#/components/schemas/FlightDiscountRead"
name:
type: string
example: "Great discount for john doe"
externalId:
description: "Either `externalId` is set or `entityId` if no `externalId` was found. `entityId` is the internal goTom Id that is used in the goTom frontend."
type: string
nullable: true
example: "campaignDiscount12345"
entityId:
description: "Either `externalId` is set or `entityId` if no `externalId` was found. `entityId` is the internal goTom Id that is used in the goTom frontend."
type: number
nullable: true
example: null
CampaignDiscountsRead:
type: object
properties:
campaignDiscounts:
type: array
items:
$ref: "#/components/schemas/CampaignDiscountRead"
FlightDiscountRead:
type: object
properties:
flightExternalId:
type: string
example: flightExternalId1234
nullable: true
externalId:
type: string
example: flightDiscountExternalId1234
description: "Either `externalId` is set or `entityId` if no `externalId` was found. `entityId` is the internal goTom Id that is used in the goTom frontend."
nullable: true
entityId:
description: "Either `externalId` is set or `entityId` if no `externalId` was found. `entityId` is the internal goTom Id that is used in the goTom frontend."
type: number
nullable: true
example: null
amountPercent:
type: number
format: float
example: 20.5
amountSum:
type: number
format: float
example: 0
FlightDiscountCreate:
properties:
flightExternalId:
type: string
externalId:
type: string
amountPercent:
description: "Note: The schemas used for creating and updating flight discounts differ for `amountPercent` and `amountSum`."
type: number
format: float
example: 20.5
nullable: true
amountSum:
description: "Note: The schemas used for creating and updating flight discounts differ for `amountPercent` and `amountSum`."
type: number
format: float
example: null
nullable: true
required:
- flightExternalId
- externalId
- amountPercent
- amountSum
FlightDiscountUpdate:
type: object
description: When updating, only one of `amountSum` or `amountPercent` should be provided — never both.
oneOf:
- required: [amountSum]
properties:
amountSum:
description: Must not be null. When updating, only one of `amountSum` or `amountPercent` should be provided — never both.
type: number
format: float
example: 5.5
nullable: false
- required: [amountPercent]
properties:
amountPercent:
description: Must not be null. When updating, only one of `amountSum` or `amountPercent` should be provided — never both.
type: number
format: float
nullable: false
example: 33.33
TarifPriceList:
description: A paginated list of prices for a tarif
type: object
required: [pagination, items]
properties:
pagination:
$ref: '#/components/schemas/Pagination'
items:
description: The found prices
type: array
items:
$ref: '#/components/schemas/TarifPriceItem'
Pagination:
type: object
required:
- totalItems
- perPage
- currentPage
- lastPage
- nextPageUrl
properties:
totalItems:
type: integer
example: 300
perPage:
type: integer
example: 100
currentPage:
type: integer
example: 1
lastPage:
type: integer
example: 3
nextPageUrl:
type: string
nullable: true
example: 'https://yourinstance.gotom.io/app-api/example/1?page=2'
TarifPriceItem:
type: object
required: [tarifId, tarif, companyId, company, platformId, platform, channelId, channel, mediaId, media, advertisingId, advertising, tarifGroupId, tarifGroup, priceTypeId, priceType, extraPriceLevelId, extraPriceLevel, price]
properties:
tarifId:
type: integer
example: 1
tarif:
type: string
example: 'Rate 2027'
companyId:
type: integer
example: 1
nullable: true
company:
type: string
example: 'Mandant 1 (Hauswährung, Plattform de+en, Netzwerk 1, CH)'
nullable: true
platformId:
type: integer
example: 6
nullable: true
platform: