solidus_api 2.11.10 → 3.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bd456dd76809794ef738af43d0351f17310aaed11df375a59605bcc4cf84279
4
- data.tar.gz: 11a016339bab6d9ce6869e5362f880060812247a8b5c0049fa91e8fc3bfecaab
3
+ metadata.gz: c75f80bedcb1079be3b929bf5793b5df00cd0c2c829da77e07afc3fe6a16af8c
4
+ data.tar.gz: 0afcfe13f9333eb287537f12c8a81b9607650d809e1a0db92237d60819543db3
5
5
  SHA512:
6
- metadata.gz: 473dcab1dabd89b3fe938d2f70a390def49fd43a23ef2a70f4648365d9d5a9812bf3c934fc3b7fef6029bef5bcbaa37724e7deaba582ff8884c2975ac64c293f
7
- data.tar.gz: 71aa0b757e05201fb02654b4f85c11d79faf2cd6d1d7eb060a788c7bc0dd4d691aa65ac66018df1320dde41f37179c952f93b32b193d980a89a0fd7155121c3b
6
+ metadata.gz: fd7e12b7b7640b4dab2de02b28b4d12fd6639360831c8b4f1363415f2a53226469253b25e440084090eecc3ac577eeb47c19b821cc1952f9da0db970a297eaec
7
+ data.tar.gz: 1535fe8316f622eb26d2eb1947e7c8013aee95c87244aeeabcafb7869945654a8de62b722a021d181d5ea568891acdce56651b182d0dee701ec84db6493eb53d
@@ -104,7 +104,7 @@ module Spree
104
104
  end
105
105
 
106
106
  def api_key
107
- bearer_token || spree_token || params[:token]
107
+ bearer_token || params[:token]
108
108
  end
109
109
  helper_method :api_key
110
110
 
@@ -114,17 +114,6 @@ module Spree
114
114
  header.gsub(pattern, '') if header.present? && header.match(pattern)
115
115
  end
116
116
 
117
- def spree_token
118
- token = request.headers["X-Spree-Token"]
119
- return if token.blank?
120
-
121
- Spree::Deprecation.warn(
122
- 'The custom X-Spree-Token request header is deprecated and will be removed in the next release.' \
123
- ' Please use bearer token authorization header instead.'
124
- )
125
- token
126
- end
127
-
128
117
  def order_token
129
118
  request.headers["X-Spree-Order-Token"] || params[:order_token]
130
119
  end
@@ -9,11 +9,10 @@ module Spree
9
9
 
10
10
  rescue_from Spree::Order::InsufficientStock, with: :insufficient_stock_error
11
11
 
12
- include Spree::Core::ControllerHelpers::Order
13
-
14
- # TODO: Remove this after deprecated usage in #update is removed
15
12
  include Spree::Core::ControllerHelpers::PaymentParameters
16
13
 
14
+ include Spree::Core::ControllerHelpers::Order
15
+
17
16
  def next
18
17
  authorize! :update, @order, order_token
19
18
  if !expected_total_ok?(params[:expected_total])
@@ -95,7 +94,7 @@ module Spree
95
94
  massaged_params
96
95
  end
97
96
 
98
- # Should be overriden if you have areas of your checkout that don't match
97
+ # Should be overridden if you have areas of your checkout that don't match
99
98
  # up to a step within checkout_steps, such as a registration step
100
99
  def skip_state_validation?
101
100
  false
@@ -116,17 +115,6 @@ module Spree
116
115
  end
117
116
 
118
117
  def after_update_attributes
119
- if params[:order] && params[:order][:coupon_code].present?
120
- Spree::Deprecation.warn('This method is deprecated. Please use `Spree::Api::CouponCodesController#create` endpoint instead.')
121
- handler = PromotionHandler::Coupon.new(@order)
122
- handler.apply
123
-
124
- if handler.error.present?
125
- @coupon_message = handler.error
126
- respond_with(@order, default_template: 'spree/api/orders/could_not_apply_coupon', status: 422)
127
- return true
128
- end
129
- end
130
118
  false
131
119
  end
132
120
 
@@ -12,8 +12,6 @@ module Spree
12
12
  class_attribute :admin_payment_attributes
13
13
  self.admin_payment_attributes = [:payment_method, :amount, :state, source: {}]
14
14
 
15
- skip_before_action :authenticate_user, only: :apply_coupon_code
16
-
17
15
  before_action :find_order, except: [:create, :mine, :current, :index]
18
16
  around_action :lock_order, except: [:create, :mine, :current, :index, :show]
19
17
 
@@ -104,20 +102,6 @@ module Spree
104
102
  end
105
103
  end
106
104
 
107
- def apply_coupon_code
108
- Spree::Deprecation.warn('This method is deprecated. Please use `Spree::Api::CouponCodesController#create` endpoint instead.')
109
-
110
- authorize! :update, @order, order_token
111
- @order.coupon_code = params[:coupon_code]
112
- @handler = PromotionHandler::Coupon.new(@order).apply
113
- if @handler.successful?
114
- render "spree/api/promotions/handler", status: 200
115
- else
116
- logger.error("apply_coupon_code_error=#{@handler.error.inspect}")
117
- render "spree/api/promotions/handler", status: 422
118
- end
119
- end
120
-
121
105
  private
122
106
 
123
107
  def order_params
@@ -15,12 +15,6 @@ module Spree
15
15
  respond_with(taxonomy)
16
16
  end
17
17
 
18
- # Because JSTree wants parameters in a *slightly* different format
19
- def jstree
20
- Spree::Deprecation.warn("Please don't use `/api/taxonomies/:taxonomy_id/jstree` endpoint. It is deprecated and will be removed in the next future.", caller)
21
- show
22
- end
23
-
24
18
  def create
25
19
  authorize! :create, Taxonomy
26
20
  @taxonomy = Spree::Taxonomy.new(taxonomy_params)
@@ -29,11 +29,6 @@ module Spree
29
29
  respond_with(@taxon)
30
30
  end
31
31
 
32
- def jstree
33
- Spree::Deprecation.warn("Please don't use `/api/taxonomies/:taxonomy_id/taxons/:taxon_id/jstree` endpoint. It is deprecated and will be removed in the next future.", caller)
34
- show
35
- end
36
-
37
32
  def create
38
33
  authorize! :create, Taxon
39
34
  @taxon = Spree::Taxon.new(taxon_params)
@@ -126,19 +126,12 @@ module Spree
126
126
  :id, :number, :state, :order_id, :memo, :created_at, :updated_at
127
127
  ]
128
128
 
129
- @@address_base_attributes = [
129
+ @@address_attributes = [
130
130
  :id, :name, :address1, :address2, :city, :zipcode, :phone, :company,
131
131
  :alternative_phone, :country_id, :country_iso, :state_id, :state_name,
132
132
  :state_text
133
133
  ]
134
134
 
135
- @@address_attributes = if Spree::Config.use_combined_first_and_last_name_in_address
136
- @@address_base_attributes
137
- else
138
- @@address_base_attributes +
139
- Spree::Address::LEGACY_NAME_ATTRS.map(&:to_sym)
140
- end
141
-
142
135
  @@country_attributes = [:id, :iso_name, :iso, :iso3, :name, :numcode]
143
136
 
144
137
  @@state_attributes = [:id, :name, :abbr, :country_id]
@@ -1,4 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- json.default_country_id(Spree::Country.default.id)
4
3
  json.default_country_iso(Spree::Config[:default_country_iso])
data/config/routes.rb CHANGED
@@ -4,11 +4,6 @@ Spree::Core::Engine.routes.draw do
4
4
  namespace :admin do
5
5
  resources :users do
6
6
  resource :api_key, controller: 'users/api_key', only: [:create, :destroy]
7
-
8
- member do
9
- put :generate_api_key # Deprecated
10
- put :clear_api_key # Deprecated
11
- end
12
7
  end
13
8
  end
14
9
 
@@ -68,7 +63,6 @@ Spree::Core::Engine.routes.draw do
68
63
  member do
69
64
  put :cancel
70
65
  put :empty
71
- put :apply_coupon_code
72
66
  end
73
67
 
74
68
  resources :coupon_codes, only: [:create, :destroy]
@@ -99,14 +93,7 @@ Spree::Core::Engine.routes.draw do
99
93
  resources :states, only: [:index, :show]
100
94
 
101
95
  resources :taxonomies do
102
- member do
103
- get :jstree
104
- end
105
- resources :taxons do
106
- member do
107
- get :jstree
108
- end
109
- end
96
+ resources :taxons
110
97
  end
111
98
 
112
99
  resources :taxons, only: [:index]
@@ -8,7 +8,7 @@ module Spree
8
8
  isolate_namespace Spree
9
9
  engine_name 'spree_api'
10
10
 
11
- # Leave initializer empty for backwards-compatability. Other apps
11
+ # Leave initializer empty for backwards-compatibility. Other apps
12
12
  # might still rely on this event.
13
13
  initializer "spree.api.environment", before: :load_config_initializers do; end
14
14
  end
@@ -16,8 +16,6 @@ module Spree
16
16
  options[:default_template]
17
17
  end
18
18
  end
19
-
20
- RablTemplate = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('RablTemplate', 'JbuilderTemplate')
21
19
  end
22
20
  end
23
21
  end
@@ -27,7 +27,7 @@ module Spree
27
27
  allow(Spree.user_class).to receive(:find_by).with(hash_including(:spree_api_key)) { current_api_user }
28
28
  end
29
29
 
30
- # This method can be overriden (with a let block) inside a context
30
+ # This method can be overridden (with a let block) inside a context
31
31
  # For instance, if you wanted to have an admin user instead.
32
32
  def current_api_user
33
33
  @current_api_user ||= stub_model(Spree::LegacyUser, email: "solidus@example.com", spree_roles: [])
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: Solidus API
4
- version: "1.0"
4
+ version: '1.0'
5
5
  description: The standard Solidus API.
6
6
  contact:
7
7
  name: Solidus
@@ -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:
@@ -1067,12 +1326,10 @@ paths:
1067
1326
  '422':
1068
1327
  $ref: '#/components/responses/delete-restriction'
1069
1328
  summary: Remove address from user address book
1070
- description: >-
1329
+ description: |-
1071
1330
  Removes an address from a user's address book.
1072
1331
 
1073
-
1074
- **Note:** Rather than delete a `Spree::UserAddress` record this action
1075
- set its `archived` attribute to `true`.
1332
+ **Note:** Rather than delete a `Spree::UserAddress` record this action set its `archived` attribute to `true`.
1076
1333
  operationId: remove-address-from-user-address-book
1077
1334
  tags:
1078
1335
  - Address books
@@ -1101,16 +1358,10 @@ paths:
1101
1358
  operationId: update-user-address-book
1102
1359
  tags:
1103
1360
  - Address books
1104
- description: >-
1361
+ description: |-
1105
1362
  Updates a user's address book.
1106
1363
 
1107
-
1108
- **Note:** if the passed `id` matches an existing `address` a new
1109
- `Spree::Address` record will be created and the matched `address`
1110
- `archived` on `Spree::UserAddress`. For a similar logic, if the passed
1111
- `id` matches an existing `address` which is in `archived` state, the
1112
- `Spree::UserAddress#archived` record will be restored to `false`.
1113
-
1364
+ **Note:** if the passed `id` matches an existing `address` a new `Spree::Address` record will be created and the matched `address` `archived` on `Spree::UserAddress`. For a similar logic, if the passed `id` matches an existing `address` which is in `archived` state, the `Spree::UserAddress#archived` record will be restored to `false`.
1114
1365
  See `user_address_book.rb` for further information.
1115
1366
  security:
1116
1367
  - api-key: []
@@ -1211,7 +1462,36 @@ paths:
1211
1462
  - api-key: []
1212
1463
  - order-token: []
1213
1464
  requestBody:
1214
- $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.
1215
1495
  '/checkouts/{checkout_id}/payments':
1216
1496
  get:
1217
1497
  responses:
@@ -1233,7 +1513,7 @@ paths:
1233
1513
  '404':
1234
1514
  $ref: '#/components/responses/not-found'
1235
1515
  summary: List checkout payments
1236
- 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. '
1237
1517
  operationId: list-checkout-payments
1238
1518
  tags:
1239
1519
  - Payments
@@ -1264,7 +1544,7 @@ paths:
1264
1544
  '422':
1265
1545
  $ref: '#/components/responses/unprocessable-entity'
1266
1546
  summary: Create checkout payment
1267
- 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.
1268
1548
  operationId: create-checkout-payment
1269
1549
  tags:
1270
1550
  - Payments
@@ -1272,7 +1552,30 @@ paths:
1272
1552
  - api-key: []
1273
1553
  - order-token: []
1274
1554
  requestBody:
1275
- $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`.
1276
1579
  '/checkouts/{checkout_id}/payments/{id}':
1277
1580
  get:
1278
1581
  responses:
@@ -1304,6 +1607,7 @@ paths:
1304
1607
  - name: id
1305
1608
  in: path
1306
1609
  required: true
1610
+ description: The payment id
1307
1611
  schema:
1308
1612
  type: string
1309
1613
  patch:
@@ -1316,12 +1620,21 @@ paths:
1316
1620
  $ref: '#/components/schemas/payment'
1317
1621
  '401':
1318
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
1319
1632
  '404':
1320
1633
  $ref: '#/components/responses/not-found'
1321
1634
  '422':
1322
1635
  $ref: '#/components/responses/unprocessable-entity'
1323
1636
  summary: Update checkout payment
1324
- 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. '
1325
1638
  operationId: update-checkout-payment
1326
1639
  tags:
1327
1640
  - Payments
@@ -1334,12 +1647,13 @@ paths:
1334
1647
  schema:
1335
1648
  type: object
1336
1649
  properties:
1337
- amount:
1338
- type: number
1339
- payment_method_id:
1340
- type: integer
1341
- payment_method:
1342
- $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'
1343
1657
  '/checkouts/{checkout_id}/return_authorizations':
1344
1658
  get:
1345
1659
  responses:
@@ -1392,14 +1706,23 @@ paths:
1392
1706
  '422':
1393
1707
  $ref: '#/components/responses/unprocessable-entity'
1394
1708
  summary: Create checkout return authorization
1395
- 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.
1396
1713
  operationId: create-checkout-return-authorization
1397
1714
  tags:
1398
1715
  - Return authorizations
1399
1716
  security:
1400
1717
  - api-key: []
1401
1718
  requestBody:
1402
- $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'
1403
1726
  '/checkouts/{checkout_id}/return_authorizations/{id}':
1404
1727
  get:
1405
1728
  responses:
@@ -1431,6 +1754,7 @@ paths:
1431
1754
  required: true
1432
1755
  schema:
1433
1756
  type: string
1757
+ description: 'The ID of the Spree::ReturnAuthorization'
1434
1758
  delete:
1435
1759
  responses:
1436
1760
  '204':
@@ -1467,14 +1791,23 @@ paths:
1467
1791
  '422':
1468
1792
  $ref: '#/components/responses/unprocessable-entity'
1469
1793
  summary: Update checkout return authorization
1470
- 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.
1471
1798
  operationId: update-checkout-return-authorization
1472
1799
  tags:
1473
1800
  - Return authorizations
1474
1801
  security:
1475
1802
  - api-key: []
1476
1803
  requestBody:
1477
- $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'
1478
1811
  '/orders/{order_id}/customer_returns/{id}':
1479
1812
  get:
1480
1813
  responses:
@@ -1504,6 +1837,7 @@ paths:
1504
1837
  - name: id
1505
1838
  in: path
1506
1839
  required: true
1840
+ description: The id of the customer return
1507
1841
  schema:
1508
1842
  type: string
1509
1843
  put:
@@ -1521,12 +1855,21 @@ paths:
1521
1855
  '422':
1522
1856
  $ref: '#/components/responses/unprocessable-entity'
1523
1857
  summary: Update order customer return
1524
- 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.
1525
1862
  operationId: update-order-customer-return
1526
1863
  tags:
1527
1864
  - Customer returns
1528
1865
  requestBody:
1529
- $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'
1530
1873
  security:
1531
1874
  - api-key: []
1532
1875
  /orders:
@@ -1577,7 +1920,21 @@ paths:
1577
1920
  security:
1578
1921
  - api-key: []
1579
1922
  requestBody:
1580
- $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
1581
1938
  '/orders/{order_number}/addresses/{id}':
1582
1939
  get:
1583
1940
  responses:
@@ -1603,11 +1960,13 @@ paths:
1603
1960
  - name: order_number
1604
1961
  in: path
1605
1962
  required: true
1963
+ description: The order number
1606
1964
  schema:
1607
1965
  type: string
1608
1966
  - name: id
1609
1967
  in: path
1610
1968
  required: true
1969
+ description: The id of the order's address that we want to retrieve
1611
1970
  schema:
1612
1971
  type: string
1613
1972
  patch:
@@ -1633,7 +1992,36 @@ paths:
1633
1992
  - api-key: []
1634
1993
  - order-token: []
1635
1994
  requestBody:
1636
- $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.
1637
2025
  '/orders/{order_number}/payments':
1638
2026
  get:
1639
2027
  responses:
@@ -1672,6 +2060,7 @@ paths:
1672
2060
  - name: order_number
1673
2061
  in: path
1674
2062
  required: true
2063
+ description: The order number
1675
2064
  schema:
1676
2065
  type: string
1677
2066
  post:
@@ -1689,7 +2078,7 @@ paths:
1689
2078
  '422':
1690
2079
  $ref: '#/components/responses/unprocessable-entity'
1691
2080
  summary: Create order payment
1692
- 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.
1693
2082
  operationId: create-order-payment
1694
2083
  tags:
1695
2084
  - Payments
@@ -1697,7 +2086,30 @@ paths:
1697
2086
  - api-key: []
1698
2087
  - order-token: []
1699
2088
  requestBody:
1700
- $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`.
1701
2113
  '/orders/{order_number}/payments/{id}':
1702
2114
  get:
1703
2115
  responses:
@@ -1739,12 +2151,21 @@ paths:
1739
2151
  $ref: '#/components/schemas/payment'
1740
2152
  '401':
1741
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
1742
2163
  '404':
1743
2164
  $ref: '#/components/responses/not-found'
1744
2165
  '422':
1745
2166
  $ref: '#/components/responses/unprocessable-entity'
1746
2167
  summary: Update order payment
1747
- 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. '
1748
2169
  operationId: update-order-payment
1749
2170
  tags:
1750
2171
  - Payments
@@ -1752,7 +2173,18 @@ paths:
1752
2173
  - api-key: []
1753
2174
  - order-token: []
1754
2175
  requestBody:
1755
- $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'
1756
2188
  '/orders/{order_number}/return_authorizations':
1757
2189
  get:
1758
2190
  responses:
@@ -1804,14 +2236,23 @@ paths:
1804
2236
  '422':
1805
2237
  $ref: '#/components/responses/unprocessable-entity'
1806
2238
  summary: Create order return authorization
1807
- 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.
1808
2243
  operationId: create-order-return-authorization
1809
2244
  tags:
1810
2245
  - Return authorizations
1811
2246
  security:
1812
2247
  - api-key: []
1813
2248
  requestBody:
1814
- $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'
1815
2256
  '/orders/{order_number}/return_authorizations/{id}':
1816
2257
  get:
1817
2258
  responses:
@@ -1838,11 +2279,13 @@ paths:
1838
2279
  required: true
1839
2280
  schema:
1840
2281
  type: string
2282
+ description: The Order number
1841
2283
  - name: id
1842
2284
  in: path
1843
2285
  required: true
1844
2286
  schema:
1845
2287
  type: string
2288
+ description: 'The ID of the Spree::ReturnAuthorization'
1846
2289
  delete:
1847
2290
  responses:
1848
2291
  '200':
@@ -1879,14 +2322,23 @@ paths:
1879
2322
  '422':
1880
2323
  $ref: '#/components/responses/unprocessable-entity'
1881
2324
  summary: Update order return authorization
1882
- 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.
1883
2329
  operationId: update-order-return-authorization
1884
2330
  tags:
1885
2331
  - Return authorizations
1886
2332
  security:
1887
2333
  - api-key: []
1888
2334
  requestBody:
1889
- $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'
1890
2342
  /config:
1891
2343
  get:
1892
2344
  responses:
@@ -1897,8 +2349,6 @@ paths:
1897
2349
  schema:
1898
2350
  type: object
1899
2351
  properties:
1900
- default_country_id:
1901
- type: integer
1902
2352
  default_country_iso:
1903
2353
  type: string
1904
2354
  '401':
@@ -2081,14 +2531,23 @@ paths:
2081
2531
  '422':
2082
2532
  $ref: '#/components/responses/unprocessable-entity'
2083
2533
  summary: Create option value
2084
- 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.
2085
2538
  operationId: create-option-value
2086
2539
  tags:
2087
2540
  - Option values
2088
2541
  security:
2089
2542
  - api-key: []
2090
2543
  requestBody:
2091
- $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'
2092
2551
  '/option_values/{id}':
2093
2552
  get:
2094
2553
  responses:
@@ -2115,6 +2574,7 @@ paths:
2115
2574
  required: true
2116
2575
  schema:
2117
2576
  type: string
2577
+ description: 'The ID of the Spree::OptionValue'
2118
2578
  delete:
2119
2579
  responses:
2120
2580
  '204':
@@ -2151,14 +2611,24 @@ paths:
2151
2611
  '422':
2152
2612
  $ref: '#/components/responses/unprocessable-entity'
2153
2613
  summary: Update option value
2154
- 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.
2155
2618
  operationId: update-option-value
2156
2619
  tags:
2157
2620
  - Option values
2158
2621
  security:
2159
2622
  - api-key: []
2160
2623
  requestBody:
2161
- $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: ''
2162
2632
  '/option_types/{option_type_id}/option_values':
2163
2633
  get:
2164
2634
  responses:
@@ -2187,6 +2657,7 @@ paths:
2187
2657
  required: true
2188
2658
  schema:
2189
2659
  type: string
2660
+ description: 'The ID of the Spree::OptionType'
2190
2661
  post:
2191
2662
  responses:
2192
2663
  '200':
@@ -2202,14 +2673,23 @@ paths:
2202
2673
  '422':
2203
2674
  $ref: '#/components/responses/unprocessable-entity'
2204
2675
  summary: Create option type value
2205
- 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.
2206
2680
  operationId: create-option-type-value
2207
2681
  tags:
2208
2682
  - Option values
2209
2683
  security:
2210
2684
  - api-key: []
2211
2685
  requestBody:
2212
- $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'
2213
2693
  '/option_types/{option_type_id}/option_values/{id}':
2214
2694
  get:
2215
2695
  responses:
@@ -2235,11 +2715,13 @@ paths:
2235
2715
  required: true
2236
2716
  schema:
2237
2717
  type: string
2718
+ description: 'The ID of the Spree::OptionType'
2238
2719
  - name: id
2239
2720
  in: path
2240
2721
  required: true
2241
2722
  schema:
2242
2723
  type: string
2724
+ description: The ID of the OptionValue
2243
2725
  delete:
2244
2726
  responses:
2245
2727
  '204':
@@ -2276,14 +2758,23 @@ paths:
2276
2758
  '422':
2277
2759
  $ref: '#/components/responses/unprocessable-entity'
2278
2760
  summary: Update option type value
2279
- 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.
2280
2765
  operationId: update-option-type-value
2281
2766
  tags:
2282
2767
  - Option values
2283
2768
  security:
2284
2769
  - api-key: []
2285
2770
  requestBody:
2286
- $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'
2287
2778
  '/products/{product_id}/product_properties':
2288
2779
  get:
2289
2780
  responses:
@@ -2335,14 +2826,29 @@ paths:
2335
2826
  '422':
2336
2827
  $ref: '#/components/responses/unprocessable-entity'
2337
2828
  summary: Create product property
2338
- 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.
2339
2833
  operationId: create-product-property
2340
2834
  tags:
2341
2835
  - Product properties
2342
2836
  security:
2343
2837
  - api-key: []
2344
2838
  requestBody:
2345
- $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
2346
2852
  '/products/{product_id}/product_properties/{id}':
2347
2853
  get:
2348
2854
  responses:
@@ -2410,14 +2916,28 @@ paths:
2410
2916
  '422':
2411
2917
  $ref: '#/components/responses/unprocessable-entity'
2412
2918
  summary: Update product property
2413
- 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.
2414
2923
  operationId: update-product-property
2415
2924
  tags:
2416
2925
  - Product properties
2417
2926
  security:
2418
2927
  - api-key: []
2419
2928
  requestBody:
2420
- $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
2421
2941
  /properties:
2422
2942
  get:
2423
2943
  responses:
@@ -2459,14 +2979,23 @@ paths:
2459
2979
  '422':
2460
2980
  $ref: '#/components/responses/unprocessable-entity'
2461
2981
  summary: Create property
2462
- 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.
2463
2986
  operationId: create-property
2464
2987
  tags:
2465
2988
  - Properties
2466
2989
  security:
2467
2990
  - api-key: []
2468
2991
  requestBody:
2469
- $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'
2470
2999
  '/properties/{id}':
2471
3000
  get:
2472
3001
  responses:
@@ -2493,6 +3022,7 @@ paths:
2493
3022
  required: true
2494
3023
  schema:
2495
3024
  type: string
3025
+ description: 'The id of the Spree::Property'
2496
3026
  delete:
2497
3027
  responses:
2498
3028
  '204':
@@ -2529,14 +3059,23 @@ paths:
2529
3059
  '422':
2530
3060
  $ref: '#/components/responses/unprocessable-entity'
2531
3061
  summary: Update property
2532
- 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.
2533
3066
  operationId: update-property
2534
3067
  tags:
2535
3068
  - Properties
2536
3069
  security:
2537
3070
  - api-key: []
2538
3071
  requestBody:
2539
- $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'
2540
3079
  '/inventory_units/{id}':
2541
3080
  get:
2542
3081
  responses:
@@ -2629,14 +3168,29 @@ paths:
2629
3168
  '422':
2630
3169
  $ref: '#/components/responses/unprocessable-entity'
2631
3170
  summary: Create stock location
2632
- 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.
2633
3175
  operationId: create-stock-location
2634
3176
  tags:
2635
3177
  - Stock locations
2636
3178
  security:
2637
3179
  - api-key: []
2638
3180
  requestBody:
2639
- $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
2640
3194
  '/stock_locations/{id}':
2641
3195
  get:
2642
3196
  responses:
@@ -2662,6 +3216,7 @@ paths:
2662
3216
  required: true
2663
3217
  schema:
2664
3218
  type: string
3219
+ description: The id of the stock location
2665
3220
  delete:
2666
3221
  responses:
2667
3222
  '204':
@@ -2698,14 +3253,28 @@ paths:
2698
3253
  '422':
2699
3254
  $ref: '#/components/responses/unprocessable-entity'
2700
3255
  summary: Update stock location
2701
- 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.
2702
3260
  operationId: update-stock-location
2703
3261
  tags:
2704
3262
  - Stock locations
2705
3263
  security:
2706
3264
  - api-key: []
2707
3265
  requestBody:
2708
- $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
2709
3278
  '/stock_locations/{stock_location_id}/stock_items':
2710
3279
  get:
2711
3280
  responses:
@@ -2757,14 +3326,23 @@ paths:
2757
3326
  '422':
2758
3327
  $ref: '#/components/responses/unprocessable-entity'
2759
3328
  summary: Create stock location item
2760
- 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.
2761
3333
  operationId: create-stock-location-item
2762
3334
  tags:
2763
3335
  - Stock items
2764
3336
  security:
2765
3337
  - api-key: []
2766
3338
  requestBody:
2767
- $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'
2768
3346
  '/stock_locations/{stock_location_id}/stock_items/{id}':
2769
3347
  get:
2770
3348
  responses:
@@ -2790,11 +3368,13 @@ paths:
2790
3368
  required: true
2791
3369
  schema:
2792
3370
  type: string
3371
+ description: 'The ID of the Spree::StockLocation'
2793
3372
  - name: id
2794
3373
  in: path
2795
3374
  required: true
2796
3375
  schema:
2797
3376
  type: string
3377
+ description: 'The ID of the Spree::StockItem'
2798
3378
  delete:
2799
3379
  responses:
2800
3380
  '204':
@@ -2831,14 +3411,23 @@ paths:
2831
3411
  '422':
2832
3412
  $ref: '#/components/responses/unprocessable-entity'
2833
3413
  summary: Update stock location item
2834
- 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.
2835
3418
  operationId: update-stock-location-item
2836
3419
  tags:
2837
3420
  - Stock items
2838
3421
  security:
2839
3422
  - api-key: []
2840
3423
  requestBody:
2841
- $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'
2842
3431
  '/stock_locations/{stock_location_id}/stock_movements':
2843
3432
  get:
2844
3433
  responses:
@@ -3097,14 +3686,30 @@ paths:
3097
3686
  '422':
3098
3687
  $ref: '#/components/responses/unprocessable-entity'
3099
3688
  summary: Create taxonomy
3100
- 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.
3101
3695
  operationId: create-taxonomy
3102
3696
  tags:
3103
3697
  - Taxonomies
3104
3698
  security:
3105
3699
  - api-key: []
3106
3700
  requestBody:
3107
- $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
3108
3713
  '/taxonomies/{id}':
3109
3714
  get:
3110
3715
  responses:
@@ -3130,6 +3735,7 @@ paths:
3130
3735
  required: true
3131
3736
  schema:
3132
3737
  type: string
3738
+ description: The id of the taxonomy
3133
3739
  delete:
3134
3740
  responses:
3135
3741
  '204':
@@ -3166,14 +3772,28 @@ paths:
3166
3772
  '422':
3167
3773
  $ref: '#/components/responses/unprocessable-entity'
3168
3774
  summary: Update taxonomy
3169
- 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.
3170
3779
  operationId: update-taxonomy
3171
3780
  tags:
3172
3781
  - Taxonomies
3173
3782
  security:
3174
3783
  - api-key: []
3175
3784
  requestBody:
3176
- $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
3177
3797
  '/taxonomies/{taxonomy_id}/taxons':
3178
3798
  get:
3179
3799
  responses:
@@ -3210,6 +3830,7 @@ paths:
3210
3830
  required: true
3211
3831
  schema:
3212
3832
  type: string
3833
+ description: The id of the taxonomy for which the new taxon will be added
3213
3834
  post:
3214
3835
  responses:
3215
3836
  '200':
@@ -3225,14 +3846,29 @@ paths:
3225
3846
  '422':
3226
3847
  $ref: '#/components/responses/unprocessable-entity'
3227
3848
  summary: Create taxonomy taxon
3228
- 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.
3229
3853
  operationId: create-taxonomy-taxon
3230
3854
  tags:
3231
3855
  - Taxons
3232
3856
  security:
3233
3857
  - api-key: []
3234
3858
  requestBody:
3235
- $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
3236
3872
  '/taxonomies/{taxonomy_id}/taxons/{id}':
3237
3873
  get:
3238
3874
  responses:
@@ -3258,11 +3894,13 @@ paths:
3258
3894
  required: true
3259
3895
  schema:
3260
3896
  type: string
3897
+ description: The id of the taxon's taxonomy
3261
3898
  - name: id
3262
3899
  in: path
3263
3900
  required: true
3264
3901
  schema:
3265
3902
  type: string
3903
+ description: The id of the taxon
3266
3904
  delete:
3267
3905
  responses:
3268
3906
  '204':
@@ -3299,14 +3937,28 @@ paths:
3299
3937
  '422':
3300
3938
  $ref: '#/components/responses/unprocessable-entity'
3301
3939
  summary: Update taxonomy taxon
3302
- 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.
3303
3944
  operationId: update-taxonomy-taxon
3304
3945
  tags:
3305
3946
  - Taxons
3306
3947
  security:
3307
3948
  - api-key: []
3308
3949
  requestBody:
3309
- $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
3310
3962
  /taxons:
3311
3963
  get:
3312
3964
  responses:
@@ -3375,14 +4027,24 @@ paths:
3375
4027
  '422':
3376
4028
  $ref: '#/components/responses/unprocessable-entity'
3377
4029
  summary: Create user
3378
- 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.
3379
4034
  operationId: create-user
3380
4035
  tags:
3381
4036
  - Users
3382
4037
  security:
3383
4038
  - api-key: []
3384
4039
  requestBody:
3385
- $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: ''
3386
4048
  /zones:
3387
4049
  get:
3388
4050
  responses:
@@ -3424,14 +4086,32 @@ paths:
3424
4086
  '422':
3425
4087
  $ref: '#/components/responses/unprocessable-entity'
3426
4088
  summary: Create zone
3427
- 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.
3428
4093
  operationId: create-zone
3429
4094
  tags:
3430
4095
  - Zones
3431
4096
  security:
3432
4097
  - api-key: []
3433
4098
  requestBody:
3434
- $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
3435
4115
  '/zones/{id}':
3436
4116
  get:
3437
4117
  responses:
@@ -3458,6 +4138,7 @@ paths:
3458
4138
  required: true
3459
4139
  schema:
3460
4140
  type: string
4141
+ description: The ID of the zone we want to update
3461
4142
  delete:
3462
4143
  responses:
3463
4144
  '204':
@@ -3494,73 +4175,28 @@ paths:
3494
4175
  '422':
3495
4176
  $ref: '#/components/responses/unprocessable-entity'
3496
4177
  summary: Update zone
3497
- 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.
3498
4182
  operationId: update-zone
3499
4183
  tags:
3500
4184
  - Zones
3501
4185
  security:
3502
4186
  - api-key: []
3503
4187
  requestBody:
3504
- $ref: '#/components/requestBodies/zone-input'
3505
- '/taxonomies/{taxonomy_id}/jstree':
3506
- get:
3507
- responses:
3508
- '200':
3509
- description: ''
3510
- content:
3511
- application/json:
3512
- schema:
3513
- $ref: '#/components/schemas/jstree'
3514
- '401':
3515
- $ref: '#/components/responses/invalid-api-key'
3516
- '404':
3517
- $ref: '#/components/responses/not-found'
3518
- summary: Get taxonomy jsTree
3519
- description: Builds a taxonomy's jsTree.
3520
- operationId: get-taxonomy-jstree
3521
- tags:
3522
- - Taxonomies
3523
- security:
3524
- - api-key: []
3525
- parameters:
3526
- - name: taxonomy_id
3527
- in: path
3528
- required: true
3529
- schema:
3530
- type: string
3531
- '/taxonomies/{taxonomy_id}/taxons/{taxon_id}/jstree':
3532
- get:
3533
- responses:
3534
- '200':
3535
- description: ''
3536
- content:
3537
- application/json:
3538
- schema:
3539
- type: array
3540
- items:
3541
- $ref: '#/components/schemas/jstree'
3542
- '401':
3543
- $ref: '#/components/responses/invalid-api-key'
3544
- '404':
3545
- $ref: '#/components/responses/not-found'
3546
- summary: Get taxon jsTree
3547
- description: Builds a taxon's jsTree.
3548
- operationId: get-taxon-jstree
3549
- tags:
3550
- - Taxons
3551
- security:
3552
- - api-key: []
3553
- parameters:
3554
- - name: taxonomy_id
3555
- in: path
3556
- required: true
3557
- schema:
3558
- type: string
3559
- - name: taxon_id
3560
- in: path
3561
- required: true
3562
- schema:
3563
- type: string
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.
3564
4200
  '/promotions/{id}':
3565
4201
  get:
3566
4202
  responses:
@@ -3615,7 +4251,7 @@ paths:
3615
4251
  - $ref: '#/components/parameters/per_page'
3616
4252
  security:
3617
4253
  - api-key: []
3618
- '/checkouts/{checkout_id}/line_items/{id}':
4254
+ '/orders/{order_number}/coupon_codes/{id}':
3619
4255
  delete:
3620
4256
  responses:
3621
4257
  '204':
@@ -3623,34 +4259,43 @@ paths:
3623
4259
  content:
3624
4260
  application/json:
3625
4261
  schema:
3626
- $ref: '#/components/schemas/line-item'
4262
+ $ref: '#/components/schemas/coupon-code-handler'
3627
4263
  '401':
3628
4264
  $ref: '#/components/responses/invalid-api-key'
3629
4265
  '404':
3630
4266
  $ref: '#/components/responses/not-found'
3631
4267
  '422':
3632
- $ref: '#/components/responses/delete-restriction'
3633
- summary: Delete checkout line item
3634
- description: Deletes a checkout's line item.
3635
- 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
3636
4279
  tags:
3637
- - Line items
4280
+ - Coupon codes
3638
4281
  security:
3639
4282
  - api-key: []
3640
4283
  - order-token: []
3641
4284
  parameters:
3642
- - name: checkout_id
4285
+ - name: order_number
3643
4286
  in: path
3644
4287
  required: true
3645
- description: The order number
3646
4288
  schema:
3647
4289
  type: string
4290
+ description: The order number
3648
4291
  - name: id
3649
4292
  in: path
3650
4293
  required: true
4294
+ description: This is the coupon code
3651
4295
  schema:
3652
4296
  type: string
3653
- patch:
4297
+ '/orders/{order_number}/line_items':
4298
+ post:
3654
4299
  responses:
3655
4300
  '200':
3656
4301
  description: ''
@@ -3664,9 +4309,12 @@ paths:
3664
4309
  $ref: '#/components/responses/not-found'
3665
4310
  '422':
3666
4311
  $ref: '#/components/responses/unprocessable-entity'
3667
- summary: Update checkout line item
3668
- description: Updates a checkout's line item.
3669
- 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
3670
4318
  tags:
3671
4319
  - Line items
3672
4320
  security:
@@ -3678,47 +4326,21 @@ paths:
3678
4326
  schema:
3679
4327
  type: object
3680
4328
  properties:
3681
- line_items_attributes:
3682
- allOf:
3683
- - properties:
3684
- id:
3685
- type: integer
3686
- type: object
3687
- '/orders/{order_number}/coupon_codes/{id}':
3688
- delete:
3689
- responses:
3690
- '204':
3691
- description: ''
3692
- content:
3693
- application/json:
3694
- schema:
3695
- $ref: '#/components/schemas/coupon-code-handler'
3696
- '401':
3697
- $ref: '#/components/responses/invalid-api-key'
3698
- '404':
3699
- $ref: '#/components/responses/not-found'
3700
- '422':
3701
- $ref: '#/components/responses/delete-restriction'
3702
- summary: Delete order coupon code
3703
- description: Deletes an order's coupon code.
3704
- operationId: delete-order-coupon-code
3705
- tags:
3706
- - Coupon codes
3707
- security:
3708
- - api-key: []
3709
- - 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: ''
3710
4338
  parameters:
3711
4339
  - name: order_number
3712
4340
  in: path
3713
4341
  required: true
3714
4342
  schema:
3715
4343
  type: string
3716
- - name: id
3717
- in: path
3718
- required: true
3719
- description: This is the coupon code
3720
- schema:
3721
- type: string
3722
4344
  '/orders/{order_number}/line_items/{id}':
3723
4345
  delete:
3724
4346
  responses:
@@ -3748,11 +4370,13 @@ paths:
3748
4370
  required: true
3749
4371
  schema:
3750
4372
  type: string
4373
+ description: The order number
3751
4374
  - name: id
3752
4375
  in: path
3753
4376
  required: true
3754
4377
  schema:
3755
4378
  type: string
4379
+ description: The id of the line item to update
3756
4380
  patch:
3757
4381
  responses:
3758
4382
  '200':
@@ -3768,7 +4392,10 @@ paths:
3768
4392
  '422':
3769
4393
  $ref: '#/components/responses/unprocessable-entity'
3770
4394
  summary: Update order line item
3771
- 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).
3772
4399
  operationId: update-order-line-item
3773
4400
  tags:
3774
4401
  - Line items
@@ -3776,7 +4403,18 @@ paths:
3776
4403
  - api-key: []
3777
4404
  - order-token: []
3778
4405
  requestBody:
3779
- $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
3780
4418
  '/stock_items/{id}':
3781
4419
  delete:
3782
4420
  responses:
@@ -3805,6 +4443,7 @@ paths:
3805
4443
  required: true
3806
4444
  schema:
3807
4445
  type: string
4446
+ description: 'The ID of the Stock::Item'
3808
4447
  patch:
3809
4448
  responses:
3810
4449
  '200':
@@ -3820,14 +4459,23 @@ paths:
3820
4459
  '422':
3821
4460
  $ref: '#/components/responses/unprocessable-entity'
3822
4461
  summary: Update stock item
3823
- 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.
3824
4466
  operationId: update-stock-item
3825
4467
  tags:
3826
4468
  - Stock items
3827
4469
  security:
3828
4470
  - api-key: []
3829
4471
  requestBody:
3830
- $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'
3831
4479
  '/checkouts/{id}':
3832
4480
  patch:
3833
4481
  responses:
@@ -3844,13 +4492,12 @@ paths:
3844
4492
  '422':
3845
4493
  $ref: '#/components/responses/unprocessable-entity'
3846
4494
  summary: Update checkout
3847
- description: >-
3848
- Updates a checkout.
4495
+ description: |-
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.
3849
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).
3850
4499
 
3851
- **Note:** In addition to the order update, this action always attempts
3852
- to perform an order state machine transition which results in a `422`
3853
- response if it cannot be transitioned.
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.
3854
4501
  operationId: update-checkout
3855
4502
  tags:
3856
4503
  - Checkouts
@@ -3861,13 +4508,17 @@ paths:
3861
4508
  content:
3862
4509
  application/json:
3863
4510
  schema:
3864
- $ref: '#/components/schemas/checkout-input'
4511
+ type: object
4512
+ properties:
4513
+ order:
4514
+ $ref: '#/components/schemas/order-input'
3865
4515
  parameters:
3866
4516
  - name: id
3867
4517
  in: path
3868
4518
  required: true
3869
4519
  schema:
3870
4520
  type: string
4521
+ description: The order number
3871
4522
  '/credit_cards/{id}':
3872
4523
  patch:
3873
4524
  responses:
@@ -3917,7 +4568,10 @@ paths:
3917
4568
  '422':
3918
4569
  $ref: '#/components/responses/unprocessable-entity'
3919
4570
  summary: Update shipment
3920
- 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.
3921
4575
  operationId: update-shipment
