solidus_api 3.0.1 → 3.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,6 +38,7 @@ paths:
38
38
  parameters:
39
39
  - $ref: '#/components/parameters/page'
40
40
  - $ref: '#/components/parameters/per_page'
41
+ - $ref: '#/components/parameters/q'
41
42
  security:
42
43
  - api-key: []
43
44
  post:
@@ -60,7 +61,37 @@ paths:
60
61
  security:
61
62
  - api-key: []
62
63
  requestBody:
63
- $ref: '#/components/requestBodies/product-input'
64
+ content:
65
+ application/json:
66
+ schema:
67
+ type: object
68
+ properties:
69
+ product:
70
+ $ref: '#/components/schemas/product-input'
71
+ examples:
72
+ Example:
73
+ value:
74
+ product:
75
+ name: The Majestic Product
76
+ price: '19.99'
77
+ shipping_category_id: 8
78
+ product_properties_attributes:
79
+ - property_name: fabric
80
+ value: cotton
81
+ option_types:
82
+ - size
83
+ - color
84
+ taxon_ids: '2,4'
85
+ variants:
86
+ - price: 19.99
87
+ cost_price: 17
88
+ sku: SKU-3
89
+ track_inventory: true
90
+ options:
91
+ - name: size
92
+ value: small
93
+ - name: color
94
+ value: black
64
95
  /orders/mine:
65
96
  get:
66
97
  responses:
@@ -87,6 +118,7 @@ paths:
87
118
  parameters:
88
119
  - $ref: '#/components/parameters/page'
89
120
  - $ref: '#/components/parameters/per_page'
121
+ - $ref: '#/components/parameters/q'
90
122
  security:
91
123
  - api-key: []
92
124
  '/orders/{number}':
@@ -116,6 +148,7 @@ paths:
116
148
  required: true
117
149
  schema:
118
150
  type: string
151
+ description: The order number
119
152
  patch:
120
153
  responses:
121
154
  '200':
@@ -131,7 +164,10 @@ paths:
131
164
  '422':
132
165
  $ref: '#/components/responses/unprocessable-entity'
133
166
  summary: Update order
134
- description: Updates an order.
167
+ description: |-
168
+ Updates an order.
169
+
170
+ To perform this operation the request should be made as the order's owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
135
171
  operationId: update-order
136
172
  tags:
137
173
  - Orders
@@ -139,7 +175,42 @@ paths:
139
175
  - api-key: []
140
176
  - order-token: []
141
177
  requestBody:
142
- $ref: '#/components/requestBodies/order-input'
178
+ content:
179
+ application/json:
180
+ schema:
181
+ type: object
182
+ properties:
183
+ order:
184
+ $ref: '#/components/schemas/order-input'
185
+ examples:
186
+ Updating Billing Address:
187
+ value:
188
+ order:
189
+ use_billing: true
190
+ ship_address_attributes:
191
+ name: Jane Doe
192
+ address1: 2191 Calico Drive
193
+ city: Phoenix
194
+ country_id: 22
195
+ state_id: 31
196
+ zipcode: '85022'
197
+ phone: 509-644-9988
198
+ company: Acme Inc.
199
+ Select a Shipment's Shipping Rate:
200
+ value:
201
+ order:
202
+ shipments_attributes:
203
+ - id: 2
204
+ selected_shipping_rate_id: 23
205
+ Updating Payment:
206
+ value:
207
+ order:
208
+ payments_attributes:
209
+ - amount: '42.42'
210
+ payment_method_id: 1
211
+ source_attributes:
212
+ gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
213
+ description: ''
143
214
  /orders/current:
144
215
  get:
145
216
  responses:
@@ -188,6 +259,7 @@ paths:
188
259
  parameters:
189
260
  - $ref: '#/components/parameters/page'
190
261
  - $ref: '#/components/parameters/per_page'
262
+ - $ref: '#/components/parameters/q'
191
263
  '/countries/{id}':
192
264
  get:
193
265
  responses:
@@ -344,7 +416,19 @@ paths:
344
416
  security:
345
417
  - api-key: []
346
418
  requestBody:
347
- $ref: '#/components/requestBodies/product-input'
419
+ content:
420
+ application/json:
421
+ schema:
422
+ type: object
423
+ properties:
424
+ product:
425
+ $ref: '#/components/schemas/product-input'
426
+ examples:
427
+ Example:
428
+ value:
429
+ product:
430
+ name: The Majestic Product
431
+ price: '22.22'
348
432
  '/products/{product_id}/images':
349
433
  get:
350
434
  responses:
@@ -391,14 +475,23 @@ paths:
391
475
  '422':
392
476
  $ref: '#/components/responses/unprocessable-entity'
393
477
  summary: Create product image
394
- description: Creates an image for a product.
478
+ description: |-
479
+ Creates an image for a product.
480
+
481
+ Only users with the `create` permission on `Spree::Image` can perform this action.
395
482
  operationId: create-product-image
396
483
  tags:
397
484
  - Images
398
485
  security:
399
486
  - api-key: []
400
487
  requestBody:
401
- $ref: '#/components/requestBodies/image-input'
488
+ content:
489
+ application/json:
490
+ schema:
491
+ type: object
492
+ properties:
493
+ image:
494
+ $ref: '#/components/schemas/image-input'
402
495
  '/products/{product_id}/variants':
403
496
  get:
404
497
  responses:
@@ -426,6 +519,7 @@ paths:
426
519
  parameters:
427
520
  - $ref: '#/components/parameters/page'
428
521
  - $ref: '#/components/parameters/per_page'
522
+ - $ref: '#/components/parameters/q'
429
523
  security:
430
524
  - api-key: []
431
525
  parameters:
@@ -456,7 +550,38 @@ paths:
456
550
  security:
457
551
  - api-key: []
458
552
  requestBody:
459
- $ref: '#/components/requestBodies/variant-input'
553
+ content:
554
+ application/json:
555
+ schema:
556
+ type: object
557
+ properties:
558
+ variant:
559
+ $ref: '#/components/schemas/variant-input'
560
+ examples:
561
+ Example with Option Value Ids:
562
+ value:
563
+ variant:
564
+ price: '11.22'
565
+ cost_price: '9'
566
+ position: 1
567
+ track_inventory: true
568
+ sku: AWSOME-1122
569
+ cost_currency: USD
570
+ option_value_ids:
571
+ - 1
572
+ - 2
573
+ Example with Option Value Text:
574
+ value:
575
+ variant:
576
+ price: '11.22'
577
+ cost_price: '9'
578
+ position: 1
579
+ track_inventory: true
580
+ sku: AWSOME-1122
581
+ cost_currency: USD
582
+ options:
583
+ name: Color
584
+ value: White
460
585
  '/products/{product_id}/images/{id}':
461
586
  get:
462
587
  responses:
@@ -483,11 +608,13 @@ paths:
483
608
  required: true
484
609
  schema:
485
610
  type: string
611
+ description: 'The id of the Spree::Product'
486
612
  - name: id
487
613
  in: path
488
614
  required: true
489
615
  schema:
490
616
  type: string
617
+ description: 'The id of the Spree::Image'
491
618
  delete:
492
619
  responses:
493
620
  '204':
@@ -524,14 +651,23 @@ paths:
524
651
  '422':
525
652
  $ref: '#/components/responses/unprocessable-entity'
526
653
  summary: Update product image
527
- description: Updates a product's image.
654
+ description: |-
655
+ Updates a product's image.
656
+
657
+ Only users with the `update` permission on the image can perform this action.
528
658
  operationId: update-product-image
529
659
  tags:
530
660
  - Images
531
661
  security:
532
662
  - api-key: []
533
663
  requestBody:
534
- $ref: '#/components/requestBodies/image-input'
664
+ content:
665
+ application/json:
666
+ schema:
667
+ type: object
668
+ properties:
669
+ image:
670
+ $ref: '#/components/schemas/image-input'
535
671
  '/products/{product_id}/variants/{id}':
536
672
  get:
537
673
  responses:
@@ -606,7 +742,38 @@ paths:
606
742
  security:
607
743
  - api-key: []
608
744
  requestBody:
609
- $ref: '#/components/requestBodies/variant-input'
745
+ content:
746
+ application/json:
747
+ schema:
748
+ type: object
749
+ properties:
750
+ variant:
751
+ $ref: '#/components/schemas/variant-input'
752
+ examples:
753
+ Example with Option Value Ids:
754
+ value:
755
+ variant:
756
+ price: '11.22'
757
+ cost_price: '9'
758
+ position: 1
759
+ track_inventory: true
760
+ sku: AWSOME-1122
761
+ cost_currency: USD
762
+ option_value_ids:
763
+ - 1
764
+ - 2
765
+ Example with Option Value Text:
766
+ value:
767
+ variant:
768
+ price: '11.22'
769
+ cost_price: '9'
770
+ position: 1
771
+ track_inventory: true
772
+ sku: AWSOME-1122
773
+ cost_currency: USD
774
+ options:
775
+ name: Color
776
+ value: White
610
777
  /states:
611
778
  get:
612
779
  responses:
@@ -674,6 +841,7 @@ paths:
674
841
  parameters:
675
842
  - $ref: '#/components/parameters/page'
676
843
  - $ref: '#/components/parameters/per_page'
844
+ - $ref: '#/components/parameters/q'
677
845
  security:
678
846
  - api-key: []
679
847
  post:
@@ -689,14 +857,49 @@ paths:
689
857
  '422':
690
858
  $ref: '#/components/responses/unprocessable-entity'
691
859
  summary: Create variant
692
- description: Creates a variant.
860
+ description: 'Creates a variant. Only users with `can :create, Variant` permissions can perform this action.'
693
861
  operationId: create-variant
694
862
  tags:
695
863
  - Variants
696
864
  security:
697
865
  - api-key: []
698
866
  requestBody:
699
- $ref: '#/components/requestBodies/variant-input'
867
+ content:
868
+ application/json:
869
+ schema:
870
+ type: object
871
+ properties:
872
+ product_id:
873
+ type: integer
874
+ variant:
875
+ $ref: '#/components/schemas/variant-input'
876
+ examples:
877
+ Example with Option Value Ids:
878
+ value:
879
+ product_id: 1
880
+ variant:
881
+ price: '11.22'
882
+ cost_price: '9'
883
+ position: 1
884
+ track_inventory: true
885
+ sku: AWSOME-1122
886
+ cost_currency: USD
887
+ option_value_ids:
888
+ - 1
889
+ - 2
890
+ Example with Option Value Text:
891
+ value:
892
+ product_id: 1
893
+ variant:
894
+ price: '11.22'
895
+ cost_price: '9'
896
+ position: 1
897
+ track_inventory: true
898
+ sku: AWSOME-1122
899
+ cost_currency: USD
900
+ options:
901
+ name: Color
902
+ value: White
700
903
  '/variants/{id}':
701
904
  get:
702
905
  responses:
@@ -766,7 +969,38 @@ paths:
766
969
  security:
767
970
  - api-key: []
768
971
  requestBody:
769
- $ref: '#/components/requestBodies/variant-input'
972
+ content:
973
+ application/json:
974
+ schema:
975
+ type: object
976
+ properties:
977
+ variant:
978
+ $ref: '#/components/schemas/variant-input'
979
+ examples:
980
+ Example with Option Value Ids:
981
+ value:
982
+ variant:
983
+ price: '11.22'
984
+ cost_price: '9'
985
+ position: 1
986
+ track_inventory: true
987
+ sku: AWSOME-1122
988
+ cost_currency: USD
989
+ option_value_ids:
990
+ - 1
991
+ - 2
992
+ Example with Option Value Text:
993
+ value:
994
+ variant:
995
+ price: '11.22'
996
+ cost_price: '9'
997
+ position: 1
998
+ track_inventory: true
999
+ sku: AWSOME-1122
1000
+ cost_currency: USD
1001
+ options:
1002
+ name: Color
1003
+ value: White
770
1004
  '/variants/{variant_id}/images':
