-
-
Notifications
You must be signed in to change notification settings - Fork 90
/
Copy pathswagger.yml
1941 lines (1902 loc) · 69.1 KB
/
swagger.yml
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
swagger: "2.0"
info:
description: "Sylius Shop API documentation"
version: "1.0.0"
title: "Sylius Shop API"
contact:
email: "lukasz.chrusciel@sylius.com"
license:
name: "MIT"
url: "https://opensource.org/licenses/MIT"
host: "demo.sylius.com"
basePath: "/shop-api"
consumes:
- "application/json"
produces:
- "application/json"
tags:
- name: "cart"
description: "All actions related to cart management."
externalDocs:
description: "Find out more"
url: "http://docs.sylius.com/en/latest/book/orders/index.html"
- name: "products"
description: "Show product catalog and add product reviews."
externalDocs:
description: "Find out more"
url: "http://docs.sylius.com/en/latest/book/products/index.html"
- name: "taxons"
description: "Show taxon tree"
externalDocs:
description: "Find out more"
url: "http://docs.sylius.com/en/latest/book/products/taxons.html"
- name: "checkout"
description: "All actions related to checkout fulfillment. It is important, to execute them in given order (address, choose shipment, choose payment and complete)."
externalDocs:
description: "Find out more"
url: "http://docs.sylius.com/en/latest/book/orders/checkout.html"
- name: "order"
description: "Showing the order information"
externalDocs:
description: "Find out more"
url: "http://docs.sylius.com/en/latest/book/orders/orders.html"
- name: "users"
description: "All actions related to user functionality."
externalDocs:
description: "Find out more"
url: "http://docs.sylius.com/en/latest/book/customers/customer_and_shopuser.html"
- name: "address"
description: "All functions related to the Sylius Customer Address Book"
externalDocs:
description: "Find out more"
url: "https://docs.sylius.com/en/latest/book/customers/addresses/address_book.html"
schemes:
- "https"
parameters:
CartToken:
in: "path"
name: "token"
description: "Cart identifier."
required: true
type: "string"
paths:
/carts:
post:
tags:
- "cart"
summary: "Pick up your cart from the store"
description: "This endpoint will allow you to create a new cart."
operationId: "cartPickUp"
responses:
201:
description: "Cart has been picked up"
schema:
$ref: "#/definitions/Cart"
400:
description: "Invalid input"
schema:
$ref: "#/definitions/GeneralError"
/carts/{token}:
parameters:
- $ref: "#/parameters/CartToken"
get:
tags:
- "cart"
summary: "Show summarized cart."
description: "This endpoint shows you the current calculated state of cart."
operationId: "cartSummarize"
responses:
200:
description: "Current state of the cart, with calculated prices and related items."
schema:
$ref: "#/definitions/Cart"
400:
description: "Invalid input (E.g. token has not been found)"
schema:
$ref: "#/definitions/GeneralError"
delete:
tags:
- "cart"
summary: "Drop your cart."
description: "This endpoint will remove the cart and all of the related cart items."
operationId: "cartDrop"
responses:
204:
description: "Cart has been dropped."
400:
description: "Invalid input (E.g. token has not been found)"
schema:
$ref: "#/definitions/GeneralError"
/carts/{token}/items:
parameters:
- $ref: "#/parameters/CartToken"
post:
tags:
- "cart"
summary: "Add an item to your cart."
description: "This endpoint will allow you to add a new item to your cart."
operationId: "cartAddItem"
parameters:
- in: "body"
name: "content"
description: "Description of an item. The smallest required amount of data is a product code and quantity for a simple product. Configurable products will require an additional `variant_code` or `options` field, but never both."
required: true
schema:
$ref: "#/definitions/PutItemToCartRequest"
responses:
201:
description: "Item has been added to the cart"
schema:
$ref: "#/definitions/Cart"
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/carts/{token}/multiple-items:
parameters:
- $ref: "#/parameters/CartToken"
post:
tags:
- "cart"
summary: "Add multiple items to your cart."
description: "This endpoint will allow you to add a new item to your cart."
operationId: "cartPutItems"
parameters:
- in: "body"
name: "content"
description: "Description of items. The same rules applied to each of the array values as to the previous point."
required: true
schema:
$ref: "#/definitions/PutItemsToCartRequest"
responses:
201:
description: "Item has been added to the cart"
schema:
$ref: "#/definitions/Cart"
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/carts/{token}/items/{identifier}:
parameters:
- $ref: "#/parameters/CartToken"
- name: "identifier"
in: "path"
description: "Identifier of a specific item. Can be found in the cart summary."
required: true
type: "string"
put:
tags:
- "cart"
summary: "Change quantity of a cart item."
operationId: "cartUpdateItem"
parameters:
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/ChangeItemQuantityRequest"
responses:
204:
description: "Quantity has been changed."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
delete:
tags:
- "cart"
summary: "Remove cart item."
operationId: "cartDeleteItem"
description: "This endpoint will remove one item from your cart"
responses:
204:
description: "Cart item has been removed."
400:
description: "Invalid input (E.g. token has not been found)"
schema:
$ref: "#/definitions/GeneralError"
/carts/{token}/estimated-shipping-cost:
parameters:
- $ref: "#/parameters/CartToken"
get:
tags:
- "cart"
summary: "Estimates the shipping cost of the cart"
operationId: "estimateShippingCost"
parameters:
- name: "countryCode"
in: "query"
description: "Shipping Country"
required: true
type: "string"
- name: "provinceCode"
in: "query"
description: "Province to ship to"
required: true
type: "string"
responses:
200:
description: "Price was calculated"
schema:
$ref: "#/definitions/EstimatedShippingCost"
400:
description: "Invalid input (E.g. token has not been found)"
schema:
$ref: "#/definitions/GeneralError"
/carts/{token}/coupon:
parameters:
- $ref: "#/parameters/CartToken"
put:
tags:
- "cart"
summary: "Add a promotion coupon code to the cart."
description: "This endpoint will allow you to add a promotion coupon code to the cart and receive the discount."
operationId: "cartAddCoupon"
parameters:
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/AddCouponRequest"
responses:
204:
description: "Coupon has been assigned to the cart."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
delete:
tags:
- "cart"
summary: "Remove a promotion coupon code from the cart."
description: "This endpoint will allow you to remove a promotion coupon code from the cart."
operationId: "cartRemoveCoupon"
responses:
204:
description: "Coupon has been removed from the cart."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/checkout/{token}:
parameters:
- $ref: "#/parameters/CartToken"
get:
tags:
- "checkout"
summary: "Show checkout summary"
description: "This endpoint will show the summarized cart during checkout. This action is an equivalent of cart summarize action."
operationId: "checkoutSummarize"
responses:
200:
description: "Current state of the cart, with calculated prices and related items."
schema:
$ref: "#/definitions/Cart"
400:
description: "Invalid input (E.g. token has not been found)"
schema:
$ref: "#/definitions/GeneralError"
/checkout/{token}/address:
parameters:
- $ref: "#/parameters/CartToken"
put:
tags:
- "checkout"
summary: "Address cart."
description: "This endpoint will allow you to add billing and shipping addresses to the cart and begin the checkout process. You can either define the same shipping and billing address or specify them separately."
operationId: "checkoutAddress"
parameters:
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/CheckoutAddressRequest"
responses:
204:
description: "Cart has been addressed."
400:
description: "Address not valid"
schema:
$ref: "#/definitions/GeneralError"
/checkout/{token}/shipping:
parameters:
- $ref: "#/parameters/CartToken"
get:
tags:
- "checkout"
summary: "Get available shipping methods."
description: "This endpoint will show you available shipping methods for all cart shipments."
operationId: "checkoutShowAvailableShippingMethods"
responses:
200:
description: "Get available shipping methods."
schema:
$ref: "#/definitions/AvailableShippingMethods"
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/checkout/{token}/shipping/{id}:
parameters:
- $ref: "#/parameters/CartToken"
put:
tags:
- "checkout"
summary: "Choosing a cart shipping method."
description: "This endpoint will allow you to choose a cart shipping method."
operationId: "checkoutChooseShippingMethod"
parameters:
- name: "id"
in: "path"
description: "Order number of shipment for which shipping method should be specified."
required: true
type: "string"
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/CheckoutChooseShippingMethodRequest"
responses:
204:
description: "Shipping method has been chosen."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/checkout/{token}/payment:
parameters:
- $ref: "#/parameters/CartToken"
get:
tags:
- "checkout"
summary: "Get available payment methods."
description: "This endpoint will show you available payment methods for all cart payments."
operationId: "checkoutShowAvailablePaymentMethods"
responses:
200:
description: "Get available payment methods."
schema:
$ref: "#/definitions/AvailablePaymentMethods"
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/checkout/{token}/payment/{id}:
parameters:
- $ref: "#/parameters/CartToken"
put:
tags:
- "checkout"
summary: "Choosing cart payment method."
description: "This endpoint will allow you to choose cart a payment method."
operationId: "checkoutChoosePaymentMethod"
parameters:
- name: "id"
in: "path"
description: "Order number of payment for which payment method should be specified."
required: true
type: "string"
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/ChoosePaymentMethodRequest"
responses:
204:
description: "Payment method has been chosen."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/checkout/{token}/complete:
parameters:
- $ref: "#/parameters/CartToken"
put:
tags:
- "checkout"
summary: "Completing checkout."
description: "This endpoint will allow you to complete the checkout."
operationId: "checkoutComplete"
parameters:
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/CheckoutCompleteRequest"
responses:
204:
description: "Checkout has been completed."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
403:
description: "Not logged in or wrong email"
security:
- {}
- bearerAuth: []
/taxon-products/by-slug/{taxonSlug}:
get:
tags:
- "products"
summary: "Show product catalog."
description: "This endpoint will return a paginated list of products for given taxon."
operationId: "productCatalogBySlug"
parameters:
- name: "taxonSlug"
in: "path"
description: "Slug of taxonomy for which products should be listed."
required: true
type: "string"
- name: "locale"
in: "query"
description: "Locale in which products should be shown."
required: false
type: "string"
- name: "limit"
in: "query"
description: "Number of expected products per page."
required: false
type: "integer"
- name: "page"
in: "query"
description: "Page number."
required: false
type: "integer"
responses:
200:
description: "Paginated product list."
schema:
$ref: "#/definitions/ProductsPage"
/taxon-products/by-code/{taxonCode}:
get:
tags:
- "products"
summary: "Show product catalog."
description: "This endpoint will return a paginated list of products for given taxon."
operationId: "productCatalog"
parameters:
- name: "taxonCode"
in: "path"
description: "Code of taxonomy for which products should be listed."
required: true
type: "string"
- name: "locale"
in: "query"
description: "Locale in which products should be shown."
required: false
type: "string"
- name: "limit"
in: "query"
description: "Number of expected products per page."
required: false
type: "integer"
- name: "page"
in: "query"
description: "Page number."
required: false
type: "integer"
responses:
200:
description: "Paginated product list."
schema:
$ref: "#/definitions/ProductsPage"
/products/by-slug/{slug}:
get:
tags:
- "products"
summary: "Show a product with the given slug."
description: "This endpoint will return a product with the given slug."
operationId: "productDetailsBySlug"
parameters:
- name: "slug"
in: "path"
description: "Slug of expected product."
required: true
type: "string"
- name: "locale"
in: "query"
description: "Locale in which products should be shown."
required: false
type: "string"
responses:
200:
description: "Show a product with the given slug."
schema:
$ref: "#/definitions/ProductDetails"
/products/by-code/{code}:
get:
tags:
- "products"
summary: "Show a product with the given code."
description: "This endpoint will return a product with the given code."
operationId: "productDetails"
parameters:
- name: "code"
in: "path"
description: "Code of expected product."
required: true
type: "string"
- name: "locale"
in: "query"
description: "Locale in which products should be shown."
required: false
type: "string"
responses:
200:
description: "Show a product with the given code."
schema:
$ref: "#/definitions/ProductDetails"
/products/by-slug/{slug}/reviews:
parameters:
- name: "slug"
in: "path"
description: "Slug of expected product."
required: true
type: "string"
post:
tags:
- "products"
summary: "Add a review to the product."
description: "This endpoint will allow you to add a new review to the product. Remember, that it should be accepted by an administrator before it will be available in the review list."
operationId: "productAddReviewBySlug"
parameters:
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/AddReviewRequest"
responses:
201:
description: "Review has been added to the product."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
get:
tags:
- "products"
summary: "Show reviews."
description: "This endpoint will return a paginated list of all reviews related to the product identified by slug."
operationId: "productReviewsBySlug"
responses:
200:
description: "A paginated list of all reviews related to the product identified by slug."
schema:
$ref: "#/definitions/ProductReviewsPage"
/products/by-code/{code}/reviews:
parameters:
- name: "code"
in: "path"
description: "Code of expected product."
required: true
type: "string"
post:
tags:
- "products"
summary: "Add a review to the product."
description: "This endpoint will allow you to add a new review to the product. Remember, that it should be accepted by an administrator before it will be available in the review list."
operationId: "productAddReview"
parameters:
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/AddReviewRequest"
responses:
201:
description: "Review has been added to the product."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
get:
tags:
- "products"
summary: "Show reviews."
description: "This endpoint will return a paginated list of all reviews related to the product identified by slug."
operationId: "productReviews"
responses:
200:
description: "A paginated list of all reviews related to the product identified by slug."
schema:
$ref: "#/definitions/ProductReviewsPage"
/product-latest:
get:
tags:
- "products"
summary: "Show latest products."
description: "This endpoint will return an array of latest products."
operationId: "latestProducts"
parameters:
- name: "locale"
in: "query"
description: "Locale in which products should be shown."
required: false
type: "string"
- name: "limit"
in: "query"
description: "Number of expected products per page."
required: false
type: "integer"
responses:
200:
description: "Array of latest products."
schema:
type: "array"
items:
$ref: "#/definitions/Product"
/taxons:
get:
tags:
- "taxons"
summary: "Show taxon tree."
description: "This endpoint will return an array of all available taxon roots with all of its children."
operationId: "taxonTree"
parameters:
- name: "locale"
in: "query"
description: "Locale in which taxons should be shown."
required: false
type: "string"
responses:
200:
description: "Array of all available taxons."
schema:
type: "array"
items:
$ref: "#/definitions/Taxon"
/taxons/{code}:
get:
tags:
- "taxons"
summary: "Show taxon with given code."
description: "This endpoint will return a taxon with given code, children and the root node with direct path to this taxon."
operationId: "taxonDetails"
parameters:
- name: "code"
in: "path"
description: "Code of expected taxon."
required: true
type: "string"
- name: "locale"
in: "query"
description: "Locale in which taxons should be shown."
required: false
type: "string"
responses:
200:
description: "Requested taxon with children."
schema:
$ref: "#/definitions/TaxonDetails"
/request-password-reset:
put:
tags:
- "users"
summary: "Request resetting password of user with passed email."
description: "Email with reset password path will be sent to user. Default path for password resetting is `/password-reset/{token}`. To change it, you need to override template `@SyliusShopApi\\Email\\passwordReset.html.twig`."
operationId: "requestPasswordReset"
parameters:
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/RequestPasswordResetting"
responses:
204:
description: "Reset password request has been sent If the email exists in our system,."
400:
description: "Email not valid"
/password-reset/{token}:
parameters:
- in: "path"
name: "token"
description: "Password reset token."
required: true
type: "string"
put:
tags:
- "users"
summary: "Password reset."
description: "This endpoint resets the user password."
operationId: "passwordReset"
parameters:
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/PasswordResetRequest"
responses:
204:
description: "Update password request success."
400:
description: "Token not found."
/register:
post:
tags:
- "users"
summary: "Registering a new user"
description: "This creates a new user that can log in the shop"
operationId: "registerUser"
parameters:
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/RegisterRequest"
responses:
204:
description: "The user was successfully created"
400:
description: "There were validation errors"
500:
description: "Channel not found"
/login:
post:
tags:
- "users"
summary: "Logs the user in and returns the token"
description: "This route is needed to log the user in and get an access token."
operationId: "loginUser"
consumes:
- "application/json"
parameters:
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/LoginRequest"
responses:
200:
description: "User was logged in"
schema:
$ref: "#/definitions/LoginSuccess"
/verify-account:
parameters:
- name: "token"
in: "query"
required: true
type: "string"
get:
tags:
- "users"
summary: "Verify an account by verification token"
description: "This route is needed to verify an user."
operationId: "verifyUser"
responses:
204:
description: "User unlocked"
/orders:
get:
tags:
- "order"
summary: "Shows a list of orders of the customer"
operationId: "orders"
responses:
200:
description: "Shows a list of placed orders of the customer"
schema:
type: "array"
items:
$ref: "#/definitions/PlacedOrder"
401:
description: "User token invalid"
security:
- bearerAuth: []
/orders/{tokenValue}:
parameters:
- in: "path"
name: "tokenValue"
description: "Order token."
required: true
type: "string"
get:
tags:
- "order"
summary: "Shows details of specific customer's order"
operationId: "order"
responses:
200:
description: "Shows details of specific customer's order with given tokenValue"
schema:
$ref: "#/definitions/PlacedOrder"
401:
description: "User token invalid"
404:
description: "Order with given tokenValue not found"
security:
- bearerAuth: []
/orders/{token}/payment:
parameters:
- $ref: "#/parameters/CartToken"
get:
tags:
- "order"
summary: "Get available payment methods."
description: "This endpoint will show you available payment methods for an order."
operationId: "showAvailablePaymentMethods"
responses:
200:
description: "Get available payment methods."
schema:
$ref: "#/definitions/AvailablePaymentMethods"
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/orders/{token}/payment/{id}:
parameters:
- $ref: "#/parameters/CartToken"
put:
tags:
- "order"
summary: "Choosing cart payment method."
description: "This endpoint will allow you to update an order payment method."
operationId: "updatePaymentMethod"
parameters:
- name: "id"
in: "path"
description: "Order number of payment for which payment method should be specified."
required: true
type: "string"
- in: "body"
name: "content"
required: true
schema:
$ref: "#/definitions/ChoosePaymentMethodRequest"
responses:
204:
description: "Payment method has been chosen."
400:
description: "Invalid input, validation failed."
schema:
$ref: "#/definitions/GeneralError"
/me:
get:
tags:
- "users"
summary: "Provides currently logged in user details."
operationId: "me"
responses:
200:
description: "Provides currently logged in user details."
schema:
$ref: "#/definitions/LoggedInCustomerDetails"
401:
description: "User token invalid"
security:
- bearerAuth: []
put:
tags:
- "users"
summary: "Updates currently logged in users details."
operationId: "updateUser"
parameters:
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/UpdateUserRequest"
responses:
200:
description: "User successfully updated."
schema:
$ref: "#/definitions/LoggedInCustomerDetails"
401:
description: "User token invalid"
security:
- bearerAuth: []
/me/change-password:
put:
tags:
- "users"
summary: "Updates the password of the user that is currently logged in."
operationId: "changePassword"
parameters:
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/ChangePasswordRequest"
responses:
204:
description: "Update password request success"
400:
description: "There were validation errors"
401:
description: "User token invalid"
/address-book:
get:
tags:
- "address"
summary: "Gets the address book of the currently logged in user"
operationId: "addressBook"
responses:
200:
description: "Successfully fetched Address Book"
schema:
$ref: "#/definitions/LoggedInCustomerAddressBook"
401:
description: "User not logged in"
security:
- bearerAuth: []
post:
tags:
- "address"
summary: "Creates a new address in the the address book"
operationId: "createAddress"
parameters:
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/LoggedInCustomerAddressBookAddress"
responses:
201:
description: "Successfully created the address"
schema:
$ref: "#/definitions/LoggedInCustomerAddressBookAddress"
400:
description: "Validation failed"
schema:
$ref: "#/definitions/GeneralError"
401:
description: "No user is logged in"
security:
- bearerAuth: []
/address-book/{id}:
put:
tags:
- "address"
summary: "Updates an address in the address book"
operationId: "updateAddressBook"
parameters:
- name: "id"
in: "path"
required: true
type: "integer"
description: "Id of the address to update"
- name: "content"
in: "body"
required: true
schema:
$ref: "#/definitions/LoggedInCustomerAddressBookAddress"
responses:
200: