spree_api 4.4.0 → 4.5.0

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 (176) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/concerns/spree/api/v2/product_list_includes.rb +10 -8
  3. data/app/controllers/spree/api/v2/platform/orders_controller.rb +1 -1
  4. data/app/controllers/spree/api/v2/platform/products_controller.rb +5 -1
  5. data/app/controllers/spree/api/v2/storefront/checkout_controller.rb +1 -1
  6. data/app/controllers/spree/api/v2/storefront/digitals_controller.rb +5 -1
  7. data/app/controllers/spree/api/v2/storefront/stores_controller.rb +4 -0
  8. data/app/helpers/spree/api/v2/store_media_serializer_images_concern.rb +35 -0
  9. data/app/models/concerns/spree/webhooks/has_webhooks.rb +31 -7
  10. data/app/models/spree/api/webhooks/product_decorator.rb +21 -2
  11. data/app/models/spree/webhooks/subscriber.rb +4 -0
  12. data/app/serializers/spree/api/v2/platform/cms_section_image_one_serializer.rb +9 -0
  13. data/app/serializers/spree/api/v2/platform/cms_section_image_three_serializer.rb +9 -0
  14. data/app/serializers/spree/api/v2/platform/cms_section_image_two_serializer.rb +9 -0
  15. data/app/serializers/spree/api/v2/platform/hero_image_serializer.rb +10 -0
  16. data/app/serializers/spree/api/v2/platform/image_gallery_serializer.rb +10 -0
  17. data/app/serializers/spree/api/v2/platform/side_by_side_image_serializer.rb +10 -0
  18. data/app/serializers/spree/api/v2/platform/store_serializer.rb +1 -0
  19. data/app/serializers/spree/api/v2/platform/user_serializer.rb +1 -1
  20. data/app/serializers/spree/v2/storefront/cms_section_serializer.rb +3 -3
  21. data/app/serializers/spree/v2/storefront/order_serializer.rb +9 -0
  22. data/app/serializers/spree/v2/storefront/product_property_serializer.rb +1 -1
  23. data/app/serializers/spree/v2/storefront/product_serializer.rb +1 -1
  24. data/app/serializers/spree/v2/storefront/shipment_serializer.rb +3 -0
  25. data/app/serializers/spree/v2/storefront/store_serializer.rb +5 -10
  26. data/app/serializers/spree/v2/storefront/user_serializer.rb +1 -1
  27. data/app/serializers/spree/v2/storefront/variant_serializer.rb +1 -1
  28. data/app/services/spree/webhooks/subscribers/queue_requests.rb +8 -2
  29. data/config/routes.rb +1 -120
  30. data/docs/v2/platform/index.yaml +1597 -998
  31. data/docs/v2/storefront/index.yaml +357 -33
  32. data/lib/spree/api/configuration.rb +11 -0
  33. data/lib/spree/api/dependencies.rb +165 -0
  34. data/lib/spree/api/engine.rb +5 -16
  35. data/lib/spree/api/testing_support/v2/platform_contexts.rb +0 -1
  36. data/lib/spree/api.rb +0 -4
  37. data/lib/spree_api.rb +0 -1
  38. data/spree_api.gemspec +0 -2
  39. metadata +16 -177
  40. data/app/controllers/spree/api/base_controller.rb +0 -171
  41. data/app/controllers/spree/api/v1/addresses_controller.rb +0 -46
  42. data/app/controllers/spree/api/v1/checkouts_controller.rb +0 -106
  43. data/app/controllers/spree/api/v1/classifications_controller.rb +0 -21
  44. data/app/controllers/spree/api/v1/countries_controller.rb +0 -22
  45. data/app/controllers/spree/api/v1/credit_cards_controller.rb +0 -26
  46. data/app/controllers/spree/api/v1/customer_returns_controller.rb +0 -25
  47. data/app/controllers/spree/api/v1/images_controller.rb +0 -58
  48. data/app/controllers/spree/api/v1/inventory_units_controller.rb +0 -54
  49. data/app/controllers/spree/api/v1/line_items_controller.rb +0 -70
  50. data/app/controllers/spree/api/v1/option_types_controller.rb +0 -60
  51. data/app/controllers/spree/api/v1/option_values_controller.rb +0 -62
  52. data/app/controllers/spree/api/v1/orders_controller.rb +0 -160
  53. data/app/controllers/spree/api/v1/payments_controller.rb +0 -82
  54. data/app/controllers/spree/api/v1/product_properties_controller.rb +0 -73
  55. data/app/controllers/spree/api/v1/products_controller.rb +0 -131
  56. data/app/controllers/spree/api/v1/promotions_controller.rb +0 -30
  57. data/app/controllers/spree/api/v1/properties_controller.rb +0 -70
  58. data/app/controllers/spree/api/v1/reimbursements_controller.rb +0 -25
  59. data/app/controllers/spree/api/v1/return_authorizations_controller.rb +0 -70
  60. data/app/controllers/spree/api/v1/shipments_controller.rb +0 -196
  61. data/app/controllers/spree/api/v1/states_controller.rb +0 -36
  62. data/app/controllers/spree/api/v1/stock_items_controller.rb +0 -82
  63. data/app/controllers/spree/api/v1/stock_locations_controller.rb +0 -53
  64. data/app/controllers/spree/api/v1/stock_movements_controller.rb +0 -45
  65. data/app/controllers/spree/api/v1/stores_controller.rb +0 -56
  66. data/app/controllers/spree/api/v1/taxonomies_controller.rb +0 -67
  67. data/app/controllers/spree/api/v1/taxons_controller.rb +0 -100
  68. data/app/controllers/spree/api/v1/users_controller.rb +0 -97
  69. data/app/controllers/spree/api/v1/variants_controller.rb +0 -81
  70. data/app/controllers/spree/api/v1/zones_controller.rb +0 -55
  71. data/app/helpers/spree/api/api_helpers.rb +0 -190
  72. data/app/models/spree/api_configuration.rb +0 -10
  73. data/app/views/spree/api/errors/gateway_error.rabl +0 -2
  74. data/app/views/spree/api/errors/invalid_api_key.rabl +0 -2
  75. data/app/views/spree/api/errors/invalid_resource.rabl +0 -3
  76. data/app/views/spree/api/errors/must_specify_api_key.rabl +0 -2
  77. data/app/views/spree/api/errors/not_found.rabl +0 -2
  78. data/app/views/spree/api/errors/unauthorized.rabl +0 -2
  79. data/app/views/spree/api/v1/addresses/show.rabl +0 -10
  80. data/app/views/spree/api/v1/adjustments/show.rabl +0 -4
  81. data/app/views/spree/api/v1/countries/index.rabl +0 -7
  82. data/app/views/spree/api/v1/countries/show.rabl +0 -5
  83. data/app/views/spree/api/v1/credit_cards/index.rabl +0 -7
  84. data/app/views/spree/api/v1/credit_cards/show.rabl +0 -3
  85. data/app/views/spree/api/v1/customer_returns/index.rabl +0 -7
  86. data/app/views/spree/api/v1/images/index.rabl +0 -4
  87. data/app/views/spree/api/v1/images/new.rabl +0 -3
  88. data/app/views/spree/api/v1/images/show.rabl +0 -6
  89. data/app/views/spree/api/v1/inventory_units/show.rabl +0 -2
  90. data/app/views/spree/api/v1/line_items/new.rabl +0 -3
  91. data/app/views/spree/api/v1/line_items/show.rabl +0 -14
  92. data/app/views/spree/api/v1/option_types/index.rabl +0 -3
  93. data/app/views/spree/api/v1/option_types/new.rabl +0 -3
  94. data/app/views/spree/api/v1/option_types/show.rabl +0 -5
  95. data/app/views/spree/api/v1/option_values/index.rabl +0 -3
  96. data/app/views/spree/api/v1/option_values/new.rabl +0 -3
  97. data/app/views/spree/api/v1/option_values/show.rabl +0 -2
  98. data/app/views/spree/api/v1/orders/address.rabl +0 -0
  99. data/app/views/spree/api/v1/orders/canceled.rabl +0 -0
  100. data/app/views/spree/api/v1/orders/cart.rabl +0 -0
  101. data/app/views/spree/api/v1/orders/complete.rabl +0 -0
  102. data/app/views/spree/api/v1/orders/could_not_apply_coupon.rabl +0 -2
  103. data/app/views/spree/api/v1/orders/could_not_transition.rabl +0 -3
  104. data/app/views/spree/api/v1/orders/index.rabl +0 -7
  105. data/app/views/spree/api/v1/orders/insufficient_quantity.rabl +0 -2
  106. data/app/views/spree/api/v1/orders/invalid_shipping_method.rabl +0 -2
  107. data/app/views/spree/api/v1/orders/mine.rabl +0 -9
  108. data/app/views/spree/api/v1/orders/order.rabl +0 -10
  109. data/app/views/spree/api/v1/orders/payment.rabl +0 -3
  110. data/app/views/spree/api/v1/orders/show.rabl +0 -51
  111. data/app/views/spree/api/v1/payments/credit_over_limit.rabl +0 -2
  112. data/app/views/spree/api/v1/payments/index.rabl +0 -7
  113. data/app/views/spree/api/v1/payments/new.rabl +0 -5
  114. data/app/views/spree/api/v1/payments/show.rabl +0 -2
  115. data/app/views/spree/api/v1/payments/update_forbidden.rabl +0 -2
  116. data/app/views/spree/api/v1/product_properties/index.rabl +0 -7
  117. data/app/views/spree/api/v1/product_properties/new.rabl +0 -2
  118. data/app/views/spree/api/v1/product_properties/show.rabl +0 -2
  119. data/app/views/spree/api/v1/products/index.rabl +0 -9
  120. data/app/views/spree/api/v1/products/new.rabl +0 -3
  121. data/app/views/spree/api/v1/products/product.rabl +0 -1
  122. data/app/views/spree/api/v1/products/show.rabl +0 -36
  123. data/app/views/spree/api/v1/promotions/handler.rabl +0 -5
  124. data/app/views/spree/api/v1/promotions/show.rabl +0 -2
  125. data/app/views/spree/api/v1/properties/index.rabl +0 -7
  126. data/app/views/spree/api/v1/properties/new.rabl +0 -2
  127. data/app/views/spree/api/v1/properties/show.rabl +0 -2
  128. data/app/views/spree/api/v1/reimbursements/index.rabl +0 -7
  129. data/app/views/spree/api/v1/return_authorizations/index.rabl +0 -7
  130. data/app/views/spree/api/v1/return_authorizations/new.rabl +0 -3
  131. data/app/views/spree/api/v1/return_authorizations/show.rabl +0 -2
  132. data/app/views/spree/api/v1/shared/stock_location_required.rabl +0 -2
  133. data/app/views/spree/api/v1/shipments/big.rabl +0 -48
  134. data/app/views/spree/api/v1/shipments/cannot_ready_shipment.rabl +0 -2
  135. data/app/views/spree/api/v1/shipments/mine.rabl +0 -9
  136. data/app/views/spree/api/v1/shipments/show.rabl +0 -32
  137. data/app/views/spree/api/v1/shipments/small.rabl +0 -37
  138. data/app/views/spree/api/v1/shipping_rates/show.rabl +0 -2
  139. data/app/views/spree/api/v1/states/index.rabl +0 -12
  140. data/app/views/spree/api/v1/states/show.rabl +0 -2
  141. data/app/views/spree/api/v1/stock_items/index.rabl +0 -7
  142. data/app/views/spree/api/v1/stock_items/show.rabl +0 -5
  143. data/app/views/spree/api/v1/stock_locations/index.rabl +0 -7
  144. data/app/views/spree/api/v1/stock_locations/show.rabl +0 -8
  145. data/app/views/spree/api/v1/stock_movements/index.rabl +0 -7
  146. data/app/views/spree/api/v1/stock_movements/show.rabl +0 -5
  147. data/app/views/spree/api/v1/stores/index.rabl +0 -4
  148. data/app/views/spree/api/v1/stores/show.rabl +0 -2
  149. data/app/views/spree/api/v1/tags/index.rabl +0 -9
  150. data/app/views/spree/api/v1/taxonomies/index.rabl +0 -7
  151. data/app/views/spree/api/v1/taxonomies/jstree.rabl +0 -7
  152. data/app/views/spree/api/v1/taxonomies/nested.rabl +0 -11
  153. data/app/views/spree/api/v1/taxonomies/new.rabl +0 -3
  154. data/app/views/spree/api/v1/taxonomies/show.rabl +0 -15
  155. data/app/views/spree/api/v1/taxons/index.rabl +0 -10
  156. data/app/views/spree/api/v1/taxons/jstree.rabl +0 -7
  157. data/app/views/spree/api/v1/taxons/new.rabl +0 -3
  158. data/app/views/spree/api/v1/taxons/show.rabl +0 -6
  159. data/app/views/spree/api/v1/taxons/taxons.rabl +0 -5
  160. data/app/views/spree/api/v1/users/index.rabl +0 -7
  161. data/app/views/spree/api/v1/users/new.rabl +0 -3
  162. data/app/views/spree/api/v1/users/show.rabl +0 -11
  163. data/app/views/spree/api/v1/variants/big.rabl +0 -14
  164. data/app/views/spree/api/v1/variants/index.rabl +0 -9
  165. data/app/views/spree/api/v1/variants/new.rabl +0 -2
  166. data/app/views/spree/api/v1/variants/show.rabl +0 -3
  167. data/app/views/spree/api/v1/variants/small.rabl +0 -18
  168. data/app/views/spree/api/v1/zones/index.rabl +0 -7
  169. data/app/views/spree/api/v1/zones/show.rabl +0 -6
  170. data/config/initializers/rabl.rb +0 -9
  171. data/lib/spree/api/api_dependencies.rb +0 -163
  172. data/lib/spree/api/controller_setup.rb +0 -19
  173. data/lib/spree/api/responders/rabl_template.rb +0 -28
  174. data/lib/spree/api/responders.rb +0 -11
  175. data/lib/spree/api/testing_support/helpers.rb +0 -44
  176. data/lib/spree/api/testing_support/setup.rb +0 -16
@@ -57,6 +57,12 @@ paths:
57
57
  email:
58
58
  type: string
59
59
  example: john@snow.org
60
+ first_name:
61
+ type: string
62
+ example: John
63
+ last_name:
64
+ type: string
65
+ example: Snow
60
66
  password:
61
67
  type: string
62
68
  example: spree123
@@ -66,7 +72,7 @@ paths:
66
72
  public_metadata:
67
73
  type: object
68
74
  example:
69
- user_segment: 'supplier'
75
+ user_segment: supplier
70
76
  description: The public metadata for this User
71
77
  private_metadata:
72
78
  type: object
@@ -98,6 +104,12 @@ paths:
98
104
  email:
99
105
  type: string
100
106
  example: john@snow.org
107
+ first_name:
108
+ type: string
109
+ example: John
110
+ last_name:
111
+ type: string
112
+ example: Snow
101
113
  bill_address_id:
102
114
  type: string
103
115
  example: '1'
@@ -387,10 +399,10 @@ paths:
387
399
  properties:
388
400
  public_metadata:
389
401
  type: object
390
- description: 'The public metadata for the cart.'
402
+ description: The public metadata for the cart.
391
403
  private_metadata:
392
404
  type: object
393
- description: 'The private metadata for the cart.'
405
+ description: The private metadata for the cart.
394
406
  summary: Create a Cart
395
407
  delete:
396
408
  description: |-
@@ -425,6 +437,7 @@ paths:
425
437
  parameters:
426
438
  - $ref: '#/components/parameters/CartIncludeParam'
427
439
  - $ref: '#/components/parameters/SparseFieldsCart'
440
+ - $ref: '#/components/parameters/CartCurrencyParam'
428
441
  summary: Retrieve a Cart
429
442
  /api/v2/storefront/cart/add_item:
430
443
  post:
@@ -461,10 +474,10 @@ paths:
461
474
  type: integer
462
475
  public_metadata:
463
476
  type: object
464
- description: 'The public metadata for the added item.'
477
+ description: The public metadata for the added item.
465
478
  private_metadata:
466
479
  type: object
467
- description: 'The private metadata for the added item.'
480
+ description: The private metadata for the added item.
468
481
  options:
469
482
  type: object
470
483
  description: 'Additional custom options. Activate these by adding: `Spree::PermittedAttributes.line_item_attributes << :foo` in `config/initializers/spree.rb`'
@@ -936,7 +949,7 @@ paths:
936
949
  description: ID of the selected Shipping Method
937
950
  shipment_id:
938
951
  type: string
939
- description: 'ID of the selected Shipment. If not supplied it will try to set selected shipping method for all shipments'
952
+ description: ID of the selected Shipment. If not supplied it will try to set selected shipping method for all shipments
940
953
  required:
941
954
  - shipping_method_id
942
955
  examples:
@@ -1249,6 +1262,23 @@ paths:
1249
1262
  '404':
1250
1263
  $ref: '#/components/responses/404NotFound'
1251
1264
  summary: Retrieve a Product
1265
+ /api/v2/storefront/store:
1266
+ get:
1267
+ summary: Return the current Store
1268
+ description: 'Returns the current Store. [Read more about Stores](https://dev-docs.spreecommerce.org/internals/stores)'
1269
+ tags:
1270
+ - Stores
1271
+ operationId: show-current-store
1272
+ parameters:
1273
+ - $ref: '#/components/parameters/StoreIncludeParam'
1274
+ - $ref: '#/components/parameters/SparseFieldsStore'
1275
+ responses:
1276
+ '200':
1277
+ $ref: '#/components/responses/Store'
1278
+ '403':
1279
+ $ref: '#/components/responses/403Forbidden'
1280
+ security:
1281
+ - bearerAuth: []
1252
1282
  /api/v2/storefront/taxons:
1253
1283
  get:
1254
1284
  description: 'Returns a list of Taxons. [Read more about Taxons](https://dev-docs.spreecommerce.org/internals/products#taxons-and-taxonomies)'
@@ -2423,14 +2453,14 @@ components:
2423
2453
  type: boolean