771
1005
  get:
772
1006
  responses:
@@ -813,14 +1047,23 @@ paths:
813
1047
  '422':
814
1048
  $ref: '#/components/responses/unprocessable-entity'
815
1049
  summary: Create variant image
816
- description: Creates an image for a variant.
1050
+ description: |-
1051
+ Creates an image for a variant.
1052
+
1053
+ Only users with the `create` permission on `Spree::Image` can perform this action.
817
1054
  operationId: create-variant-image
818
1055
  tags:
819
1056
  - Images
820
1057
  security:
821
1058
  - api-key: []
822
1059
  requestBody:
823
- $ref: '#/components/requestBodies/image-input'
1060
+ content:
1061
+ application/json:
1062
+ schema:
1063
+ type: object
1064
+ properties:
1065
+ image:
1066
+ $ref: '#/components/schemas/image-input'
824
1067
  '/variants/{variant_id}/images/{id}':
825
1068
  get:
826
1069
  responses:
@@ -847,11 +1090,13 @@ paths:
847
1090
  required: true
848
1091
  schema:
849
1092
  type: string
1093
+ description: 'The id of the Spree::Variant'
850
1094
  - name: id
851
1095
  in: path
852
1096
  required: true
853
1097
  schema:
854
1098
  type: string
1099
+ description: 'The id of the Spree::Image'
855
1100
  delete:
856
1101
  responses:
857
1102
  '204':
@@ -888,14 +1133,23 @@ paths:
888
1133
  '422':
889
1134
  $ref: '#/components/responses/unprocessable-entity'
890
1135
  summary: Update variant image
891
- description: Updates a variant's image.
1136
+ description: |-
1137
+ Updates a variant's image.
1138
+
1139
+ Only users with the `update` permission on the image can perform this action.
892
1140
  operationId: update-variant-image
893
1141
  tags:
894
1142
  - Images
895
1143
  security:
896
1144
  - api-key: []
897
1145
  requestBody:
898
- $ref: '#/components/requestBodies/image-input'
1146
+ content:
1147
+ application/json:
1148
+ schema:
1149
+ type: object
1150
+ properties:
1151
+ image:
1152
+ $ref: '#/components/schemas/image-input'
899
1153
  '/shipments/{shipment_number}/estimated_rates':
900
1154
  get:
901
1155
  responses:
@@ -954,6 +1208,7 @@ paths:
954
1208
  parameters:
955
1209
  - $ref: '#/components/parameters/page'
956
1210
  - $ref: '#/components/parameters/per_page'
1211
+ - $ref: '#/components/parameters/q'
957
1212
  security:
958
1213
  - api-key: []
959
1214
  '/users/{id}':
@@ -982,6 +1237,7 @@ paths:
982
1237
  required: true
983
1238
  schema:
984
1239
  type: string
1240
+ description: 'The ID of the Spree::User'
985
1241
  delete:
986
1242
  responses:
987
1243
  '204':
@@ -1018,14 +1274,23 @@ paths:
1018
1274
  '422':
1019
1275
  $ref: '#/components/responses/unprocessable-entity'
1020
1276
  summary: Update user
1021
- description: Updates a user.
1277
+ description: |-
1278
+ Updates a user.
1279
+
1280
+ Only users with the `update` permission on the user can perform this action.
1022
1281
  operationId: update-user
1023
1282
  tags:
1024
1283
  - Users
1025
1284
  security:
1026
1285
  - api-key: []
1027
1286
  requestBody:
1028
- $ref: '#/components/requestBodies/user-input'
1287
+ content:
1288
+ application/json:
1289
+ schema:
1290
+ type: object
1291
+ properties:
1292
+ user:
1293
+ $ref: '#/components/schemas/user-input'
1029
1294
  '/users/{user_id}/address_book':
1030
1295
  get:
1031
1296
  responses:
@@ -1139,6 +1404,7 @@ paths:
1139
1404
  parameters:
1140
1405
  - $ref: '#/components/parameters/page'
1141
1406
  - $ref: '#/components/parameters/per_page'
1407
+ - $ref: '#/components/parameters/q'
1142
1408
  security:
1143
1409
  - api-key: []
1144
1410
  parameters:
@@ -1203,7 +1469,36 @@ paths:
1203
1469
  - api-key: []
1204
1470
  - order-token: []
1205
1471
  requestBody:
1206
- $ref: '#/components/requestBodies/address-input'
1472
+ content:
1473
+ application/json:
1474
+ schema:
1475
+ type: object
1476
+ properties:
1477
+ address:
1478
+ $ref: '#/components/schemas/address-input'
1479
+ examples:
1480
+ Example with state_id:
1481
+ value:
1482
+ address:
1483
+ name: Jane Doe
1484
+ address1: 2191 Calico Drive
1485
+ city: Phoenix
1486
+ country_id: 22
1487
+ state_id: 31
1488
+ zipcode: '85022'
1489
+ phone: 509-644-9988
1490
+ company: Acme Inc.
1491
+ Example with state_name:
1492
+ value:
1493
+ address:
1494
+ name: Jane Doe
1495
+ address1: 2191 Calico Drive
1496
+ city: Phoenix
1497
+ country_id: 22
1498
+ state_name: AZ
1499
+ zipcode: '85022'
1500
+ phone: 509-644-9988
1501
+ company: Acme Inc.
1207
1502
  '/checkouts/{checkout_id}/payments':
1208
1503
  get:
1209
1504
  responses:
@@ -1225,13 +1520,14 @@ paths:
1225
1520
  '404':
1226
1521
  $ref: '#/components/responses/not-found'
1227
1522
  summary: List checkout payments
1228
- description: Lists a checkout's payments.
1523
+ description: 'Lists a checkout''s payments. The list of payments is only visible by the checkout''s owner and by users authorized to see the order, eg. users with admin role. '
1229
1524
  operationId: list-checkout-payments
1230
1525
  tags:
1231
1526
  - Payments
1232
1527
  parameters:
1233
1528
  - $ref: '#/components/parameters/page'
1234
1529
  - $ref: '#/components/parameters/per_page'
1530
+ - $ref: '#/components/parameters/q'
1235
1531
  security:
1236
1532
  - api-key: []
1237
1533
  parameters:
@@ -1256,7 +1552,7 @@ paths:
1256
1552
  '422':
1257
1553
  $ref: '#/components/responses/unprocessable-entity'
1258
1554
  summary: Create checkout payment
1259
- description: Creates a new payment for a checkout.
1555
+ description: Creates a new payment for a checkout. Only the checkout's owner and users that can create a payment (eg. users with admin role) are allowed to perform this action.
1260
1556
  operationId: create-checkout-payment
1261
1557
  tags:
1262
1558
  - Payments
@@ -1264,7 +1560,30 @@ paths:
1264
1560
  - api-key: []
1265
1561
  - order-token: []
1266
1562
  requestBody:
1267
- $ref: '#/components/requestBodies/payment-input'
1563
+ content:
1564
+ application/json:
1565
+ schema:
1566
+ type: object
1567
+ properties:
1568
+ payment:
1569
+ $ref: '#/components/schemas/payment-input'
1570
+ examples:
1571
+ Example without a payment source:
1572
+ value:
1573
+ payment:
1574
+ amount: '42.42'
1575
+ payment_method_id: 1
1576
+ Example with a payment source:
1577
+ value:
1578
+ payment:
1579
+ amount: '42.42'
1580
+ payment_method_id: 1
1581
+ source_attributes:
1582
+ gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
1583
+ description: |-
1584
+ This requests only accepts available Payment Methods in the `payment_method_id` field.
1585
+
1586
+ The Payment Methods available to users for creating a new payment are the ones with both attributes `available_to_users` and `active` set to `true`.
1268
1587
  '/checkouts/{checkout_id}/payments/{id}':
1269
1588
  get:
1270
1589
  responses:
@@ -1296,6 +1615,7 @@ paths:
1296
1615
  - name: id
1297
1616
  in: path
1298
1617
  required: true
1618
+ description: The payment id
1299
1619
  schema:
1300
1620
  type: string
1301
1621
  patch:
@@ -1308,12 +1628,21 @@ paths:
1308
1628
  $ref: '#/components/schemas/payment'
1309
1629
  '401':
1310
1630
  $ref: '#/components/responses/invalid-api-key'
1631
+ '403':
1632
+ description: 'Forbidden '
1633
+ content:
1634
+ application/json:
1635
+ schema:
1636
+ type: object
1637
+ properties:
1638
+ error:
1639
+ type: string
1311
1640
  '404':
1312
1641
  $ref: '#/components/responses/not-found'
1313
1642
  '422':
1314
1643
  $ref: '#/components/responses/unprocessable-entity'
1315
1644
  summary: Update checkout payment
1316
- description: Updates a checkout's payment.
1645
+ description: 'Updates a checkout''s payment. Please note that this action can be done by users with the admin permissions on Payments (eg. users with the admin role). Only pending payment can be updated. '
1317
1646
  operationId: update-checkout-payment
1318
1647
  tags:
1319
1648
  - Payments
@@ -1326,12 +1655,13 @@ paths:
1326
1655
  schema:
1327
1656
  type: object
1328
1657
  properties:
1329
- amount:
1330
- type: number
1331
- payment_method_id:
1332
- type: integer
1333
- payment_method:
1334
- $ref: '#/components/schemas/payment-method'
1658
+ payment:
1659
+ $ref: '#/components/schemas/payment-input'
1660
+ examples:
1661
+ Example:
1662
+ value:
1663
+ payment:
1664
+ amount: '12.10'
1335
1665
  '/checkouts/{checkout_id}/return_authorizations':
1336
1666
  get:
1337
1667
  responses:
@@ -1360,6 +1690,7 @@ paths:
1360
1690
  parameters:
1361
1691
  - $ref: '#/components/parameters/page'
1362
1692
  - $ref: '#/components/parameters/per_page'
1693
+ - $ref: '#/components/parameters/q'
1363
1694
  security:
1364
1695
  - api-key: []
1365
1696
  parameters:
@@ -1384,14 +1715,23 @@ paths:
1384
1715
  '422':
1385
1716
  $ref: '#/components/responses/unprocessable-entity'
1386
1717
  summary: Create checkout return authorization
1387
- description: Creates a return authorization for a checkout.
1718
+ description: |-
1719
+ Creates a return authorization for a checkout.
1720
+
1721
+ Only users with the `create` permission on `Spree::RetrunAuthorization` can perform this action.
1388
1722
  operationId: create-checkout-return-authorization
1389
1723
  tags:
1390
1724
  - Return authorizations
1391
1725
  security:
1392
1726
  - api-key: []
1393
1727
  requestBody:
1394
- $ref: '#/components/requestBodies/return-authorization-input'
1728
+ content:
1729
+ application/json:
1730
+ schema:
1731
+ type: object
1732
+ properties:
1733
+ return_authorization:
1734
+ $ref: '#/components/schemas/return-authorization-input'
1395
1735
  '/checkouts/{checkout_id}/return_authorizations/{id}':
1396
1736
  get:
1397
1737
  responses:
@@ -1423,6 +1763,7 @@ paths:
1423
1763
  required: true
1424
1764
  schema:
1425
1765
  type: string
1766
+ description: 'The ID of the Spree::ReturnAuthorization'
1426
1767
  delete:
1427
1768
  responses:
1428
1769
  '204':
@@ -1459,14 +1800,23 @@ paths:
1459
1800
  '422':
