spree_api 4.1.12 → 4.2.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/concerns/spree/api/v2/storefront/order_concern.rb +4 -0
- data/app/controllers/spree/api/base_controller.rb +9 -5
- data/app/controllers/spree/api/errors_controller.rb +1 -1
- data/app/controllers/spree/api/v1/shipments_controller.rb +16 -6
- data/app/controllers/spree/api/v1/taxons_controller.rb +6 -1
- data/app/controllers/spree/api/v1/users_controller.rb +35 -9
- data/app/controllers/spree/api/v2/base_controller.rb +0 -25
- data/app/controllers/spree/api/v2/resource_controller.rb +82 -0
- data/app/controllers/spree/api/v2/storefront/account/addresses_controller.rb +3 -11
- data/app/controllers/spree/api/v2/storefront/account/credit_cards_controller.rb +7 -15
- data/app/controllers/spree/api/v2/storefront/account/orders_controller.rb +7 -26
- data/app/controllers/spree/api/v2/storefront/account_controller.rb +1 -5
- data/app/controllers/spree/api/v2/storefront/countries_controller.rb +9 -16
- data/app/controllers/spree/api/v2/storefront/order_status_controller.rb +1 -5
- data/app/controllers/spree/api/v2/storefront/products_controller.rb +4 -14
- data/app/controllers/spree/api/v2/storefront/stores_controller.rb +2 -6
- data/app/controllers/spree/api/v2/storefront/taxons_controller.rb +4 -14
- data/app/helpers/spree/api/api_helpers.rb +4 -3
- data/app/models/spree/api_dependencies.rb +6 -3
- data/app/serializers/spree/v2/storefront/address_serializer.rb +8 -3
- data/app/serializers/spree/v2/storefront/base_serializer.rb +1 -1
- data/app/serializers/spree/v2/storefront/cart_serializer.rb +2 -1
- data/app/serializers/spree/v2/storefront/country_serializer.rb +6 -0
- data/app/serializers/spree/v2/storefront/estimated_shipping_rate_serializer.rb +3 -1
- data/app/serializers/spree/v2/storefront/payment_serializer.rb +1 -1
- data/app/serializers/spree/v2/storefront/product_property_serializer.rb +7 -2
- data/app/serializers/spree/v2/storefront/product_serializer.rb +17 -6
- data/app/serializers/spree/v2/storefront/shipment_serializer.rb +3 -1
- data/app/serializers/spree/v2/storefront/shipping_rate_serializer.rb +3 -1
- data/app/serializers/spree/v2/storefront/store_credit_category_serializer.rb +11 -0
- data/app/serializers/spree/v2/storefront/store_credit_serializer.rb +1 -1
- data/app/serializers/spree/v2/storefront/store_serializer.rb +3 -1
- data/app/serializers/spree/v2/storefront/taxon_serializer.rb +11 -3
- data/app/serializers/spree/v2/storefront/user_serializer.rb +3 -1
- data/app/serializers/spree/v2/storefront/variant_serializer.rb +13 -5
- data/app/views/spree/api/v1/products/show.rabl +4 -0
- data/config/locales/en.yml +1 -1
- data/docs/oauth/index.yml +78 -15
- data/docs/v2/storefront/index.yaml +3409 -672
- data/lib/spree/api/controller_setup.rb +0 -1
- data/lib/spree/api/testing_support/v2/current_order.rb +2 -0
- data/lib/spree_api.rb +1 -1
- data/spree_api.gemspec +2 -2
- metadata +15 -13
@@ -2,15 +2,11 @@ module Spree
|
|
2
2
|
module Api
|
3
3
|
module V2
|
4
4
|
module Storefront
|
5
|
-
class OrderStatusController < ::Spree::Api::V2::
|
5
|
+
class OrderStatusController < ::Spree::Api::V2::ResourceController
|
6
6
|
include Spree::Api::V2::Storefront::OrderConcern
|
7
7
|
|
8
8
|
before_action :ensure_order_token
|
9
9
|
|
10
|
-
def show
|
11
|
-
render_serialized_payload { serialize_resource(resource) }
|
12
|
-
end
|
13
|
-
|
14
10
|
private
|
15
11
|
|
16
12
|
def resource
|
@@ -2,21 +2,11 @@ module Spree
|
|
2
2
|
module Api
|
3
3
|
module V2
|
4
4
|
module Storefront
|
5
|
-
class ProductsController < ::Spree::Api::V2::
|
6
|
-
include Spree::Api::V2::CollectionOptionsHelpers
|
7
|
-
|
8
|
-
def index
|
9
|
-
render_serialized_payload { serialize_collection(paginated_collection) }
|
10
|
-
end
|
11
|
-
|
12
|
-
def show
|
13
|
-
render_serialized_payload { serialize_resource(resource) }
|
14
|
-
end
|
15
|
-
|
5
|
+
class ProductsController < ::Spree::Api::V2::ResourceController
|
16
6
|
private
|
17
7
|
|
18
8
|
def sorted_collection
|
19
|
-
collection_sorter.new(collection, params,
|
9
|
+
collection_sorter.new(collection, current_currency, params, allowed_sort_attributes).call
|
20
10
|
end
|
21
11
|
|
22
12
|
def collection
|
@@ -43,8 +33,8 @@ module Spree
|
|
43
33
|
Spree::Api::Dependencies.storefront_product_serializer.constantize
|
44
34
|
end
|
45
35
|
|
46
|
-
def
|
47
|
-
Spree::Product
|
36
|
+
def model_class
|
37
|
+
Spree::Product
|
48
38
|
end
|
49
39
|
|
50
40
|
def scope_includes
|
@@ -2,14 +2,10 @@ module Spree
|
|
2
2
|
module Api
|
3
3
|
module V2
|
4
4
|
module Storefront
|
5
|
-
class StoresController < ::Spree::Api::V2::
|
6
|
-
def show
|
7
|
-
render_serialized_payload { serialize_resource(resource) }
|
8
|
-
end
|
9
|
-
|
5
|
+
class StoresController < ::Spree::Api::V2::ResourceController
|
10
6
|
private
|
11
7
|
|
12
|
-
def
|
8
|
+
def model_class
|
13
9
|
Spree::Store
|
14
10
|
end
|
15
11
|
|
@@ -2,17 +2,7 @@ module Spree
|
|
2
2
|
module Api
|
3
3
|
module V2
|
4
4
|
module Storefront
|
5
|
-
class TaxonsController < ::Spree::Api::V2::
|
6
|
-
include Spree::Api::V2::CollectionOptionsHelpers
|
7
|
-
|
8
|
-
def index
|
9
|
-
render_serialized_payload { serialize_collection(paginated_collection) }
|
10
|
-
end
|
11
|
-
|
12
|
-
def show
|
13
|
-
render_serialized_payload { serialize_resource(resource) }
|
14
|
-
end
|
15
|
-
|
5
|
+
class TaxonsController < ::Spree::Api::V2::ResourceController
|
16
6
|
private
|
17
7
|
|
18
8
|
def collection_serializer
|
@@ -39,8 +29,8 @@ module Spree
|
|
39
29
|
scope.find_by(permalink: params[:id]) || scope.find(params[:id])
|
40
30
|
end
|
41
31
|
|
42
|
-
def
|
43
|
-
Spree::Taxon
|
32
|
+
def model_class
|
33
|
+
Spree::Taxon
|
44
34
|
end
|
45
35
|
|
46
36
|
def scope_includes
|
@@ -51,7 +41,7 @@ module Spree
|
|
51
41
|
children: node_includes,
|
52
42
|
taxonomy: [root: node_includes],
|
53
43
|
products: [],
|
54
|
-
icon: []
|
44
|
+
icon: [attachment_attachment: :blob]
|
55
45
|
}
|
56
46
|
end
|
57
47
|
end
|
@@ -116,7 +116,7 @@ module Spree
|
|
116
116
|
@@address_attributes = [
|
117
117
|
:id, :firstname, :lastname, :full_name, :address1, :address2, :city,
|
118
118
|
:zipcode, :phone, :company, :alternative_phone, :country_id, :state_id,
|
119
|
-
:state_name, :state_text
|
119
|
+
:label, :state_name, :state_text
|
120
120
|
]
|
121
121
|
|
122
122
|
@@country_attributes = [:id, :iso_name, :iso, :iso3, :name, :numcode]
|
@@ -161,8 +161,9 @@ module Spree
|
|
161
161
|
|
162
162
|
@@store_attributes = [
|
163
163
|
:id, :name, :url, :meta_description, :meta_keywords, :seo_title,
|
164
|
-
:mail_from_address, :
|
165
|
-
:facebook, :twitter, :instagram
|
164
|
+
:mail_from_address, :customer_support_email, :default_currency,
|
165
|
+
:code, :default, :facebook, :twitter, :instagram,
|
166
|
+
:supported_currencies
|
166
167
|
]
|
167
168
|
|
168
169
|
@@tag_attributes = [:id, :name]
|
@@ -14,8 +14,9 @@ module Spree
|
|
14
14
|
:storefront_collection_paginator, :storefront_user_serializer, :storefront_products_sorter, :storefront_products_finder,
|
15
15
|
:storefront_product_serializer, :storefront_taxon_serializer, :storefront_taxon_finder, :storefront_find_by_variant_finder,
|
16
16
|
:storefront_cart_update_service, :storefront_cart_estimate_shipping_rates_service, :storefront_estimated_shipment_serializer,
|
17
|
-
:storefront_store_serializer, :storefront_address_serializer,
|
18
|
-
:storefront_account_create_address_service, :storefront_account_update_address_service, :storefront_address_finder
|
17
|
+
:storefront_store_serializer, :storefront_address_serializer, :storefront_order_serializer,
|
18
|
+
:storefront_account_create_address_service, :storefront_account_update_address_service, :storefront_address_finder,
|
19
|
+
:storefront_collection_sorter
|
19
20
|
].freeze
|
20
21
|
|
21
22
|
attr_accessor *INJECTION_POINTS
|
@@ -66,9 +67,11 @@ module Spree
|
|
66
67
|
@storefront_product_serializer = 'Spree::V2::Storefront::ProductSerializer'
|
67
68
|
@storefront_estimated_shipment_serializer = 'Spree::V2::Storefront::EstimatedShippingRateSerializer'
|
68
69
|
@storefront_store_serializer = 'Spree::V2::Storefront::StoreSerializer'
|
70
|
+
@storefront_order_serializer = 'Spree::V2::Storefront::CartSerializer'
|
69
71
|
|
70
72
|
# sorters
|
71
|
-
@
|
73
|
+
@storefront_collection_sorter = Spree::Dependencies.collection_sorter
|
74
|
+
@storefront_order_sorter = Spree::Dependencies.collection_sorter
|
72
75
|
@storefront_products_sorter = Spree::Dependencies.products_sorter
|
73
76
|
|
74
77
|
# paginators
|
@@ -5,10 +5,15 @@ module Spree
|
|
5
5
|
set_type :address
|
6
6
|
|
7
7
|
attributes :firstname, :lastname, :address1, :address2, :city, :zipcode, :phone, :state_name,
|
8
|
-
:company, :country_name, :country_iso3, :country_iso
|
8
|
+
:company, :country_name, :country_iso3, :country_iso, :label
|
9
9
|
|
10
|
-
attribute :state_code
|
11
|
-
|
10
|
+
attribute :state_code do |address|
|
11
|
+
address.state_abbr
|
12
|
+
end
|
13
|
+
|
14
|
+
attribute :state_name do |address|
|
15
|
+
address.state_name_text
|
16
|
+
end
|
12
17
|
end
|
13
18
|
end
|
14
19
|
end
|
@@ -9,7 +9,8 @@ module Spree
|
|
9
9
|
:display_included_tax_total, :tax_total, :currency, :state, :token, :email,
|
10
10
|
:display_item_total, :display_ship_total, :display_adjustment_total, :display_tax_total,
|
11
11
|
:promo_total, :display_promo_total, :item_count, :special_instructions, :display_total,
|
12
|
-
:pre_tax_item_amount, :display_pre_tax_item_amount, :pre_tax_total, :display_pre_tax_total
|
12
|
+
:pre_tax_item_amount, :display_pre_tax_item_amount, :pre_tax_total, :display_pre_tax_total,
|
13
|
+
:shipment_state, :payment_state
|
13
14
|
|
14
15
|
has_many :line_items
|
15
16
|
has_many :variants
|
@@ -12,6 +12,12 @@ module Spree
|
|
12
12
|
end
|
13
13
|
|
14
14
|
has_many :states, if: proc { |_record, params| params && params[:include_states] }
|
15
|
+
|
16
|
+
has_many :checkout_zone_applicable_states,
|
17
|
+
serializer: ::Spree::V2::Storefront::StateSerializer,
|
18
|
+
if: proc { |_record, params| params && params[:current_store].present? } do |object, params|
|
19
|
+
params[:current_store].states_available_for_checkout(object)
|
20
|
+
end
|
15
21
|
end
|
16
22
|
end
|
17
23
|
end
|
@@ -6,7 +6,9 @@ module Spree
|
|
6
6
|
|
7
7
|
attributes :name, :selected, :cost, :tax_amount, :shipping_method_id
|
8
8
|
|
9
|
-
attribute :final_price
|
9
|
+
attribute :final_price do |shipping_rate|
|
10
|
+
shipping_rate.cost
|
11
|
+
end
|
10
12
|
|
11
13
|
attributes :display_cost, :display_final_price do |object, params|
|
12
14
|
Spree::Money.new(object.cost, currency: params[:currency])
|
@@ -6,8 +6,13 @@ module Spree
|
|
6
6
|
|
7
7
|
attribute :value
|
8
8
|
|
9
|
-
attribute :name
|
10
|
-
|
9
|
+
attribute :name do |product_property|
|
10
|
+
product_property.property_name
|
11
|
+
end
|
12
|
+
|
13
|
+
attribute :description do |product_property|
|
14
|
+
product_property.property_presentation
|
15
|
+
end
|
11
16
|
end
|
12
17
|
end
|
13
18
|
end
|
@@ -5,13 +5,24 @@ module Spree
|
|
5
5
|
set_type :product
|
6
6
|
|
7
7
|
attributes :name, :description, :price, :currency, :display_price,
|
8
|
-
:
|
9
|
-
:updated_at
|
8
|
+
:compare_at_price, :display_compare_at_price, :available_on,
|
9
|
+
:slug, :meta_description, :meta_keywords, :updated_at
|
10
10
|
|
11
|
-
attribute :purchasable
|
12
|
-
|
13
|
-
|
14
|
-
|
11
|
+
attribute :purchasable do |product|
|
12
|
+
product.purchasable?
|
13
|
+
end
|
14
|
+
|
15
|
+
attribute :in_stock do |product|
|
16
|
+
product.in_stock?
|
17
|
+
end
|
18
|
+
|
19
|
+
attribute :backorderable do |product|
|
20
|
+
product.backorderable?
|
21
|
+
end
|
22
|
+
|
23
|
+
attribute :available do |product|
|
24
|
+
product.available?
|
25
|
+
end
|
15
26
|
|
16
27
|
has_many :variants
|
17
28
|
has_many :option_types
|
@@ -7,7 +7,9 @@ module Spree
|
|
7
7
|
attributes :name, :selected, :final_price, :display_final_price, :cost,
|
8
8
|
:display_cost, :tax_amount, :display_tax_amount, :shipping_method_id
|
9
9
|
|
10
|
-
attribute :free
|
10
|
+
attribute :free do |shipping_rate|
|
11
|
+
shipping_rate.free?
|
12
|
+
end
|
11
13
|
end
|
12
14
|
end
|
13
15
|
end
|
@@ -6,7 +6,9 @@ module Spree
|
|
6
6
|
|
7
7
|
attributes :name, :url, :meta_description, :meta_keywords, :seo_title, :default_currency, :default, :supported_currencies, :facebook,
|
8
8
|
:twitter, :instagram, :default_locale, :customer_support_email, :default_country_id, :description,
|
9
|
-
:address, :contact_phone
|
9
|
+
:address, :contact_phone
|
10
|
+
|
11
|
+
has_one :default_country, serializer: :country, record_type: :country, id_method_name: :default_country_id
|
10
12
|
end
|
11
13
|
end
|
12
14
|
end
|
@@ -7,9 +7,17 @@ module Spree
|
|
7
7
|
attributes :name, :pretty_name, :permalink, :seo_title, :description, :meta_title, :meta_description,
|
8
8
|
:meta_keywords, :left, :right, :position, :depth, :updated_at
|
9
9
|
|
10
|
-
attribute :is_root
|
11
|
-
|
12
|
-
|
10
|
+
attribute :is_root do |taxon|
|
11
|
+
taxon.root?
|
12
|
+
end
|
13
|
+
|
14
|
+
attribute :is_child do |taxon|
|
15
|
+
taxon.child?
|
16
|
+
end
|
17
|
+
|
18
|
+
attribute :is_leaf do |taxon|
|
19
|
+
taxon.leaf?
|
20
|
+
end
|
13
21
|
|
14
22
|
belongs_to :parent, record_type: :taxon, serializer: :taxon
|
15
23
|
belongs_to :taxonomy, record_type: :taxonomy
|
@@ -4,12 +4,20 @@ module Spree
|
|
4
4
|
class VariantSerializer < BaseSerializer
|
5
5
|
set_type :variant
|
6
6
|
|
7
|
-
attributes :
|
8
|
-
:width, :depth, :is_master, :options_text
|
7
|
+
attributes :sku, :price, :currency, :display_price, :weight, :height,
|
8
|
+
:width, :depth, :is_master, :options_text
|
9
9
|
|
10
|
-
attribute :purchasable
|
11
|
-
|
12
|
-
|
10
|
+
attribute :purchasable do |variant|
|
11
|
+
variant.purchasable?
|
12
|
+
end
|
13
|
+
|
14
|
+
attribute :in_stock do |variant|
|
15
|
+
variant.in_stock?
|
16
|
+
end
|
17
|
+
|
18
|
+
attribute :backorderable do |variant|
|
19
|
+
variant.backorderable?
|
20
|
+
end
|
13
21
|
|
14
22
|
belongs_to :product
|
15
23
|
has_many :images
|
@@ -6,6 +6,10 @@ attributes *product_attributes
|
|
6
6
|
node(:display_price) { |p| p.display_price.to_s }
|
7
7
|
node(:has_variants, &:has_variants?)
|
8
8
|
node(:taxon_ids, &:taxon_ids)
|
9
|
+
node(:display_current_currency_price) do |product|
|
10
|
+
price = product.price_in(current_currency)
|
11
|
+
Spree::Money.new(price.amount, currency: current_currency).to_s
|
12
|
+
end
|
9
13
|
|
10
14
|
child master: :master do
|
11
15
|
extends 'spree/api/v1/variants/small'
|
data/config/locales/en.yml
CHANGED
@@ -26,7 +26,7 @@ en:
|
|
26
26
|
cannot_ready: "Cannot ready shipment."
|
27
27
|
stock_location_required: "A stock_location_id parameter must be provided in order to retrieve stock movements."
|
28
28
|
invalid_taxonomy_id: "Invalid taxonomy id."
|
29
|
-
|
29
|
+
shipment_transfer_errors_occurred: "Following errors occured while attempting this action:"
|
30
30
|
negative_quantity: "quantity is negative"
|
31
31
|
wrong_shipment_target: "target shipment is the same as original shipment"
|
32
32
|
|
data/docs/oauth/index.yml
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
openapi: 3.0.0
|
2
2
|
servers:
|
3
|
-
- url: '
|
3
|
+
- url: 'https://demo.spreecommerce.org'
|
4
|
+
description: demo
|
5
|
+
- url: 'http://localhost:3000'
|
6
|
+
description: localhost
|
4
7
|
info:
|
5
8
|
version: 1.0.0
|
6
9
|
title: Spree OAuth 2.0 Authentication
|
7
|
-
description:
|
8
|
-
|
9
|
-
|
10
|
+
description: "For API v2 Spree uses [Doorkeeper](https://github.com/doorkeeper-gem/doorkeeper) gem for handling OAuth athentication. \n\nSpree supports new token creation and refreshing of existing tokens."
|
11
|
+
contact:
|
12
|
+
name: Spark Solutions
|
13
|
+
url: 'https://sparksolutions.co'
|
14
|
+
email: we@sparksolutions.co
|
15
|
+
license:
|
16
|
+
url: 'https://github.com/spree/spree/blob/master/license.md'
|
17
|
+
name: BSD-3-Clause
|
10
18
|
paths:
|
11
|
-
|
19
|
+
/spree_oauth/token:
|
12
20
|
post:
|
13
|
-
description:
|
14
|
-
Creates or refreshes a Bearer token required to authorize calls API calls
|
21
|
+
description: Creates or refreshes a Bearer token required to authorize calls API calls
|
15
22
|
tags:
|
16
23
|
- Token
|
17
24
|
operationId: Create or Refresh Token
|
@@ -22,14 +29,40 @@ paths:
|
|
22
29
|
application/json:
|
23
30
|
schema:
|
24
31
|
$ref: '#/components/schemas/Token'
|
32
|
+
examples:
|
33
|
+
create token:
|
34
|
+
value:
|
35
|
+
access_token: SfM3k8kq5Wkc6xz6rgMlsl-mbygJ1ptq4DR0Ah51vjA
|
36
|
+
token_type: Bearer
|
37
|
+
expires_in: 7200
|
38
|
+
refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
|
39
|
+
created_at: 1581873931
|
40
|
+
refresh token:
|
41
|
+
value:
|
42
|
+
access_token: Es9lLPW2mVaDB80I-I_OdQCw3JfOT1s19YN1naFWx98
|
43
|
+
token_type: Bearer
|
44
|
+
expires_in: 7200
|
45
|
+
refresh_token: j92BxulqIIYtiiaBsuAM1TzGsGSVxaykT4kk8OYHGNY
|
46
|
+
created_at: 1581876572
|
25
47
|
requestBody:
|
26
48
|
required: true
|
27
49
|
content:
|
28
|
-
application/
|
50
|
+
application/json:
|
29
51
|
schema:
|
30
52
|
oneOf:
|
31
53
|
- $ref: '#/components/schemas/CreateTokenBody'
|
32
54
|
- $ref: '#/components/schemas/RefreshTokenBody'
|
55
|
+
examples:
|
56
|
+
create token:
|
57
|
+
value:
|
58
|
+
grant_type: password
|
59
|
+
username: spree@example.com
|
60
|
+
password: spree123
|
61
|
+
refresh token:
|
62
|
+
value:
|
63
|
+
grant_type: refresh_token
|
64
|
+
refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
|
65
|
+
description: ''
|
33
66
|
components:
|
34
67
|
schemas:
|
35
68
|
Token:
|
@@ -44,34 +77,64 @@ components:
|
|
44
77
|
expires_in:
|
45
78
|
type: integer
|
46
79
|
example: 7200
|
47
|
-
description:
|
80
|
+
description: Time (in seconds) after which the access token will expire
|
48
81
|
refresh_token:
|
49
82
|
type: string
|
50
83
|
example: f5d78642252eeb3f3001f67b196ac21a27afc030462a54060b0ebbdae2b8dc9c
|
51
84
|
created_at:
|
52
85
|
type: integer
|
53
86
|
example: 1539863418
|
87
|
+
x-examples:
|
88
|
+
create token:
|
89
|
+
access_token: SfM3k8kq5Wkc6xz6rgMlsl-mbygJ1ptq4DR0Ah51vjA
|
90
|
+
token_type: Bearer
|
91
|
+
expires_in: 7200
|
92
|
+
refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
|
93
|
+
created_at: 1581873931
|
94
|
+
refresh token:
|
95
|
+
access_token: Es9lLPW2mVaDB80I-I_OdQCw3JfOT1s19YN1naFWx98
|
96
|
+
token_type: Bearer
|
97
|
+
expires_in: 7200
|
98
|
+
refresh_token: j92BxulqIIYtiiaBsuAM1TzGsGSVxaykT4kk8OYHGNY
|
99
|
+
created_at: 1581876572
|
54
100
|
CreateTokenBody:
|
101
|
+
type: object
|
102
|
+
x-examples:
|
103
|
+
example-1:
|
104
|
+
grant_type: password
|
105
|
+
username: spree@example.com
|
106
|
+
password: spree123
|
55
107
|
properties:
|
56
108
|
grant_type:
|
57
109
|
type: string
|
58
110
|
default: password
|
59
|
-
description:
|
60
|
-
Use `password` to create a token and `refresh_token` to refresh it
|
111
|
+
description: Use `password` to create a token and `refresh_token` to refresh it
|
61
112
|
username:
|
62
113
|
type: string
|
63
114
|
description: User email address
|
64
|
-
example:
|
115
|
+
example: spree@example.com
|
65
116
|
password:
|
66
117
|
type: string
|
67
118
|
description: User password
|
68
|
-
example:
|
119
|
+
example: spree123
|
120
|
+
required:
|
121
|
+
- grant_type
|
122
|
+
- username
|
123
|
+
- password
|
69
124
|
RefreshTokenBody:
|
125
|
+
type: object
|
70
126
|
properties:
|
71
127
|
grant_type:
|
72
128
|
type: string
|
73
129
|
default: refresh_token
|
74
130
|
refresh_token:
|
75
131
|
type: string
|
76
|
-
description:
|
77
|
-
example: 27af95fd57a424e5d01aaf5eab1324a8d5c0ca57daf384fae39f811a5144330143301'
|
132
|
+
description: Refresh token obtained from the create token response
|
133
|
+
example: "27af95fd57a424e5d01aaf5eab1324a8d5c0ca57daf384fae39f811a5144330143301'"
|
134
|
+
required:
|
135
|
+
- grant_type
|
136
|
+
- refresh_token
|
137
|
+
x-examples:
|
138
|
+
example-1:
|
139
|
+
grant_type: refresh_token
|
140
|
+
refresh_token: SqJDIwX00fehqHxS6xmb-kzqAlrYe_0EHgekMexVT8k
|