solidus_api 3.0.1 → 3.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/openapi/solidus-api.oas.yml +1083 -356
  3. metadata +8 -8
@@ -60,7 +60,37 @@ paths:
60
60
  security:
61
61
  - api-key: []
62
62
  requestBody:
63
- $ref: '#/components/requestBodies/product-input'
63
+ content:
64
+ application/json:
65
+ schema:
66
+ type: object
67
+ properties:
68
+ product:
69
+ $ref: '#/components/schemas/product-input'
70
+ examples:
71
+ Example:
72
+ value:
73
+ product:
74
+ name: The Majestic Product
75
+ price: '19.99'
76
+ shipping_category_id: 8
77
+ product_properties_attributes:
78
+ - property_name: fabric
79
+ value: cotton
80
+ option_types:
81
+ - size
82
+ - color
83
+ taxon_ids: '2,4'
84
+ variants:
85
+ - price: 19.99
86
+ cost_price: 17
87
+ sku: SKU-3
88
+ track_inventory: true
89
+ options:
90
+ - name: size
91
+ value: small
92
+ - name: color
93
+ value: black
64
94
  /orders/mine:
65
95
  get:
66
96
  responses:
@@ -116,6 +146,7 @@ paths:
116
146
  required: true
117
147
  schema:
118
148
  type: string
149
+ description: The order number
119
150
  patch:
120
151
  responses:
121
152
  '200':
@@ -131,7 +162,10 @@ paths:
131
162
  '422':
132
163
  $ref: '#/components/responses/unprocessable-entity'
133
164
  summary: Update order
134
- description: Updates an order.
165
+ description: |-
166
+ Updates an order.
167
+
168
+ 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
169
  operationId: update-order
136
170
  tags:
137
171
  - Orders
@@ -139,7 +173,42 @@ paths:
139
173
  - api-key: []
140
174
  - order-token: []
141
175
  requestBody:
142
- $ref: '#/components/requestBodies/order-input'
176
+ content:
177
+ application/json:
178
+ schema:
179
+ type: object
180
+ properties:
181
+ order:
182
+ $ref: '#/components/schemas/order-input'
183
+ examples:
184
+ Updating Billing Address:
185
+ value:
186
+ order:
187
+ use_billing: true
188
+ ship_address_attributes:
189
+ name: Jane Doe
190
+ address1: 2191 Calico Drive
191
+ city: Phoenix
192
+ country_id: 22
193
+ state_id: 31
194
+ zipcode: '85022'
195
+ phone: 509-644-9988
196
+ company: Acme Inc.
197
+ Select a Shipment's Shipping Rate:
198
+ value:
199
+ order:
200
+ shipments_attributes:
201
+ - id: 2
202
+ selected_shipping_rate_id: 23
203
+ Updating Payment:
204
+ value:
205
+ order:
206
+ payments_attributes:
207
+ - amount: '42.42'
208
+ payment_method_id: 1
209
+ source_attributes:
210
+ gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
211
+ description: ''
143
212
  /orders/current:
144
213
  get:
145
214
  responses:
@@ -344,7 +413,19 @@ paths:
344
413
  security:
345
414
  - api-key: []
346
415
  requestBody:
347
- $ref: '#/components/requestBodies/product-input'
416
+ content:
417
+ application/json:
418
+ schema:
419
+ type: object
420
+ properties:
421
+ product:
422
+ $ref: '#/components/schemas/product-input'
423
+ examples:
424
+ Example:
425
+ value:
426
+ product:
427
+ name: The Majestic Product
428
+ price: '22.22'
348
429
  '/products/{product_id}/images':
349
430
  get:
350
431
  responses:
@@ -391,14 +472,23 @@ paths:
391
472
  '422':
392
473
  $ref: '#/components/responses/unprocessable-entity'
393
474
  summary: Create product image
394
- description: Creates an image for a product.
475
+ description: |-
476
+ Creates an image for a product.
477
+
478
+ Only users with the `create` permission on `Spree::Image` can perform this action.
395
479
  operationId: create-product-image
396
480
  tags:
397
481
  - Images
398
482
  security:
399
483
  - api-key: []
400
484
  requestBody:
401
- $ref: '#/components/requestBodies/image-input'
485
+ content:
486
+ application/json:
487
+ schema:
488
+ type: object
489
+ properties:
490
+ image:
491
+ $ref: '#/components/schemas/image-input'
402
492
  '/products/{product_id}/variants':
403
493
  get:
404
494
  responses:
@@ -456,7 +546,38 @@ paths:
456
546
  security:
457
547
  - api-key: []
458
548
  requestBody:
459
- $ref: '#/components/requestBodies/variant-input'
549
+ content:
550
+ application/json:
551
+ schema:
552
+ type: object
553
+ properties:
554
+ variant:
555
+ $ref: '#/components/schemas/variant-input'
556
+ examples:
557
+ Example with Option Value Ids:
558
+ value:
559
+ variant:
560
+ price: '11.22'
561
+ cost_price: '9'
562
+ position: 1
563
+ track_inventory: true
564
+ sku: AWSOME-1122
565
+ cost_currency: USD
566
+ option_value_ids:
567
+ - 1
568
+ - 2
569
+ Example with Option Value Text:
570
+ value:
571
+ variant:
572
+ price: '11.22'
573
+ cost_price: '9'
574
+ position: 1
575
+ track_inventory: true
576
+ sku: AWSOME-1122
577
+ cost_currency: USD
578
+ options:
579
+ name: Color
580
+ value: White
460
581
  '/products/{product_id}/images/{id}':
461
582
  get:
462
583
  responses:
@@ -483,11 +604,13 @@ paths:
483
604
  required: true
484
605
  schema:
485
606
  type: string
607
+ description: 'The id of the Spree::Product'
486
608
  - name: id
487
609
  in: path
488
610
  required: true
489
611
  schema:
490
612
  type: string
613
+ description: 'The id of the Spree::Image'
491
614
  delete:
492
615
  responses:
493
616
  '204':
@@ -524,14 +647,23 @@ paths:
524
647
  '422':
525
648
  $ref: '#/components/responses/unprocessable-entity'
526
649
  summary: Update product image
527
- description: Updates a product's image.
650
+ description: |-
651
+ Updates a product's image.
652
+
653
+ Only users with the `update` permission on the image can perform this action.
528
654
  operationId: update-product-image
529
655
  tags:
530
656
  - Images
531
657
  security:
532
658
  - api-key: []
533
659
  requestBody:
534
- $ref: '#/components/requestBodies/image-input'
660
+ content:
661
+ application/json:
662
+ schema:
663
+ type: object
664
+ properties:
665
+ image:
666
+ $ref: '#/components/schemas/image-input'
535
667
  '/products/{product_id}/variants/{id}':
536
668
  get:
537
669
  responses:
@@ -606,7 +738,38 @@ paths:
606
738
  security:
607
739
  - api-key: []
608
740
  requestBody:
609
- $ref: '#/components/requestBodies/variant-input'
741
+ content:
742
+ application/json:
743
+ schema:
744
+ type: object
745
+ properties:
746
+ variant:
747
+ $ref: '#/components/schemas/variant-input'
748
+ examples:
749
+ Example with Option Value Ids:
750
+ value:
751
+ variant:
752
+ price: '11.22'
753
+ cost_price: '9'
754
+ position: 1
755
+ track_inventory: true
756
+ sku: AWSOME-1122
757
+ cost_currency: USD
758
+ option_value_ids:
759
+ - 1
760
+ - 2
761
+ Example with Option Value Text:
762
+ value:
763
+ variant:
764
+ price: '11.22'
765
+ cost_price: '9'
766
+ position: 1
767
+ track_inventory: true
768
+ sku: AWSOME-1122
769
+ cost_currency: USD
770
+ options:
771
+ name: Color
772
+ value: White
610
773
  /states:
611
774
  get:
612
775
  responses:
@@ -689,14 +852,49 @@ paths:
689
852
  '422':
690
853
  $ref: '#/components/responses/unprocessable-entity'
691
854
  summary: Create variant
692
- description: Creates a variant.
855
+ description: 'Creates a variant. Only users with `can :create, Variant` permissions can perform this action.'
693
856
  operationId: create-variant
694
857
  tags:
695
858
  - Variants
696
859
  security:
697
860
  - api-key: []
698
861
  requestBody:
699
- $ref: '#/components/requestBodies/variant-input'
862
+ content:
863
+ application/json:
864
+ schema:
865
+ type: object
866
+ properties:
867
+ product_id:
868
+ type: integer
869
+ variant:
870
+ $ref: '#/components/schemas/variant-input'
871
+ examples:
872
+ Example with Option Value Ids:
873
+ value:
874
+ product_id: 1
875
+ variant:
876
+ price: '11.22'
877
+ cost_price: '9'
878
+ position: 1
879
+ track_inventory: true
880
+ sku: AWSOME-1122
881
+ cost_currency: USD
882
+ option_value_ids:
883
+ - 1
884
+ - 2
885
+ Example with Option Value Text:
886
+ value:
887
+ product_id: 1
888
+ variant:
889
+ price: '11.22'
890
+ cost_price: '9'
891
+ position: 1
892
+ track_inventory: true
893
+ sku: AWSOME-1122
894
+ cost_currency: USD
895
+ options:
896
+ name: Color
897
+ value: White
700
898
  '/variants/{id}':
701
899
  get:
702
900
  responses:
@@ -766,7 +964,38 @@ paths:
766
964
  security:
767
965
  - api-key: []
768
966
  requestBody:
769
- $ref: '#/components/requestBodies/variant-input'
967
+ content:
968
+ application/json:
969
+ schema:
970
+ type: object
971
+ properties:
972
+ variant:
973
+ $ref: '#/components/schemas/variant-input'
974
+ examples:
975
+ Example with Option Value Ids:
976
+ value:
977
+ variant:
978
+ price: '11.22'
979
+ cost_price: '9'
980
+ position: 1
981
+ track_inventory: true
982
+ sku: AWSOME-1122
983
+ cost_currency: USD
984
+ option_value_ids:
985
+ - 1
986
+ - 2
987
+ Example with Option Value Text:
988
+ value:
989
+ variant:
990
+ price: '11.22'
991
+ cost_price: '9'
992
+ position: 1
993
+ track_inventory: true
994
+ sku: AWSOME-1122
995
+ cost_currency: USD
996
+ options:
997
+ name: Color
998
+ value: White
770
999
  '/variants/{variant_id}/images':
771
1000
  get:
772
1001
  responses:
@@ -813,14 +1042,23 @@ paths:
813
1042
  '422':
814
1043
  $ref: '#/components/responses/unprocessable-entity'
815
1044
  summary: Create variant image
816
- description: Creates an image for a variant.
1045
+ description: |-
1046
+ Creates an image for a variant.
1047
+
1048
+ Only users with the `create` permission on `Spree::Image` can perform this action.
817
1049
  operationId: create-variant-image
818
1050
  tags:
819
1051
  - Images
820
1052
  security:
821
1053
  - api-key: []
822
1054
  requestBody:
823
- $ref: '#/components/requestBodies/image-input'
1055
+ content:
1056
+ application/json:
1057
+ schema:
1058
+ type: object
1059
+ properties:
1060
+ image:
1061
+ $ref: '#/components/schemas/image-input'
824
1062
  '/variants/{variant_id}/images/{id}':
825
1063
  get:
826
1064
  responses:
@@ -847,11 +1085,13 @@ paths:
847
1085
  required: true
848
1086
  schema:
849
1087
  type: string
1088
+ description: 'The id of the Spree::Variant'
850
1089
  - name: id
851
1090
  in: path
852
1091
  required: true
853
1092
  schema:
854
1093
  type: string
1094
+ description: 'The id of the Spree::Image'
855
1095
  delete:
856
1096
  responses:
857
1097
  '204':
@@ -888,14 +1128,23 @@ paths:
888
1128
  '422':
889
1129
  $ref: '#/components/responses/unprocessable-entity'
890
1130
  summary: Update variant image
891
- description: Updates a variant's image.
1131
+ description: |-
1132
+ Updates a variant's image.
1133
+
1134
+ Only users with the `update` permission on the image can perform this action.
892
1135
  operationId: update-variant-image
893
1136
  tags:
894
1137
  - Images
895
1138
  security:
896
1139
  - api-key: []
897
1140
  requestBody:
898
- $ref: '#/components/requestBodies/image-input'
1141
+ content:
1142
+ application/json:
1143
+ schema:
1144
+ type: object
1145
+ properties:
1146
+ image:
1147
+ $ref: '#/components/schemas/image-input'
899
1148
  '/shipments/{shipment_number}/estimated_rates':
900
1149
  get:
901
1150
  responses:
@@ -982,6 +1231,7 @@ paths:
982
1231
  required: true
983
1232
  schema:
984
1233
  type: string
1234
+ description: 'The ID of the Spree::User'
985
1235
  delete:
986
1236
  responses:
987
1237
  '204':
@@ -1018,14 +1268,23 @@ paths:
1018
1268
  '422':
1019
1269
  $ref: '#/components/responses/unprocessable-entity'
1020
1270
  summary: Update user
1021
- description: Updates a user.
1271
+ description: |-
1272
+ Updates a user.
1273
+
1274
+ Only users with the `update` permission on the user can perform this action.
1022
1275
  operationId: update-user
1023
1276
  tags:
1024
1277
  - Users
1025
1278
  security:
1026
1279
  - api-key: []
1027
1280
  requestBody:
1028
- $ref: '#/components/requestBodies/user-input'
1281
+ content:
1282
+ application/json:
1283
+ schema:
1284
+ type: object
1285
+ properties:
1286
+ user:
1287
+ $ref: '#/components/schemas/user-input'
1029
1288
  '/users/{user_id}/address_book':
1030
1289
  get:
1031
1290
  responses:
@@ -1203,7 +1462,36 @@ paths:
1203
1462
  - api-key: []
1204
1463
  - order-token: []
1205
1464
  requestBody:
1206
- $ref: '#/components/requestBodies/address-input'
1465
+ content:
1466
+ application/json:
1467
+ schema:
1468
+ type: object
1469
+ properties:
1470
+ address:
1471
+ $ref: '#/components/schemas/address-input'
1472
+ examples:
1473
+ Example with state_id:
1474
+ value:
1475
+ address:
1476
+ name: Jane Doe
1477
+ address1: 2191 Calico Drive
1478
+ city: Phoenix
1479
+ country_id: 22
1480
+ state_id: 31
1481
+ zipcode: '85022'
1482
+ phone: 509-644-9988
1483
+ company: Acme Inc.
1484
+ Example with state_name:
1485
+ value:
1486
+ address:
1487
+ name: Jane Doe
1488
+ address1: 2191 Calico Drive
1489
+ city: Phoenix
1490
+ country_id: 22
1491
+ state_name: AZ
1492
+ zipcode: '85022'
1493
+ phone: 509-644-9988
1494
+ company: Acme Inc.
1207
1495
  '/checkouts/{checkout_id}/payments':
1208
1496
  get:
1209
1497
  responses:
@@ -1225,7 +1513,7 @@ paths:
1225
1513
  '404':
1226
1514
  $ref: '#/components/responses/not-found'
1227
1515
  summary: List checkout payments
1228
- description: Lists a checkout's payments.
1516
+ 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
1517
  operationId: list-checkout-payments
1230
1518
  tags:
1231
1519
  - Payments
@@ -1256,7 +1544,7 @@ paths:
1256
1544
  '422':
1257
1545
  $ref: '#/components/responses/unprocessable-entity'
1258
1546
  summary: Create checkout payment
1259
- description: Creates a new payment for a checkout.
1547
+ 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
1548
  operationId: create-checkout-payment
1261
1549
  tags:
1262
1550
  - Payments
@@ -1264,7 +1552,30 @@ paths:
1264
1552
  - api-key: []
1265
1553
  - order-token: []
1266
1554
  requestBody:
1267
- $ref: '#/components/requestBodies/payment-input'
1555
+ content:
1556
+ application/json:
1557
+ schema:
1558
+ type: object
1559
+ properties:
1560
+ payment:
1561
+ $ref: '#/components/schemas/payment-input'
1562
+ examples:
1563
+ Example without a payment source:
1564
+ value:
1565
+ payment:
1566
+ amount: '42.42'
1567
+ payment_method_id: 1
1568
+ Example with a payment source:
1569
+ value:
1570
+ payment:
1571
+ amount: '42.42'
1572
+ payment_method_id: 1
1573
+ source_attributes:
1574
+ gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
1575
+ description: |-
1576
+ This requests only accepts available Payment Methods in the `payment_method_id` field.
1577
+
1578
+ 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
1579
  '/checkouts/{checkout_id}/payments/{id}':
1269
1580
  get:
1270
1581
  responses:
@@ -1296,6 +1607,7 @@ paths:
1296
1607
  - name: id
1297
1608
  in: path
1298
1609
  required: true
1610
+ description: The payment id
1299
1611
  schema:
1300
1612
  type: string
1301
1613
  patch:
@@ -1308,12 +1620,21 @@ paths:
1308
1620
  $ref: '#/components/schemas/payment'
1309
1621
  '401':
1310
1622
  $ref: '#/components/responses/invalid-api-key'
1623
+ '403':
1624
+ description: 'Forbidden '
1625
+ content:
1626
+ application/json:
1627
+ schema:
1628
+ type: object
1629
+ properties:
1630
+ error:
1631
+ type: string
1311
1632
  '404':
1312
1633
  $ref: '#/components/responses/not-found'
1313
1634
  '422':
1314
1635
  $ref: '#/components/responses/unprocessable-entity'
1315
1636
  summary: Update checkout payment
1316
- description: Updates a checkout's payment.
1637
+ 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
1638
  operationId: update-checkout-payment
1318
1639
  tags:
1319
1640
  - Payments
@@ -1326,12 +1647,13 @@ paths:
1326
1647
  schema:
1327
1648
  type: object
1328
1649
  properties:
1329
- amount:
1330
- type: number
1331
- payment_method_id:
1332
- type: integer
1333
- payment_method:
1334
- $ref: '#/components/schemas/payment-method'
1650
+ payment:
1651
+ $ref: '#/components/schemas/payment-input'
1652
+ examples:
1653
+ Example:
1654
+ value:
1655
+ payment:
1656
+ amount: '12.10'
1335
1657
  '/checkouts/{checkout_id}/return_authorizations':
1336
1658
  get:
1337
1659
  responses:
@@ -1384,14 +1706,23 @@ paths:
1384
1706
  '422':