1460
1801
  $ref: '#/components/responses/unprocessable-entity'
1461
1802
  summary: Update checkout return authorization
1462
- description: Updates a checkout's return authorization.
1803
+ description: |-
1804
+ Updates a checkout's return authorization.
1805
+
1806
+ Only users with the `update` permission on the return authorization can perform this action.
1463
1807
  operationId: update-checkout-return-authorization
1464
1808
  tags:
1465
1809
  - Return authorizations
1466
1810
  security:
1467
1811
  - api-key: []
1468
1812
  requestBody:
1469
- $ref: '#/components/requestBodies/return-authorization-input'
1813
+ content:
1814
+ application/json:
1815
+ schema:
1816
+ type: object
1817
+ properties:
1818
+ return_authorization:
1819
+ $ref: '#/components/schemas/return-authorization-input'
1470
1820
  '/orders/{order_id}/customer_returns/{id}':
1471
1821
  get:
1472
1822
  responses:
@@ -1496,6 +1846,7 @@ paths:
1496
1846
  - name: id
1497
1847
  in: path
1498
1848
  required: true
1849
+ description: The id of the customer return
1499
1850
  schema:
1500
1851
  type: string
1501
1852
  put:
@@ -1513,12 +1864,21 @@ paths:
1513
1864
  '422':
1514
1865
  $ref: '#/components/responses/unprocessable-entity'
1515
1866
  summary: Update order customer return
1516
- description: Updates an orders customer return.
1867
+ description: |-
1868
+ Updates an orders customer return.
1869
+
1870
+ Only users with the `update` permission on the customer return can perform this action.
1517
1871
  operationId: update-order-customer-return
1518
1872
  tags:
1519
1873
  - Customer returns
1520
1874
  requestBody:
1521
- $ref: '#/components/requestBodies/customer-return-input'
1875
+ content:
1876
+ application/json:
1877
+ schema:
1878
+ type: object
1879
+ properties:
1880
+ customer_return:
1881
+ $ref: '#/components/schemas/customer-return-input'
1522
1882
  security:
1523
1883
  - api-key: []
1524
1884
  /orders:
@@ -1547,6 +1907,7 @@ paths:
1547
1907
  parameters:
1548
1908
  - $ref: '#/components/parameters/page'
1549
1909
  - $ref: '#/components/parameters/per_page'
1910
+ - $ref: '#/components/parameters/q'
1550
1911
  security:
1551
1912
  - api-key: []
1552
1913
  post:
@@ -1569,7 +1930,21 @@ paths:
1569
1930
  security:
1570
1931
  - api-key: []
1571
1932
  requestBody:
1572
- $ref: '#/components/requestBodies/order-input'
1933
+ content:
1934
+ application/json:
1935
+ schema:
1936
+ type: object
1937
+ properties:
1938
+ order:
1939
+ $ref: '#/components/schemas/order-input'
1940
+ examples:
1941
+ Example:
1942
+ value:
1943
+ order:
1944
+ email: string
1945
+ line_items_attributes:
1946
+ - quantity: 1
1947
+ variant_id: 22
1573
1948
  '/orders/{order_number}/addresses/{id}':
1574
1949
  get:
1575
1950
  responses:
@@ -1595,11 +1970,13 @@ paths:
1595
1970
  - name: order_number
1596
1971
  in: path
1597
1972
  required: true
1973
+ description: The order number
1598
1974
  schema:
1599
1975
  type: string
1600
1976
  - name: id
1601
1977
  in: path
1602
1978
  required: true
1979
+ description: The id of the order's address that we want to retrieve
1603
1980
  schema:
1604
1981
  type: string
1605
1982
  patch:
@@ -1625,7 +2002,36 @@ paths:
1625
2002
  - api-key: []
1626
2003
  - order-token: []
1627
2004
  requestBody:
1628
- $ref: '#/components/requestBodies/address-input'
2005
+ content:
2006
+ application/json:
2007
+ schema:
2008
+ type: object
2009
+ properties:
2010
+ address:
2011
+ $ref: '#/components/schemas/address-input'
2012
+ examples:
2013
+ Example with state_id:
2014
+ value:
2015
+ address:
2016
+ name: Jane Doe
2017
+ address1: 2191 Calico Drive
2018
+ city: Phoenix
2019
+ country_id: 22
2020
+ state_id: 31
2021
+ zipcode: '85022'
2022
+ phone: 509-644-9988
2023
+ company: Acme Inc.
2024
+ Example with state_name:
2025
+ value:
2026
+ address:
2027
+ name: Jane Doe
2028
+ address1: 2191 Calico Drive
2029
+ city: Phoenix
2030
+ country_id: 22
2031
+ state_name: AZ
2032
+ zipcode: '85022'
2033
+ phone: 509-644-9988
2034
+ company: Acme Inc.
1629
2035
  '/orders/{order_number}/payments':
1630
2036
  get:
1631
2037
  responses:
@@ -1657,6 +2063,7 @@ paths:
1657
2063
  parameters:
1658
2064
  - $ref: '#/components/parameters/page'
1659
2065
  - $ref: '#/components/parameters/per_page'
2066
+ - $ref: '#/components/parameters/q'
1660
2067
  security:
1661
2068
  - api-key: []
1662
2069
  - order-token: []
@@ -1664,6 +2071,7 @@ paths:
1664
2071
  - name: order_number
1665
2072
  in: path
1666
2073
  required: true
2074
+ description: The order number
1667
2075
  schema:
1668
2076
  type: string
1669
2077
  post:
@@ -1681,7 +2089,7 @@ paths:
1681
2089
  '422':
1682
2090
  $ref: '#/components/responses/unprocessable-entity'
1683
2091
  summary: Create order payment
1684
- description: Creates a payment for an order.
2092
+ description: Creates a new payment for a checkout. Only the order's owner and users that can create a payment (eg. users with admin role) are allowed to perform this action.
1685
2093
  operationId: create-order-payment
1686
2094
  tags:
1687
2095
  - Payments
@@ -1689,7 +2097,30 @@ paths:
1689
2097
  - api-key: []
1690
2098
  - order-token: []
1691
2099
  requestBody:
1692
- $ref: '#/components/requestBodies/payment-input'
2100
+ content:
2101
+ application/json:
2102
+ schema:
2103
+ type: object
2104
+ properties:
2105
+ payment:
2106
+ $ref: '#/components/schemas/payment-input'
2107
+ examples:
2108
+ Example without a payment source:
2109
+ value:
2110
+ payment:
2111
+ amount: '42.42'
2112
+ payment_method_id: 1
2113
+ Example with a payment source:
2114
+ value:
2115
+ payment:
2116
+ amount: '42.42'
2117
+ payment_method_id: 1
2118
+ source_attributes:
2119
+ gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
2120
+ description: |-
2121
+ This requests only accepts available Payment Methods in the `payment_method_id` field.
2122
+
2123
+ The Payment Methods available to users for creating a new payment are the ones with both attributes `available_to_users` and `active` set to `true`.
1693
2124
  '/orders/{order_number}/payments/{id}':
1694
2125
  get:
1695
2126
  responses:
@@ -1731,12 +2162,21 @@ paths:
1731
2162
  $ref: '#/components/schemas/payment'
1732
2163
  '401':
1733
2164
  $ref: '#/components/responses/invalid-api-key'
2165
+ '403':
2166
+ description: Forbidden
2167
+ content:
2168
+ application/json:
2169
+ schema:
2170
+ type: object
2171
+ properties:
2172
+ error:
2173
+ type: string
1734
2174
  '404':
1735
2175
  $ref: '#/components/responses/not-found'
1736
2176
  '422':
1737
2177
  $ref: '#/components/responses/unprocessable-entity'
1738
2178
  summary: Update order payment
1739
- description: Updates an order's payment.
2179
+ description: 'Updates a checkout''s payment. Please note that this action can be done by users with the admin permissions on Payments (eg. users with the admin role). Only pending payment can be updated. '
1740
2180
  operationId: update-order-payment
1741
2181
  tags:
1742
2182
  - Payments
@@ -1744,7 +2184,18 @@ paths:
1744
2184
  - api-key: []
1745
2185
  - order-token: []
1746
2186
  requestBody:
1747
- $ref: '#/components/requestBodies/payment-input'
2187
+ content:
2188
+ application/json:
2189
+ schema:
2190
+ type: object
2191
+ properties:
2192
+ payment:
2193
+ $ref: '#/components/schemas/payment-input'
2194
+ examples:
2195
+ Example:
2196
+ value:
2197
+ payment:
2198
+ amount: '12.10'
1748
2199
  '/orders/{order_number}/return_authorizations':
1749
2200
  get:
1750
2201
  responses:
@@ -1773,6 +2224,7 @@ paths:
1773
2224
  parameters:
1774
2225
  - $ref: '#/components/parameters/page'
1775
2226
  - $ref: '#/components/parameters/per_page'
2227
+ - $ref: '#/components/parameters/q'
1776
2228
  security:
1777
2229
  - api-key: []
1778
2230
  parameters:
@@ -1796,14 +2248,23 @@ paths:
1796
2248
  '422':
1797
2249
  $ref: '#/components/responses/unprocessable-entity'
1798
2250
  summary: Create order return authorization
1799
- description: Creates a return authorization for an order.
2251
+ description: |-
2252
+ Creates a return authorization for an order.
2253
+
2254
+ Only users with the `create` permission on `Spree::ReturnAuthorization` can perform this action.
1800
2255
  operationId: create-order-return-authorization
1801
2256
  tags:
1802
2257
  - Return authorizations
1803
2258
  security:
1804
2259
  - api-key: []
1805
2260
  requestBody:
1806
- $ref: '#/components/requestBodies/return-authorization-input'
2261
+ content:
2262
+ application/json:
2263
+ schema:
2264
+ type: object
2265
+ properties:
2266
+ return_authorization:
2267
+ $ref: '#/components/schemas/return-authorization-input'
1807
2268
  '/orders/{order_number}/return_authorizations/{id}':
1808
2269
  get:
1809
2270
  responses:
@@ -1830,11 +2291,13 @@ paths:
1830
2291
  required: true
1831
2292
  schema:
1832
2293
  type: string
2294
+ description: The Order number
1833
2295
  - name: id
1834
2296
  in: path
1835
2297
  required: true
1836
2298
  schema:
1837
2299
  type: string
2300
+ description: 'The ID of the Spree::ReturnAuthorization'
1838
2301
  delete:
1839
2302
  responses:
1840
2303
  '200':
@@ -1871,14 +2334,23 @@ paths:
1871
2334
  '422':
1872
2335
  $ref: '#/components/responses/unprocessable-entity'
1873
2336
  summary: Update order return authorization
1874
- description: Updates an order's return authorization.
2337
+ description: |-
2338
+ Updates an order's return authorization.
2339
+
2340
+ Only users with the `update` permission on the return authorization can perform this action.
1875
2341
  operationId: update-order-return-authorization
1876
2342
  tags:
1877
2343
  - Return authorizations
1878
2344
  security:
1879
2345
  - api-key: []
1880
2346
  requestBody:
1881
- $ref: '#/components/requestBodies/return-authorization-input'
2347
+ content:
2348
+ application/json:
2349
+ schema:
2350
+ type: object
2351
+ properties:
2352
+ return_authorization:
2353
+ $ref: '#/components/schemas/return-authorization-input'
1882
2354
  /config:
1883
2355
  get:
1884
2356
  responses:
@@ -2071,14 +2543,23 @@ paths:
2071
2543
  '422':
2072
2544
  $ref: '#/components/responses/unprocessable-entity'
2073
2545
  summary: Create option value