3922
4576
  tags:
3923
4577
  - Shipments
@@ -3927,7 +4581,15 @@ paths:
3927
4581
  content:
3928
4582
  application/json:
3929
4583
  schema:
3930
- $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
3931
4593
  parameters:
3932
4594
  - name: number
3933
4595
  in: path
@@ -4232,78 +4894,167 @@ paths:
4232
4894
  description: The order number
4233
4895
  schema:
4234
4896
  type: string
4235
- /classifications:
4236
- put:
4897
+ '/checkouts/{checkout_id}/line_items':
4898
+ post:
4237
4899
  responses:
4238
4900
  '200':
4239
4901
  description: ''
4240
4902
  content:
4241
4903
  application/json:
4242
4904
  schema:
4243
- type: object
4244
- properties: {}
4905
+ $ref: '#/components/schemas/line-item'
4245
4906
  '401':
4246
4907
  $ref: '#/components/responses/invalid-api-key'
4908
+ '404':
4909
+ $ref: '#/components/responses/not-found'
4247
4910
  '422':
4248
4911
  $ref: '#/components/responses/unprocessable-entity'
4249
- summary: Update classification
4912
+ summary: Create checkout line item
4250
4913
  description: |-
4251
- Updates a classification.
4914
+ Create a line item in an checkout not yet completed.
4252
4915
 