1385
1707
  $ref: '#/components/responses/unprocessable-entity'
1386
1708
  summary: Create checkout return authorization
1387
- description: Creates a return authorization for a checkout.
1709
+ description: |-
1710
+ Creates a return authorization for a checkout.
1711
+
1712
+ Only users with the `create` permission on `Spree::RetrunAuthorization` can perform this action.
1388
1713
  operationId: create-checkout-return-authorization
1389
1714
  tags:
1390
1715
  - Return authorizations
1391
1716
  security:
1392
1717
  - api-key: []
1393
1718
  requestBody:
1394
- $ref: '#/components/requestBodies/return-authorization-input'
1719
+ content:
1720
+ application/json:
1721
+ schema:
1722
+ type: object
1723
+ properties:
1724
+ return_authorization:
1725
+ $ref: '#/components/schemas/return-authorization-input'
1395
1726
  '/checkouts/{checkout_id}/return_authorizations/{id}':
1396
1727
  get:
1397
1728
  responses:
@@ -1423,6 +1754,7 @@ paths:
1423
1754
  required: true
1424
1755
  schema:
1425
1756
  type: string
1757
+ description: 'The ID of the Spree::ReturnAuthorization'
1426
1758
  delete:
1427
1759
  responses:
1428
1760
  '204':
@@ -1459,14 +1791,23 @@ paths:
1459
1791
  '422':
1460
1792
  $ref: '#/components/responses/unprocessable-entity'
1461
1793
  summary: Update checkout return authorization
1462
- description: Updates a checkout's return authorization.
1794
+ description: |-
1795
+ Updates a checkout's return authorization.
1796
+
1797
+ Only users with the `update` permission on the return authorization can perform this action.
1463
1798
  operationId: update-checkout-return-authorization
1464
1799
  tags:
1465
1800
  - Return authorizations
1466
1801
  security:
1467
1802
  - api-key: []
1468
1803
  requestBody:
1469
- $ref: '#/components/requestBodies/return-authorization-input'
1804
+ content:
1805
+ application/json:
1806
+ schema:
1807
+ type: object
1808
+ properties:
1809
+ return_authorization:
1810
+ $ref: '#/components/schemas/return-authorization-input'
1470
1811
  '/orders/{order_id}/customer_returns/{id}':
1471
1812
  get:
1472
1813
  responses:
@@ -1496,6 +1837,7 @@ paths:
1496
1837
  - name: id
1497
1838
  in: path
1498
1839
  required: true
1840
+ description: The id of the customer return
1499
1841
  schema:
1500
1842
  type: string
1501
1843
  put:
@@ -1513,12 +1855,21 @@ paths:
1513
1855
  '422':
1514
1856
  $ref: '#/components/responses/unprocessable-entity'
1515
1857
  summary: Update order customer return
1516
- description: Updates an orders customer return.
1858
+ description: |-
1859
+ Updates an orders customer return.
1860
+
1861
+ Only users with the `update` permission on the customer return can perform this action.
1517
1862
  operationId: update-order-customer-return
1518
1863
  tags:
1519
1864
  - Customer returns
1520
1865
  requestBody:
1521
- $ref: '#/components/requestBodies/customer-return-input'
1866
+ content:
1867
+ application/json:
1868
+ schema:
1869
+ type: object
1870
+ properties:
1871
+ customer_return:
1872
+ $ref: '#/components/schemas/customer-return-input'
1522
1873
  security:
1523
1874
  - api-key: []
1524
1875
  /orders:
@@ -1569,7 +1920,21 @@ paths:
1569
1920
  security:
1570
1921
  - api-key: []
1571
1922
  requestBody:
1572
- $ref: '#/components/requestBodies/order-input'
1923
+ content:
1924
+ application/json:
1925
+ schema:
1926
+ type: object
1927
+ properties:
1928
+ order:
1929
+ $ref: '#/components/schemas/order-input'
1930
+ examples:
1931
+ Example:
1932
+ value:
1933
+ order:
1934
+ email: string
1935
+ line_items_attributes:
1936
+ - quantity: 1
1937
+ variant_id: 22
1573
1938
  '/orders/{order_number}/addresses/{id}':
1574
1939
  get:
1575
1940
  responses:
@@ -1595,11 +1960,13 @@ paths:
1595
1960
  - name: order_number
1596
1961
  in: path
1597
1962
  required: true
1963
+ description: The order number
1598
1964
  schema:
1599
1965
  type: string
1600
1966
  - name: id
1601
1967
  in: path
1602
1968
  required: true
1969
+ description: The id of the order's address that we want to retrieve
1603
1970
  schema:
1604
1971
  type: string
1605
1972
  patch:
@@ -1625,7 +1992,36 @@ paths:
1625
1992
  - api-key: []
1626
1993
  - order-token: []
1627
1994
  requestBody:
1628
- $ref: '#/components/requestBodies/address-input'
1995
+ content:
1996
+ application/json:
1997
+ schema:
1998
+ type: object
1999
+ properties:
2000
+ address:
2001
+ $ref: '#/components/schemas/address-input'
2002
+ examples:
2003
+ Example with state_id:
2004
+ value:
2005
+ address:
2006
+ name: Jane Doe
2007
+ address1: 2191 Calico Drive
2008
+ city: Phoenix
2009
+ country_id: 22
2010
+ state_id: 31
2011
+ zipcode: '85022'
2012
+ phone: 509-644-9988
2013
+ company: Acme Inc.
2014
+ Example with state_name:
2015
+ value:
2016
+ address:
2017
+ name: Jane Doe
2018
+ address1: 2191 Calico Drive
2019
+ city: Phoenix
2020
+ country_id: 22
2021
+ state_name: AZ
2022
+ zipcode: '85022'
2023
+ phone: 509-644-9988
2024
+ company: Acme Inc.
1629
2025
  '/orders/{order_number}/payments':
1630
2026
  get:
1631
2027
  responses:
@@ -1664,6 +2060,7 @@ paths:
1664
2060
  - name: order_number
1665
2061
  in: path
1666
2062
  required: true
2063
+ description: The order number
1667
2064
  schema:
1668
2065
  type: string
1669
2066
  post:
@@ -1681,7 +2078,7 @@ paths:
1681
2078
  '422':
1682
2079
  $ref: '#/components/responses/unprocessable-entity'
1683
2080
  summary: Create order payment
1684
- description: Creates a payment for an order.
2081
+ 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
2082
  operationId: create-order-payment
1686
2083
  tags:
1687
2084
  - Payments
@@ -1689,7 +2086,30 @@ paths:
1689
2086
  - api-key: []
1690
2087
  - order-token: []
1691
2088
  requestBody:
1692
- $ref: '#/components/requestBodies/payment-input'
2089
+ content:
2090
+ application/json:
2091
+ schema:
2092
+ type: object
2093
+ properties:
2094
+ payment:
2095
+ $ref: '#/components/schemas/payment-input'
2096
+ examples:
2097
+ Example without a payment source:
2098
+ value:
2099
+ payment:
2100
+ amount: '42.42'
2101
+ payment_method_id: 1
2102
+ Example with a payment source:
2103
+ value:
2104
+ payment:
2105
+ amount: '42.42'
2106
+ payment_method_id: 1
2107
+ source_attributes:
2108
+ gateway_payment_profile_id: super-secret-token-2131m3n13bv3hv1vasda
2109
+ description: |-
2110
+ This requests only accepts available Payment Methods in the `payment_method_id` field.
2111
+
2112
+ 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
2113
  '/orders/{order_number}/payments/{id}':
1694
2114
  get:
1695
2115
  responses:
@@ -1731,12 +2151,21 @@ paths:
1731
2151
  $ref: '#/components/schemas/payment'
1732
2152
  '401':
1733
2153
  $ref: '#/components/responses/invalid-api-key'
2154
+ '403':
2155
+ description: Forbidden
2156
+ content:
2157
+ application/json:
2158
+ schema:
2159
+ type: object
2160
+ properties:
2161
+ error:
2162
+ type: string
1734
2163
  '404':
1735
2164
  $ref: '#/components/responses/not-found'
1736
2165
  '422':
1737
2166
  $ref: '#/components/responses/unprocessable-entity'
1738
2167
  summary: Update order payment
1739
- description: Updates an order's payment.
2168
+ 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
2169
  operationId: update-order-payment
1741
2170
  tags:
1742
2171
  - Payments
@@ -1744,7 +2173,18 @@ paths:
1744
2173
  - api-key: []
1745
2174
  - order-token: []
1746
2175
  requestBody:
1747
- $ref: '#/components/requestBodies/payment-input'
2176
+ content:
2177
+ application/json:
2178
+ schema:
2179
+ type: object
2180
+ properties:
2181
+ payment:
2182
+ $ref: '#/components/schemas/payment-input'
2183
+ examples:
2184
+ Example:
2185
+ value:
2186
+ payment:
2187
+ amount: '12.10'
1748
2188
  '/orders/{order_number}/return_authorizations':
1749
2189
  get:
1750
2190
  responses:
@@ -1796,14 +2236,23 @@ paths:
1796
2236
  '422':
1797
2237
  $ref: '#/components/responses/unprocessable-entity'
1798
2238
  summary: Create order return authorization
1799
- description: Creates a return authorization for an order.
2239
+ description: |-
2240
+ Creates a return authorization for an order.
2241
+
2242
+ Only users with the `create` permission on `Spree::ReturnAuthorization` can perform this action.
1800
2243
  operationId: create-order-return-authorization