2424
2454
  example: true
2425
2455
  description: Defines if this is the default CC for a signed in user
2426
- relationships:
2427
- type: object
2428
- properties:
2429
- payment_method:
2430
- type: object
2431
- properties:
2432
- data:
2433
- $ref: '#/components/schemas/Relation'
2456
+ relationships:
2457
+ type: object
2458
+ properties:
2459
+ payment_method:
2460
+ type: object
2461
+ properties:
2462
+ data:
2463
+ $ref: '#/components/schemas/Relation'
2434
2464
  required:
2435
2465
  - id
2436
2466
  - type
@@ -2638,7 +2668,7 @@ components:
2638
2668
  type: object
2639
2669
  example:
2640
2670
  recommended_by_us: true
2641
- description: 'The public metadata for the Line Item.'
2671
+ description: The public metadata for the Line Item.
2642
2672
  relationships:
2643
2673
  type: object
2644
2674
  properties:
@@ -3055,6 +3085,13 @@ components:
3055
3085
  - $ref: '#/components/schemas/Variant'
3056
3086
  - $ref: '#/components/schemas/Image'
3057
3087
  - $ref: '#/components/schemas/Taxon'
3088
+ StoreIncludes:
3089
+ x-internal: true
3090
+ title: Store Includes
3091
+ anyOf:
3092
+ - $ref: '#/components/schemas/Country'
3093
+ - $ref: '#/components/schemas/Menu'
3094
+ - $ref: '#/components/schemas/CmsPage'
3058
3095
  ProductProperty:
3059
3096
  title: Product Property
3060
3097
  type: object
@@ -3145,6 +3182,122 @@ components:
3145
3182
  example: New York
3146
3183
  description: State name
3147
3184
  x-internal: true
3185
+ Store:
3186
+ type: object
3187
+ description: Stores are the center of the Spree ecosystem. Each Spree installation can have multiple Stores. Each Store operates on a different domain or subdomain.
3188
+ title: Store
3189
+ x-internal: true
3190
+ properties:
3191
+ id:
3192
+ type: string
3193
+ example: '1'
3194
+ type:
3195
+ type: string
3196
+ default: store
3197
+ attributes:
3198
+ type: object
3199
+ properties:
3200
+ name:
3201
+ type: string
3202
+ example: Spree Demo
3203
+ description: Name of the Store
3204
+ url:
3205
+ type: string
3206
+ example: spree-demo.com
3207
+ description: Store Url
3208
+ meta_description:
3209
+ type: string
3210
+ example: Luxury clothing store for men and women.
3211
+ description: Meta description for SEO
3212
+ meta_keywords:
3213
+ type: string
3214
+ example: luxury clothing men women
3215
+ description: Meta keywords for SEO
3216
+ seo_title:
3217
+ type: string
3218
+ example: Buy Luxury Clothing With Ease
3219
+ description: The title for SEO
3220
+ default_currency:
3221
+ type: string
3222
+ example: EUR
3223
+ description: Default currency of the store
3224
+ default:
3225
+ type: boolean
3226
+ example: true
3227
+ description: Indicates if the Store is the default one
3228
+ supported_currencies:
3229
+ type: string
3230
+ example: 'EUR,USD,GBP'
3231
+ description: All currencies supported by store
3232
+ facebook:
3233
+ type: string
3234
+ example: 'https://www.facebook.com/mystorename'
3235
+ description: URL of Facebook page
3236
+ twitter:
3237
+ type: string
3238
+ example: 'https://twitter.com/mystorename'
3239
+ description: URL of Twitter page
3240
+ instagram:
3241
+ type: string
3242
+ example: 'https://instagram.com/mystorename'
3243
+ description: URL of Instagram page
3244
+ default_locale:
3245
+ type: string
3246
+ example: en
3247
+ description: Default locale of the Store
3248
+ supported_locales:
3249
+ type: string
3250
+ example: 'en,es,de'
3251
+ description: Supported locales of the Store
3252
+ customer_support_email:
3253
+ type: string
3254
+ example: support@mystore.com
3255
+ description: This email is visible to your Store visitors in the Footer section
3256
+ description:
3257
+ type: string
3258
+ example: Mystore has been selling luxury clothing for more than 20 years and has 15 stores currently.
3259
+ description: Description of the Store which is visible in the Footer
3260
+ address:
3261
+ type: string
3262
+ example: '813 Howard Street, Oswego NY 13126, USA'
3263
+ description: Address of the Store which is visible in the Footer
3264
+ contact_phone:
3265
+ type: string
3266
+ example: '+123456789'
3267
+ description: Contact phone number of the Store which is visible in the Footer
3268
+ favicon_path:
3269
+ type: string
3270
+ example: /assets/favicon.ico
3271
+ relationships:
3272
+ type: object
3273
+ properties:
3274
+ menus:
3275
+ type: object
3276
+ description: Menus
3277
+ properties:
3278
+ data:
3279
+ type: array
3280
+ items:
3281
+ $ref: '#/components/schemas/Relation'
3282
+ cms_pages:
3283
+ type: object
3284
+ description: CMS Pages
3285
+ properties:
3286
+ data:
3287
+ type: array
3288
+ items:
3289
+ $ref: '#/components/schemas/Relation'
3290
+ default_country:
3291
+ type: object
3292
+ description: Default Country of the Store
3293
+ properties:
3294
+ data:
3295
+ $ref: '#/components/schemas/Relation'
3296
+ required:
3297
+ - id
3298
+ - type
3299
+ - attributes
3300
+ - relationships
3148
3301
  Shipment:
3149
3302
  type: object
3150
3303
  title: Shipment
@@ -3491,6 +3644,12 @@ components:
3491
3644
  email:
3492
3645
  type: string
3493
3646
  example: spree@example.com
3647
+ first_name:
3648
+ type: string
3649
+ example: John
3650
+ last_name:
3651
+ type: string
3652
+ example: Doe
3494
3653
  store_credits:
3495
3654
  type: number
3496
3655
  example: 150.75
@@ -3501,7 +3660,7 @@ components:
3501
3660
  public_metadata:
3502
3661
  type: object
3503
3662
  example:
3504
- user_segment: 'supplier'
3663
+ user_segment: supplier
3505
3664
  description: The public metadata for this User
3506
3665
  relationships:
3507
3666
  type: object
@@ -3820,6 +3979,13 @@ components:
3820
3979
  type: string
3821
3980
  description: 'Specify the related resources you would like to receive in the response body. [More Information](https://jsonapi.org/format/#fetching-includes).'
3822
3981
  example: 'line_items,variants,variants.images,billing_address,shipping_address,user,payments,shipments,promotions'
3982
+ CartCurrencyParam:
3983
+ name: currency
3984
+ in: query
3985
+ schema:
3986
+ type: string
3987
+ description: 'Must be specified when is different than current store default currency.'
3988
+ example: 'USD'
3823
3989
  ProductIncludeParam:
3824
3990
  name: include
3825
3991
  in: query
@@ -3834,6 +4000,20 @@ components:
3834
4000
 