2074
- description: Creates an option value.
2546
+ description: |-
2547
+ Creates an option value.
2548
+
2549
+ Only users with the `create` permission on `Spree::OptionValue` can perform this action.
2075
2550
  operationId: create-option-value
2076
2551
  tags:
2077
2552
  - Option values
2078
2553
  security:
2079
2554
  - api-key: []
2080
2555
  requestBody:
2081
- $ref: '#/components/requestBodies/option-value-input'
2556
+ content:
2557
+ application/json:
2558
+ schema:
2559
+ type: object
2560
+ properties:
2561
+ option_value:
2562
+ $ref: '#/components/schemas/option-value-input'
2082
2563
  '/option_values/{id}':
2083
2564
  get:
2084
2565
  responses:
@@ -2105,6 +2586,7 @@ paths:
2105
2586
  required: true
2106
2587
  schema:
2107
2588
  type: string
2589
+ description: 'The ID of the Spree::OptionValue'
2108
2590
  delete:
2109
2591
  responses:
2110
2592
  '204':
@@ -2141,14 +2623,24 @@ paths:
2141
2623
  '422':
2142
2624
  $ref: '#/components/responses/unprocessable-entity'
2143
2625
  summary: Update option value
2144
- description: Updates an option value.
2626
+ description: |-
2627
+ Updates an option value.
2628
+
2629
+ Only users with the `update` permission on the option value can perform this action.
2145
2630
  operationId: update-option-value
2146
2631
  tags:
2147
2632
  - Option values
2148
2633
  security:
2149
2634
  - api-key: []
2150
2635
  requestBody:
2151
- $ref: '#/components/requestBodies/option-value-input'
2636
+ content:
2637
+ application/json:
2638
+ schema:
2639
+ type: object
2640
+ properties:
2641
+ option_value:
2642
+ $ref: '#/components/schemas/option-value-input'
2643
+ description: ''
2152
2644
  '/option_types/{option_type_id}/option_values':
2153
2645
  get:
2154
2646
  responses:
@@ -2177,6 +2669,7 @@ paths:
2177
2669
  required: true
2178
2670
  schema:
2179
2671
  type: string
2672
+ description: 'The ID of the Spree::OptionType'
2180
2673
  post:
2181
2674
  responses:
2182
2675
  '200':
@@ -2192,14 +2685,23 @@ paths:
2192
2685
  '422':
2193
2686
  $ref: '#/components/responses/unprocessable-entity'
2194
2687
  summary: Create option type value
2195
- description: Creates an option value for a type.
2688
+ description: |-
2689
+ Creates an option value for a type.
2690
+
2691
+ Only users with the `create` permission on `Spree::OptionValue` can perform this action.
2196
2692
  operationId: create-option-type-value
2197
2693
  tags:
2198
2694
  - Option values
2199
2695
  security:
2200
2696
  - api-key: []
2201
2697
  requestBody:
2202
- $ref: '#/components/requestBodies/option-value-input'
2698
+ content:
2699
+ application/json:
2700
+ schema:
2701
+ type: object
2702
+ properties:
2703
+ option_value:
2704
+ $ref: '#/components/schemas/option-value-input'
2203
2705
  '/option_types/{option_type_id}/option_values/{id}':
2204
2706
  get:
2205
2707
  responses:
@@ -2225,11 +2727,13 @@ paths:
2225
2727
  required: true
2226
2728
  schema:
2227
2729
  type: string
2730
+ description: 'The ID of the Spree::OptionType'
2228
2731
  - name: id
2229
2732
  in: path
2230
2733
  required: true
2231
2734
  schema:
2232
2735
  type: string
2736
+ description: The ID of the OptionValue
2233
2737
  delete:
2234
2738
  responses:
2235
2739
  '204':
@@ -2266,14 +2770,23 @@ paths:
2266
2770
  '422':
2267
2771
  $ref: '#/components/responses/unprocessable-entity'
2268
2772
  summary: Update option type value
2269
- description: Updates an option type's value.
2773
+ description: |-
2774
+ Updates an option type's value.
2775
+
2776
+ Only users with the `update` permission on the option value can perform this action.
2270
2777
  operationId: update-option-type-value
2271
2778
  tags:
2272
2779
  - Option values
2273
2780
  security:
2274
2781
  - api-key: []
2275
2782
  requestBody:
2276
- $ref: '#/components/requestBodies/option-value-input'
2783
+ content:
2784
+ application/json:
2785
+ schema:
2786
+ type: object
2787
+ properties:
2788
+ option_value:
2789
+ $ref: '#/components/schemas/option-value-input'
2277
2790
  '/products/{product_id}/product_properties':
2278
2791
  get:
2279
2792
  responses:
@@ -2302,6 +2815,7 @@ paths:
2302
2815
  parameters:
2303
2816
  - $ref: '#/components/parameters/page'
2304
2817
  - $ref: '#/components/parameters/per_page'
2818
+ - $ref: '#/components/parameters/q'
2305
2819
  security:
2306
2820
  - api-key: []
2307
2821
  parameters:
@@ -2325,14 +2839,29 @@ paths:
2325
2839
  '422':
2326
2840
  $ref: '#/components/responses/unprocessable-entity'
2327
2841
  summary: Create product property
2328
- description: Creates a product property.
2842
+ description: |-
2843
+ Creates a product property.
2844
+
2845
+ Only users with the `create` permission on `Spree::ProductProperty` can perform this action.
2329
2846
  operationId: create-product-property
2330
2847
  tags:
2331
2848
  - Product properties
2332
2849
  security:
2333
2850
  - api-key: []
2334
2851
  requestBody:
2335
- $ref: '#/components/requestBodies/product-property-input'
2852
+ content:
2853
+ application/json:
2854
+ schema:
2855
+ type: object
2856
+ properties:
2857
+ product_property:
2858
+ $ref: '#/components/schemas/product-property-input'
2859
+ examples:
2860
+ Example:
2861
+ value:
2862
+ product_property:
2863
+ property_name: Fit
2864
+ value: Loose
2336
2865
  '/products/{product_id}/product_properties/{id}':
2337
2866
  get:
2338
2867
  responses:
@@ -2400,14 +2929,28 @@ paths:
2400
2929
  '422':
2401
2930
  $ref: '#/components/responses/unprocessable-entity'
2402
2931
  summary: Update product property
2403
- description: Updates a product's property.
2932
+ description: |-
2933
+ Updates a product's property.
2934
+
2935
+ Only users with the `update` permission on the product property can perform this action.
2404
2936
  operationId: update-product-property
2405
2937
  tags:
2406
2938
  - Product properties
2407
2939
  security:
2408
2940
  - api-key: []
2409
2941
  requestBody:
2410
- $ref: '#/components/requestBodies/product-property-input'
2942
+ content:
2943
+ application/json:
2944
+ schema:
2945
+ type: object
2946
+ properties:
2947
+ product_property:
2948
+ $ref: '#/components/schemas/product-property-input'
2949
+ examples:
2950
+ Example:
2951
+ value:
2952
+ product_property:
2953
+ value: Regular
2411
2954
  /properties:
2412
2955
  get:
2413
2956
  responses:
@@ -2434,6 +2977,7 @@ paths:
2434
2977
  parameters:
2435
2978
  - $ref: '#/components/parameters/page'
2436
2979
  - $ref: '#/components/parameters/per_page'
2980
+ - $ref: '#/components/parameters/q'
2437
2981
  security:
2438
2982
  - api-key: []
2439
2983
  post:
@@ -2449,14 +2993,23 @@ paths:
2449
2993
  '422':
2450
2994
  $ref: '#/components/responses/unprocessable-entity'
2451
2995
  summary: Create property
2452
- description: Creates a property.
2996
+ description: |-
2997
+ Creates a property.
2998
+
2999
+ Only users with the `create` permission on `Spree::Propery` can perform this action.
2453
3000
  operationId: create-property
2454
3001
  tags:
2455
3002
  - Properties
2456
3003
  security:
2457
3004
  - api-key: []
2458
3005
  requestBody:
2459
- $ref: '#/components/requestBodies/property-input'
3006
+ content:
3007
+ application/json:
3008
+ schema:
3009
+ type: object
3010
+ properties:
3011
+ property:
3012
+ $ref: '#/components/schemas/property-input'
2460
3013
  '/properties/{id}':
2461
3014
  get:
2462
3015
  responses:
@@ -2483,6 +3036,7 @@ paths:
2483
3036
  required: true
2484
3037
  schema:
2485
3038
  type: string
3039
+ description: 'The id of the Spree::Property'
2486
3040
  delete:
2487
3041
  responses:
2488
3042
  '204':
@@ -2519,14 +3073,23 @@ paths:
2519
3073
  '422':
2520
3074
  $ref: '#/components/responses/unprocessable-entity'
2521
3075
  summary: Update property
2522
- description: Updates a property.
3076
+ description: |-
3077
+ Updates a property.
3078
+
3079
+ Only users with the `update` permission on the property can perform this action.
2523
3080
  operationId: update-property
2524
3081
  tags:
2525
3082
  - Properties
2526
3083
  security:
2527
3084
  - api-key: []
2528
3085
  requestBody:
2529
- $ref: '#/components/requestBodies/property-input'
3086
+ content:
3087
+ application/json:
3088
+ schema:
3089
+ type: object
3090
+ properties:
3091
+ property:
3092
+ $ref: '#/components/schemas/property-input'
2530
3093
  '/inventory_units/{id}':
2531
3094
  get:
2532
3095
  responses:
@@ -2604,6 +3167,7 @@ paths:
2604
3167
  parameters:
2605
3168
  - $ref: '#/components/parameters/page'
2606
3169
  - $ref: '#/components/parameters/per_page'
3170
+ - $ref: '#/components/parameters/q'
2607
3171
  security:
2608
3172
  - api-key: []
2609
3173
  post:
@@ -2619,14 +3183,29 @@ paths:
2619
3183
  '422':
2620
3184
  $ref: '#/components/responses/unprocessable-entity'
2621
3185
  summary: Create stock location
2622
- description: Creates a stock location.
3186
+ description: |-
3187
+ Creates a stock location.
3188
+
3189
+ Only users with the `create` permission on `Spree::StockLocation` can perform this action.
2623
3190
  operationId: create-stock-location
2624
3191
  tags:
2625
3192
  - Stock locations
2626
3193
  security:
2627
3194
  - api-key: []
2628
3195
  requestBody:
2629
- $ref: '#/components/requestBodies/stock-location-input'
3196
+ content:
3197
+ application/json:
3198
+ schema:
3199
+ type: object
3200
+ properties:
3201
+ stock_location:
3202
+ $ref: '#/components/schemas/stock-location-input'
3203
+ examples:
3204
+ Example:
3205
+ value:
3206
+ stock_location:
3207
+ name: North Pole
3208
+ active: true
2630
3209
  '/stock_locations/{id}':
2631
3210
  get:
2632
3211
  responses:
@@ -2652,6 +3231,7 @@ paths:
2652
3231
  required: true
2653
3232
  schema:
2654
3233
  type: string
3234
+ description: The id of the stock location
2655
3235
  delete:
2656
3236
  responses:
2657
3237
  '204':
@@ -2688,14 +3268,28 @@ paths:
2688
3268
  '422':
2689
3269
  $ref: '#/components/responses/unprocessable-entity'
2690
3270
  summary: Update stock location
2691
- description: Updates a stock location.
3271
+ description: |-
3272
+ Updates a stock location.
3273
+
3274
+ Only users with the `update` permission on the stock location can perform this action.
2692
3275
  operationId: update-stock-location
2693
3276
  tags:
2694
3277
  - Stock locations
2695
3278
  security:
2696
3279
  - api-key: []
2697
3280
  requestBody:
2698
- $ref: '#/components/requestBodies/stock-location-input'
3281
+ content:
3282
+ application/json:
3283
+ schema:
3284
+ type: object
3285
+ properties:
3286
+ stock_location:
3287
+ $ref: '#/components/schemas/stock-location-input'
3288
+ examples:
3289
+ Example:
3290
+ value:
3291
+ stock_location:
3292
+ active: false
2699
3293
  '/stock_locations/{stock_location_id}/stock_items':
2700
3294
  get:
2701
3295
  responses:
@@ -2724,6 +3318,7 @@ paths:
2724
3318
  parameters:
2725
3319
  - $ref: '#/components/parameters/page'
2726
3320
  - $ref: '#/components/parameters/per_page'
3321
+ - $ref: '#/components/parameters/q'
2727
3322
  security:
2728
3323
  - api-key: []
2729
3324
  parameters:
@@ -2747,14 +3342,23 @@ paths:
2747
3342
  '422':
2748
3343
  $ref: '#/components/responses/unprocessable-entity'
2749
3344
  summary: Create stock location item
2750
- description: Creates a stock item for a stock location.
3345
+ description: |-
3346
+ Creates a stock item for a stock location.
3347
+
3348
+ Only users with the `create` permission on `Spree::StockItem` can perform this action.
2751
3349
  operationId: create-stock-location-item
2752
3350
  tags:
2753
3351
  - Stock items
2754
3352
  security:
2755
3353
  - api-key: []
2756
3354
  requestBody:
2757
- $ref: '#/components/requestBodies/stock-item-input'
3355
+ content:
3356
+ application/json:
3357
+ schema:
3358
+ type: object
3359
+ properties:
3360
+ stock_item:
3361
+ $ref: '#/components/schemas/stock-item-input'
2758
3362
  '/stock_locations/{stock_location_id}/stock_items/{id}':
2759
3363
  get:
2760
3364
  responses:
@@ -2780,11 +3384,13 @@ paths:
2780
3384
  required: true
2781
3385
  schema:
2782
3386
  type: string
3387
+ description: 'The ID of the Spree::StockLocation'
2783
3388
  - name: id
2784
3389
  in: path
2785
3390
  required: true
2786
3391
  schema:
2787
3392
  type: string
3393
+ description: 'The ID of the Spree::StockItem'
2788
3394
  delete:
2789
3395
  responses:
2790
3396
  '204':
@@ -2821,14 +3427,23 @@ paths:
2821
3427
  '422':
2822
3428
  $ref: '#/components/responses/unprocessable-entity'
2823
3429
  summary: Update stock location item
2824
- description: Updates a stock location's item.
3430
+ description: |-
3431
+ Updates a stock location's item.
3432
+
3433
+ Only users with the `update` permission on the stock item can perform this action.
2825
3434
  operationId: update-stock-location-item
2826
3435
  tags:
2827
3436
  - Stock items
2828
3437
  security:
2829
3438
  - api-key: []
2830
3439
  requestBody:
2831
- $ref: '#/components/requestBodies/stock-item-input'
3440
+ content:
3441
+ application/json:
3442
+ schema:
3443
+ type: object
3444
+ properties:
3445
+ stock_item:
3446
+ $ref: '#/components/schemas/stock-item-input'
2832
3447
  '/stock_locations/{stock_location_id}/stock_movements':
2833
3448
  get:
2834
3449
  responses:
@@ -2855,6 +3470,7 @@ paths:
2855
3470
  parameters:
2856
3471
  - $ref: '#/components/parameters/page'
2857
3472
  - $ref: '#/components/parameters/per_page'
3473
+ - $ref: '#/components/parameters/q'
2858
3474
  security:
2859
3475
  - api-key: []
2860
3476
  parameters:
@@ -3072,6 +3688,7 @@ paths:
3072
3688
  parameters:
3073
3689
  - $ref: '#/components/parameters/page'
3074
3690
  - $ref: '#/components/parameters/per_page'
3691
+ - $ref: '#/components/parameters/q'
3075
3692
  security:
3076
3693
  - api-key: []
3077
3694
  post:
@@ -3087,14 +3704,30 @@ paths:
3087
3704
  '422':
3088
3705
  $ref: '#/components/responses/unprocessable-entity'
3089
3706
  summary: Create taxonomy
3090
- description: Creates a taxonomy.
3707
+ description: |-
3708
+ Creates a taxonomy.
3709
+
3710
+ Only users with the `create` permission on `Spree::Taxonomy` can perform this action.
3711
+
3712
+ Creating a taxonomy, its root taxon with the same name will be automatically created. The root taxon's information will be available in the response.
3091
3713
  operationId: create-taxonomy
3092
3714
  tags:
3093
3715
  - Taxonomies
3094
3716
  security:
3095
3717
  - api-key: []
3096
3718
  requestBody:
3097
- $ref: '#/components/requestBodies/taxonomy-input'
3719
+ content:
3720
+ application/json:
3721
+ schema:
3722
+ type: object
3723
+ properties:
3724
+ taxonomy:
3725
+ $ref: '#/components/schemas/taxonomy-input'
3726
+ examples:
3727
+ Example:
3728
+ value:
3729
+ taxonomy:
3730
+ name: Colors
3098
3731
  '/taxonomies/{id}':
3099
3732
  get:
3100
3733
  responses:
@@ -3114,12 +3747,20 @@ paths:
3114
3747
  - Taxonomies
3115
3748
  security:
3116
3749
  - api-key: []
3750
+ parameters:
3751
+ - schema:
3752
+ type: string
3753
+ default: nested
3754
+ in: query
3755
+ name: set
3756
+ description: When `set=nested` it will recoursively return all the taxons of that taxonomy
3117
3757
  parameters:
3118
3758
  - name: id
3119
3759
  in: path
3120
3760
  required: true
3121
3761
  schema:
3122
3762
  type: string
3763
+ description: The id of the taxonomy
3123
3764
  delete:
3124
3765
  responses:
3125
3766
  '204':
@@ -3156,17 +3797,31 @@ paths:
3156
3797
  '422':
3157
3798
  $ref: '#/components/responses/unprocessable-entity'
3158
3799
  summary: Update taxonomy
3159
- description: Updates a taxonomy.
3800
+ description: |-
3801
+ Updates a taxonomy.
3802
+
3803
+ Only users with the `update` permission on the taxonomy can perform this action.
3160
3804
  operationId: update-taxonomy
3161
3805
  tags:
3162
3806
  - Taxonomies
3163
3807
  security:
3164
3808
  - api-key: []
3165
3809
  requestBody:
3166
- $ref: '#/components/requestBodies/taxonomy-input'
3167
- '/taxonomies/{taxonomy_id}/taxons':
3168
- get:
3169
- responses:
3810
+ content:
3811
+ application/json:
3812
+ schema:
3813
+ type: object
3814
+ properties:
3815
+ taxonomy:
3816
+ $ref: '#/components/schemas/taxonomy-input'
3817
+ examples:
3818
+ Example:
3819
+ value:
3820
+ taxonomy:
3821
+ name: Colours
3822
+ '/taxonomies/{taxonomy_id}/taxons':
3823
+ get:
3824
+ responses:
3170
3825
  '200':
3171
3826
  description: ''
3172
3827
  content:
@@ -3192,6 +3847,7 @@ paths:
3192
3847
  parameters:
3193
3848
  - $ref: '#/components/parameters/page'
3194
3849
  - $ref: '#/components/parameters/per_page'
3850
+ - $ref: '#/components/parameters/q'
3195
3851
  security:
3196
3852
  - api-key: []
3197
3853
  parameters:
@@ -3200,6 +3856,7 @@ paths:
3200
3856
  required: true
3201
3857
  schema:
3202
3858
  type: string
3859
+ description: The id of the taxonomy for which the new taxon will be added
3203
3860
  post:
3204
3861
  responses:
3205
3862
  '200':
@@ -3215,14 +3872,29 @@ paths:
3215
3872
  '422':
3216
3873
  $ref: '#/components/responses/unprocessable-entity'
3217
3874
  summary: Create taxonomy taxon
3218
- description: Creates a taxon for a taxonomy.
3875
+ description: |-
3876
+ Creates a taxon for a taxonomy.
3877
+
3878
+ Only users with the `create` permission on `Spree::Taxon` can perform this action.
3219
3879
  operationId: create-taxonomy-taxon
3220
3880
  tags:
3221
3881
  - Taxons
3222
3882
  security:
3223
3883
  - api-key: []
3224
3884
  requestBody:
3225
- $ref: '#/components/requestBodies/taxon-input'
3885
+ content:
3886
+ application/json:
3887
+ schema:
3888
+ type: object
3889
+ properties:
3890
+ taxon:
3891
+ $ref: '#/components/schemas/taxon-input'
3892
+ examples:
3893
+ Example:
3894
+ value:
3895
+ taxon:
3896
+ name: Colors
3897
+ parent_id: 22
3226
3898
  '/taxonomies/{taxonomy_id}/taxons/{id}':
3227
3899
  get:
3228
3900
  responses:
@@ -3248,11 +3920,13 @@ paths:
3248
3920
  required: true
3249
3921
  schema:
3250
3922
  type: string
3923
+ description: The id of the taxon's taxonomy
3251
3924
  - name: id
3252
3925
  in: path
3253
3926
  required: true
3254
3927
  schema:
3255
3928
  type: string
3929
+ description: The id of the taxon
3256
3930
  delete:
3257
3931
  responses:
3258
3932
  '204':
@@ -3289,14 +3963,28 @@ paths:
3289
3963
  '422':
3290
3964
  $ref: '#/components/responses/unprocessable-entity'
3291
3965
  summary: Update taxonomy taxon
3292
- description: Updates a taxonomy's taxon.
3966
+ description: |-
3967
+ Updates a taxonomy's taxon.
3968
+
3969
+ Only users with the `update` permission on the taxon can perform this action.
3293
3970
  operationId: update-taxonomy-taxon
3294
3971
  tags:
3295
3972
  - Taxons
3296
3973
  security:
3297
3974
  - api-key: []
3298
3975
  requestBody:
3299
- $ref: '#/components/requestBodies/taxon-input'
3976
+ content:
3977
+ application/json:
3978
+ schema:
3979
+ type: object
3980
+ properties:
3981
+ taxon:
3982
+ $ref: '#/components/schemas/taxon-input'
3983
+ examples:
3984
+ Example:
3985
+ value:
3986
+ taxon:
3987
+ name: Colours
3300
3988
  /taxons:
3301
3989
  get:
3302
3990
  responses:
@@ -3323,6 +4011,12 @@ paths:
3323
4011
  parameters:
3324
4012
  - $ref: '#/components/parameters/page'
3325
4013
  - $ref: '#/components/parameters/per_page'
4014
+ - $ref: '#/components/parameters/q'
4015
+ - schema:
4016
+ type: boolean
4017
+ in: query
4018
+ name: without_children
4019
+ description: 'When set to `true`, it won''t recursively return all the taxons'' children.'
3326
4020
  security:
3327
4021
  - api-key: []
3328
4022
  /users:
@@ -3350,6 +4044,7 @@ paths:
3350
4044
  parameters:
3351
4045
  - $ref: '#/components/parameters/page'
3352
4046
  - $ref: '#/components/parameters/per_page'
4047
+ - $ref: '#/components/parameters/q'
3353
4048
  security:
3354
4049
  - api-key: []
3355
4050
  post:
@@ -3365,14 +4060,24 @@ paths:
3365
4060
  '422':
3366
4061
  $ref: '#/components/responses/unprocessable-entity'
3367
4062
  summary: Create user
3368
- description: Creates a user.
4063
+ description: |
4064
+ Creates a user.
4065
+
4066
+ Only users with the `create` permission on `Spree::User` can perform this action.
3369
4067
  operationId: create-user