1801
2244
  tags:
1802
2245
  - Return authorizations
1803
2246
  security:
1804
2247
  - api-key: []
1805
2248
  requestBody:
1806
- $ref: '#/components/requestBodies/return-authorization-input'
2249
+ content:
2250
+ application/json:
2251
+ schema:
2252
+ type: object
2253
+ properties:
2254
+ return_authorization:
2255
+ $ref: '#/components/schemas/return-authorization-input'
1807
2256
  '/orders/{order_number}/return_authorizations/{id}':
1808
2257
  get:
1809
2258
  responses:
@@ -1830,11 +2279,13 @@ paths:
1830
2279
  required: true
1831
2280
  schema:
1832
2281
  type: string
2282
+ description: The Order number
1833
2283
  - name: id
1834
2284
  in: path
1835
2285
  required: true
1836
2286
  schema:
1837
2287
  type: string
2288
+ description: 'The ID of the Spree::ReturnAuthorization'
1838
2289
  delete:
1839
2290
  responses:
1840
2291
  '200':
@@ -1871,14 +2322,23 @@ paths:
1871
2322
  '422':
1872
2323
  $ref: '#/components/responses/unprocessable-entity'
1873
2324
  summary: Update order return authorization
1874
- description: Updates an order's return authorization.
2325
+ description: |-
2326
+ Updates an order's return authorization.
2327
+
2328
+ Only users with the `update` permission on the return authorization can perform this action.
1875
2329
  operationId: update-order-return-authorization
1876
2330
  tags:
1877
2331
  - Return authorizations
1878
2332
  security:
1879
2333
  - api-key: []
1880
2334
  requestBody:
1881
- $ref: '#/components/requestBodies/return-authorization-input'
2335
+ content:
2336
+ application/json:
2337
+ schema:
2338
+ type: object
2339
+ properties:
2340
+ return_authorization:
2341
+ $ref: '#/components/schemas/return-authorization-input'
1882
2342
  /config:
1883
2343
  get:
1884
2344
  responses:
@@ -2071,14 +2531,23 @@ paths:
2071
2531
  '422':
2072
2532
  $ref: '#/components/responses/unprocessable-entity'
2073
2533
  summary: Create option value
2074
- description: Creates an option value.
2534
+ description: |-
2535
+ Creates an option value.
2536
+
2537
+ Only users with the `create` permission on `Spree::OptionValue` can perform this action.
2075
2538
  operationId: create-option-value
2076
2539
  tags:
2077
2540
  - Option values
2078
2541
  security:
2079
2542
  - api-key: []
2080
2543
  requestBody:
2081
- $ref: '#/components/requestBodies/option-value-input'
2544
+ content:
2545
+ application/json:
2546
+ schema:
2547
+ type: object
2548
+ properties:
2549
+ option_value:
2550
+ $ref: '#/components/schemas/option-value-input'
2082
2551
  '/option_values/{id}':
2083
2552
  get:
2084
2553
  responses:
@@ -2105,6 +2574,7 @@ paths:
2105
2574
  required: true
2106
2575
  schema:
2107
2576
  type: string
2577
+ description: 'The ID of the Spree::OptionValue'
2108
2578
  delete:
2109
2579
  responses:
2110
2580
  '204':
@@ -2141,14 +2611,24 @@ paths:
2141
2611
  '422':
2142
2612
  $ref: '#/components/responses/unprocessable-entity'
2143
2613
  summary: Update option value
2144
- description: Updates an option value.
2614
+ description: |-
2615
+ Updates an option value.
2616
+
2617
+ Only users with the `update` permission on the option value can perform this action.
2145
2618
  operationId: update-option-value
2146
2619
  tags:
2147
2620
  - Option values
2148
2621
  security:
2149
2622
  - api-key: []
2150
2623
  requestBody:
2151
- $ref: '#/components/requestBodies/option-value-input'
2624
+ content:
2625
+ application/json:
2626
+ schema:
2627
+ type: object
2628
+ properties:
2629
+ option_value:
2630
+ $ref: '#/components/schemas/option-value-input'
2631
+ description: ''
2152
2632
  '/option_types/{option_type_id}/option_values':
2153
2633
  get:
2154
2634
  responses:
@@ -2177,6 +2657,7 @@ paths:
2177
2657
  required: true
2178
2658
  schema:
2179
2659
  type: string
2660
+ description: 'The ID of the Spree::OptionType'
2180
2661
  post:
2181
2662
  responses:
2182
2663
  '200':
@@ -2192,14 +2673,23 @@ paths:
2192
2673
  '422':
2193
2674
  $ref: '#/components/responses/unprocessable-entity'
2194
2675
  summary: Create option type value
2195
- description: Creates an option value for a type.
2676
+ description: |-
2677
+ Creates an option value for a type.
2678
+
2679
+ Only users with the `create` permission on `Spree::OptionValue` can perform this action.
2196
2680
  operationId: create-option-type-value
2197
2681
  tags:
2198
2682
  - Option values
2199
2683
  security:
2200
2684
  - api-key: []
2201
2685
  requestBody:
2202
- $ref: '#/components/requestBodies/option-value-input'
2686
+ content:
2687
+ application/json:
2688
+ schema:
2689
+ type: object
2690
+ properties:
2691
+ option_value:
2692
+ $ref: '#/components/schemas/option-value-input'
2203
2693
  '/option_types/{option_type_id}/option_values/{id}':
2204
2694
  get:
2205
2695
  responses:
@@ -2225,11 +2715,13 @@ paths:
2225
2715
  required: true
2226
2716
  schema:
2227
2717
  type: string
2718
+ description: 'The ID of the Spree::OptionType'
2228
2719
  - name: id
2229
2720
  in: path
2230
2721
  required: true
2231
2722
  schema:
2232
2723
  type: string
2724
+ description: The ID of the OptionValue
2233
2725
  delete:
2234
2726
  responses:
2235
2727
  '204':
@@ -2266,14 +2758,23 @@ paths:
2266
2758
  '422':
2267
2759
  $ref: '#/components/responses/unprocessable-entity'
2268
2760
  summary: Update option type value
2269
- description: Updates an option type's value.
2761
+ description: |-
2762
+ Updates an option type's value.
2763
+
2764
+ Only users with the `update` permission on the option value can perform this action.
2270
2765
  operationId: update-option-type-value
2271
2766
  tags:
2272
2767
  - Option values
2273
2768
  security:
2274
2769
  - api-key: []
2275
2770
  requestBody:
2276
- $ref: '#/components/requestBodies/option-value-input'
2771
+ content:
2772
+ application/json:
2773
+ schema:
2774
+ type: object
2775
+ properties:
2776
+ option_value:
2777
+ $ref: '#/components/schemas/option-value-input'
2277
2778
  '/products/{product_id}/product_properties':
2278
2779
  get:
2279
2780
  responses:
@@ -2325,14 +2826,29 @@ paths:
2325
2826
  '422':
2326
2827
  $ref: '#/components/responses/unprocessable-entity'
2327
2828
  summary: Create product property
2328
- description: Creates a product property.
2829
+ description: |-
2830
+ Creates a product property.
2831
+
2832
+ Only users with the `create` permission on `Spree::ProductProperty` can perform this action.
2329
2833
  operationId: create-product-property
2330
2834
  tags:
2331
2835
  - Product properties
2332
2836
  security:
2333
2837
  - api-key: []
2334
2838
  requestBody:
2335
- $ref: '#/components/requestBodies/product-property-input'
2839
+ content:
2840
+ application/json:
2841
+ schema:
2842
+ type: object
2843
+ properties:
2844
+ product_property:
2845
+ $ref: '#/components/schemas/product-property-input'
2846
+ examples:
2847
+ Example:
2848
+ value:
2849
+ product_property:
2850
+ property_name: Fit
2851
+ value: Loose
2336
2852
  '/products/{product_id}/product_properties/{id}':
2337
2853
  get:
2338
2854
  responses:
@@ -2400,14 +2916,28 @@ paths:
2400
2916
  '422':
2401
2917
  $ref: '#/components/responses/unprocessable-entity'
2402
2918
  summary: Update product property
2403
- description: Updates a product's property.
2919
+ description: |-
2920
+ Updates a product's property.
2921
+
2922
+ Only users with the `update` permission on the product property can perform this action.
2404
2923
  operationId: update-product-property
2405
2924
  tags:
2406
2925
  - Product properties
2407
2926
  security:
2408
2927
  - api-key: []
2409
2928
  requestBody:
2410
- $ref: '#/components/requestBodies/product-property-input'
2929
+ content:
2930
+ application/json:
2931
+ schema:
2932
+ type: object
2933
+ properties:
2934
+ product_property:
2935
+ $ref: '#/components/schemas/product-property-input'
2936
+ examples:
2937
+ Example:
2938
+ value:
2939
+ product_property:
2940
+ value: Regular
2411
2941
  /properties:
2412
2942
  get:
2413
2943
  responses:
@@ -2449,14 +2979,23 @@ paths:
2449
2979
  '422':
2450
2980
  $ref: '#/components/responses/unprocessable-entity'
2451
2981
  summary: Create property
2452
- description: Creates a property.
2982
+ description: |-
2983
+ Creates a property.
2984
+
2985
+ Only users with the `create` permission on `Spree::Propery` can perform this action.
2453
2986
  operationId: create-property