3835
4001
  [More information](https://jsonapi.org/format/#fetching-includes)
3836
4002
  example: 'default_variant,variants,option_types,product_properties,taxons,images,primary_variant'
4003
+ StoreIncludeParam:
4004
+ name: include
4005
+ in: query
4006
+ schema:
4007
+ type: string
4008
+ description: |-
4009
+ Specify what related resources (relationships) you would like to receive in the response body. Eg.
4010
+
4011
+ ```
4012
+ default_country,menus,cms_pages
4013
+ ```
4014
+
4015
+ [More information](https://jsonapi.org/format/#fetching-includes)
4016
+ example: 'default_country,menus,cms_pages'
3837
4017
  ProductImageTransformationSizeParam:
3838
4018
  in: query
3839
4019
  name: 'image_transformation[size]'
@@ -3975,6 +4155,13 @@ components:
3975
4155
  schema:
3976
4156
  type: string
3977
4157
  example: 'price,description,name'
4158
+ SparseFieldsStore:
4159
+ name: 'fields[store]'
4160
+ in: query
4161
+ description: 'Specify the fields you would like returned in the response body. [More information](https://jsonapi.org/format/#fetching-sparse-fieldsets).'
4162
+ schema:
4163
+ type: string
4164
+ example: 'name,url,supported_locales'
3978
4165
  SparseFieldsShippingRate:
3979
4166
  in: query
3980
4167
  name: 'fields[shipping_rate]'
@@ -4920,10 +5107,12 @@ components:
4920
5107
  type: user
4921
5108
  attributes:
4922
5109
  email: spree@example.com
5110
+ first_name: John
5111
+ last_name: Snow
4923
5112
  store_credits: 0
4924
5113
  completed_orders: 0
4925
5114
  public_metadata:
4926
- user_segment: 'supplier'
5115
+ user_segment: supplier
4927
5116
  relationships:
4928
5117
  default_billing_address:
4929
5118
  data:
@@ -6043,11 +6232,11 @@ components:
6043
6232
  year: 2026
6044
6233
  name: John Doe
6045
6234
  default: true
6046
- relationships:
6047
- payment_method:
6048
- data:
6049
- id: '1'
6050
- type: payment_method
6235
+ relationships:
6236
+ payment_method:
6237
+ data:
6238
+ id: '1'
6239
+ type: payment_method
6051
6240
  included:
6052
6241
  - id: '1'
6053
6242
  type: payment_method
@@ -6092,11 +6281,11 @@ components:
6092
6281
  year: 2026
6093
6282
  name: John Doe
6094
6283
  default: true
6095
- relationships:
6096
- payment_method:
6097
- data:
6098
- id: string
6099
- type: string
6284
+ relationships:
6285
+ payment_method:
6286
+ data:
6287
+ id: string
6288
+ type: string
6100
6289
  - id: '2'
6101
6290
  type: credit_card
6102
6291
  attributes:
@@ -6106,11 +6295,11 @@ components:
6106
6295
  year: 2030
6107
6296
  name: John Doe
6108
6297
  default: false
6109
- relationships:
6110
- payment_method:
6111
- data:
6112
- id: string
6113
- type: string
6298
+ relationships:
6299
+ payment_method:
6300
+ data:
6301
+ id: string
6302
+ type: string
6114
6303
  included:
6115
6304
  - id: '1'
6116
6305
  type: payment_method
@@ -8362,6 +8551,140 @@ components:
8362
8551
  prev: 'http://localhost:3000/api/v2/storefront/products?page=1'
8363
8552
  last: 'http://localhost:3000/api/v2/storefront/products?page=5'
8364
8553
  first: 'http://localhost:3000/api/v2/storefront/products?page=1'
8554
+ Store:
8555
+ description: 200 Success - Returns the `store` object.
8556
+ content:
8557
+ application/vnd.api+json:
8558
+ schema:
8559
+ type: object
8560
+ properties:
8561
+ data:
8562
+ $ref: '#/components/schemas/Store'
8563
+ included:
8564
+ type: array
8565
+ items:
8566
+ $ref: '#/components/schemas/StoreIncludes'
8567
+ required:
8568
+ - data
8569
+ examples:
8570
+ Store without includes:
8571
+ value:
8572
+ data:
8573
+ id: '3'
8574
+ type: store
8575
+ attributes:
8576
+ name: Mystore
8577
+ url: spree-demo.com
8578
+ meta_description: Luxury clothing store for men and women.
8579
+ meta_keywords: luxury clothing men women
8580
+ seo_title: ''
8581
+ default_currency: USD
8582
+ default: true
8583
+ supported_currencies: 'EUR,GBP,USD'
8584
+ facebook: 'https://www.facebook.com/mystorename'
8585
+ twitter: 'https://twitter.com/mystorename'
8586
+ instagram: 'https://instagram.com/mystorename'
8587
+ default_locale: en
8588
+ customer_support_email: support@mystore.com
8589
+ description: Mystore has been selling luxury clothing for more than 20 years and has 15 stores currently.
8590
+ address: '813 Howard Street, Oswego NY 13126, USA'
8591
+ contact_phone: '+123456789'
8592
+ supported_locales: en
8593
+ favicon_path: /assets/favicon.ico
8594
+ relationships:
8595
+ menus:
8596
+ data:
8597
+ - id: '10'
8598
+ type: menu
8599
+ - id: '11'
8600
+ type: menu
8601
+ cms_pages:
8602
+ data:
8603
+ - id: '5'
8604
+ type: cms_page
8605
+ default_country:
8606
+ data:
8607
+ id: '2'
8608
+ type: country
8609
+ Store with Includes:
8610
+ value:
8611
+ data:
8612
+ id: '3'
8613
+ type: store
8614
+ attributes:
8615
+ name: Mystore
8616
+ url: spree-demo.com
8617
+ meta_description: Luxury clothing store for men and women.
8618
+ meta_keywords: luxury clothing men women
8619
+ seo_title: ''
8620
+ default_currency: USD
8621
+ default: true
8622
+ supported_currencies: 'EUR,GBP,USD'
8623
+ facebook: 'https://www.facebook.com/mystorename'
8624
+ twitter: 'https://twitter.com/mystorename'
8625
+ instagram: 'https://instagram.com/mystorename'
8626
+ default_locale: en
8627
+ customer_support_email: support@mystore.com
8628
+ description: Mystore has been selling luxury clothing for more than 20 years and has 15 stores currently.
8629
+ address: '813 Howard Street, Oswego NY 13126, USA'
8630
+ contact_phone: '+123456789'
8631
+ supported_locales: en
8632
+ favicon_path: /assets/favicon.ico
8633
+ relationships:
8634
+ menus:
8635
+ data:
8636
+ - id: '10'
8637
+ type: menu
8638
+ - id: '11'
8639
+ type: menu
8640
+ cms_pages:
8641
+ data:
8642
+ - id: '5'
8643
+ type: cms_page
8644
+ default_country:
8645
+ data:
8646
+ id: '2'
8647
+ type: country
8648
+ included:
8649
+ - id: '2'
8650
+ type: country
8651
+ attributes:
8652
+ iso: US
8653
+ iso3: USA
8654
+ iso_name: UNITED STATES
8655
+ name: United States
8656
+ states_required: true
8657
+ zipcode_required: true
8658
+ default: true
8659
+ relationships:
8660
+ checkout_zone_applicable_states:
8661
+ data: []
8662
+ - id: '10'
8663
+ type: cms_page
8664
+ attributes:
8665
+ title: Returns Policy
8666
+ content: null
8667
+ locale: en
8668
+ meta_description: ''
8669
+ meta_title: ''
8670
+ slug: returns-policy
8671
+ type: 'Spree::Cms::Pages::StandardPage'
8672
+ relationships:
8673
+ cms_sections:
8674
+ data: []
8675
+ - id: '12'
8676
+ type: menu
8677
+ attributes:
8678
+ name: Company
8679
+ location: header
8680
+ locale: en
8681
+ relationships:
8682
+ menu_items:
8683
+ data:
8684
+ - id: '1'
8685
+ type: menu_item
8686
+ - id: '2'
8687
+ type: menu_item
8365
8688
  Taxon:
8366
8689
  description: 200 Success - Returns the `taxon` object.
8367
8690
  content:
@@ -14895,7 +15218,7 @@ components:
14895
15218
  last: 'http://localhost:3000/api/v2/storefront/countries?page=1&per_page=240'
14896
15219
  first: 'http://localhost:3000/api/v2/storefront/countries?page=1&per_page=240'
14897
15220
  Shipment:
14898
- description: '200 Success - Returns an array containing sevral `shipment` objects, along with the included array containing all available `shipping_rate` and `stock_location` objects. '
15221
+ description: '200 Success - Returns an array containing several `shipment` objects, along with the included array containing all available `shipping_rate` and `stock_location` objects. '
14899
15222
  content:
14900
15223
  application/vnd.api+json:
14901
15224
  schema:
@@ -16175,6 +16498,7 @@ tags:
16175
16498
  - name: Menus
16176
16499
  - name: Order Status
16177
16500
  - name: Products
16501
+ - name: Stores
16178
16502
  - name: Taxons
16179
16503
  - name: Wishlists
16180
16504
  - name: Wishlists / Wished Items
@@ -0,0 +1,11 @@
1
+ module Spree
2
+ module Api
3
+ class Configuration < Preferences::Configuration
4
+ preference :api_v2_serializers_cache_ttl, :integer, default: 3600 # 1 hour in seconds
5
+ preference :api_v2_collection_cache_ttl, :integer, default: 3600 # 1 hour in seconds
6
+ preference :api_v2_collection_cache_namespace, :string, default: 'api_v2_collection_cache'
7
+ preference :api_v2_content_type, :string, default: 'application/vnd.api+json'
8
+ preference :api_v2_per_page_limit, :integer, default: 500
9
+ end
10
+ end
11
+ end