3370
4068
  tags:
3371
4069
  - Users
3372
4070
  security:
3373
4071
  - api-key: []
3374
4072
  requestBody:
3375
- $ref: '#/components/requestBodies/user-input'
4073
+ content:
4074
+ application/json:
4075
+ schema:
4076
+ type: object
4077
+ properties:
4078
+ user:
4079
+ $ref: '#/components/schemas/user-input'
4080
+ description: ''
3376
4081
  /zones:
3377
4082
  get:
3378
4083
  responses:
@@ -3399,6 +4104,7 @@ paths:
3399
4104
  parameters:
3400
4105
  - $ref: '#/components/parameters/page'
3401
4106
  - $ref: '#/components/parameters/per_page'
4107
+ - $ref: '#/components/parameters/q'
3402
4108
  security:
3403
4109
  - api-key: []
3404
4110
  post:
@@ -3414,14 +4120,32 @@ paths:
3414
4120
  '422':
3415
4121
  $ref: '#/components/responses/unprocessable-entity'
3416
4122
  summary: Create zone
3417
- description: Creates a zone.
4123
+ description: |-
4124
+ Creates a zone.
4125
+
4126
+ Only users with the `create` permission on `Spree::Zone` can perform this action.
3418
4127
  operationId: create-zone
3419
4128
  tags:
3420
4129
  - Zones
3421
4130
  security:
3422
4131
  - api-key: []
3423
4132
  requestBody:
3424
- $ref: '#/components/requestBodies/zone-input'
4133
+ content:
4134
+ application/json:
4135
+ schema:
4136
+ type: object
4137
+ properties:
4138
+ zone:
4139
+ $ref: '#/components/schemas/zone-input'
4140
+ examples:
4141
+ Example:
4142
+ value:
4143
+ zone:
4144
+ name: North Pole
4145
+ description: The coldest one.
4146
+ zone_members_attributes:
4147
+ - zoneable_type: 'Spree::Country'
4148
+ zoneable_id: 1
3425
4149
  '/zones/{id}':
3426
4150
  get:
3427
4151
  responses:
@@ -3448,6 +4172,7 @@ paths:
3448
4172
  required: true
3449
4173
  schema:
3450
4174
  type: string
4175
+ description: The ID of the zone we want to update
3451
4176
  delete:
3452
4177
  responses:
3453
4178
  '204':
@@ -3484,14 +4209,28 @@ paths:
3484
4209
  '422':
3485
4210
  $ref: '#/components/responses/unprocessable-entity'
3486
4211
  summary: Update zone
3487
- description: Updates a zone.
4212
+ description: |-
4213
+ Updates a zone.
4214
+
4215
+ Only users with the `update` permission on the zone can perform this action.
3488
4216
  operationId: update-zone
3489
4217
  tags:
3490
4218
  - Zones
3491
4219
  security:
3492
4220
  - api-key: []
3493
4221
  requestBody:
3494
- $ref: '#/components/requestBodies/zone-input'
4222
+ content:
4223
+ application/json:
4224
+ schema:
4225
+ type: object
4226
+ properties:
4227
+ zone:
4228
+ $ref: '#/components/schemas/zone-input'
4229
+ examples:
4230
+ Example:
4231
+ value:
4232
+ zone:
4233
+ description: Brrr. The coldest one.
3495
4234
  '/promotions/{id}':
3496
4235
  get:
3497
4236
  responses:
@@ -3546,7 +4285,7 @@ paths:
3546
4285
  - $ref: '#/components/parameters/per_page'
3547
4286
  security:
3548
4287
  - api-key: []
3549
- '/checkouts/{checkout_id}/line_items/{id}':
4288
+ '/orders/{order_number}/coupon_codes/{id}':
3550
4289
  delete:
3551
4290
  responses:
3552
4291
  '204':
@@ -3554,34 +4293,43 @@ paths:
3554
4293
  content:
3555
4294
  application/json:
3556
4295
  schema:
3557
- $ref: '#/components/schemas/line-item'
4296
+ $ref: '#/components/schemas/coupon-code-handler'
3558
4297
  '401':
3559
4298
  $ref: '#/components/responses/invalid-api-key'
3560
4299
  '404':
3561
4300
  $ref: '#/components/responses/not-found'
3562
4301
  '422':
3563
- $ref: '#/components/responses/delete-restriction'
3564
- summary: Delete checkout line item
3565
- description: Deletes a checkout's line item.
3566
- operationId: delete-checkout-line-item
4302
+ description: Unprocessable Entity (WebDAV)
4303
+ content:
4304
+ application/json:
4305
+ schema:
4306
+ $ref: '#/components/schemas/coupon-code-handler'
4307
+ summary: Delete order coupon code
4308
+ description: |-
4309
+ Deletes an order's coupon code.
4310
+
4311
+ To perform this operation the request should be made as the order's owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
4312
+ operationId: delete-order-coupon-code
3567
4313
  tags:
3568
- - Line items
4314
+ - Coupon codes
3569
4315
  security:
3570
4316
  - api-key: []
3571
4317
  - order-token: []
3572
4318
  parameters:
3573
- - name: checkout_id
4319
+ - name: order_number
3574
4320
  in: path
3575
4321
  required: true
3576
- description: The order number
3577
4322
  schema:
3578
4323
  type: string
4324
+ description: The order number
3579
4325
  - name: id
3580
4326
  in: path
3581
4327
  required: true
4328
+ description: This is the coupon code
3582
4329
  schema:
3583
4330
  type: string
3584
- patch:
4331
+ '/orders/{order_number}/line_items':
4332
+ post:
3585
4333
  responses:
3586
4334
  '200':
3587
4335
  description: ''
@@ -3595,9 +4343,12 @@ paths:
3595
4343
  $ref: '#/components/responses/not-found'
3596
4344
  '422':
3597
4345
  $ref: '#/components/responses/unprocessable-entity'
3598
- summary: Update checkout line item
3599
- description: Updates a checkout's line item.
3600
- operationId: update-checkout-line-item
4346
+ summary: Create order line item
4347
+ description: |-
4348
+ Create a line item in an order not yet completed.
4349
+
4350
+ To perform this operation the request should be made as the order owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
4351
+ operationId: create-order-line-item
3601
4352
  tags:
3602
4353
  - Line items
3603
4354
  security:
@@ -3609,47 +4360,21 @@ paths:
3609
4360
  schema:
3610
4361
  type: object
3611
4362
  properties:
3612
- line_items_attributes:
3613
- allOf:
3614
- - properties:
3615
- id:
3616
- type: integer
3617
- type: object
3618
- '/orders/{order_number}/coupon_codes/{id}':
3619
- delete:
3620
- responses:
3621
- '204':
3622
- description: ''
3623
- content:
3624
- application/json:
3625
- schema:
3626
- $ref: '#/components/schemas/coupon-code-handler'
3627
- '401':
3628
- $ref: '#/components/responses/invalid-api-key'
3629
- '404':
3630
- $ref: '#/components/responses/not-found'
3631
- '422':
3632
- $ref: '#/components/responses/delete-restriction'
3633
- summary: Delete order coupon code
3634
- description: Deletes an order's coupon code.
3635
- operationId: delete-order-coupon-code
3636
- tags:
3637
- - Coupon codes
3638
- security:
3639
- - api-key: []
3640
- - order-token: []
4363
+ line_item:
4364
+ $ref: '#/components/schemas/line-item-input'
4365
+ examples:
4366
+ Example:
4367
+ value:
4368
+ line_item:
4369
+ quantity: 1
4370
+ variant_id: 22
4371
+ description: ''
3641
4372
  parameters:
3642
4373
  - name: order_number
3643
4374
  in: path
3644
4375
  required: true
3645
4376
  schema:
3646
4377
  type: string
3647
- - name: id
3648
- in: path
3649
- required: true
3650
- description: This is the coupon code
3651
- schema:
3652
- type: string
3653
4378
  '/orders/{order_number}/line_items/{id}':
3654
4379
  delete:
3655
4380
  responses:
@@ -3679,11 +4404,13 @@ paths:
3679
4404
  required: true
3680
4405
  schema:
3681
4406
  type: string
4407
+ description: The order number
3682
4408
  - name: id
3683
4409
  in: path
3684
4410
  required: true
3685
4411
  schema:
3686
4412
  type: string
4413
+ description: The id of the line item to update
3687
4414
  patch:
3688
4415
  responses:
3689
4416
  '200':
@@ -3699,7 +4426,10 @@ paths:
3699
4426
  '422':
3700
4427
  $ref: '#/components/responses/unprocessable-entity'
3701
4428
  summary: Update order line item
3702
- description: Updates an order's line item.
4429
+ description: |-
4430
+ Update line item's information in an order not yet completed.
4431
+
4432
+ To perform this operation the request should be made as the order owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
3703
4433
  operationId: update-order-line-item
3704
4434
  tags:
3705
4435
  - Line items
@@ -3707,7 +4437,18 @@ paths:
3707
4437
  - api-key: []
3708
4438
  - order-token: []
3709
4439
  requestBody:
3710
- $ref: '#/components/requestBodies/line-item-input'
4440
+ content:
4441
+ application/json:
4442
+ schema:
4443
+ type: object
4444
+ properties:
4445
+ line_item:
4446
+ $ref: '#/components/schemas/line-item-input'
4447
+ examples:
4448
+ example-1:
4449
+ value:
4450
+ line_item:
4451
+ quantity: 1
3711
4452
  '/stock_items/{id}':
3712
4453
  delete:
3713
4454
  responses:
@@ -3736,6 +4477,7 @@ paths:
3736
4477
  required: true
3737
4478
  schema:
3738
4479
  type: string
4480
+ description: 'The ID of the Stock::Item'
3739
4481
  patch:
3740
4482
  responses:
3741
4483
  '200':
@@ -3751,14 +4493,23 @@ paths:
3751
4493
  '422':
3752
4494
  $ref: '#/components/responses/unprocessable-entity'
3753
4495
  summary: Update stock item
3754
- description: Updates a stock item.
4496
+ description: |-
4497
+ Updates a stock item.
4498
+
4499
+ Only users with the `update` permission on the stock item can perform this action.
3755
4500
  operationId: update-stock-item
3756
4501
  tags:
3757
4502
  - Stock items
3758
4503
  security:
3759
4504
  - api-key: []
3760
4505
  requestBody:
3761
- $ref: '#/components/requestBodies/stock-item-input'
4506
+ content:
4507
+ application/json:
4508
+ schema:
4509
+ type: object
4510
+ properties:
4511
+ stock_item:
4512
+ $ref: '#/components/schemas/stock-item-input'
3762
4513
  '/checkouts/{id}':
3763
4514
  patch:
3764
4515
  responses:
@@ -3776,7 +4527,9 @@ paths:
3776
4527
  $ref: '#/components/responses/unprocessable-entity'
3777
4528
  summary: Update checkout
3778
4529
  description: |-
3779
- Updates a checkout.
4530
+ Updates a checkout and moves the order to the next checkout step. A request with an empty body is legit and only tries to move the order to the next step.
4531
+
4532
+ To perform this operation the request should be made as the order owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
3780
4533
 
3781
4534
  **Note:** In addition to the order update, this action always attempts to perform an order state machine transition which results in a `422` response if it cannot be transitioned.
3782
4535
  operationId: update-checkout
@@ -3789,13 +4542,17 @@ paths:
3789
4542
  content:
3790
4543
  application/json:
3791
4544
  schema:
3792
- $ref: '#/components/schemas/checkout-input'
4545
+ type: object
4546
+ properties:
4547
+ order:
4548
+ $ref: '#/components/schemas/order-input'
3793
4549
  parameters:
3794
4550
  - name: id
3795
4551
  in: path
3796
4552
  required: true
3797
4553
  schema:
3798
4554
  type: string
4555
+ description: The order number
3799
4556
  '/credit_cards/{id}':
3800
4557
  patch:
3801
4558
  responses:
@@ -3845,7 +4602,10 @@ paths:
3845
4602
  '422':
3846
4603
  $ref: '#/components/responses/unprocessable-entity'
3847
4604
  summary: Update shipment
3848
- description: Updates a shipment.
4605
+ description: |-
4606
+ Updates a shipment.
4607
+
4608
+ Please note that this request can be only performed by users with the `update` permission on the shipment.
3849
4609
  operationId: update-shipment
3850
4610
  tags:
3851
4611
  - Shipments
@@ -3855,7 +4615,15 @@ paths:
3855
4615
  content:
3856
4616
  application/json:
3857
4617
  schema:
3858
- $ref: '#/components/schemas/shipment-input'
4618
+ type: object
4619
+ properties:
4620
+ shipment:
4621
+ $ref: '#/components/schemas/shipment-input'
4622
+ examples:
4623
+ Example:
4624
+ value:
4625
+ shipment:
4626
+ tracking: tracking-identifier-provided-by-shipping-provider
3859
4627
  parameters:
3860
4628
  - name: number
3861
4629
  in: path
@@ -4160,6 +4928,131 @@ paths:
4160
4928
  description: The order number
4161
4929
  schema:
4162
4930
  type: string
4931
+ '/checkouts/{checkout_id}/line_items':
4932
+ post:
4933
+ responses:
4934
+ '200':
4935
+ description: ''
4936
+ content:
4937
+ application/json:
4938
+ schema:
4939
+ $ref: '#/components/schemas/line-item'
4940
+ '401':
4941
+ $ref: '#/components/responses/invalid-api-key'
4942
+ '404':
4943
+ $ref: '#/components/responses/not-found'
4944
+ '422':
4945
+ $ref: '#/components/responses/unprocessable-entity'
4946
+ summary: Create checkout line item
4947
+ description: |-
4948
+ Create a line item in an checkout not yet completed.
4949
+
4950
+ To perform this operation the request should be made as the order owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
4951
+
4952
+ It is not possible to add a line item to a completed order.
4953
+ operationId: create-checkout-line-item
4954
+ tags:
4955
+ - Line items
4956
+ security:
4957
+ - api-key: []
4958
+ - order-token: []
4959
+ requestBody:
4960
+ content:
4961
+ application/json:
4962
+ schema:
4963
+ type: object
4964
+ properties:
4965
+ line_item:
4966
+ $ref: '#/components/schemas/line-item-input'
4967
+ examples:
4968
+ Example:
4969
+ value:
4970
+ line_item:
4971
+ quantity: 1
4972
+ variant_id: 22
4973
+ parameters:
4974
+ - name: checkout_id
4975
+ in: path
4976
+ required: true
4977
+ description: The order number
4978
+ schema:
4979
+ type: string
4980
+ '/checkouts/{checkout_id}/line_items/{id}':
4981
+ delete:
4982
+ responses:
4983
+ '204':
4984
+ description: ''
4985
+ content:
4986
+ application/json:
4987
+ schema:
4988
+ $ref: '#/components/schemas/line-item'
4989
+ '401':
4990
+ $ref: '#/components/responses/invalid-api-key'
4991
+ '404':
4992
+ $ref: '#/components/responses/not-found'
4993
+ '422':
4994
+ $ref: '#/components/responses/delete-restriction'
4995
+ summary: Delete checkout line item
4996
+ description: Deletes a checkout's line item.
4997
+ operationId: delete-checkout-line-item
4998
+ tags:
4999
+ - Line items
5000
+ security:
5001
+ - api-key: []
5002
+ - order-token: []
5003
+ parameters:
5004
+ - name: checkout_id
5005
+ in: path
5006
+ required: true
5007
+ description: The order number
5008
+ schema:
5009
+ type: string
5010
+ - name: id
5011
+ in: path
5012
+ required: true
5013
+ schema:
5014
+ type: string
5015
+ description: The id of the line item to update
5016
+ patch:
5017
+ responses:
5018
+ '200':
5019
+ description: ''
5020
+ content:
5021
+ application/json:
5022
+ schema:
5023
+ $ref: '#/components/schemas/line-item'
5024
+ '401':
5025
+ $ref: '#/components/responses/invalid-api-key'
5026
+ '404':
5027
+ $ref: '#/components/responses/not-found'
5028
+ '422':
5029
+ $ref: '#/components/responses/unprocessable-entity'
5030
+ summary: Update checkout line item
5031
+ description: |-
5032
+ Update line item's information in an checkout not yet completed.
5033
+
5034
+ To perform this operation the request should be made as the order owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
5035
+
5036
+ It is not possible to add a line item to a completed order.
5037
+ operationId: update-checkout-line-item
5038
+ tags:
5039
+ - Line items
5040
+ security:
5041
+ - api-key: []
5042
+ - order-token: []
5043
+ requestBody:
5044
+ content:
5045
+ application/json:
5046
+ schema:
5047
+ type: object
5048
+ properties:
5049
+ line_item:
5050
+ $ref: '#/components/schemas/line-item-input'
5051
+ examples:
5052
+ Example:
5053
+ value:
5054
+ line_item:
5055
+ quantity: 2
4163
5056
  /classifications:
4164
5057
  put:
4165
5058
  responses:
@@ -4612,7 +5505,7 @@ paths:
4612
5505
  required: true
4613
5506
  schema:
4614
5507
  type: string
4615
- '/checkouts/{checkout_id}/line_items':
5508
+ '/orders/{order_number}/coupon_codes':
4616
5509
  post:
4617
5510
  responses:
4618
5511
  '200':
@@ -4620,47 +5513,22 @@ paths:
4620
5513
  content:
4621
5514
  application/json:
4622
5515
  schema:
4623
- $ref: '#/components/schemas/line-item'
5516
+ $ref: '#/components/schemas/coupon-code-handler'
4624
5517
  '401':
4625
5518
  $ref: '#/components/responses/invalid-api-key'
4626
5519
  '404':
4627
5520
  $ref: '#/components/responses/not-found'
4628
5521
  '422':
4629
- $ref: '#/components/responses/unprocessable-entity'
4630
- summary: Create checkout line item
4631
- description: Creates a new line item for a checkout.
4632
- operationId: create-checkout-line-item
4633
- tags:
4634
- - Line items
4635
- security:
4636
- - api-key: []
4637
- - order-token: []
4638
- requestBody:
4639
- $ref: '#/components/requestBodies/line-item-input'
4640
- parameters:
4641
- - name: checkout_id
4642
- in: path
4643
- required: true
4644
- description: The order number
4645
- schema:
4646
- type: string
4647
- '/orders/{order_number}/coupon_codes':
4648
- post:
4649
- responses:
4650
- '200':
4651
5522
  description: ''
4652
5523
  content:
4653
5524
  application/json:
4654
5525
  schema:
4655
5526
  $ref: '#/components/schemas/coupon-code-handler'
4656
- '401':
4657
- $ref: '#/components/responses/invalid-api-key'
4658
- '404':
4659
- $ref: '#/components/responses/not-found'
4660
- '422':
4661
- $ref: '#/components/responses/unprocessable-entity'
4662
5527
  summary: Create order coupon code
4663
- description: Creates a coupon code for an order.
5528
+ description: |-
5529
+ Creates a coupon code for an order.
5530
+
5531
+ To perform this operation the request should be made as the order's owner or with the order token in case of unauthenitcated checkouts (es. guest checkout).
4664
5532
  operationId: create-order-coupon-code
4665
5533
  tags:
4666
5534
  - Coupon codes
@@ -4668,44 +5536,21 @@ paths:
4668
5536
  - api-key: []
4669
5537
  - order-token: []
4670
5538
  requestBody:
4671
- $ref: '#/components/requestBodies/coupon-code-input'
4672
- parameters:
4673
- - name: order_number
4674
- in: path
4675
- required: true
4676
- schema:
4677
- type: string
4678
- '/orders/{order_number}/line_items':
4679
- post:
4680
- responses:
4681
- '200':
4682
- description: ''
4683
- content:
4684
- application/json:
4685
- schema:
4686
- $ref: '#/components/schemas/line-item'
4687
- '401':
4688
- $ref: '#/components/responses/invalid-api-key'
4689
- '404':
4690
- $ref: '#/components/responses/not-found'
4691
- '422':
4692
- $ref: '#/components/responses/unprocessable-entity'
4693
- summary: Create order line item
4694
- description: Creates a line item for an order.
4695
- operationId: create-order-line-item
4696
- tags:
4697
- - Line items
4698
- security:
4699
- - api-key: []
4700
- - order-token: []
4701
- requestBody:
4702
- $ref: '#/components/requestBodies/line-item-input'
5539
+ content:
5540
+ application/json:
5541
+ schema:
5542
+ $ref: '#/components/schemas/coupon-code-input'
5543
+ examples:
5544
+ Example:
5545
+ value:
5546
+ coupon_code: off-20
4703
5547
  parameters:
4704
5548
  - name: order_number
4705
5549
  in: path
4706
5550
  required: true
4707
5551
  schema:
4708
5552
  type: string
5553
+ description: The order number
4709
5554
  /shipments:
4710
5555
  post:
4711
5556
  responses:
@@ -4720,7 +5565,10 @@ paths:
4720
5565
  '422':
4721
5566
  $ref: '#/components/responses/unprocessable-entity'
4722
5567
  summary: Create shipment
4723
- description: Creates a shipment.
5568
+ description: |-
5569
+ Creates a shipment.
5570
+
5571
+ Please note that this request can be only performed by users with the `create` permission on the shipment.
4724
5572
  operationId: create-shipment
4725
5573
  tags:
4726
5574
  - Shipments
@@ -4738,6 +5586,12 @@ paths:
4738
5586
  type: integer
4739
5587
  quantity:
4740
5588
  type: integer
5589
+ examples:
5590
+ Example:
5591
+ value:
5592
+ stock_location_id: 0
5593
+ variant_id: 0
5594
+ quantity: 0
4741
5595
  /shipments/transfer_to_location:
4742
5596
  post:
4743
5597
  responses:
@@ -4846,12 +5700,15 @@ paths:
4846
5700
  name: id
4847
5701
  schema:
4848
5702
  type: integer
5703
+ description: The id of the Taxon
4849
5704
  - $ref: '#/components/parameters/page'
4850
5705
  - $ref: '#/components/parameters/per_page'
5706
+ - $ref: '#/components/parameters/q'
4851
5707
  - in: query
4852
5708
  name: simple
4853
5709
  schema:
4854
5710
  type: boolean
5711
+ description: Returns a simplified version of the JSON
4855
5712
  security:
4856
5713
  - api-key: []
4857
5714
  '/orders/{order_number}/customer_returns':
@@ -4882,6 +5739,7 @@ paths:
4882
5739
  parameters:
4883
5740
  - $ref: '#/components/parameters/page'
4884
5741
  - $ref: '#/components/parameters/per_page'
5742
+ - $ref: '#/components/parameters/q'
4885
5743
  security:
4886
5744
  - api-key: []
4887
5745
  parameters:
@@ -4890,6 +5748,7 @@ paths:
4890
5748
  schema:
4891
5749
  type: string
4892
5750
  required: true
5751
+ description: The order number
4893
5752
  post:
4894
5753
  responses:
4895
5754
  '200':
@@ -4905,12 +5764,21 @@ paths:
4905
5764
  '422':
4906
5765
  $ref: '#/components/responses/unprocessable-entity'
4907
5766
  summary: Create order customer return
4908
- description: Creates a customer return for an order.
5767
+ description: |-
5768
+ Creates a customer return for an order.
5769
+
5770
+ Only users with the `create` permission on `Spree::CustomerReturn` can perform this action.
4909
5771
  operationId: create-order-customer-return
4910
5772
  tags:
4911
5773
  - Customer returns
4912
5774
  requestBody:
4913
- $ref: '#/components/requestBodies/customer-return-input'
5775
+ content:
5776
+ application/json:
5777
+ schema:
5778
+ type: object
5779
+ properties:
5780
+ customer_return:
5781
+ $ref: '#/components/schemas/customer-return-input'
4914
5782
  security:
4915
5783
  - api-key: []
4916
5784
  tags:
@@ -4964,6 +5832,12 @@ components:
4964
5832
  schema:
4965
5833
  type: integer
4966
5834
  default: 25
5835
+ q:
5836
+ name: q
5837
+ in: query
5838
+ schema:
5839
+ example: '?q[attribute_eq]=value'
5840
+ description: 'Allows to query results based on search filters provided by Ransack (https://github.com/activerecord-hackery/ransack/).'
4967
5841
  responses:
4968
5842
  not-found:
4969
5843
  description: ''
@@ -5004,96 +5878,6 @@ components:
5004
5878
  message:
5005
5879
  type: string
5006
5880
  requestBodies:
5007
- taxon-input:
5008
- content:
5009
- application/json:
5010
- schema:
5011
- $ref: '#/components/schemas/taxon-input'
5012
- line-item-input:
5013
- content:
5014
- application/json:
5015
- schema:
5016
- $ref: '#/components/schemas/line-item-input'
5017
- payment-input:
5018
- content:
5019
- application/json:
5020
- schema:
5021
- $ref: '#/components/schemas/payment-input'
5022
- zone-input:
5023
- content:
5024
- application/json:
5025
- schema:
5026
- $ref: '#/components/schemas/zone-input'
5027
- product-property-input:
5028
- content:
5029
- application/json:
5030
- schema:
5031
- $ref: '#/components/schemas/product-property-input'
5032
- stock-location-input:
5033
- content:
5034
- application/json:
5035
- schema:
5036
- $ref: '#/components/schemas/stock-location-input'
5037
- product-input:
5038
- content:
5039
- application/json:
5040
- schema:
5041
- $ref: '#/components/schemas/product-input'
5042
- property-input:
5043
- content:
5044
- application/json:
5045
- schema:
5046
- $ref: '#/components/schemas/property-input'
5047
- address-input:
5048
- content:
5049
- application/json:
5050
- schema:
5051
- $ref: '#/components/schemas/address-input'
5052
- order-input:
5053
- content:
5054
- application/json:
5055
- schema:
5056
- $ref: '#/components/schemas/order-input'
5057
- image-input:
5058
- content:
5059
- application/json:
5060
- schema:
5061
- $ref: '#/components/schemas/image-input'
5062
- variant-input:
5063
- content:
5064
- application/json:
5065
- schema:
5066
- $ref: '#/components/schemas/variant-input'
5067
- user-input:
5068
- content:
5069
- application/json:
5070
- schema:
5071
- $ref: '#/components/schemas/user-input'
5072
- return-authorization-input:
5073
- content:
5074
- application/json:
5075
- schema:
5076
- $ref: '#/components/schemas/return-authorization-input'
5077
- customer-return-input:
5078
- content:
5079
- application/json:
5080
- schema:
5081
- $ref: '#/components/schemas/customer-return-input'
5082
- option-value-input:
5083
- content:
5084
- application/json:
5085
- schema:
5086
- $ref: '#/components/schemas/option-value-input'
5087
- stock-item-input:
5088
- content:
5089
- application/json:
5090
- schema:
5091
- $ref: '#/components/schemas/stock-item-input'
5092
- taxonomy-input:
5093
- content:
5094
- application/json:
5095
- schema:
5096
- $ref: '#/components/schemas/taxonomy-input'
5097
5881
  complete-checkoutBody:
5098
5882
  content:
5099
5883
  application/json:
@@ -5102,11 +5886,6 @@ components:
5102
5886
  properties:
5103
5887
  expected_total:
5104
5888
  type: string
5105
- coupon-code-input:
5106
- content:
5107
- application/json:
5108
- schema:
5109
- $ref: '#/components/schemas/coupon-code-input'
5110
5889
  add-shipment-itemBody:
5111
5890
  content:
5112
5891
  application/json:
@@ -6043,12 +6822,18 @@ components:
6043
6822
  properties:
6044
6823
  success:
6045
6824
  type: string
6825
+ description: Message returned if the coupon has been applied.
6046
6826
  error:
6047
6827
  type: string
6828
+ description: Message returned if there are errors applying the coupon.
6048
6829
  successful:
6049
6830
  type: boolean
6050
6831
  status_code:
6051
6832
  type: string
6833
+ description: |-
6834
+ When applying a coupon code, it can be: `coupon_code_applied`, `coupon_code_unknown_error`, `coupon_code_max_usage`, `coupon_code_not_eligible`, `coupon_code_already_applied`, `coupon_code_expired` or `coupon_code_not_found`.
6835
+
6836
+ When removing a coupon code, it can be: `coupon_code_removed`, `coupon_code_not_present`, `coupon_code_not_found`.
6052
6837
  address-book:
6053
6838
  type: array
6054
6839
  title: Address book
@@ -6128,19 +6913,20 @@ components:
6128
6913
  type: string
6129
6914
  abbr:
6130
6915
  type: string
6916
+ description: ''
6131
6917
  line-item-input:
6132
6918
  type: object
6133
6919
  title: Line item input
6134
6920
  properties:
6135
6921
  quantity:
6136
6922
  type: integer
6137
- description: 'Passing `0`, the line item will be removed.'
6923
+ description: 'Passing `0`, the line item will be removed. When omitted creating a line item, quantity will be `1`.'
6138
6924
  options:
6139
6925
  type: object
6140
6926
  description: 'This field can be used to pass custom line item attributes. When used, it will force a new price calculation, unless `price` is one of the options.'
6141
6927
  id:
6142
6928
  type: integer
6143
- description: Required for existing line items only.
6929
+ description: 'Required when updating existing line items, only when not already present in the Path Parameters.'
6144
6930
  variant_id:
6145
6931
  type: integer
6146
6932
  description: Required for new line items only.
@@ -6164,30 +6950,6 @@ components:
6164
6950
  type: string
6165
6951
  presentation:
6166
6952
  type: string
6167
- checkout-input:
6168
- type: object
6169
- title: Checkout input
6170
- properties:
6171
- coupon_code:
6172
- type: string
6173
- email:
6174
- type: string
6175
- special_instructions:
6176
- type: string
6177
- use_billing:
6178
- type: boolean
6179
- bill_address_attributes:
6180
- $ref: '#/components/schemas/address-input'
6181
- ship_address_attributes:
6182
- $ref: '#/components/schemas/address-input'
6183
- payments_attributes:
6184
- type: array
6185
- items:
6186
- $ref: '#/components/schemas/payment-input'
6187
- shipments_attributes:
6188
- type: array
6189
- items:
6190
- $ref: '#/components/schemas/shipment-input'
6191
6953
  credit-card-update-input:
6192
6954
  type: object
6193
6955
  title: Credit card update input
@@ -6222,10 +6984,9 @@ components:
6222
6984
  type: string
6223
6985
  payment_method_id:
6224
6986
  type: integer
6225
- payment_method:
6226
- type: string
6227
6987
  source_attributes:
6228
6988
  type: object
6989
+ description: This field is required for Payment Method that has source_required? returning true.
6229
6990
  properties:
6230
6991
  number:
6231
6992
  type: string
@@ -6271,14 +7032,29 @@ components:
6271
7032
  type: integer
6272
7033
  order-input:
6273
7034
  title: Order input
6274
- allOf:
6275
- - $ref: '#/components/schemas/checkout-input'
6276
- - type: object
6277
- properties:
6278
- line_items_attributes:
6279
- type: array
6280
- items:
6281
- $ref: '#/components/schemas/line-item-input'
7035
+ properties:
7036
+ email:
7037
+ type: string
7038
+ special_instructions:
7039
+ type: string
7040
+ use_billing:
7041
+ type: boolean
7042
+ bill_address_attributes:
7043
+ $ref: '#/components/schemas/address-input'
7044
+ ship_address_attributes:
7045
+ $ref: '#/components/schemas/address-input'
7046
+ payments_attributes:
7047
+ type: array
7048
+ items:
7049
+ $ref: '#/components/schemas/payment-input'
7050
+ shipments_attributes:
7051
+ type: array
7052
+ items:
7053
+ $ref: '#/components/schemas/shipment-input'
7054
+ line_items_attributes:
7055
+ type: array
7056
+ items:
7057
+ $ref: '#/components/schemas/line-item-input'
6282
7058
  product-input:
6283
7059
  type: object
6284
7060
  title: Product input
@@ -6289,8 +7065,6 @@ components:
6289
7065
  type: string
6290
7066
  available_on:
6291
7067
  type: string
6292
- permalink:
6293
- type: string
6294
7068
  meta_description:
6295
7069
  type: string
6296
7070
  meta_keywords:
@@ -6316,13 +7090,11 @@ components:
6316
7090
  tax_category_id:
6317
7091
  type: integer
6318
7092
  taxon_ids:
6319
- type: array
6320
- items:
6321
- type: integer
7093
+ type: string
7094
+ description: 'Comma separated list of taxon ids. Eg. "1,2"'
6322
7095
  option_type_ids:
6323
- type: array
6324
- items:
6325
- type: integer
7096
+ description: 'Comma separated list of option type ids ids. Eg. "1,2"'
7097
+ type: string
6326
7098
  cost_currency:
6327
7099
  type: string
6328
7100
  cost_price:
@@ -6359,28 +7131,16 @@ components:
6359
7131
  type: object
6360
7132
  title: Variant input
6361
7133
  properties:
6362
- name:
6363
- type: string
6364
- presentation:
7134
+ price:
6365
7135
  type: string
6366
7136
  cost_price:
6367
7137
  type: string
6368
- lock_version:
6369
- type: string
6370
7138
  position:
6371
7139
  type: integer
6372
7140
  track_inventory:
6373
7141
  type: boolean
6374
7142
  product_id:
6375
7143
  type: integer
6376
- product:
6377
- type: integer
6378
- option_values_attributes:
6379
- type: array
6380
- items:
6381
- $ref: '#/components/schemas/option-value-input'
6382
- price:
6383
- type: string
6384
7144
  weight:
6385
7145
  type: string
6386
7146
  height:
@@ -6397,13 +7157,20 @@ components:
6397
7157
  type: array
6398
7158
  items:
6399
7159
  type: integer
7160
+ option_values_attributes:
7161
+ type: array
7162
+ items:
7163
+ $ref: '#/components/schemas/option-value-input'
6400
7164
  options:
6401
7165
  type: object
7166
+ description: '`Name` will be the name/presentation of the option type and `Value` will be the name/presentation of the option value. They will be created if not exist.'
6402
7167
  properties:
6403
7168
  name:
6404
7169
  type: string
6405
7170
  value:
6406
7171
  type: string
7172
+ required:
7173
+ - price
6407
7174
  property-input:
6408
7175
  type: object
6409
7176
  title: Property input
@@ -6480,6 +7247,8 @@ components:
6480
7247
  properties:
6481
7248
  name:
6482
7249
  type: string
7250
+ required:
7251
+ - name
6483
7252
  taxon-input:
6484
7253
  type: object
6485
7254
  title: Taxon input