2454
2987
  tags:
2455
2988
  - Properties
2456
2989
  security:
2457
2990
  - api-key: []
2458
2991
  requestBody:
2459
- $ref: '#/components/requestBodies/property-input'
2992
+ content:
2993
+ application/json:
2994
+ schema:
2995
+ type: object
2996
+ properties:
2997
+ property:
2998
+ $ref: '#/components/schemas/property-input'
2460
2999
  '/properties/{id}':
2461
3000
  get:
2462
3001
  responses:
@@ -2483,6 +3022,7 @@ paths:
2483
3022
  required: true
2484
3023
  schema:
2485
3024
  type: string
3025
+ description: 'The id of the Spree::Property'
2486
3026
  delete:
2487
3027
  responses:
2488
3028
  '204':
@@ -2519,14 +3059,23 @@ paths:
2519
3059
  '422':
2520
3060
  $ref: '#/components/responses/unprocessable-entity'
2521
3061
  summary: Update property
2522
- description: Updates a property.
3062
+ description: |-
3063
+ Updates a property.
3064
+
3065
+ Only users with the `update` permission on the property can perform this action.
2523
3066
  operationId: update-property
2524
3067
  tags:
2525
3068
  - Properties
2526
3069
  security:
2527
3070
  - api-key: []
2528
3071
  requestBody:
2529
- $ref: '#/components/requestBodies/property-input'
3072
+ content:
3073
+ application/json:
3074
+ schema:
3075
+ type: object
3076
+ properties:
3077
+ property:
3078
+ $ref: '#/components/schemas/property-input'
2530
3079
  '/inventory_units/{id}':
2531
3080
  get:
2532
3081
  responses:
@@ -2619,14 +3168,29 @@ paths:
2619
3168
  '422':
2620
3169
  $ref: '#/components/responses/unprocessable-entity'
2621
3170
  summary: Create stock location
2622
- description: Creates a stock location.
3171
+ description: |-
3172
+ Creates a stock location.
3173
+
3174
+ Only users with the `create` permission on `Spree::StockLocation` can perform this action.
2623
3175
  operationId: create-stock-location
2624
3176
  tags:
2625
3177
  - Stock locations
2626
3178
  security:
2627
3179
  - api-key: []
2628
3180
  requestBody:
2629
- $ref: '#/components/requestBodies/stock-location-input'
3181
+ content:
3182
+ application/json:
3183
+ schema:
3184
+ type: object
3185
+ properties:
3186
+ stock_location:
3187
+ $ref: '#/components/schemas/stock-location-input'
3188
+ examples:
3189
+ Example:
3190
+ value:
3191
+ stock_location:
3192
+ name: North Pole
3193
+ active: true
2630
3194
  '/stock_locations/{id}':
2631
3195
  get:
2632
3196
  responses:
@@ -2652,6 +3216,7 @@ paths:
2652
3216
  required: true
2653
3217
  schema:
2654
3218
  type: string
3219
+ description: The id of the stock location
2655
3220
  delete:
2656
3221
  responses:
2657
3222
  '204':
@@ -2688,14 +3253,28 @@ paths:
2688
3253
  '422':
2689
3254
  $ref: '#/components/responses/unprocessable-entity'
2690
3255
  summary: Update stock location
2691
- description: Updates a stock location.
3256
+ description: |-
3257
+ Updates a stock location.
3258
+
3259
+ Only users with the `update` permission on the stock location can perform this action.
2692
3260
  operationId: update-stock-location
2693
3261
  tags:
2694
3262
  - Stock locations
2695
3263
  security:
2696
3264
  - api-key: []
2697
3265
  requestBody:
2698
- $ref: '#/components/requestBodies/stock-location-input'
3266
+ content:
3267
+ application/json:
3268
+ schema:
3269
+ type: object
3270
+ properties:
3271
+ stock_location:
3272
+ $ref: '#/components/schemas/stock-location-input'
3273
+ examples:
3274
+ Example:
3275
+ value:
3276
+ stock_location:
3277
+ active: false
2699
3278
  '/stock_locations/{stock_location_id}/stock_items':
2700
3279
  get:
2701
3280
  responses:
@@ -2747,14 +3326,23 @@ paths:
2747
3326
  '422':
2748
3327
  $ref: '#/components/responses/unprocessable-entity'
2749
3328
  summary: Create stock location item
2750
- description: Creates a stock item for a stock location.
3329
+ description: |-
3330
+ Creates a stock item for a stock location.
3331
+
3332
+ Only users with the `create` permission on `Spree::StockItem` can perform this action.
2751
3333
  operationId: create-stock-location-item
2752
3334
  tags:
2753
3335
  - Stock items
2754
3336
  security:
2755
3337
  - api-key: []
2756
3338
  requestBody:
2757
- $ref: '#/components/requestBodies/stock-item-input'
3339
+ content:
3340
+ application/json:
3341
+ schema:
3342
+ type: object
3343
+ properties:
3344
+ stock_item:
3345
+ $ref: '#/components/schemas/stock-item-input'
2758
3346
  '/stock_locations/{stock_location_id}/stock_items/{id}':
2759
3347
  get:
2760
3348
  responses:
@@ -2780,11 +3368,13 @@ paths:
2780
3368
  required: true
2781
3369
  schema:
2782
3370
  type: string
3371
+ description: 'The ID of the Spree::StockLocation'
2783
3372
  - name: id
2784
3373
  in: path
2785
3374
  required: true
2786
3375
  schema:
2787
3376
  type: string
3377
+ description: 'The ID of the Spree::StockItem'
2788
3378
  delete:
2789
3379
  responses:
2790
3380
  '204':
@@ -2821,14 +3411,23 @@ paths:
2821
3411
  '422':
2822
3412
  $ref: '#/components/responses/unprocessable-entity'
2823
3413
  summary: Update stock location item
2824
- description: Updates a stock location's item.
3414
+ description: |-
3415
+ Updates a stock location's item.
3416
+
3417
+ Only users with the `update` permission on the stock item can perform this action.
2825
3418
  operationId: update-stock-location-item
2826
3419
  tags:
2827
3420
  - Stock items
2828
3421
  security:
2829
3422
  - api-key: []
2830
3423
  requestBody:
2831
- $ref: '#/components/requestBodies/stock-item-input'
3424
+ content:
3425
+ application/json:
3426
+ schema:
3427
+ type: object
3428
+ properties:
3429
+ stock_item:
3430
+ $ref: '#/components/schemas/stock-item-input'
2832
3431
  '/stock_locations/{stock_location_id}/stock_movements':
2833
3432
  get:
2834
3433
  responses:
@@ -3087,14 +3686,30 @@ paths:
3087
3686
  '422':
3088
3687
  $ref: '#/components/responses/unprocessable-entity'
3089
3688
  summary: Create taxonomy
3090
- description: Creates a taxonomy.
3689
+ description: |-
3690
+ Creates a taxonomy.
3691
+
3692
+ Only users with the `create` permission on `Spree::Taxonomy` can perform this action.
3693
+
3694
+ 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
3695
  operationId: create-taxonomy
3092
3696
  tags:
3093
3697
  - Taxonomies
3094
3698
  security:
3095
3699
  - api-key: []
3096
3700
  requestBody:
3097
- $ref: '#/components/requestBodies/taxonomy-input'
3701
+ content:
3702
+ application/json:
3703
+ schema:
3704
+ type: object
3705
+ properties:
3706
+ taxonomy:
3707
+ $ref: '#/components/schemas/taxonomy-input'
3708
+ examples:
3709
+ Example:
3710
+ value:
3711
+ taxonomy:
3712
+ name: Colors
3098
3713
  '/taxonomies/{id}':
3099
3714
  get:
3100
3715
  responses:
@@ -3120,6 +3735,7 @@ paths:
3120
3735
  required: true
3121
3736
  schema:
3122
3737
  type: string
3738
+ description: The id of the taxonomy
3123
3739
  delete:
3124
3740
  responses:
3125
3741
  '204':
@@ -3156,14 +3772,28 @@ paths:
3156
3772
  '422':
3157
3773
  $ref: '#/components/responses/unprocessable-entity'
3158
3774
  summary: Update taxonomy
3159
- description: Updates a taxonomy.
3775
+ description: |-
3776
+ Updates a taxonomy.
3777
+
3778
+ Only users with the `update` permission on the taxonomy can perform this action.
3160
3779
  operationId: update-taxonomy
3161
3780
  tags:
3162
3781
  - Taxonomies
3163
3782
  security:
3164
3783
  - api-key: []
3165
3784
  requestBody:
3166
- $ref: '#/components/requestBodies/taxonomy-input'
3785
+ content:
3786
+ application/json:
3787
+ schema:
3788
+ type: object
3789
+ properties:
3790
+ taxonomy:
3791
+ $ref: '#/components/schemas/taxonomy-input'
3792
+ examples:
3793
+ Example:
3794
+ value:
3795
+ taxonomy:
3796
+ name: Colours
3167
3797
  '/taxonomies/{taxonomy_id}/taxons':
3168
3798
  get:
3169
3799
  responses:
@@ -3200,6 +3830,7 @@ paths:
3200
3830
  required: true
3201
3831
  schema:
3202
3832
  type: string
3833
+ description: The id of the taxonomy for which the new taxon will be added
3203
3834
  post:
3204
3835
  responses:
3205
3836
  '200':
@@ -3215,14 +3846,29 @@ paths:
3215
3846
  '422':
3216
3847
  $ref: '#/components/responses/unprocessable-entity'
3217
3848
  summary: Create taxonomy taxon
3218
- description: Creates a taxon for a taxonomy.
3849
+ description: |-
3850
+ Creates a taxon for a taxonomy.
3851
+
3852
+ Only users with the `create` permission on `Spree::Taxon` can perform this action.
3219
3853
  operationId: create-taxonomy-taxon
3220
3854
  tags:
3221
3855
  - Taxons
3222
3856
  security:
3223
3857
  - api-key: []
3224
3858
  requestBody:
3225
- $ref: '#/components/requestBodies/taxon-input'
3859
+ content:
3860
+ application/json:
3861
+ schema:
3862
+ type: object
3863
+ properties:
3864
+ taxon:
3865
+ $ref: '#/components/schemas/taxon-input'
3866
+ examples:
3867
+ Example:
3868
+ value:
3869
+ taxon:
3870
+ name: Colors
3871
+ parent_id: 22
3226
3872
  '/taxonomies/{taxonomy_id}/taxons/{id}':
3227
3873
  get:
3228
3874
  responses:
@@ -3248,11 +3894,13 @@ paths:
3248
3894
  required: true
3249
3895
  schema:
3250
3896
  type: string
3897
+ description: The id of the taxon's taxonomy
3251
3898
  - name: id
3252
3899
  in: path
3253
3900
  required: true
3254
3901
  schema:
3255
3902
  type: string
3903
+ description: The id of the taxon
3256
3904
  delete:
3257
3905
  responses:
3258
3906
  '204':
@@ -3289,14 +3937,28 @@ paths:
3289
3937
  '422':
3290
3938
  $ref: '#/components/responses/unprocessable-entity'
3291
3939
  summary: Update taxonomy taxon
3292
- description: Updates a taxonomy's taxon.
3940
+ description: |-
3941
+ Updates a taxonomy's taxon.
3942
+
3943
+ Only users with the `update` permission on the taxon can perform this action.
3293
3944
  operationId: update-taxonomy-taxon
3294
3945
  tags:
3295
3946
  - Taxons
3296
3947
  security:
3297
3948
  - api-key: []
3298
3949
  requestBody:
3299
- $ref: '#/components/requestBodies/taxon-input'
3950
+ content:
3951
+ application/json:
3952
+ schema:
3953
+ type: object
3954
+ properties:
3955
+ taxon:
3956
+ $ref: '#/components/schemas/taxon-input'
3957
+ examples:
3958
+ Example:
3959
+ value:
3960
+ taxon:
3961
+ name: Colours
3300
3962
  /taxons:
3301
3963
  get:
3302
3964
  responses:
@@ -3365,14 +4027,24 @@ paths:
3365
4027
  '422':
3366
4028
  $ref: '#/components/responses/unprocessable-entity'
3367
4029
  summary: Create user
3368
- description: Creates a user.
4030
+ description: |
4031
+ Creates a user.
4032
+
4033
+ Only users with the `create` permission on `Spree::User` can perform this action.
3369
4034
  operationId: create-user
3370
4035
  tags:
3371
4036
  - Users
3372
4037
  security:
3373
4038
  - api-key: []
3374
4039
  requestBody:
3375
- $ref: '#/components/requestBodies/user-input'
4040
+ content:
4041
+ application/json:
4042
+ schema:
4043
+ type: object
4044
+ properties:
4045
+ user:
4046
+ $ref: '#/components/schemas/user-input'
4047
+ description: ''
3376
4048
  /zones:
3377
4049
  get:
3378
4050
  responses:
@@ -3414,14 +4086,32 @@ paths:
3414
4086
  '422':
3415
4087
  $ref: '#/components/responses/unprocessable-entity'
3416
4088
  summary: Create zone
3417
- description: Creates a zone.
4089
+ description: |-
4090
+ Creates a zone.
4091
+
4092
+ Only users with the `create` permission on `Spree::Zone` can perform this action.
3418
4093
  operationId: create-zone
3419
4094
  tags:
3420
4095
  - Zones
3421
4096
  security:
3422
4097
  - api-key: []
3423
4098
  requestBody:
3424
- $ref: '#/components/requestBodies/zone-input'
4099
+ content:
4100
+ application/json:
4101
+ schema:
4102
+ type: object
4103
+ properties:
4104
+ zone:
4105
+ $ref: '#/components/schemas/zone-input'
4106
+ examples:
4107
+ Example:
4108
+ value:
4109
+ zone:
4110
+ name: North Pole
4111
+ description: The coldest one.
4112
+ zone_members_attributes:
4113
+ - zoneable_type: 'Spree::Country'
4114
+ zoneable_id: 1
3425
4115
  '/zones/{id}':
3426
4116
  get:
3427
4117
  responses:
@@ -3448,6 +4138,7 @@ paths:
3448
4138
  required: true
3449
4139
  schema:
3450
4140
  type: string
4141
+ description: The ID of the zone we want to update
3451
4142
  delete:
3452
4143
  responses:
3453
4144
  '204':
@@ -3484,14 +4175,28 @@ paths:
3484
4175
  '422':
3485
4176
  $ref: '#/components/responses/unprocessable-entity'
3486
4177
  summary: Update zone
3487
- description: Updates a zone.
4178
+ description: |-
4179
+ Updates a zone.
4180
+
4181
+ Only users with the `update` permission on the zone can perform this action.
3488
4182
  operationId: update-zone
3489
4183
  tags:
3490
4184
  - Zones
3491
4185
  security:
3492
4186
  - api-key: []
3493
4187
  requestBody:
3494
- $ref: '#/components/requestBodies/zone-input'
4188
+ content:
4189
+ application/json:
4190
+ schema:
4191
+ type: object
4192
+ properties:
4193
+ zone:
4194
+ $ref: '#/components/schemas/zone-input'
4195
+ examples:
4196
+ Example:
4197
+ value:
4198
+ zone:
4199
+ description: Brrr. The coldest one.
3495
4200
  '/promotions/{id}':
3496
4201
  get:
3497
4202
  responses:
@@ -3546,7 +4251,7 @@ paths:
3546
4251
  - $ref: '#/components/parameters/per_page'
3547
4252
  security:
3548
4253
  - api-key: []
3549
- '/checkouts/{checkout_id}/line_items/{id}':
4254
+ '/orders/{order_number}/coupon_codes/{id}':
3550
4255
  delete:
3551
4256
  responses:
3552
4257
  '204':
@@ -3554,34 +4259,43 @@ paths:
3554
4259
  content:
3555
4260
  application/json:
3556
4261
  schema:
3557
- $ref: '#/components/schemas/line-item'
4262
+ $ref: '#/components/schemas/coupon-code-handler'
3558
4263
  '401':
3559
4264
  $ref: '#/components/responses/invalid-api-key'
3560
4265
  '404':
3561
4266
  $ref: '#/components/responses/not-found'
3562
4267
  '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
4268
+ description: Unprocessable Entity (WebDAV)
4269
+ content:
4270
+ application/json:
4271
+ schema:
4272
+ $ref: '#/components/schemas/coupon-code-handler'
4273
+ summary: Delete order coupon code
4274
+ description: |-
4275
+ Deletes an order's coupon code.
4276
+
4277
+ 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).
4278
+ operationId: delete-order-coupon-code
3567
4279
  tags:
3568
- - Line items
4280
+ - Coupon codes
3569
4281
  security:
3570
4282
  - api-key: []
3571
4283
  - order-token: []
3572
4284
  parameters:
3573
- - name: checkout_id
4285
+ - name: order_number
3574
4286
  in: path
3575
4287
  required: true
3576
- description: The order number
3577
4288
  schema:
3578
4289
  type: string
4290
+ description: The order number
3579
4291
  - name: id
3580
4292
  in: path
3581
4293
  required: true
4294
+ description: This is the coupon code
3582
4295
  schema:
3583
4296
  type: string
3584
- patch:
4297
+ '/orders/{order_number}/line_items':
4298
+ post:
3585
4299
  responses:
3586
4300
  '200':
3587
4301
  description: ''
@@ -3595,9 +4309,12 @@ paths:
3595
4309
  $ref: '#/components/responses/not-found'
3596
4310
  '422':
3597
4311
  $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
4312
+ summary: Create order line item
4313
+ description: |-
4314
+ Create a line item in an order not yet completed.
4315
+
4316
+ 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).
4317
+ operationId: create-order-line-item
3601
4318
  tags:
3602
4319
  - Line items
3603
4320
  security:
@@ -3609,47 +4326,21 @@ paths:
3609
4326
  schema:
3610
4327
  type: object
3611
4328
  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: []
4329
+ line_item:
4330
+ $ref: '#/components/schemas/line-item-input'
4331
+ examples:
4332
+ Example:
4333
+ value:
4334
+ line_item:
4335
+ quantity: 1
4336
+ variant_id: 22
4337
+ description: ''
3641
4338
  parameters:
3642
4339
  - name: order_number
3643
4340
  in: path
3644
4341
  required: true
3645
4342
  schema:
3646
4343
  type: string
3647
- - name: id
3648
- in: path
3649
- required: true
3650
- description: This is the coupon code
3651
- schema:
3652
- type: string
3653
4344
  '/orders/{order_number}/line_items/{id}':