4253
- This method only updates the classification position.
4254
- operationId: update-classification
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
4255
4920
  tags:
4256
- - Classifications
4921
+ - Line items
4257
4922
  security:
4258
4923
  - api-key: []
4924
+ - order-token: []
4259
4925
  requestBody:
4260
4926
  content:
4261
4927
  application/json:
4262
4928
  schema:
4263
4929
  type: object
4264
4930
  properties:
4265
- product_id:
4266
- type: integer
4267
- taxon_id:
4268
- type: integer
4269
- position:
4270
- type: integer
4271
- '/orders/{order_number}/apply_coupon_code':
4272
- put:
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:
4273
4948
  responses:
4274
- '200':
4949
+ '204':
4275
4950
  description: ''
4276
4951
  content:
4277
4952
  application/json:
4278
4953
  schema:
4279
- $ref: '#/components/schemas/coupon-code-handler'
4954
+ $ref: '#/components/schemas/line-item'
4280
4955
  '401':
4281
4956
  $ref: '#/components/responses/invalid-api-key'
4282
4957
  '404':
4283
4958
  $ref: '#/components/responses/not-found'
4284
4959
  '422':
4285
- $ref: '#/components/responses/unprocessable-entity'
4286
- summary: Apply order coupon code
4287
- deprecated: true
4288
- description: >-
4289
- **Deprecated:** This method is deprecated. Please use
4290
- `Spree::Api::CouponCodesController#create` endpoint instead.
4291
-
4292
- Applies a coupon code on the order.
4293
- operationId: apply-order-coupon-code
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
4294
4964
  tags:
4295
- - Coupon codes
4965
+ - Line items
4296
4966
  security:
4297
4967
  - api-key: []
4298
4968
  - order-token: []
4299
- requestBody:
4300
- $ref: '#/components/requestBodies/coupon-code-input'
4301
4969
  parameters:
4302
- - name: order_number
4970
+ - name: checkout_id
4971
+ in: path
4972
+ required: true
4973
+ description: The order number
4974
+ schema:
4975
+ type: string
4976
+ - name: id
4303
4977
  in: path
4304
4978
  required: true
4305
4979
  schema:
4306
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
5022
+ /classifications:
5023
+ put:
5024
+ responses:
5025
+ '200':
5026
+ description: ''
5027
+ content:
5028
+ application/json:
5029
+ schema:
5030
+ type: object
5031
+ properties: {}
5032
+ '401':
5033
+ $ref: '#/components/responses/invalid-api-key'
5034
+ '422':
5035
+ $ref: '#/components/responses/unprocessable-entity'
5036
+ summary: Update classification
5037
+ description: |-
5038
+ Updates a classification.
5039
+
5040
+ This method only updates the classification position.
5041
+ operationId: update-classification
5042
+ tags:
5043
+ - Classifications
5044
+ security:
5045
+ - api-key: []
5046
+ requestBody:
5047
+ content:
5048
+ application/json:
5049
+ schema:
5050
+ type: object
5051
+ properties:
5052
+ product_id:
5053
+ type: integer
5054
+ taxon_id:
5055
+ type: integer
5056
+ position:
5057
+ type: integer
4307
5058
  '/orders/{order_number}/cancel':
4308
5059
  put:
4309
5060
  responses:
@@ -4720,7 +5471,7 @@ paths:
4720
5471
  required: true
4721
5472
  schema:
4722
5473
  type: string
4723
- '/checkouts/{checkout_id}/line_items':
5474
+ '/orders/{order_number}/coupon_codes':
4724
5475
  post:
4725
5476
  responses:
4726
5477
  '200':
@@ -4728,47 +5479,22 @@ paths:
4728
5479
  content:
4729
5480
  application/json:
4730
5481
  schema:
4731
- $ref: '#/components/schemas/line-item'
5482
+ $ref: '#/components/schemas/coupon-code-handler'
4732
5483
  '401':
4733
5484
  $ref: '#/components/responses/invalid-api-key'
4734
5485
  '404':
4735
5486
  $ref: '#/components/responses/not-found'
4736
5487
  '422':
4737
- $ref: '#/components/responses/unprocessable-entity'
4738
- summary: Create checkout line item
4739
- description: Creates a new line item for a checkout.
4740
- operationId: create-checkout-line-item
4741
- tags:
4742
- - Line items
4743
- security:
4744
- - api-key: []
4745
- - order-token: []
4746
- requestBody:
4747
- $ref: '#/components/requestBodies/line-item-input'
4748
- parameters:
4749
- - name: checkout_id
4750
- in: path
4751
- required: true
4752
- description: The order number
4753
- schema:
4754
- type: string
4755
- '/orders/{order_number}/coupon_codes':
4756
- post:
4757
- responses:
4758
- '200':
4759
5488
  description: ''
4760
5489
  content:
4761
5490
  application/json:
4762
5491
  schema:
4763
5492
  $ref: '#/components/schemas/coupon-code-handler'
4764
- '401':
4765
- $ref: '#/components/responses/invalid-api-key'
4766
- '404':
4767
- $ref: '#/components/responses/not-found'
4768
- '422':
4769
- $ref: '#/components/responses/unprocessable-entity'
4770
5493
  summary: Create order coupon code
4771
- 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).
4772
5498
  operationId: create-order-coupon-code
4773
5499
  tags:
4774
5500
  - Coupon codes
@@ -4776,44 +5502,21 @@ paths:
4776
5502
  - api-key: []
4777
5503
  - order-token: []
4778
5504
  requestBody:
4779
- $ref: '#/components/requestBodies/coupon-code-input'
4780
- parameters:
4781
- - name: order_number
4782
- in: path
4783
- required: true
4784
- schema:
4785
- type: string
4786
- '/orders/{order_number}/line_items':
4787
- post:
4788
- responses:
4789
- '200':
4790
- description: ''
4791
- content:
4792
- application/json:
4793
- schema:
4794
- $ref: '#/components/schemas/line-item'
4795
- '401':
4796
- $ref: '#/components/responses/invalid-api-key'
4797
- '404':
4798
- $ref: '#/components/responses/not-found'
4799
- '422':
4800
- $ref: '#/components/responses/unprocessable-entity'
4801
- summary: Create order line item
4802
- description: Creates a line item for an order.
4803
- operationId: create-order-line-item
4804
- tags:
4805
- - Line items
4806
- security:
4807
- - api-key: []
4808
- - order-token: []
4809
- requestBody:
4810
- $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
4811
5513
  parameters:
4812
5514
  - name: order_number
4813
5515
  in: path
4814
5516
  required: true
4815
5517
  schema:
4816
5518
  type: string
5519
+ description: The order number
4817
5520
  /shipments:
4818
5521
  post:
4819
5522
  responses:
@@ -4828,7 +5531,10 @@ paths:
4828
5531
  '422':
4829
5532
  $ref: '#/components/responses/unprocessable-entity'
4830
5533
  summary: Create shipment
4831
- 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.
4832
5538
  operationId: create-shipment
4833
5539
  tags:
4834
5540
  - Shipments
@@ -4846,6 +5552,12 @@ paths:
4846
5552
  type: integer
4847
5553
  quantity:
4848
5554
  type: integer
5555
+ examples:
5556
+ Example:
5557
+ value:
5558
+ stock_location_id: 0
5559
+ variant_id: 0
5560
+ quantity: 0
4849
5561
  /shipments/transfer_to_location:
4850
5562
  post:
4851
5563
  responses:
@@ -4983,7 +5695,7 @@ paths:
4983
5695
  '404':
4984
5696
  $ref: '#/components/responses/not-found'
4985
5697
  summary: List order customer returns
4986
- description: "Lists an order's customer returns."
5698
+ description: Lists an order's customer returns.
4987
5699
  operationId: list-order-customer-returns
4988
5700
  tags:
4989
5701
  - Customer returns
@@ -4998,6 +5710,7 @@ paths:
4998
5710
  schema:
4999
5711
  type: string
5000
5712
  required: true
5713
+ description: The order number
5001
5714
  post:
5002
5715
  responses:
5003
5716
  '200':
@@ -5013,12 +5726,21 @@ paths:
5013
5726
  '422':
5014
5727
  $ref: '#/components/responses/unprocessable-entity'
5015
5728
  summary: Create order customer return
5016
- 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.
5017
5733
  operationId: create-order-customer-return
5018
5734
  tags:
5019
5735
  - Customer returns
5020
5736
  requestBody:
5021
- $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'
5022
5744
  security:
5023
5745
  - api-key: []
5024
5746
  tags:
@@ -5112,96 +5834,6 @@ components:
5112
5834
  message:
5113
5835
  type: string
5114
5836
  requestBodies:
5115
- taxon-input:
5116
- content:
5117
- application/json:
5118
- schema:
5119
- $ref: '#/components/schemas/taxon-input'
5120
- line-item-input:
5121
- content:
5122
- application/json:
5123
- schema:
5124
- $ref: '#/components/schemas/line-item-input'
5125
- payment-input:
5126
- content:
5127
- application/json:
5128
- schema:
5129
- $ref: '#/components/schemas/payment-input'
5130
- zone-input:
5131
- content:
5132
- application/json:
5133
- schema:
5134
- $ref: '#/components/schemas/zone-input'
5135
- product-property-input:
5136
- content:
5137
- application/json:
5138
- schema:
5139
- $ref: '#/components/schemas/product-property-input'
5140
- stock-location-input:
5141
- content:
5142
- application/json:
5143
- schema:
5144
- $ref: '#/components/schemas/stock-location-input'
5145
- product-input:
5146
- content:
5147
- application/json:
5148
- schema:
5149
- $ref: '#/components/schemas/product-input'
5150
- property-input:
5151
- content:
5152
- application/json:
5153
- schema:
5154
- $ref: '#/components/schemas/property-input'
5155
- address-input:
5156
- content:
5157
- application/json:
5158
- schema:
5159
- $ref: '#/components/schemas/address-input'
5160
- order-input:
5161
- content:
5162
- application/json:
5163
- schema:
5164
- $ref: '#/components/schemas/order-input'
5165
- image-input:
5166
- content:
5167
- application/json:
5168
- schema:
5169
- $ref: '#/components/schemas/image-input'
5170
- variant-input:
5171
- content:
5172
- application/json:
5173
- schema:
5174
- $ref: '#/components/schemas/variant-input'
5175
- user-input:
5176
- content:
5177
- application/json:
5178
- schema:
5179
- $ref: '#/components/schemas/user-input'
5180
- return-authorization-input:
5181
- content:
5182
- application/json:
5183
- schema:
5184
- $ref: '#/components/schemas/return-authorization-input'
5185
- customer-return-input:
5186
- content:
5187
- application/json:
5188
- schema:
5189
- $ref: '#/components/schemas/customer-return-input'
5190
- option-value-input:
5191
- content:
5192
- application/json:
5193
- schema:
5194
- $ref: '#/components/schemas/option-value-input'
5195
- stock-item-input:
5196
- content:
5197
- application/json:
5198
- schema:
5199
- $ref: '#/components/schemas/stock-item-input'
5200
- taxonomy-input:
5201
- content:
5202
- application/json:
5203
- schema:
5204
- $ref: '#/components/schemas/taxonomy-input'
5205
5837
  complete-checkoutBody:
5206
5838
  content:
5207
5839
  application/json:
@@ -5210,11 +5842,6 @@ components:
5210
5842
  properties:
5211
5843
  expected_total:
5212
5844
  type: string
5213
- coupon-code-input:
5214
- content:
5215
- application/json:
5216
- schema:
5217
- $ref: '#/components/schemas/coupon-code-input'
5218
5845
  add-shipment-itemBody:
5219
5846
  content:
5220
5847
  application/json:
@@ -5675,20 +6302,8 @@ components:
5675
6302
  type: integer
5676
6303
  country_iso:
5677
6304
  type: string
5678
- firstname:
5679
- type: string
5680
- deprecated: true
5681
- description: '*Deprecated: will be removed in Solidus 3.0, please use `name` property*'
5682
- full_name:
5683
- type: string
5684
- deprecated: true
5685
- description: '*Deprecated: will be removed in Solidus 3.0, please use `name` property*'
5686
6305
  id:
5687
6306
  type: integer
5688
- lastname:
5689
- type: string
5690
- deprecated: true
5691
- description: '*Deprecated: will be removed in Solidus 3.0, please use `name` property*'
5692
6307
  name:
5693
6308
  type: string
5694
6309
  phone:
@@ -6117,23 +6732,6 @@ components:
6117
6732
  root:
6118
6733
  $ref: '#/components/schemas/taxon'
6119
6734
  title: Taxonomy
6120
- jstree:
6121
- type: array
6122
- items:
6123
- type: object
6124
- properties:
6125
- attr:
6126
- type: object
6127
- properties:
6128
- id:
6129
- type: integer
6130
- name:
6131
- type: string
6132
- data:
6133
- type: string
6134
- state:
6135
- type: string
6136
- title: jsTree
6137
6735
  promotion:
6138
6736
  type: object
6139
6737
  properties:
@@ -6180,12 +6778,18 @@ components:
6180
6778
  properties:
6181
6779
  success:
6182
6780
  type: string
6781
+ description: Message returned if the coupon has been applied.
6183
6782
  error:
6184
6783
  type: string
6784
+ description: Message returned if there are errors applying the coupon.
6185
6785
  successful:
6186
6786
  type: boolean
6187
6787
  status_code:
6188
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`.
6189
6793
  address-book:
6190
6794
  type: array
6191
6795
  title: Address book
@@ -6225,14 +6829,6 @@ components:
6225
6829
  type: integer
6226
6830
  name:
6227
6831
  type: string
6228
- firstname:
6229
- type: string
6230
- deprecated: true
6231
- description: '*Deprecated: will be removed in Solidus 3.0, please use `name` property*'
6232
- lastname:
6233
- type: string
6234
- deprecated: true
6235
- description: '*Deprecated: will be removed in Solidus 3.0, please use `name` property*'
6236
6832
  address1:
6237
6833
  type: string
6238
6834
  address2:
@@ -6273,22 +6869,20 @@ components:
6273
6869
  type: string
6274
6870
  abbr:
6275
6871
  type: string
6872
+ description: ''
6276
6873
  line-item-input:
6277
6874
  type: object
6278
6875
  title: Line item input
6279
6876
  properties:
6280
6877
  quantity:
6281
6878
  type: integer
6282
- 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`.'
6283
6880
  options:
6284
6881
  type: object
6285
- description: >-
6286
- This field can be used to pass custom line item attributes. When
6287
- used, it will force a new price calculation, unless `price` is one
6288
- of the options.
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.'
6289
6883
  id:
6290
6884
  type: integer
6291
- description: Required for existing line items only.
6885
+ description: 'Required when updating existing line items, only when not already present in the Path Parameters.'
6292
6886
  variant_id:
6293
6887
  type: integer
6294
6888
  description: Required for new line items only.
@@ -6312,30 +6906,6 @@ components:
6312
6906
  type: string
6313
6907
  presentation:
6314
6908
  type: string
6315
- checkout-input:
6316
- type: object
6317
- title: Checkout input
6318
- properties:
6319
- coupon_code:
6320
- type: string
6321
- email:
6322
- type: string
6323
- special_instructions:
6324
- type: string
6325
- use_billing:
6326
- type: boolean
6327
- bill_address_attributes:
6328
- $ref: '#/components/schemas/address-input'
6329
- ship_address_attributes:
6330
- $ref: '#/components/schemas/address-input'
6331
- payments_attributes:
6332
- type: array
6333
- items:
6334
- $ref: '#/components/schemas/payment-input'
6335
- shipments_attributes:
6336
- type: array
6337
- items:
6338
- $ref: '#/components/schemas/shipment-input'
6339
6909
  credit-card-update-input:
6340
6910
  type: object
6341
6911
  title: Credit card update input
@@ -6370,10 +6940,9 @@ components:
6370
6940
  type: string
6371
6941
  payment_method_id:
6372
6942
  type: integer
6373
- payment_method:
6374
- type: string
6375
6943
  source_attributes:
6376
6944
  type: object
6945
+ description: This field is required for Payment Method that has source_required? returning true.
6377
6946
  properties:
6378
6947
  number:
6379
6948
  type: string
@@ -6399,8 +6968,6 @@ components:
6399
6968
  type: string
6400
6969
  encrypted_data:
6401
6970
  type: string
6402
- existing_card_id:
6403
- type: integer
6404
6971
  wallet_payment_source_id:
6405
6972
  type: integer
6406
6973
  address_attributes:
@@ -6421,14 +6988,29 @@ components:
6421
6988
  type: integer
6422
6989
  order-input:
6423
6990
  title: Order input
6424
- allOf:
6425
- - $ref: '#/components/schemas/checkout-input'
6426
- - type: object
6427
- properties:
6428
- line_items_attributes:
6429
- type: array
6430
- items:
6431
- $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'
6432
7014
  product-input:
6433
7015
  type: object
6434
7016
  title: Product input
@@ -6466,13 +7048,11 @@ components:
6466
7048
  tax_category_id:
6467
7049
  type: integer
6468
7050
  taxon_ids:
6469
- type: array
6470
- items:
6471
- type: integer
7051
+ type: string
7052
+ description: 'Comma separated list of taxon ids. Eg. "1,2"'
6472
7053
  option_type_ids:
6473
- type: array
6474
- items:
6475
- type: integer
7054
+ description: 'Comma separated list of option type ids ids. Eg. "1,2"'
7055
+ type: string
6476
7056
  cost_currency:
6477
7057
  type: string
6478
7058
  cost_price:
@@ -6509,28 +7089,16 @@ components:
6509
7089
  type: object
6510
7090
  title: Variant input
6511
7091
  properties:
6512
- name:
6513
- type: string
6514
- presentation:
7092
+ price:
6515
7093
  type: string
6516
7094
  cost_price:
6517
7095
  type: string
6518
- lock_version:
6519
- type: string
6520
7096
  position:
6521
7097
  type: integer
6522
7098
  track_inventory:
6523
7099
  type: boolean
6524
7100
  product_id:
6525
7101
  type: integer
6526
- product:
6527
- type: integer
6528
- option_values_attributes:
6529
- type: array
6530
- items:
6531
- $ref: '#/components/schemas/option-value-input'
6532
- price:
6533
- type: string
6534
7102
  weight:
6535
7103
  type: string
6536
7104
  height:
@@ -6547,13 +7115,20 @@ components:
6547
7115
  type: array
6548
7116
  items:
6549
7117
  type: integer
7118
+ option_values_attributes:
7119
+ type: array
7120
+ items:
7121
+ $ref: '#/components/schemas/option-value-input'
6550
7122
  options:
6551
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.'
6552
7125
  properties:
6553
7126
  name:
6554
7127
  type: string
6555
7128
  value:
6556
7129
  type: string
7130
+ required:
7131
+ - price
6557
7132
  property-input:
6558
7133
  type: object
6559
7134
  title: Property input
@@ -6630,6 +7205,8 @@ components:
6630
7205
  properties:
6631
7206
  name:
6632
7207
  type: string
7208
+ required:
7209
+ - name
6633
7210
  taxon-input:
6634
7211
  type: object
6635
7212
  title: Taxon input