forked from coffeedesk/allegro-api-client-php
-
Notifications
You must be signed in to change notification settings - Fork 0
/
swagger.yaml
13969 lines (13891 loc) · 459 KB
/
swagger.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
servers:
- url: https://api.{environment}
variables:
environment:
default: allegro.pl
enum:
- allegro.pl # Production server
- allegro.pl.allegrosandbox.pl # Sandbox server
info:
description: 'https://developer.allegro.pl/about'
version: 'latest'
title: Allegro REST API
termsOfService: 'https://developer.allegro.pl/rules/'
contact:
name: "API Support"
url: 'https://github.com/allegro/allegro-api/issues'
tags:
- name: Public offer information
- name: Public user information
- name: Categories and parameters
- name: User's offer information
- name: Offer management
- name: Products
- name: Compatibility List
- name: Classifieds
- name: Images and attachments
- name: Pricing
- name: Batch offer modification
- name: Size tables
- name: Points of service
- name: Contacts
- name: Additional services
- name: After sale services
- name: Offer variants
- name: Sets and rebates
- name: Promotion campaigns
- name: Badge campaigns
- name: Delivery
- name: Offer tags
- name: Offer rating
- name: Order management
- name: Payments
- name: Disputes
- name: Information about user
- name: Blacklist management
- name: Auctions and Bidding
- name: Billing
- name: Commission refunds
security:
- bearer-token-for-user: []
paths:
'/offers/{offerId}/change-price-commands/{commandId}':
put:
tags:
- Offer management
summary: 'Modify the Buy Now price in an offer'
description:
'Use this resource to change the Buy Now price in a single offer.
<a href="../../news/2016-08-01-zmiana-ceny/" target="_blank">Read more</a>.'
operationId: createChangePriceCommandUsingPUT
parameters:
- name: offerId
in: path
description: The offer identifier.
required: true
schema:
type: string
- name: commandId
in: path
description: The unique command id generated by you.
required: true
schema:
type: string
format: uuid
responses:
'200':
description: The command was created successfully and is queued for processing.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ChangePrice'
default:
description: >-
An immediate error response is returned whether the command input data is not valid or there is an internal
problem with our systems.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
requestBody:
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ChangePriceWithoutOutput'
required: true
/sale/offers:
post:
tags:
- Offer management
summary: 'Create a draft offer'
description:
'Use this resource to create a draft offer. <a href="../../sale/#step-6-draft" target="_blank">Read more</a>.'
operationId: createOfferUsingPOST
responses:
'200':
description: Offer created successfully
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/Offer'
'400':
description: Syntactically incorrect request
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'422':
description: Unprocessable Entity
requestBody:
$ref: '#/components/requestBodies/Offer'
get:
tags:
- User's offer information
summary: "Get seller's offers"
description: >-
Use this resource to get the list of the seller's offers. You can use different query parameters to filter
the list.
operationId: searchOffersUsingGET
parameters:
- name: offer.id
in: query
description: Offer ID.
required: false
schema:
type: string
- name: name
in: query
description: The text to search in the offer title.
required: false
schema:
type: string
- name: sellingMode.price.amount.gte
in: query
description: The lower threshold of price.
required: false
schema:
type: number
example: 9.99
- name: sellingMode.price.amount.lte
in: query
description: The upper threshold of price.
required: false
schema:
type: number
example: 125.99
- name: publication.status
in: query
description: >-
The publication status of the offer. Passing more than one value will search for offers with any of the given statuses. By default all statuses are included.
Example: `publication.status=INACTIVE&publication.status=ACTIVE` - returns offers with status `INACTIVE` or `ACTIVE`.
required: false
schema:
type: array
items:
type: string
enum:
- INACTIVE
- ACTIVE
- ACTIVATING
- ENDED
- name: sellingMode.format
in: query
required: false
description: >-
The offer's selling format. Passing more than one value will search for offers with any of the given formats. By default all formats are included.
Example: `sellingMode.format=BUY_NOW&sellingMode.format=ADVERTISEMENT` - returns offers with with format `BUY_NOW` or `ADVERTISEMENT`.
schema:
type: array
items:
type: string
enum:
- BUY_NOW
- ADVERTISEMENT
- AUCTION
- name: external.id
in: query
description: >-
The ID from the client's external system. Passing more than one value will search for offers with any of the given IDs. By default no ID is included.
Example: `external.id=1233&external.id=1234` - returns offers with ID `1233` or `1234`. Single ID length shouldn't exceed 100 characters.
required: false
schema:
type: array
maxItems: 100
items:
type: string
maxLength: 100
- name: delivery.shippingRates.id
in: query
description: >-
The ID of shipping rates. Returns offers with given shipping rates ID.
schema:
type: string
format: uuid
- name: delivery.shippingRates.id.empty
in: query
description: Allow to filter offers by existence of shipping rates ID.
schema:
type: boolean
- name: sort
in: query
description: >-
The results' sorting order. No prefix in the value means ascending order. `-` prefix means descending order.
If you don't provide the sort parameter, the list is sorted by offer creation time, descending.
required: false
schema:
type: string
enum:
- sellingMode.price.amount
- -sellingMode.price.amount
- stock.sold
- -stock.sold
- stock.available
- -stock.available
- name: limit
in: query
required: false
description: >-
The maximum number of offers returned in the response.
schema:
type: integer
format: int32
minimum: 1
maximum: 1000
default: 20
- name: offset
in: query
required: false
description: Index of the first returned offer from all search results.
schema:
type: integer
format: int32
minimum: 0
responses:
'200':
description: The list of offers returned successfully.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/OffersSearchResultDto'
'400':
description: The request query parameters are invalid.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'/sale/offers/{offerId}':
put:
tags:
- Offer management
summary: 'Complete a draft offer or edit an offer'
description:
'Use this resource to complete a draft offer or edit ongoing offers. <a href="../../sale/#step-7-complete" target="_blank">Read more</a>.'
operationId: updateOfferUsingPUT
parameters:
- name: offerId
in: path
description: Offer identifier.
required: true
schema:
type: string
responses:
'200':
description: Offer updated successfully
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/Offer'
'201':
description: Created
'400':
description: Syntactically incorrect request
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'422':
description: Unprocessable Entity
requestBody:
$ref: '#/components/requestBodies/Offer'
get:
tags:
- User's offer information
summary: 'Get all fields of the particular offer'
description:
'Use this resource to retrieve all fields of the particular offer. <a href="../../sale/#similar-offer" target="_blank">Read more</a>.'
operationId: getOfferUsingGET
parameters:
- name: offerId
in: path
description: Offer identifier.
required: true
schema:
type: string
responses:
'200':
description: Offer returned successfully
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/Offer'
'400':
description: Syntactically incorrect request
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
delete:
tags:
- Offer management
summary: 'Delete a draft offer'
description:
'Use this resource to delete a draft offer. <a href="../../news/2018-10-09_draft_delete/" target="_blank">Read more</a>.'
operationId: deleteOfferUsingDELETE
parameters:
- name: offerId
in: path
description: Offer identifier.
required: true
schema:
type: string
responses:
'204':
description: No content
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'/sale/offer-publication-commands/{commandId}':
put:
tags:
- Offer management
summary: 'Batch offer publish / unpublish'
description:
'Use this resource to modify multiple offers publication at once. <a href="../../sale/#step-8-offer-publication-commands" target="_blank">Read more</a>.'
operationId: changePublicationStatusUsingPUT
parameters:
- name: commandId
in: path
description: Command identifier.
required: true
schema:
type: string
responses:
'201':
description: Command was registered
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/GeneralReport'
'400':
description: Semantically incorrect request or provided conditions not correct
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
'409':
description: Command id was already used
'422':
description: Unprocessable Entity
requestBody:
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/PublicationChangeCommandDto'
description: publicationChangeCommandDto
required: true
get:
tags:
- Offer management
summary: "Publish command summary"
description:
'Use this resource to retrieve information about the offer listing statuses. You will receive a summary with
a number of correctly listed offers and errors. <a href="../../sale/#step-8-offer-publication-commands" target="_blank">Read more</a>.'
operationId: getPublicationReportUsingGET
parameters:
- name: commandId
in: path
description: Command identifier.
required: true
schema:
type: string
responses:
'200':
description: report was generated and successfully returned
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/GeneralReport'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Command not found
'/sale/offer-publication-commands/{commandId}/tasks':
get:
tags:
- Offer management
summary: 'Publish command detailed report'
description:
'Use this resource to retrieve information about the offer statuses on the site (Defaults: limit = 100,
offset = 0). <a href="../../sale/#step-8-offer-publication-commands" target="_blank">Read more</a>.'
operationId: getPublicationTasksUsingGET
parameters:
- name: commandId
in: path
description: Command identifier.
required: true
schema:
type: string
- name: limit
in: query
description: The limit of elements in the response.
required: false
schema:
type: integer
format: int32
- name: offset
in: query
description: The offset of elements in the response.
required: false
schema:
type: integer
format: int32
responses:
'200':
description: Task status successfully returned
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/TaskReport'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Command not found
'/sale/offer-classifieds-packages/{offerId}':
get:
tags:
- Classifieds
summary: Get classified packages assigned to an offer
description:
'Use this resource to retrieve classified packages currently assigned to an offer.'
operationId: getClassifiedPackagesUsingGET
parameters:
- name: offerId
in: path
description: Offer ID.
required: true
schema:
type: string
responses:
'200':
description: Packages returned successfully
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ClassifiedResponse'
'400':
description: Bad request
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'401':
description: Unauthorized
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/AuthError'
'403':
description: Forbidden
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'404':
description: Classified not found
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
put:
tags:
- Classifieds
summary: Assign packages to a classified
description:
'Use this resource to assign classified packages to an offer.'
operationId: assignClassifiedPackagesUsingPUT
parameters:
- name: offerId
in: path
description: The offer ID.
required: true
schema:
type: string
responses:
'200':
description: Packages have been successfully assigned to the classified.
'400':
description: Bad request
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'401':
description: Unauthorized
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/AuthError'
'403':
description: Forbidden
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'422':
description: Validation error
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
requestBody:
description: Packages that should be assigned to the classified.
required: true
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ClassifiedPackages'
'/sale/classifieds-packages':
get:
tags:
- Classifieds
summary: Get configurations of packages
description:
'Use this resource to retrieve configurations of classifieds packages for a category.'
operationId: getClassifiedPackageConfigurationsForCategoryUsingGET
parameters:
- name: category.id
in: query
description: The category ID.
required: true
schema:
type: string
responses:
'200':
description: Package configurations for the category returned successfully.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ClassifiedPackageConfigs'
'400':
description: Bad request
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'401':
description: Unauthorized
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/AuthError'
'/sale/classifieds-packages/{packageId}':
get:
tags:
- Classifieds
summary: Get the configuration of a package
description:
'Use this resource to retrieve the configuration of a classifieds package.'
operationId: getClassifiedPackageConfigurationUsingGET
parameters:
- name: packageId
in: path
description: The classifieds package ID.
required: true
schema:
type: string
responses:
'200':
description: The package's configuration returned successfully.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ClassifiedPackageConfig'
'400':
description: Bad request
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'401':
description: Unauthorized
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/AuthError'
'404':
description: The classifieds package not found.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'/users/{userId}/ratings-summary':
get:
tags:
- Public user information
summary: "Get any user's ratings summary"
description:
'Use this resource to receive feedback statistics. <a href="../../news/2017-10-09-news_informacje_o_ocenach/" target="_blank">Read more</a>.'
operationId: getUserSummaryUsingGET
parameters:
- name: userId
in: path
description: The ID of the user.
required: true
schema:
type: string
example: "41846511"
responses:
'200':
description: Feedback statistics returned successfully.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/UserRatingSummaryResponse'
'401':
description: Unauthorized
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'403':
description: Forbidden
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'404':
description: User with the given ID not found or user is not a seller.
/sale/user-ratings:
get:
tags:
- Information about user
summary: "Get the user's ratings"
description:
'Use this resource to receive your sales score. <a href="../../news/2017-10-09-news_informacje_o_ocenach/" target="_blank">Read more</a>.'
operationId: getUserRatingsUsingGET
parameters:
- name: user.id
in: query
description: Filter by user id, you are allowed to get your ratings only.
required: true
schema:
type: string
- name: recommended
in: query
description: Filter by recommended.
required: false
schema:
type: string
enum:
- 'true'
- 'false'
- name: offset
in: query
description: The offset of elements in the response.
required: false
schema:
type: integer
format: int32
minimum: 0
maximum: 20000
default: 0
- name: limit
in: query
description: The limit of elements in the response.
required: false
schema:
type: integer
format: int32
minimum: 1
maximum: 100
default: 20
responses:
'200':
description: OK
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/UserRatingListResponse'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
/sale/user-ratings/{ratingId}/answer:
put:
tags:
- Information about user
summary: "Answer for user's rating"
description:
'Use this resource to answer for received rating.'
operationId: answerUserRatingUsingPUT
parameters:
- name: ratingId
in: path
description: ID of the rating.
required: true
schema:
type: string
example: "5df0a6d1ef437e00255572a1"
responses:
'200':
description: OK
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/Answer'
'400':
description: Bad request
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
requestBody:
$ref: '#/components/requestBodies/UserRatingAnswerRequest'
/sale/user-ratings/{ratingId}/removal:
put:
tags:
- Information about user
summary: "Request removal of user's rating"
description:
'Use this resource to request removal of received rating.'
operationId: userRatingRemovalUsingPUT
parameters:
- name: ratingId
in: path
description: ID of the rating.
required: true
schema:
type: string
example: "5df0a6d1ef437e00255572a1"
responses:
'200':
description: OK
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/Removal'
'400':
description: Bad request
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'401':
description: Unauthorized
'403':
description: Forbidden
'404':
description: Not Found
requestBody:
$ref: '#/components/requestBodies/UserRatingRemovalRequest'
/me:
get:
tags:
- Information about user
summary: "Get basic information about user"
description:
'Use this resource when you need basic information about authenticated user.'
operationId: meGET
responses:
'200':
description: OK
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/MeResponse'
'401':
description: Unauthorized
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/AuthError'
'403':
description: Forbidden - when token is without user context
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
/sale/offer-additional-services/groups:
post:
tags:
- Additional services
summary: 'Create additional services group'
description:
'Use this resource to create a group of additional services. <a href="../../news/2017-10-25-news_uslugi_dodatkowe/#2" target="_blank">Read more</a>.'
operationId: createAdditionalServicesGroupUsingPOST
responses:
'201':
description: OK
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/AdditionalServicesGroupResponse'
'401':
description: Unauthorized
'422':
description: Unprocessable Entity
requestBody:
$ref: '#/components/requestBodies/AdditionalServicesGroupRequest'
get:
tags:
- Additional services
summary: "Get the user's additional services groups"
description:
'Use this resource to retrieve a list of groups with additional services available to a given user which you
may assign to offers. <a href="../../news/2017-10-25-news_uslugi_dodatkowe/#4" target="_blank">Read more</a>.'
operationId: getListOfAdditionalServicesGroupsUsingGET
parameters:
- name: offset
in: query
description: The offset of elements in the response.
required: false
schema:
type: integer
format: int32
default: 0
minimum: 0
- name: limit
in: query
description: The limit of elements in the response.
required: false
schema:
type: integer
format: int32
default: 100
minimum: 1
maximum: 1000
- name: user.id
in: query
description: User identifier.
required: true
schema:
type: string
responses:
'200':
description: OK
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/AdditionalServicesGroups'
'401':
description: Unauthorized
'403':
description: Forbidden
/sale/loyalty/promotions:
post:
tags:
- Sets and rebates
summary: "Create a new promotion"
description: >-
This endpoint creates a new promotion. You can define the following types of promotions:
1. Bundle
In order to create a new bundle, you have to define a
promotion with a single benefit of type **ORDER_FIXED_DISCOUNT** and a single criterion of type **CONTAINS_OFFERS**. In the benefit specification you have to declare the discount amount that you want to be deducted from the sum of bundled offers prices. In the offer criterion you need to pass a list of offers that are to be grouped as a bundle. For each offer you have to define a fixed quantity (that many pieces of your offer will be part of the bundle) and you also have to set a promotionEntryPoint flag (offers with this flag set to true will have a section that allows the users to purchase your bundle).
2. Multipack
In order to create a new multipack, you have to define a promotion with a single benefit of type **UNIT_PERCENTAGE_DISCOUNT** and a single criterion of type **CONTAINS_OFFERS**. The benefit specification should contain a configuration section with a percentage which indicates the specific discount for the discounted offer. This percentage should be an integer value greater than 15 for quantity 2, greater than 30 for quantity 3, greater than 40 for quantity 4, greater than 50 for quantity 5 and lower than or equal to 100. The specification should also contain a trigger section with a field forEachQuantity that defines the amount of items in the multipack which is necessary to trigger the benefit. Additionally, the discountedNumber field must be set to 1 by default as you can only discount one unit in a multipack. Finally, the offer criterion specifies the offer for which the multipack promotion will take effect.
3. Cross-offer multipack
A cross-offer multipack is created in the same fashion as a standard multipack. The only difference is that you need to pass
more than 1 offer in the offer criterion section. This group of offers is then considered as a pool from which users can
pick and choose forEachQuantity offers and the cheapest of them gets a discount.
Read more about <a href="../../news/2017-10-18-news_promocyjne_zestawy_ofert/" target="_blank">bundles</a>, <a href="../../news/2018-02-01-rabaty_ilosciowe/" target="_blank">multipack</a> and <a href="../../news/2018-10-08-rabaty_ilosciowe/" target="_blank">cross-offer multipack</a>.
operationId: createPromotionUsingPOST_1
responses:
'201':
description: Successfully created the requested promotion
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/SellerRebateDto'
examples:
bundle:
summary: Bundle
value:
status: "ACTIVE"
createdAt: "2019-05-12T10:02:31.123Z"
id: "72c40ffb-6127-4719-a473-867bf5775601"
benefits:
- specification:
type: ORDER_FIXED_DISCOUNT
value:
amount: '10.00'
currency: PLN
offerCriteria:
- type: CONTAINS_OFFERS
offers:
- id: '1122334455'
quantity: 2
promotionEntryPoint: true
- id: '2233445566'
quantity: 1
promotionEntryPoint: false
multipack:
summary: Multipack
value:
status: "ACTIVE"
createdAt: "2019-05-12T10:02:31.123Z"
id: "72c40ffb-6127-4719-a473-867bf5775601"
benefits:
- specification:
type: UNIT_PERCENTAGE_DISCOUNT
configuration:
percentage: 100
trigger:
forEachQuantity: 3
discountedNumber: 1
offerCriteria:
- type: CONTAINS_OFFERS
offers:
- id: '1122334455'
cross-offer-multipack:
summary: Cross-offer Multipack
value:
status: "ACTIVE"
createdAt: "2019-05-12T10:02:31.123Z"
id: "72c40ffb-6127-4719-a473-867bf5775601"
benefits:
- specification:
type: UNIT_PERCENTAGE_DISCOUNT
configuration:
percentage: 100
trigger:
forEachQuantity: 3
discountedNumber: 1
offerCriteria:
- type: CONTAINS_OFFERS
offers:
- id: '1122334455'
- id: '2233445566'
'400':
description: Bad request
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
'422':
description: >-
Validation failed - your request was correct, but the promotion
could not be created.
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/ErrorsHolder'
requestBody:
content:
application/vnd.allegro.public.v1+json:
schema:
$ref: '#/components/schemas/SellerCreateRebateRequestDto'