3654
4345
  delete:
3655
4346
  responses:
@@ -3679,11 +4370,13 @@ paths:
3679
4370
  required: true
3680
4371
  schema:
3681
4372
  type: string
4373
+ description: The order number
3682
4374
  - name: id
3683
4375
  in: path
3684
4376
  required: true
3685
4377
  schema:
3686
4378
  type: string
4379
+ description: The id of the line item to update
3687
4380
  patch:
3688
4381
  responses:
3689
4382
  '200':
@@ -3699,7 +4392,10 @@ paths:
3699
4392
  '422':
3700
4393
  $ref: '#/components/responses/unprocessable-entity'
3701
4394
  summary: Update order line item
3702
- description: Updates an order's line item.
4395
+ description: |-
4396
+ Update line item's information in an order not yet completed.
4397
+
4398
+ 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
4399
  operationId: update-order-line-item
3704
4400
  tags:
3705
4401
  - Line items
@@ -3707,7 +4403,18 @@ paths:
3707
4403
  - api-key: []
3708
4404
  - order-token: []
3709
4405
  requestBody:
3710
- $ref: '#/components/requestBodies/line-item-input'
4406
+ content:
4407
+ application/json:
4408
+ schema:
4409
+ type: object
4410
+ properties:
4411
+ line_item:
4412
+ $ref: '#/components/schemas/line-item-input'
4413
+ examples:
4414
+ example-1:
4415
+ value:
4416
+ line_item:
4417
+ quantity: 1
3711
4418
  '/stock_items/{id}':
3712
4419
  delete:
3713
4420
  responses:
@@ -3736,6 +4443,7 @@ paths:
3736
4443
  required: true
3737
4444
  schema:
3738
4445
  type: string
4446
+ description: 'The ID of the Stock::Item'
3739
4447
  patch:
3740
4448
  responses:
3741
4449
  '200':
@@ -3751,14 +4459,23 @@ paths:
3751
4459
  '422':
3752
4460
  $ref: '#/components/responses/unprocessable-entity'
3753
4461
  summary: Update stock item
3754
- description: Updates a stock item.
4462
+ description: |-
4463
+ Updates a stock item.
4464
+
4465
+ Only users with the `update` permission on the stock item can perform this action.
3755
4466
  operationId: update-stock-item
3756
4467
  tags:
3757
4468
  - Stock items
3758
4469
  security:
3759
4470
  - api-key: []
3760
4471
  requestBody:
3761
- $ref: '#/components/requestBodies/stock-item-input'
4472
+ content:
4473
+ application/json:
4474
+ schema:
4475
+ type: object
4476
+ properties:
4477
+ stock_item:
4478
+ $ref: '#/components/schemas/stock-item-input'
3762
4479
  '/checkouts/{id}':
3763
4480
  patch:
3764
4481
  responses:
@@ -3776,7 +4493,9 @@ paths:
3776
4493
  $ref: '#/components/responses/unprocessable-entity'
3777
4494
  summary: Update checkout
3778
4495
  description: |-
3779
- Updates a checkout.
4496
+ 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.
4497
+
4498
+ 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
4499
 
3781
4500
  **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
4501
  operationId: update-checkout
@@ -3789,13 +4508,17 @@ paths:
3789
4508
  content:
3790
4509
  application/json:
3791
4510
  schema:
3792
- $ref: '#/components/schemas/checkout-input'
4511
+ type: object
4512
+ properties:
4513
+ order:
4514
+ $ref: '#/components/schemas/order-input'
3793
4515
  parameters:
3794
4516
  - name: id
3795
4517
  in: path
3796
4518
  required: true
3797
4519
  schema:
3798
4520
  type: string
4521
+ description: The order number
3799
4522
  '/credit_cards/{id}':
3800
4523
  patch:
3801
4524
  responses:
@@ -3845,7 +4568,10 @@ paths:
3845
4568
  '422':
3846
4569
  $ref: '#/components/responses/unprocessable-entity'
3847
4570
  summary: Update shipment
3848
- description: Updates a shipment.
4571
+ description: |-
4572
+ Updates a shipment.
4573
+
4574
+ Please note that this request can be only performed by users with the `update` permission on the shipment.
3849
4575
  operationId: update-shipment
3850
4576
  tags:
3851
4577
  - Shipments
@@ -3855,7 +4581,15 @@ paths:
3855
4581
  content:
3856
4582
  application/json:
3857
4583
  schema:
3858
- $ref: '#/components/schemas/shipment-input'
4584
+ type: object
4585
+ properties:
4586
+ shipment:
4587
+ $ref: '#/components/schemas/shipment-input'
4588
+ examples:
4589
+ Example:
4590
+ value:
4591
+ shipment:
4592
+ tracking: tracking-identifier-provided-by-shipping-provider
3859
4593
  parameters:
3860
4594
  - name: number
3861
4595
  in: path
@@ -4160,6 +4894,131 @@ paths:
4160
4894
  description: The order number
4161
4895
  schema:
4162
4896
  type: string
4897
+ '/checkouts/{checkout_id}/line_items':
4898
+ post:
4899
+ responses:
4900
+ '200':
4901
+ description: ''
4902
+ content:
4903
+ application/json:
4904
+ schema:
4905
+ $ref: '#/components/schemas/line-item'
4906
+ '401':
4907
+ $ref: '#/components/responses/invalid-api-key'
4908
+ '404':
4909
+ $ref: '#/components/responses/not-found'
4910
+ '422':
4911
+ $ref: '#/components/responses/unprocessable-entity'
4912
+ summary: Create checkout line item
4913
+ description: |-
4914
+ Create a line item in an checkout not yet completed.
4915
+
4916
+ 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).
4917
+
4918
+ It is not possible to add a line item to a completed order.
4919
+ operationId: create-checkout-line-item
4920
+ tags:
4921
+ - Line items
4922
+ security:
4923
+ - api-key: []
4924
+ - order-token: []
4925
+ requestBody:
4926
+ content:
4927
+ application/json:
4928
+ schema:
4929
+ type: object
4930
+ properties:
4931
+ line_item:
4932
+ $ref: '#/components/schemas/line-item-input'
4933
+ examples:
4934
+ Example:
4935
+ value:
4936
+ line_item:
4937
+ quantity: 1
4938
+ variant_id: 22
4939
+ parameters:
4940
+ - name: checkout_id
4941
+ in: path
4942
+ required: true
4943
+ description: The order number
4944
+ schema:
4945
+ type: string
4946
+ '/checkouts/{checkout_id}/line_items/{id}':
4947
+ delete:
4948
+ responses:
4949
+ '204':
4950
+ description: ''
4951
+ content:
4952
+ application/json:
4953
+ schema:
4954
+ $ref: '#/components/schemas/line-item'
4955
+ '401':
4956
+ $ref: '#/components/responses/invalid-api-key'
4957
+ '404':
4958
+ $ref: '#/components/responses/not-found'
4959
+ '422':
4960
+ $ref: '#/components/responses/delete-restriction'
4961
+ summary: Delete checkout line item
4962
+ description: Deletes a checkout's line item.
4963
+ operationId: delete-checkout-line-item
4964
+ tags:
4965
+ - Line items
4966
+ security:
4967
+ - api-key: []
4968
+ - order-token: []
4969
+ parameters:
4970
+ - name: checkout_id
4971
+ in: path
4972
+ required: true
4973
+ description: The order number
4974
+ schema:
4975
+ type: string
4976
+ - name: id
4977
+ in: path
4978
+ required: true
4979
+ schema:
4980
+ type: string
4981
+ description: The id of the line item to update
4982
+ patch:
4983
+ responses:
4984
+ '200':
4985
+ description: ''
4986
+ content:
4987
+ application/json:
4988
+ schema:
4989
+ $ref: '#/components/schemas/line-item'
4990
+ '401':
4991
+ $ref: '#/components/responses/invalid-api-key'
4992
+ '404':
4993
+ $ref: '#/components/responses/not-found'
4994
+ '422':
4995
+ $ref: '#/components/responses/unprocessable-entity'
4996
+ summary: Update checkout line item
4997
+ description: |-
4998
+ Update line item's information in an checkout not yet completed.
4999
+
5000
+ 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).
5001
+
5002
+ It is not possible to add a line item to a completed order.
5003
+ operationId: update-checkout-line-item
5004
+ tags:
5005
+ - Line items
5006
+ security:
5007
+ - api-key: []
5008
+ - order-token: []
5009
+ requestBody:
5010
+ content:
5011
+ application/json:
5012
+ schema:
5013
+ type: object
5014
+ properties:
5015
+ line_item:
5016
+ $ref: '#/components/schemas/line-item-input'
5017
+ examples:
5018
+ Example:
5019
+ value:
5020
+ line_item:
5021
+ quantity: 2
4163
5022
  /classifications:
4164
5023
  put:
4165
5024
  responses:
@@ -4612,7 +5471,7 @@ paths:
4612
5471
  required: true
4613
5472
  schema:
4614
5473
  type: string
4615
- '/checkouts/{checkout_id}/line_items':
5474
+ '/orders/{order_number}/coupon_codes':
4616
5475
  post:
4617
5476
  responses:
4618
5477
  '200':
@@ -4620,47 +5479,22 @@ paths:
4620
5479
  content:
4621
5480
  application/json:
4622
5481
  schema:
4623
- $ref: '#/components/schemas/line-item'
5482
+ $ref: '#/components/schemas/coupon-code-handler'
4624
5483
  '401':
4625
5484
  $ref: '#/components/responses/invalid-api-key'
4626
5485
  '404':
4627
5486
  $ref: '#/components/responses/not-found'
4628
5487
  '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
5488
  description: ''
4652
5489
  content:
4653
5490
  application/json:
4654
5491
  schema:
4655
5492
  $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
5493
  summary: Create order coupon code
4663
- description: Creates a coupon code for an order.
5494
+ description: |-
5495
+ Creates a coupon code for an order.
5496
+
5497
+ 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
5498
  operationId: create-order-coupon-code
4665
5499
  tags:
4666
5500
  - Coupon codes
@@ -4668,44 +5502,21 @@ paths:
4668
5502
  - api-key: []
4669
5503
  - order-token: []
4670
5504
  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'
5505
+ content:
5506
+ application/json:
5507
+ schema:
5508
+ $ref: '#/components/schemas/coupon-code-input'
5509
+ examples:
5510
+ Example:
5511
+ value:
5512
+ coupon_code: off-20
4703
5513
  parameters:
4704
5514
  - name: order_number
4705
5515
  in: path
4706
5516
  required: true
4707
5517
  schema:
4708
5518
  type: string
5519
+ description: The order number
4709
5520
  /shipments:
4710
5521
  post:
4711
5522
  responses:
@@ -4720,7 +5531,10 @@ paths:
4720
5531
  '422':
4721
5532
  $ref: '#/components/responses/unprocessable-entity'
4722
5533
  summary: Create shipment
4723
- description: Creates a shipment.
5534
+ description: |-
5535
+ Creates a shipment.
5536
+
5537
+ Please note that this request can be only performed by users with the `create` permission on the shipment.
4724
5538
  operationId: create-shipment
4725
5539
  tags:
4726
5540
  - Shipments
@@ -4738,6 +5552,12 @@ paths:
4738
5552
  type: integer
4739
5553
  quantity:
4740
5554
  type: integer
5555
+ examples:
5556
+ Example:
5557
+ value:
5558
+ stock_location_id: 0
5559
+ variant_id: 0
5560
+ quantity: 0
4741
5561
  /shipments/transfer_to_location:
4742
5562
  post:
4743
5563
  responses:
@@ -4890,6 +5710,7 @@ paths:
4890
5710
  schema:
4891
5711
  type: string
4892
5712
  required: true
5713
+ description: The order number
4893
5714
  post:
4894
5715
  responses:
4895
5716
  '200':
@@ -4905,12 +5726,21 @@ paths:
4905
5726
  '422':
4906
5727
  $ref: '#/components/responses/unprocessable-entity'
4907
5728
  summary: Create order customer return
4908
- description: Creates a customer return for an order.
5729
+ description: |-
5730
+ Creates a customer return for an order.
5731
+
5732
+ Only users with the `create` permission on `Spree::CustomerReturn` can perform this action.
4909
5733
  operationId: create-order-customer-return
4910
5734
  tags:
4911
5735
  - Customer returns
4912
5736
  requestBody:
4913
- $ref: '#/components/requestBodies/customer-return-input'
5737
+ content:
5738
+ application/json:
5739
+ schema:
5740
+ type: object
5741
+ properties:
5742
+ customer_return:
5743
+ $ref: '#/components/schemas/customer-return-input'
4914
5744
  security:
4915
5745
  - api-key: []
4916
5746
  tags:
@@ -5004,96 +5834,6 @@ components:
5004
5834
  message:
5005
5835
  type: string
5006
5836
  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
5837
  complete-checkoutBody:
5098
5838
  content:
5099
5839
  application/json:
@@ -5102,11 +5842,6 @@ components:
5102
5842
  properties:
5103
5843
  expected_total:
5104
5844
  type: string
5105
- coupon-code-input:
5106
- content:
5107
- application/json:
5108
- schema:
5109
- $ref: '#/components/schemas/coupon-code-input'
5110
5845
  add-shipment-itemBody:
5111
5846
  content:
5112
5847
  application/json:
@@ -6043,12 +6778,18 @@ components:
6043
6778
  properties:
6044
6779
  success:
6045
6780
  type: string
6781
+ description: Message returned if the coupon has been applied.
6046
6782
  error:
6047
6783
  type: string
6784
+ description: Message returned if there are errors applying the coupon.
6048
6785
  successful:
6049
6786
  type: boolean
6050
6787
  status_code:
6051
6788
  type: string
6789
+ description: |-
6790
+ 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`.
6791
+
6792
+ When removing a coupon code, it can be: `coupon_code_removed`, `coupon_code_not_present`, `coupon_code_not_found`.
6052
6793
  address-book:
6053
6794
  type: array
6054
6795
  title: Address book
@@ -6128,19 +6869,20 @@ components:
6128
6869
  type: string
6129
6870
  abbr:
6130
6871
  type: string
6872
+ description: ''
6131
6873
  line-item-input:
6132
6874
  type: object
6133
6875
  title: Line item input
6134
6876
  properties:
6135
6877
  quantity:
6136
6878
  type: integer
6137
- description: 'Passing `0`, the line item will be removed.'
6879
+ description: 'Passing `0`, the line item will be removed. When omitted creating a line item, quantity will be `1`.'
6138
6880
  options:
6139
6881
  type: object
6140
6882
  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
6883
  id:
6142
6884
  type: integer
6143
- description: Required for existing line items only.
6885
+ description: 'Required when updating existing line items, only when not already present in the Path Parameters.'
6144
6886
  variant_id:
6145
6887
  type: integer
6146
6888
  description: Required for new line items only.
@@ -6164,30 +6906,6 @@ components:
6164
6906
  type: string
6165
6907
  presentation:
6166
6908
  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
6909
  credit-card-update-input:
6192
6910
  type: object
6193
6911
  title: Credit card update input
@@ -6222,10 +6940,9 @@ components:
6222
6940
  type: string
6223
6941
  payment_method_id:
6224
6942
  type: integer
6225
- payment_method:
6226
- type: string
6227
6943
  source_attributes:
6228
6944
  type: object
6945
+ description: This field is required for Payment Method that has source_required? returning true.
6229
6946
  properties:
6230
6947
  number:
6231
6948
  type: string
@@ -6271,14 +6988,29 @@ components:
6271
6988
  type: integer
6272
6989
  order-input:
6273
6990
  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'
6991
+ properties:
6992
+ email:
6993
+ type: string
6994
+ special_instructions:
6995
+ type: string
6996
+ use_billing:
6997
+ type: boolean
6998
+ bill_address_attributes:
6999
+ $ref: '#/components/schemas/address-input'
7000
+ ship_address_attributes:
7001
+ $ref: '#/components/schemas/address-input'
7002
+ payments_attributes:
7003
+ type: array
7004
+ items:
7005
+ $ref: '#/components/schemas/payment-input'
7006
+ shipments_attributes:
7007
+ type: array
7008
+ items:
7009
+ $ref: '#/components/schemas/shipment-input'
7010
+ line_items_attributes:
7011
+ type: array
7012
+ items:
7013
+ $ref: '#/components/schemas/line-item-input'
6282
7014
  product-input:
6283
7015
  type: object
6284
7016
  title: Product input
@@ -6316,13 +7048,11 @@ components:
6316
7048
  tax_category_id:
6317
7049
  type: integer
6318
7050
  taxon_ids:
6319
- type: array
6320
- items:
6321
- type: integer
7051
+ type: string
7052
+ description: 'Comma separated list of taxon ids. Eg. "1,2"'
6322
7053
  option_type_ids:
6323
- type: array
6324
- items:
6325
- type: integer
7054
+ description: 'Comma separated list of option type ids ids. Eg. "1,2"'
7055
+ type: string
6326
7056
  cost_currency:
6327
7057
  type: string
6328
7058
  cost_price:
@@ -6359,28 +7089,16 @@ components:
6359
7089
  type: object
6360
7090
  title: Variant input
6361
7091
  properties:
6362
- name:
6363
- type: string
6364
- presentation:
7092
+ price:
6365
7093
  type: string
6366
7094
  cost_price:
6367
7095
  type: string
6368
- lock_version:
6369
- type: string
6370
7096
  position:
6371
7097
  type: integer
6372
7098
  track_inventory:
6373
7099
  type: boolean
6374
7100
  product_id:
6375
7101
  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
7102
  weight:
6385
7103
  type: string
6386
7104
  height:
@@ -6397,13 +7115,20 @@ components:
6397
7115
  type: array
6398
7116
  items:
6399
7117
  type: integer
7118
+ option_values_attributes:
7119
+ type: array
7120
+ items:
7121
+ $ref: '#/components/schemas/option-value-input'
6400
7122
  options:
6401
7123
  type: object
7124
+ 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
7125
  properties:
6403
7126
  name:
6404
7127
  type: string
6405
7128
  value:
6406
7129
  type: string
7130
+ required:
7131
+ - price
6407
7132
  property-input:
6408
7133
  type: object
6409
7134
  title: Property input
@@ -6480,6 +7205,8 @@ components:
6480
7205
  properties:
6481
7206
  name:
6482
7207
  type: string
7208
+ required:
7209
+ - name
6483
7210
  taxon-input:
6484
7211
  type: object
6485
7212
  title: Taxon input