Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

Re-organize Cart/Order API endpoints (#13628)

Damian Legawiec3708005d2138
diff --git a/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rb b/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rb
index 2b1e232a73..a6ec8e0fbb 100644
--- a/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rb
+++ b/backend/engines/api/app/controllers/spree/api/v3/store/cart_controller.rb
@@ -7,9 +7,22 @@ module Spree
before_action :require_authentication!, only: [:associate]
+ # POST /api/v3/store/cart
+ # Creates a new shopping cart (order)
+ # Can be created by guests or authenticated customers
+ def create
+ @cart = Spree::Order.create!(
+ store: current_store,
+ currency: current_currency,
+ user: current_user # nil for guests
+ )
+
+ render json: serialize_resource(@cart), status: :created
+ end
+
# GET /api/v3/store/cart
# Returns current incomplete order (cart)
- # Returns 404 if no cart exists - use POST /orders to create one
+ # Returns 404 if no cart exists - use POST /cart to create one
# Authorize via order_token param or JWT Bearer token
def show
@cart = find_cart
@@ -59,13 +72,6 @@ module Spree
raise ActiveRecord::RecordNotFound.new(nil, 'Spree::Order')
end
-
- def serialize_resource(resource)
- result = serializer_class.new(resource, params: serializer_params).to_h
- # Always include order token for cart (needed for guest checkout)
- result[:token] = resource.token if resource.token.present?
- result
- end
end
end
end
diff --git a/backend/engines/api/app/controllers/spree/api/v3/store/customer/orders_controller.rb b/backend/engines/api/app/controllers/spree/api/v3/store/customer/orders_controller.rb
new file mode 100644
index 0000000000..e723a04139
--- /dev/null
+++ b/backend/engines/api/app/controllers/spree/api/v3/store/customer/orders_controller.rb
@@ -0,0 +1,35 @@
+module Spree
+ module Api
+ module V3
+ module Store
+ module Customer
+ class OrdersController < ResourceController
+ prepend_before_action :require_authentication!
+
+ protected
+
+ def model_class
+ Spree::Order
+ end
+
+ def serializer_class
+ Spree.api.order_serializer
+ end
+
+ def set_parent
+ @parent = current_user
+ end
+
+ def parent_association
+ :orders
+ end
+
+ def scope
+ super.for_store(current_store)
+ end
+ end
+ end
+ end
+ end
+ end
+end
diff --git a/backend/engines/api/app/controllers/spree/api/v3/store/orders_controller.rb b/backend/engines/api/app/controllers/spree/api/v3/store/orders_controller.rb
index b571e25c8d..18f6874bce 100644
--- a/backend/engines/api/app/controllers/spree/api/v3/store/orders_controller.rb
+++ b/backend/engines/api/app/controllers/spree/api/v3/store/orders_controller.rb
@@ -7,21 +7,7 @@ module Spree
# Skip base controller's set_resource and define our own complete list
skip_before_action :set_resource
- before_action :set_resource, only: [:show, :update, :destroy, :next, :advance, :complete]
- prepend_before_action :require_authentication!, only: [:index]
-
- # POST /api/v3/store/orders (public - guest checkout)
- def create
- @resource = Spree::Order.create!(
- store: current_store,
- currency: current_currency,
- user: current_user # nil for guests
- )
-
- render json: serialize_resource(@resource).merge(
- order_token: @resource.token # Return token for guest access
- ), status: :created
- end
+ before_action :set_resource, only: [:show, :update, :next, :advance, :complete]
# PATCH /api/v3/store/orders/:id
#
diff --git a/backend/engines/api/config/routes.rb b/backend/engines/api/config/routes.rb
index 62ae24fc98..4bf501f2da 100644
--- a/backend/engines/api/config/routes.rb
+++ b/backend/engines/api/config/routes.rb
@@ -25,12 +25,13 @@ Spree::Core::Engine.add_routes do
resources :products, only: [:index], controller: 'taxons/products'
end
- # Cart - alias for current incomplete order (creates if none exists)
- get 'cart', to: 'cart#show'
- patch 'cart/associate', to: 'cart#associate'
+ # Cart
+ resource :cart, only: [:show, :create], controller: 'cart' do
+ patch :associate
+ end
- # Orders - all orders (complete and incomplete)
- resources :orders do
+ # Orders - individual order management and checkout
+ resources :orders, only: [:show, :update] do
member do
# State transitions
patch :next # Move to next checkout step
@@ -61,6 +62,7 @@ Spree::Core::Engine.add_routes do
patch :mark_as_default
end
end
+ resources :orders, only: [:index]
resources :credit_cards, only: [:index, :show, :destroy]
resources :gift_cards, only: [:index, :show]
resources :payment_setup_sessions, only: [:create, :show] do
diff --git a/backend/engines/api/lib/spree/api/openapi/typelizer_converter.rb b/backend/engines/api/lib/spree/api/openapi/typelizer_converter.rb
index 8dcf7c7765..80ffc049d9 100644
--- a/backend/engines/api/lib/spree/api/openapi/typelizer_converter.rb
+++ b/backend/engines/api/lib/spree/api/openapi/typelizer_converter.rb
@@ -211,6 +211,13 @@ module Spree
return schema
end
+ # Record<K, V> types -> plain object
+ if type_string.match?(/^Record</)
+ schema = { type: :object }
+ schema[:nullable] = true if nullable
+ return schema
+ end
+
# Reference type - in OpenAPI 3.0, nullable $ref needs allOf wrapper
if type_string.match?(/^[A-Z]/)
ref = { '$ref' => "#/components/schemas/#{type_string}" }
diff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rb
index 44f158e1af..1d78706725 100644
--- a/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rb
+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/cart_controller_spec.rb
@@ -9,6 +9,55 @@ RSpec.describe Spree::Api::V3::Store::CartController, type: :controller do
request.headers['X-Spree-Api-Key'] = api_key.token
end
+ describe 'POST #create' do
+ it 'creates a new cart' do
+ expect do
+ post :create
+ end.to change(Spree::Order, :count).by(1)
+
+ expect(response).to have_http_status(:created)
+ expect(json_response['number']).to be_present
+ expect(json_response['state']).to eq('cart')
+ end
+
+ it 'returns token for guest access' do
+ post :create
+
+ expect(json_response['token']).to be_present
+ end
+
+ it 'creates cart associated with current store' do
+ post :create
+
+ expect(Spree::Order.last.store_id).to eq(store.id)
+ end
+
+ context 'for authenticated user' do
+ before do
+ request.headers['Authorization'] = "Bearer #{jwt_token}"
+ end
+
+ it 'creates a cart associated with user' do
+ post :create
+
+ expect(response).to have_http_status(:created)
+ expect(Spree::Order.last.user_id).to eq(user.id)
+ end
+ end
+
+ context 'without API key' do
+ before { request.headers['X-Spree-Api-Key'] = nil }
+
+ it 'returns unauthorized' do
+ post :create
+
+ expect(response).to have_http_status(:unauthorized)
+ expect(json_response['error']['code']).to eq('invalid_token')
+ expect(json_response['error']['message']).to be_present
+ end
+ end
+ end
+
describe 'GET #show' do
context 'with order_token parameter' do
let(:cart) { create(:order_with_line_items, store: store) }
diff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/customer/orders_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/orders_controller_spec.rb
new file mode 100644
index 0000000000..1e9d033b99
--- /dev/null
+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/orders_controller_spec.rb
@@ -0,0 +1,59 @@
+require 'spec_helper'
+
+RSpec.describe Spree::Api::V3::Store::Customer::OrdersController, type: :controller do
+ render_views
+
+ include_context 'API v3 Store'
+
+ let!(:order) { create(:order_with_line_items, user: user, store: store) }
+ let!(:other_user_order) { create(:order_with_line_items, store: store) }
+
+ before do
+ request.headers['X-Spree-Api-Key'] = api_key.token
+ request.headers['Authorization'] = "Bearer #{jwt_token}"
+ end
+
+ describe 'GET #index' do
+ it 'returns user orders' do
+ get :index
+
+ expect(response).to have_http_status(:ok)
+ expect(json_response['data'].size).to eq(1)
+ expect(json_response['data'].first['number']).to eq(order.number)
+ end
+
+ it 'does not return other users orders' do
+ get :index
+
+ numbers = json_response['data'].map { |o| o['number'] }
+ expect(numbers).not_to include(other_user_order.number)
+ end
+
+ it 'does not return orders from other stores' do
+ other_store = create(:store)
+ create(:order_with_line_items, user: user, store: other_store)
+
+ get :index
+
+ numbers = json_response['data'].map { |o| o['number'] }
+ expect(numbers).to eq([order.number])
+ end
+
+ it 'returns pagination metadata' do
+ get :index
+
+ expect(json_response['meta']).to include('page', 'count', 'pages')
+ end
+
+ context 'without authentication' do
+ before { request.headers['Authorization'] = nil }
+
+ it 'returns unauthorized' do
+ get :index
+
+ expect(response).to have_http_status(:unauthorized)
+ expect(json_response['error']['code']).to eq('authentication_required')
+ end
+ end
+ end
+end
diff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/orders_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/orders_controller_spec.rb
index b70e888c84..2768956afb 100644
--- a/backend/engines/api/spec/controllers/spree/api/v3/store/orders_controller_spec.rb
+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/orders_controller_spec.rb
@@ -9,91 +9,6 @@ RSpec.describe Spree::Api::V3::Store::OrdersController, type: :controller do
request.headers['X-Spree-Api-Key'] = api_key.token
end
- describe 'POST #create' do
- it 'creates a new cart' do
- expect do
- post :create
- end.to change(Spree::Order, :count).by(1)
-
- expect(response).to have_http_status(:created)
- expect(json_response['number']).to be_present
- expect(json_response['state']).to eq('cart')
- end
-
- it 'creates cart associated with current store' do
- post :create
-
- expect(Spree::Order.last.store_id).to eq(store.id)
- end
-
- context 'for authenticated user' do
- before do
- request.headers['Authorization'] = "Bearer #{jwt_token}"
- end
-
- it 'creates a cart associated with user' do
- post :create
-
- expect(response).to have_http_status(:created)
- expect(Spree::Order.last.user_id).to eq(user.id)
- end
- end
-
- context 'without API key' do
- before { request.headers['X-Spree-Api-Key'] = nil }
-
- it 'returns unauthorized' do
- post :create
-
- expect(response).to have_http_status(:unauthorized)
- expect(json_response['error']['code']).to eq('invalid_token')
- expect(json_response['error']['message']).to be_present
- end
- end
- end
-
- describe 'GET #index' do
- let!(:order) { create(:order_with_line_items, user: user, store: store) }
- let!(:other_user_order) { create(:order_with_line_items, store: store) }
-
- context 'authenticated' do
- before do
- request.headers['Authorization'] = "Bearer #{jwt_token}"
- end
-
- it 'returns user orders' do
- get :index
-
- expect(response).to have_http_status(:ok)
- expect(json_response['data'].size).to eq(1)
- expect(json_response['data'].first['number']).to eq(order.number)
- end
-
- it 'does not return other users orders' do
- get :index
-
- numbers = json_response['data'].map { |o| o['number'] }
- expect(numbers).not_to include(other_user_order.number)
- end
-
- it 'returns pagination metadata' do
- get :index
-
- expect(json_response['meta']).to include('page', 'count', 'pages')
- end
- end
-
- context 'unauthenticated' do
- it 'returns unauthorized' do
- get :index
-
- expect(response).to have_http_status(:unauthorized)
- expect(json_response['error']['code']).to eq('authentication_required')
- expect(json_response['error']['message']).to be_present
- end
- end
- end
-
describe 'GET #show' do
let(:order) { create(:order_with_line_items, user: user, store: store) }
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/addresses_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/addresses_spec.rb
index a43b800bb5..b4f6602390 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/addresses_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/addresses_spec.rb
@@ -11,7 +11,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/stor
path '/api/v3/store/customer/addresses' do
get 'List customer addresses' do
- tags 'Addresses'
+ tags 'Customers'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns all addresses in the customer address book'
@@ -48,7 +48,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/stor
end
post 'Create an address' do
- tags 'Addresses'
+ tags 'Customers'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -115,7 +115,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/stor
path '/api/v3/store/customer/addresses/{id}' do
get 'Get an address' do
- tags 'Addresses'
+ tags 'Customers'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -145,7 +145,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/stor
end
patch 'Update an address' do
- tags 'Addresses'
+ tags 'Customers'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -179,7 +179,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/stor
end
delete 'Delete an address' do
- tags 'Addresses'
+ tags 'Customers'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -209,7 +209,7 @@ RSpec.describe 'Addresses API', type: :request, swagger_doc: 'api-reference/stor
path '/api/v3/store/customer/addresses/{id}/mark_as_default' do
patch 'Mark address as default' do
- tags 'Addresses'
+ tags 'Customers'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/cart_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/cart_spec.rb
index 34df9bd376..df528440fc 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/cart_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/cart_spec.rb
@@ -6,6 +6,50 @@ RSpec.describe 'Cart API', type: :request, swagger_doc: 'api-reference/store.yam
include_context 'API v3 Store'
path '/api/v3/store/cart' do
+ post 'Create a new cart' do
+ tags 'Cart'
+ produces 'application/json'
+ security [api_key: []]
+ description <<~DESC
+ Creates a new shopping cart (order). Can be created by guests or authenticated customers.
+ Returns a `token` that must be used for guest access to the order.
+ DESC
+
+ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
+ parameter name: 'Authorization', in: :header, type: :string, required: false,
+ description: 'Bearer JWT token (optional - for authenticated customers)'
+
+ response '201', 'cart created (guest)' do
+ let(:'x-spree-api-key') { api_key.token }
+
+ schema '$ref' => '#/components/schemas/StoreOrder'
+
+ run_test! do |response|
+ data = JSON.parse(response.body)
+ expect(data['number']).to be_present
+ expect(data['state']).to eq('cart')
+ expect(data['token']).to be_present
+ end
+ end
+
+ response '201', 'cart created (authenticated)' do
+ let(:'x-spree-api-key') { api_key.token }
+ let(:'Authorization') { "Bearer #{jwt_token}" }
+
+ schema '$ref' => '#/components/schemas/StoreOrder'
+
+ run_test!
+ end
+
+ response '401', 'unauthorized - invalid API key' do
+ let(:'x-spree-api-key') { 'invalid' }
+
+ schema '$ref' => '#/components/schemas/ErrorResponse'
+
+ run_test!
+ end
+ end
+
get 'Get current cart' do
tags 'Cart'
produces 'application/json'
@@ -26,11 +70,7 @@ RSpec.describe 'Cart API', type: :request, swagger_doc: 'api-reference/store.yam
let(:'x-spree-api-key') { api_key.token }
let(:order_token) { cart.token }
- schema type: :object,
- allOf: [
- { '$ref' => '#/components/schemas/StoreOrder' },
- { type: :object, properties: { token: { type: :string } } }
- ]
+ schema '$ref' => '#/components/schemas/StoreOrder'
run_test! do |response|
data = JSON.parse(response.body)
@@ -45,11 +85,7 @@ RSpec.describe 'Cart API', type: :request, swagger_doc: 'api-reference/store.yam
let(:'x-spree-api-key') { api_key.token }
let(:'Authorization') { "Bearer #{jwt_token}" }
- schema type: :object,
- allOf: [
- { '$ref' => '#/components/schemas/StoreOrder' },
- { type: :object, properties: { token: { type: :string } } }
- ]
+ schema '$ref' => '#/components/schemas/StoreOrder'
run_test! do |response|
data = JSON.parse(response.body)
@@ -95,11 +131,7 @@ RSpec.describe 'Cart API', type: :request, swagger_doc: 'api-reference/store.yam
let(:'Authorization') { "Bearer #{jwt_token}" }
let(:order_token) { guest_cart.token }
- schema type: :object,
- allOf: [
- { '$ref' => '#/components/schemas/StoreOrder' },
- { type: :object, properties: { token: { type: :string } } }
- ]
+ schema '$ref' => '#/components/schemas/StoreOrder'
run_test! do |response|
data = JSON.parse(response.body)
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/coupon_codes_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/coupon_codes_spec.rb
index 4a056ab14e..816b5874f0 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/coupon_codes_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/coupon_codes_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe 'Coupon Codes API', type: :request, swagger_doc: 'api-reference/s
path '/api/v3/store/orders/{order_id}/coupon_codes' do
post 'Apply coupon code' do
- tags 'Coupon Codes'
+ tags 'Cart'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -92,7 +92,7 @@ RSpec.describe 'Coupon Codes API', type: :request, swagger_doc: 'api-reference/s
path '/api/v3/store/orders/{order_id}/coupon_codes/{id}' do
delete 'Remove coupon code' do
- tags 'Coupon Codes'
+ tags 'Cart'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Removes a previously applied coupon code from the order.'
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/credit_cards_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/credit_cards_spec.rb
index 91b994717e..8a73a14d7d 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/credit_cards_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/credit_cards_spec.rb
@@ -9,7 +9,7 @@ RSpec.describe 'Credit Cards API', type: :request, swagger_doc: 'api-reference/s
path '/api/v3/store/customer/credit_cards' do
get 'List saved credit cards' do
- tags 'Credit Cards'
+ tags 'Customers'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns all saved credit cards for the authenticated customer'
@@ -49,7 +49,7 @@ RSpec.describe 'Credit Cards API', type: :request, swagger_doc: 'api-reference/s
path '/api/v3/store/customer/credit_cards/{id}' do
get 'Get a credit card' do
- tags 'Credit Cards'
+ tags 'Customers'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a saved credit card by its ID'
@@ -80,7 +80,7 @@ RSpec.describe 'Credit Cards API', type: :request, swagger_doc: 'api-reference/s
end
delete 'Delete a credit card' do
- tags 'Credit Cards'
+ tags 'Customers'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Removes a saved credit card from the customer account'
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/customer_orders_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/customer_orders_spec.rb
new file mode 100644
index 0000000000..2c804604bb
--- /dev/null
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/customer_orders_spec.rb
@@ -0,0 +1,53 @@
+# frozen_string_literal: true
+
+require 'swagger_helper'
+
+RSpec.describe 'Customer Orders API', type: :request, swagger_doc: 'api-reference/store.yaml' do
+ include_context 'API v3 Store'
+
+ let(:user) { create(:user_with_addresses) }
+ let!(:order) { create(:order_with_line_items, store: store, user: user) }
+
+ path '/api/v3/store/customer/orders' do
+ get 'List customer orders' do
+ tags 'Customers'
+ produces 'application/json'
+ security [api_key: [], bearer_auth: []]
+ description 'Returns a paginated list of orders for the authenticated customer'
+
+ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
+ parameter name: 'Authorization', in: :header, type: :string, required: true
+ parameter name: :page, in: :query, type: :integer, required: false
+ parameter name: :per_page, in: :query, type: :integer, required: false
+ parameter name: 'q[state_eq]', in: :query, type: :string, required: false,
+ description: 'Filter by order state'
+ parameter name: 'q[completed_at_gte]', in: :query, type: :string, required: false,
+ description: 'Filter by completion date (after)'
+
+ response '200', 'orders found' do
+ let(:'x-spree-api-key') { api_key.token }
+ let(:'Authorization') { "Bearer #{jwt_token}" }
+
+ schema type: :object,
+ properties: {
+ data: { type: :array, items: { '$ref' => '#/components/schemas/StoreOrder' } },
+ meta: { '$ref' => '#/components/schemas/PaginationMeta' }
+ }
+
+ run_test! do |response|
+ data = JSON.parse(response.body)
+ expect(data['data']).to be_an(Array)
+ end
+ end
+
+ response '401', 'unauthorized - authentication required' do
+ let(:'x-spree-api-key') { api_key.token }
+ let(:'Authorization') { '' }
+
+ schema '$ref' => '#/components/schemas/ErrorResponse'
+
+ run_test!
+ end
+ end
+ end
+end
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/line_items_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/line_items_spec.rb
index 7f7e59bf1c..5e1e33f292 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/line_items_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/line_items_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe 'Line Items API', type: :request, swagger_doc: 'api-reference/sto
path '/api/v3/store/orders/{order_id}/line_items' do
post 'Add item to cart' do
- tags 'Line Items'
+ tags 'Cart'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -77,7 +77,7 @@ RSpec.describe 'Line Items API', type: :request, swagger_doc: 'api-reference/sto
path '/api/v3/store/orders/{order_id}/line_items/{id}' do
patch 'Update line item quantity' do
- tags 'Line Items'
+ tags 'Cart'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -115,7 +115,7 @@ RSpec.describe 'Line Items API', type: :request, swagger_doc: 'api-reference/sto
end
delete 'Remove line item from cart' do
- tags 'Line Items'
+ tags 'Cart'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Removes a line item from the order'
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/orders_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/orders_spec.rb
index ce7b28045f..0af5463a02 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/orders_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/orders_spec.rb
@@ -8,106 +8,6 @@ RSpec.describe 'Orders API', type: :request, swagger_doc: 'api-reference/store.y
let(:user) { create(:user_with_addresses) }
let!(:order) { create(:order_with_line_items, store: store, user: user) }
- path '/api/v3/store/orders' do
- get 'List orders' do
- tags 'Orders'
- produces 'application/json'
- security [api_key: [], bearer_auth: []]
- description 'Returns a paginated list of orders for the authenticated customer'
-
- parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
- parameter name: 'Authorization', in: :header, type: :string, required: true
- parameter name: :page, in: :query, type: :integer, required: false
- parameter name: :per_page, in: :query, type: :integer, required: false
- parameter name: 'q[state_eq]', in: :query, type: :string, required: false,
- description: 'Filter by order state'
- parameter name: 'q[completed_at_gte]', in: :query, type: :string, required: false,
- description: 'Filter by completion date (after)'
-
- response '200', 'orders found' do
- let(:'x-spree-api-key') { api_key.token }
- let(:'Authorization') { "Bearer #{jwt_token}" }
-
- schema type: :object,
- properties: {
- data: { type: :array, items: { '$ref' => '#/components/schemas/StoreOrder' } },
- meta: { '$ref' => '#/components/schemas/PaginationMeta' }
- }
-
- run_test! do |response|
- data = JSON.parse(response.body)
- expect(data['data']).to be_an(Array)
- end
- end
-
- response '401', 'unauthorized - authentication required' do
- let(:'x-spree-api-key') { api_key.token }
- let(:'Authorization') { '' }
-
- schema '$ref' => '#/components/schemas/ErrorResponse'
-
- run_test!
- end
- end
-
- post 'Create a cart' do
- tags 'Orders'
- produces 'application/json'
- security [api_key: []]
- description <<~DESC
- Creates a new order (shopping cart). Can be created by guests or authenticated customers.
- Returns an `order_token` that must be used for guest access to the order.
- DESC
-
- parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
- parameter name: 'Authorization', in: :header, type: :string, required: false,
- description: 'Bearer JWT token (optional - for authenticated customers)'
-
- response '201', 'cart created (guest)' do
- let(:'x-spree-api-key') { api_key.token }
-
- schema type: :object,
- allOf: [
- { '$ref' => '#/components/schemas/StoreOrder' },
- {
- type: :object,
- properties: {
- order_token: { type: :string, description: 'Token for guest access to this order' }
- }
- }
- ]
-
- run_test! do |response|
- data = JSON.parse(response.body)
- expect(data['number']).to be_present
- expect(data['state']).to eq('cart')
- expect(data['order_token']).to be_present
- end
- end
-
- response '201', 'cart created (authenticated)' do
- let(:'x-spree-api-key') { api_key.token }
- let(:'Authorization') { "Bearer #{jwt_token}" }
-
- schema type: :object,
- allOf: [
- { '$ref' => '#/components/schemas/StoreOrder' },
- { type: :object, properties: { order_token: { type: :string } } }
- ]
-
- run_test!
- end
-
- response '401', 'unauthorized - invalid API key' do
- let(:'x-spree-api-key') { 'invalid' }
-
- schema '$ref' => '#/components/schemas/ErrorResponse'
-
- run_test!
- end
- end
- end
-
path '/api/v3/store/orders/{id}' do
get 'Get an order' do
tags 'Orders'
@@ -172,7 +72,7 @@ RSpec.describe 'Orders API', type: :request, swagger_doc: 'api-reference/store.y
end
patch 'Update an order' do
- tags 'Orders'
+ tags 'Checkout'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -250,7 +150,7 @@ RSpec.describe 'Orders API', type: :request, swagger_doc: 'api-reference/store.y
path '/api/v3/store/orders/{id}/next' do
patch 'Advance to next checkout step' do
- tags 'Orders'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Advances the order to the next state in the checkout flow'
@@ -286,7 +186,7 @@ RSpec.describe 'Orders API', type: :request, swagger_doc: 'api-reference/store.y
path '/api/v3/store/orders/{id}/advance' do
patch 'Advance through checkout' do
- tags 'Orders'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Advances the order through all possible checkout states'
@@ -311,7 +211,7 @@ RSpec.describe 'Orders API', type: :request, swagger_doc: 'api-reference/store.y
path '/api/v3/store/orders/{id}/complete' do
patch 'Complete the order' do
- tags 'Orders'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Completes the order (finalizes the purchase)'
@@ -352,76 +252,4 @@ RSpec.describe 'Orders API', type: :request, swagger_doc: 'api-reference/store.y
end
end
end
-
- path '/api/v3/store/orders/{order_id}/store_credits' do
- post 'Add store credit' do
- tags 'Orders'
- consumes 'application/json'
- produces 'application/json'
- security [api_key: [], bearer_auth: []]
- description 'Applies store credit to the order'
-
- parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
- parameter name: 'Authorization', in: :header, type: :string, required: true
- parameter name: :order_id, in: :path, type: :string, required: true
- parameter name: :order_token, in: :query, type: :string, required: false
- parameter name: :body, in: :body, schema: {
- type: :object,
- properties: {
- amount: { type: :number, example: 10.0, description: 'Amount to apply (optional - defaults to max available)' }
- }
- }
-
- response '200', 'store credit applied' do
- let(:store_credit_payment_method) { create(:store_credit_payment_method, stores: [store]) }
- let(:store_credit) { create(:store_credit, user: user, store: store, amount: 50) }
- let(:'x-spree-api-key') { api_key.token }
- let(:'Authorization') { "Bearer #{jwt_token}" }
- let(:order_id) { order.to_param }
- let(:body) { { amount: 10 } }
-
- before do
- store_credit_payment_method
- store_credit
- end
-
- schema '$ref' => '#/components/schemas/StoreOrder'
-
- run_test!
- end
-
- response '422', 'no store credit available' do
- let(:'x-spree-api-key') { api_key.token }
- let(:'Authorization') { "Bearer #{jwt_token}" }
- let(:order_id) { order.to_param }
- let(:body) { {} }
-
- schema '$ref' => '#/components/schemas/ErrorResponse'
-
- run_test!
- end
- end
-
- delete 'Remove store credit' do
- tags 'Orders'
- produces 'application/json'
- security [api_key: [], bearer_auth: []]
- description 'Removes store credit from the order'
-
- parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
- parameter name: 'Authorization', in: :header, type: :string, required: true
- parameter name: :order_id, in: :path, type: :string, required: true
- parameter name: :order_token, in: :query, type: :string, required: false
-
- response '200', 'store credit removed' do
- let(:'x-spree-api-key') { api_key.token }
- let(:'Authorization') { "Bearer #{jwt_token}" }
- let(:order_id) { order.to_param }
-
- schema '$ref' => '#/components/schemas/StoreOrder'
-
- run_test!
- end
- end
- end
end
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/payment_methods_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/payment_methods_spec.rb
index 89c1562c25..2a8658aacb 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/payment_methods_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/payment_methods_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe 'Payment Methods API', type: :request, swagger_doc: 'api-referenc
path '/api/v3/store/orders/{order_id}/payment_methods' do
get 'List available payment methods' do
- tags 'Payment Methods'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns payment methods available for the order based on store configuration and order state'
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rb
index 8100632dc8..5f8785f968 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/payment_sessions_spec.rb
@@ -18,7 +18,7 @@ RSpec.describe 'Payment Sessions API', type: :request, swagger_doc: 'api-referen
path '/api/v3/store/orders/{order_id}/payment_sessions' do
post 'Create payment session' do
- tags 'Payment Sessions'
+ tags 'Checkout'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -79,7 +79,7 @@ RSpec.describe 'Payment Sessions API', type: :request, swagger_doc: 'api-referen
description: 'Order token for guest access'
get 'Get payment session' do
- tags 'Payment Sessions'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single payment session with its current status and provider data.'
@@ -109,7 +109,7 @@ RSpec.describe 'Payment Sessions API', type: :request, swagger_doc: 'api-referen
end
patch 'Update payment session' do
- tags 'Payment Sessions'
+ tags 'Checkout'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -151,7 +151,7 @@ RSpec.describe 'Payment Sessions API', type: :request, swagger_doc: 'api-referen
description: 'Order token for guest access'
patch 'Complete payment session' do
- tags 'Payment Sessions'
+ tags 'Checkout'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb
index 050a4e6bb1..83c48240b3 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb
@@ -15,7 +15,7 @@ RSpec.describe 'Payment Setup Sessions API', type: :request, swagger_doc: 'api-r
path '/api/v3/store/customer/payment_setup_sessions' do
post 'Create payment setup session' do
- tags 'Payment Setup Sessions'
+ tags 'Customers'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
@@ -74,7 +74,7 @@ RSpec.describe 'Payment Setup Sessions API', type: :request, swagger_doc: 'api-r
description: 'Payment setup session ID'
get 'Get payment setup session' do
- tags 'Payment Setup Sessions'
+ tags 'Customers'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a payment setup session with its current status and provider data.'
@@ -111,7 +111,7 @@ RSpec.describe 'Payment Setup Sessions API', type: :request, swagger_doc: 'api-r
description: 'Payment setup session ID'
patch 'Complete payment setup session' do
- tags 'Payment Setup Sessions'
+ tags 'Customers'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/payments_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/payments_spec.rb
index 07a32394bd..545a7925ff 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/payments_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/payments_spec.rb
@@ -16,7 +16,7 @@ RSpec.describe 'Payments API', type: :request, swagger_doc: 'api-reference/store
parameter name: :order_id, in: :path, type: :string, description: 'Order prefix ID'
get 'List payments' do
- tags 'Payments'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a list of payments for the specified order'
@@ -59,7 +59,7 @@ RSpec.describe 'Payments API', type: :request, swagger_doc: 'api-reference/store
parameter name: :id, in: :path, type: :string, description: 'Payment ID'
get 'Get payment' do
- tags 'Payments'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns a single payment by ID'
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/shipments_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/shipments_spec.rb
index 28f07de6f7..0505df55d4 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/shipments_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/shipments_spec.rb
@@ -10,7 +10,7 @@ RSpec.describe 'Shipments API', type: :request, swagger_doc: 'api-reference/stor
path '/api/v3/store/orders/{order_id}/shipments' do
get 'List shipments for an order' do
- tags 'Shipments'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns all shipments associated with the order'
@@ -52,7 +52,7 @@ RSpec.describe 'Shipments API', type: :request, swagger_doc: 'api-reference/stor
path '/api/v3/store/orders/{order_id}/shipments/{id}' do
get 'Get a shipment' do
- tags 'Shipments'
+ tags 'Checkout'
produces 'application/json'
security [api_key: [], bearer_auth: []]
description 'Returns details of a specific shipment'
@@ -94,7 +94,7 @@ RSpec.describe 'Shipments API', type: :request, swagger_doc: 'api-reference/stor
end
patch 'Select shipping rate for shipment' do
- tags 'Shipments'
+ tags 'Checkout'
consumes 'application/json'
produces 'application/json'
security [api_key: [], bearer_auth: []]
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/store_credits_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/store_credits_spec.rb
new file mode 100644
index 0000000000..f4b4e7b8de
--- /dev/null
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/store_credits_spec.rb
@@ -0,0 +1,82 @@
+# frozen_string_literal: true
+
+require 'swagger_helper'
+
+RSpec.describe 'Store Credits API', type: :request, swagger_doc: 'api-reference/store.yaml' do
+ include_context 'API v3 Store'
+
+ let(:user) { create(:user_with_addresses) }
+ let!(:order) { create(:order_with_line_items, store: store, user: user) }
+
+ path '/api/v3/store/orders/{order_id}/store_credits' do
+ post 'Add store credit' do
+ tags 'Checkout'
+ consumes 'application/json'
+ produces 'application/json'
+ security [api_key: [], bearer_auth: []]
+ description 'Applies store credit to the order'
+
+ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
+ parameter name: 'Authorization', in: :header, type: :string, required: true
+ parameter name: :order_id, in: :path, type: :string, required: true
+ parameter name: :order_token, in: :query, type: :string, required: false
+ parameter name: :body, in: :body, schema: {
+ type: :object,
+ properties: {
+ amount: { type: :number, example: 10.0, description: 'Amount to apply (optional - defaults to max available)' }
+ }
+ }
+
+ response '200', 'store credit applied' do
+ let(:store_credit_payment_method) { create(:store_credit_payment_method, stores: [store]) }
+ let(:store_credit) { create(:store_credit, user: user, store: store, amount: 50) }
+ let(:'x-spree-api-key') { api_key.token }
+ let(:'Authorization') { "Bearer #{jwt_token}" }
+ let(:order_id) { order.to_param }
+ let(:body) { { amount: 10 } }
+
+ before do
+ store_credit_payment_method
+ store_credit
+ end
+
+ schema '$ref' => '#/components/schemas/StoreOrder'
+
+ run_test!
+ end
+
+ response '422', 'no store credit available' do
+ let(:'x-spree-api-key') { api_key.token }
+ let(:'Authorization') { "Bearer #{jwt_token}" }
+ let(:order_id) { order.to_param }
+ let(:body) { {} }
+
+ schema '$ref' => '#/components/schemas/ErrorResponse'
+
+ run_test!
+ end
+ end
+
+ delete 'Remove store credit' do
+ tags 'Checkout'
+ produces 'application/json'
+ security [api_key: [], bearer_auth: []]
+ description 'Removes store credit from the order'
+
+ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
+ parameter name: 'Authorization', in: :header, type: :string, required: true
+ parameter name: :order_id, in: :path, type: :string, required: true
+ parameter name: :order_token, in: :query, type: :string, required: false
+
+ response '200', 'store credit removed' do
+ let(:'x-spree-api-key') { api_key.token }
+ let(:'Authorization') { "Bearer #{jwt_token}" }
+ let(:order_id) { order.to_param }
+
+ schema '$ref' => '#/components/schemas/StoreOrder'
+
+ run_test!
+ end
+ end
+ end
+end
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/taxonomies_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/taxonomies_spec.rb
index cccaab2261..50126176a7 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/taxonomies_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/taxonomies_spec.rb
@@ -12,7 +12,7 @@ RSpec.describe 'Taxonomies API', type: :request, swagger_doc: 'api-reference/sto
path '/api/v3/store/taxonomies' do
get 'List taxonomies' do
- tags 'Taxonomies'
+ tags 'Taxons'
produces 'application/json'
security [api_key: []]
description 'Returns a list of taxonomies (category hierarchies) for the current store'
@@ -50,7 +50,7 @@ RSpec.describe 'Taxonomies API', type: :request, swagger_doc: 'api-reference/sto
path '/api/v3/store/taxonomies/{id}' do
get 'Get a taxonomy' do
- tags 'Taxonomies'
+ tags 'Taxons'
produces 'application/json'
security [api_key: []]
description 'Returns a single taxonomy with its taxon tree'
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/taxons_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/taxons_spec.rb
index 9d0a149ab9..1414c92f43 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/taxons_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/taxons_spec.rb
@@ -13,6 +13,48 @@ RSpec.describe 'Taxons API', type: :request, swagger_doc: 'api-reference/store.y
let!(:other_taxonomy) { create(:taxonomy, store: other_store) }
let!(:other_taxon) { create(:taxon, taxonomy: other_taxonomy) }
+ path '/api/v3/store/taxons' do
+ get 'List taxons' do
+ tags 'Taxons'
+ produces 'application/json'
+ security [api_key: []]
+ description 'Returns a paginated list of taxons (categories) for the current store'
+
+ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true
+ parameter name: :page, in: :query, type: :integer, required: false
+ parameter name: :per_page, in: :query, type: :integer, required: false
+ parameter name: 'q[name_cont]', in: :query, type: :string, required: false,
+ description: 'Filter by name'
+
+ response '200', 'taxons found' do
+ let(:'x-spree-api-key') { api_key.token }
+
+ schema type: :object,
+ properties: {
+ data: { type: :array, items: { '$ref' => '#/components/schemas/StoreTaxon' } },
+ meta: { '$ref' => '#/components/schemas/PaginationMeta' }
+ }
+
+ run_test! do |response|
+ data = JSON.parse(response.body)
+ expect(data['data']).to be_an(Array)
+ expect(data['data'].size).to be >= 1
+ # Should not include taxons from other stores
+ ids = data['data'].map { |t| t['id'] }
+ expect(ids).not_to include(other_taxon.prefixed_id)
+ end
+ end
+
+ response '401', 'unauthorized' do
+ let(:'x-spree-api-key') { 'invalid' }
+
+ schema '$ref' => '#/components/schemas/ErrorResponse'
+
+ run_test!
+ end
+ end
+ end
+
path '/api/v3/store/taxons/{id}' do
get 'Get a taxon' do
tags 'Taxons'
diff --git a/backend/engines/api/spec/swagger_helper.rb b/backend/engines/api/spec/swagger_helper.rb
index 3b444853a1..9990782692 100644
--- a/backend/engines/api/spec/swagger_helper.rb
+++ b/backend/engines/api/spec/swagger_helper.rb
@@ -86,29 +86,22 @@ RSpec.configure do |config|
{ name: 'Authentication', description: 'Customer authentication and registration' },
{ name: 'Store', description: 'Store information and settings' },
{ name: 'Products', description: 'Product catalog browsing' },
- { name: 'Taxonomies', description: 'Category hierarchies' },
- { name: 'Taxons', description: 'Individual categories' },
+ { name: 'Taxons', description: 'Taxonomies and categories' },
{ name: 'Countries', description: 'Available shipping countries' },
{ name: 'Cart', description: 'Shopping cart management' },
- { name: 'Orders', description: 'Order management and checkout' },
- { name: 'Line Items', description: 'Cart item management' },
- { name: 'Coupon Codes', description: 'Coupon code and gift card management' },
- { name: 'Payments', description: 'Payment processing' },
- { name: 'Payment Sessions', description: 'Provider-agnostic payment session management' },
- { name: 'Payment Methods', description: 'Available payment options' },
- { name: 'Shipments', description: 'Shipping and delivery' },
- { name: 'Customers', description: 'Customer account management' },
- { name: 'Addresses', description: 'Customer address book' },
- { name: 'Credit Cards', description: 'Saved payment methods' },
- { name: 'Payment Setup Sessions', description: 'Save payment methods for future use via gateway-agnostic setup sessions' },
+ { name: 'Checkout', description: 'Checkout flow and order updates' },
+ { name: 'Orders', description: 'Order lookup' },
+ { name: 'Customers', description: 'Customer account, addresses, saved payment methods, and order history' },
{ name: 'Wishlists', description: 'Customer wishlists' },
{ name: 'Digitals', description: 'Digital product downloads' }
],
'x-tagGroups': [
{ name: 'Store', tags: %w[Store Countries] },
- { name: 'Catalog', tags: %w[Products Taxonomies Taxons] },
- { name: 'Checkout', tags: ['Cart', 'Orders', 'Line Items', 'Coupon Codes', 'Payments', 'Payment Sessions', 'Payment Methods', 'Shipments'] },
- { name: 'Customer', tags: ['Authentication', 'Customers', 'Addresses', 'Credit Cards', 'Payment Setup Sessions', 'Wishlists', 'Digitals'] }
+ { name: 'Catalog', tags: %w[Products Taxons] },
+ { name: 'Cart', tags: ['Cart'] },
+ { name: 'Checkout', tags: ['Checkout'] },
+ { name: 'Orders', tags: ['Orders'] },
+ { name: 'Customer', tags: %w[Authentication Customers Wishlists Digitals] }
],
components: {
securitySchemes: {
diff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yaml
index 8f1171bc47..172b13ded3 100644
--- a/docs/api-reference/store.yaml
+++ b/docs/api-reference/store.yaml
@@ -44,7 +44,7 @@ paths:
get:
summary: List customer addresses
tags:
- - Addresses
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -154,7 +154,7 @@ paths:
post:
summary: Create an address
tags:
- - Addresses
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -272,7 +272,7 @@ paths:
get:
summary: Get an address
tags:
- - Addresses
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -328,7 +328,7 @@ paths:
patch:
summary: Update an address
tags:
- - Addresses
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -392,7 +392,7 @@ paths:
delete:
summary: Delete an address
tags:
- - Addresses
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -429,7 +429,7 @@ paths:
patch:
summary: Mark address as default
tags:
- - Addresses
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -530,14 +530,14 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTUxNTQ3N30.uBxiFkcVbnJSQwrzLgYSczuKI6ODdzJakv1MKow6VDs
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTU5MTkzNn0.Z3YVAYOW-pywsfUXOrul3c7fZCWXtK7FiRHllTqqC08
user:
id: cus_UkLWZg9DAJ
- first_name: Sharyn
- last_name: Walker
- created_at: '2026-02-18T15:37:56.798Z'
- updated_at: '2026-02-18T15:37:56.798Z'
+ first_name: Tiera
+ last_name: Windler
+ created_at: '2026-02-19T12:52:16.606Z'
+ updated_at: '2026-02-19T12:52:16.606Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -593,14 +593,14 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTUxNTQ3OH0.J3-t-bhAEKPgLrpqvx9jk8QQ_yMLA2hpxKtUPOcbp84
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTU5MTkzOH0.u1iy2s9iXQ9Gg_fP5APfaOgIMEHFVY038J16VeJlxk8
user:
id: cus_UkLWZg9DAJ
first_name: John
last_name: Doe
- created_at: '2026-02-18T15:37:58.195Z'
- updated_at: '2026-02-18T15:37:58.195Z'
+ created_at: '2026-02-19T12:52:17.997Z'
+ updated_at: '2026-02-19T12:52:17.997Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -672,14 +672,14 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTUxNTQ3OH0.J3-t-bhAEKPgLrpqvx9jk8QQ_yMLA2hpxKtUPOcbp84
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTU5MTkzOH0.u1iy2s9iXQ9Gg_fP5APfaOgIMEHFVY038J16VeJlxk8
user:
id: cus_UkLWZg9DAJ
- first_name: Val
- last_name: Grady
- created_at: '2026-02-18T15:37:58.749Z'
- updated_at: '2026-02-18T15:37:58.749Z'
+ first_name: Jung
+ last_name: Hagenes
+ created_at: '2026-02-19T12:52:18.553Z'
+ updated_at: '2026-02-19T12:52:18.553Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -696,6 +696,81 @@ paths:
schema:
"$ref": "#/components/schemas/ErrorResponse"
"/api/v3/store/cart":
+ post:
+ summary: Create a new cart
+ tags:
+ - Cart
+ security:
+ - api_key: []
+ description: |
+ Creates a new shopping cart (order). Can be created by guests or authenticated customers.
+ Returns a `token` that must be used for guest access to the order.
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: false
+ description: Bearer JWT token (optional - for authenticated customers)
+ schema:
+ type: string
+ responses:
+ '201':
+ description: cart created (authenticated)
+ content:
+ application/json:
+ example:
+ id: or_UkLWZg9DAJ
+ number: R969779111
+ state: cart
+ token: JaQNShQSA2JLE6VbXPXZPa7CfRS8j45q3sN
+ special_instructions:
+ currency: USD
+ item_count: 0
+ shipment_state:
+ payment_state:
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ ship_total: '0.0'
+ display_ship_total: "$0.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '0.0'
+ display_total: "$0.00"
+ completed_at:
+ created_at: '2026-02-19T12:52:19.154Z'
+ updated_at: '2026-02-19T12:52:19.154Z'
+ order_promotions: []
+ line_items: []
+ shipments: []
+ payments: []
+ bill_address:
+ ship_address:
+ payment_methods: []
+ schema:
+ "$ref": "#/components/schemas/StoreOrder"
+ '401':
+ description: unauthorized - invalid API key
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_token
+ message: Valid API key required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
get:
summary: Get current cart
tags:
@@ -731,10 +806,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R921530365
+ number: R549023312
state: cart
- token: ZQcGqyL8DFcsCBXfQdaufSaUqiFF5D7LX4b
+ token: 7LxrhxeBGgQY5GMbsT7ECgNKmumQ9s7r2EZ
special_instructions:
currency: USD
item_count: 1
@@ -757,15 +832,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-18T15:37:59.851Z'
- updated_at: '2026-02-18T15:37:59.979Z'
+ created_at: '2026-02-19T12:52:20.244Z'
+ updated_at: '2026-02-19T12:52:20.435Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 21619
- slug: product-21619
+ currency: USD
+ name: Product 29001
+ slug: product-29001
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -784,37 +860,37 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:37:59.929Z'
- updated_at: '2026-02-18T15:37:59.929Z'
+ created_at: '2026-02-19T12:52:20.378Z'
+ updated_at: '2026-02-19T12:52:20.378Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H55596258871
+ number: H98495756514
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:37:59.943Z'
- updated_at: '2026-02-18T15:37:59.967Z'
+ created_at: '2026-02-19T12:52:20.398Z'
+ updated_at: '2026-02-19T12:52:20.422Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_39
- name: Hyacinth Gorczany
+ state_abbr: STATE_ABBR_41
+ name: Asia Breitenberg
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_39
+ state_text: STATE_ABBR_41
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -832,7 +908,7 @@ paths:
firstname: John
lastname: Doe
full_name: John Doe
- address1: 41 Lovely Street
+ address1: 43 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -840,15 +916,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_41
- state_abbr: STATE_ABBR_41
- state_name: STATE_NAME_41
+ state_text: STATE_ABBR_43
+ state_abbr: STATE_ABBR_43
+ state_name: STATE_NAME_43
ship_address:
id: addr_VqXmZF31wY
firstname: John
lastname: Doe
full_name: John Doe
- address1: 42 Lovely Street
+ address1: 44 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -856,18 +932,12 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_42
- state_abbr: STATE_ABBR_42
- state_name: STATE_NAME_42
+ state_text: STATE_ABBR_44
+ state_abbr: STATE_ABBR_44
+ state_name: STATE_NAME_44
payment_methods: []
schema:
- type: object
- allOf:
- - "$ref": "#/components/schemas/StoreOrder"
- - type: object
- properties:
- token:
- type: string
+ "$ref": "#/components/schemas/StoreOrder"
'404':
description: no cart found
content:
@@ -921,10 +991,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R065272221
+ number: R412750360
state: cart
- token: PUhQjPRauiYXZKmi6853BQvBUqrWpVRWrkz
+ token: MBZYZEBXqFUUYhXWji9vrppq2Kcc2gGuoh1
special_instructions:
currency: USD
item_count: 1
@@ -947,15 +1017,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-18T15:38:00.082Z'
- updated_at: '2026-02-18T15:38:00.206Z'
+ created_at: '2026-02-19T12:52:20.467Z'
+ updated_at: '2026-02-19T12:52:20.576Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 33013
- slug: product-33013
+ currency: USD
+ name: Product 3928
+ slug: product-3928
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -974,37 +1045,37 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:00.157Z'
- updated_at: '2026-02-18T15:38:00.157Z'
+ created_at: '2026-02-19T12:52:20.530Z'
+ updated_at: '2026-02-19T12:52:20.530Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H69760617547
+ number: H86047485151
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:00.172Z'
- updated_at: '2026-02-18T15:38:00.194Z'
+ created_at: '2026-02-19T12:52:20.541Z'
+ updated_at: '2026-02-19T12:52:20.565Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_43
- name: Damien Bashirian
+ state_abbr: STATE_ABBR_45
+ name: Del Will
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_43
+ state_text: STATE_ABBR_45
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -1022,7 +1093,7 @@ paths:
firstname: John
lastname: Doe
full_name: John Doe
- address1: 43 Lovely Street
+ address1: 45 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -1030,15 +1101,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_43
- state_abbr: STATE_ABBR_43
- state_name: STATE_NAME_43
+ state_text: STATE_ABBR_45
+ state_abbr: STATE_ABBR_45
+ state_name: STATE_NAME_45
ship_address:
id: addr_gbHJdmfrXB
firstname: John
lastname: Doe
full_name: John Doe
- address1: 44 Lovely Street
+ address1: 46 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -1046,18 +1117,12 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_44
- state_abbr: STATE_ABBR_44
- state_name: STATE_NAME_44
+ state_text: STATE_ABBR_46
+ state_abbr: STATE_ABBR_46
+ state_name: STATE_NAME_46
payment_methods: []
schema:
- type: object
- allOf:
- - "$ref": "#/components/schemas/StoreOrder"
- - type: object
- properties:
- token:
- type: string
+ "$ref": "#/components/schemas/StoreOrder"
'401':
description: unauthorized - JWT required
content:
@@ -1239,7 +1304,7 @@ paths:
post:
summary: Apply coupon code
tags:
- - Coupon Codes
+ - Cart
security:
- api_key: []
bearer_auth: []
@@ -1277,10 +1342,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R485145561
+ number: R202551549
state: cart
- token: YDFHZM9TTmeQseeCbKbfKH5uLCjJhSsX19U
+ token: dzRjZkUdN4xQrSiAVifXcUevTZYL7MtXZcD
special_instructions:
currency: USD
item_count: 1
@@ -1303,15 +1368,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-18T15:38:04.524Z'
- updated_at: '2026-02-18T15:38:04.695Z'
+ created_at: '2026-02-19T12:52:24.864Z'
+ updated_at: '2026-02-19T12:52:25.016Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 87978
- slug: product-87978
+ currency: USD
+ name: Product 8598
+ slug: product-8598
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1330,37 +1396,37 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:04.593Z'
- updated_at: '2026-02-18T15:38:04.593Z'
+ created_at: '2026-02-19T12:52:24.921Z'
+ updated_at: '2026-02-19T12:52:24.921Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H42941571817
+ number: H86385877165
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:04.607Z'
- updated_at: '2026-02-18T15:38:04.629Z'
+ created_at: '2026-02-19T12:52:24.935Z'
+ updated_at: '2026-02-19T12:52:24.954Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_63
- name: Maudie Macejkovic
+ state_abbr: STATE_ABBR_65
+ name: Kandra Streich
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_63
+ state_text: STATE_ABBR_65
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -1376,12 +1442,12 @@ paths:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
state: checkout
- response_code: 1-SC-20260218153804690376
- number: PYSNCMMU
+ response_code: 1-SC-20260219125225011065
+ number: PWCAYU39
amount: '50.0'
display_amount: "$50.00"
- created_at: '2026-02-18T15:38:04.695Z'
- updated_at: '2026-02-18T15:38:04.695Z'
+ created_at: '2026-02-19T12:52:25.015Z'
+ updated_at: '2026-02-19T12:52:25.015Z'
source_type: store_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -1404,7 +1470,7 @@ paths:
firstname: John
lastname: Doe
full_name: John Doe
- address1: 65 Lovely Street
+ address1: 67 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -1412,15 +1478,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_65
- state_abbr: STATE_ABBR_65
- state_name: STATE_NAME_65
+ state_text: STATE_ABBR_67
+ state_abbr: STATE_ABBR_67
+ state_name: STATE_NAME_67
ship_address:
id: addr_VqXmZF31wY
firstname: John
lastname: Doe
full_name: John Doe
- address1: 66 Lovely Street
+ address1: 68 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -1428,9 +1494,9 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_66
- state_abbr: STATE_ABBR_66
- state_name: STATE_NAME_66
+ state_text: STATE_ABBR_68
+ state_abbr: STATE_ABBR_68
+ state_name: STATE_NAME_68
payment_methods:
- id: pm_UkLWZg9DAJ
name: Store Credit
@@ -1475,7 +1541,7 @@ paths:
delete:
summary: Remove coupon code
tags:
- - Coupon Codes
+ - Cart
security:
- api_key: []
bearer_auth: []
@@ -1517,10 +1583,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R842138853
+ number: R215253402
state: cart
- token: tSbqYxqF1VXAsE4pdWK1vsTLdzgdbk38fm3
+ token: aoMvnztE4EzCwJpdLFF258BKGXDkph3LMmd
special_instructions:
currency: USD
item_count: 1
@@ -1543,15 +1609,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-18T15:38:06.613Z'
- updated_at: '2026-02-18T15:38:06.811Z'
+ created_at: '2026-02-19T12:52:26.962Z'
+ updated_at: '2026-02-19T12:52:27.253Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 115354
- slug: product-115354
+ currency: USD
+ name: Product 111638
+ slug: product-111638
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1570,37 +1637,37 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:06.673Z'
- updated_at: '2026-02-18T15:38:06.797Z'
+ created_at: '2026-02-19T12:52:27.067Z'
+ updated_at: '2026-02-19T12:52:27.239Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H80039652239
+ number: H08184903248
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:06.688Z'
- updated_at: '2026-02-18T15:38:06.712Z'
+ created_at: '2026-02-19T12:52:27.091Z'
+ updated_at: '2026-02-19T12:52:27.130Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_75
- name: Cassidy Gutkowski
+ state_abbr: STATE_ABBR_77
+ name: Sherise Rutherford
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_75
+ state_text: STATE_ABBR_77
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -1618,7 +1685,7 @@ paths:
firstname: John
lastname: Doe
full_name: John Doe
- address1: 77 Lovely Street
+ address1: 79 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -1626,15 +1693,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_77
- state_abbr: STATE_ABBR_77
- state_name: STATE_NAME_77
+ state_text: STATE_ABBR_79
+ state_abbr: STATE_ABBR_79
+ state_name: STATE_NAME_79
ship_address:
id: addr_VqXmZF31wY
firstname: John
lastname: Doe
full_name: John Doe
- address1: 78 Lovely Street
+ address1: 80 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -1642,9 +1709,9 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_78
- state_abbr: STATE_ABBR_78
- state_name: STATE_NAME_78
+ state_text: STATE_ABBR_80
+ state_abbr: STATE_ABBR_80
+ state_name: STATE_NAME_80
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
@@ -1662,7 +1729,7 @@ paths:
get:
summary: List saved credit cards
tags:
- - Credit Cards
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -1736,7 +1803,7 @@ paths:
get:
summary: Get a credit card
tags:
- - Credit Cards
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -1786,7 +1853,7 @@ paths:
delete:
summary: Delete a credit card
tags:
- - Credit Cards
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -1820,15 +1887,15 @@ paths:
message: Credit card not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/customer":
+ "/api/v3/store/customer/orders":
get:
- summary: Get current customer profile
+ summary: List customer orders
tags:
- Customers
security:
- api_key: []
bearer_auth: []
- description: Returns the profile of the currently authenticated customer
+ description: Returns a paginated list of orders for the authenticated customer
parameters:
- name: x-spree-api-key
in: header
@@ -1838,487 +1905,206 @@ paths:
- name: Authorization
in: header
required: true
- description: Bearer JWT token
schema:
type: string
- responses:
- '200':
- description: profile found
- content:
- application/json:
- example:
- id: cus_UkLWZg9DAJ
- first_name: Shanika
- last_name: Schaden
- created_at: '2026-02-18T15:38:11.179Z'
- updated_at: '2026-02-18T15:38:11.460Z'
- addresses:
- - id: addr_gbHJdmfrXB
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 96 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_96
- state_abbr: STATE_ABBR_96
- state_name: STATE_NAME_96
- - id: addr_UkLWZg9DAJ
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 95 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_95
- state_abbr: STATE_ABBR_95
- state_name: STATE_NAME_95
- default_billing_address:
- id: addr_gbHJdmfrXB
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 96 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_96
- state_abbr: STATE_ABBR_96
- state_name: STATE_NAME_96
- default_shipping_address:
- id: addr_UkLWZg9DAJ
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 95 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_95
- state_abbr: STATE_ABBR_95
- state_name: STATE_NAME_95
- schema:
- "$ref": "#/components/schemas/StoreCustomer"
- '401':
- description: unauthorized - invalid token
- content:
- application/json:
- example:
- error:
- code: authentication_required
- message: Authentication required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update current customer profile
- tags:
- - Customers
- security:
- - api_key: []
- bearer_auth: []
- description: Updates the profile of the currently authenticated customer
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: per_page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: q[state_eq]
+ in: query
+ required: false
+ description: Filter by order state
schema:
type: string
- - name: Authorization
- in: header
- required: true
+ - name: q[completed_at_gte]
+ in: query
+ required: false
+ description: Filter by completion date (after)
schema:
type: string
responses:
'200':
- description: profile updated
+ description: orders found
content:
application/json:
example:
- id: cus_UkLWZg9DAJ
- first_name: Updated
- last_name: Name
- created_at: '2026-02-18T15:38:11.763Z'
- updated_at: '2026-02-18T15:38:12.056Z'
- addresses:
- - id: addr_gbHJdmfrXB
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 98 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_98
- state_abbr: STATE_ABBR_98
- state_name: STATE_NAME_98
- - id: addr_UkLWZg9DAJ
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 97 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_97
- state_abbr: STATE_ABBR_97
- state_name: STATE_NAME_97
- default_billing_address:
- id: addr_gbHJdmfrXB
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 98 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_98
- state_abbr: STATE_ABBR_98
- state_name: STATE_NAME_98
- default_shipping_address:
- id: addr_UkLWZg9DAJ
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 97 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_97
- state_abbr: STATE_ABBR_97
- state_name: STATE_NAME_97
- schema:
- "$ref": "#/components/schemas/StoreCustomer"
- '422':
- description: validation error
- content:
- application/json:
- example:
- error:
- code: validation_error
- message: Email can't be blank
- details:
- email:
- - can't be blank
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- first_name:
- type: string
- example: John
- last_name:
- type: string
- example: Doe
- email:
- type: string
- format: email
- password:
- type: string
- example: newpassword123
- password_confirmation:
- type: string
- example: newpassword123
- accepts_email_marketing:
- type: boolean
- example: true
- phone:
- type: string
- example: "+1 555 123 4567"
- "/api/v3/store/digitals/{token}":
- get:
- summary: Download a digital product
- tags:
- - Digitals
- security:
- - api_key: []
- description: |
- Downloads a digital product file using the digital link token.
- The token is provided in the order confirmation or digital links list.
- Each download increments the access counter. Downloads may be limited by
- store settings (number of downloads and/or time-based expiration).
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: token
- in: path
- required: true
- description: Digital link token
- schema:
- type: string
- responses:
- '200':
- description: file downloaded
- content:
- application/json: {}
- '403':
- description: download link expired or limit exceeded
- content:
- application/json:
- example:
- error:
- code: digital_link_expired
- message: Download link expired or invalid
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- application/octet-stream:
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- '404':
- description: digital link not found
- content:
- application/json:
- example:
- error:
- code: record_not_found
- message: Digital link not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- application/octet-stream:
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- '401':
- description: unauthorized - invalid API key
- content:
- application/json:
- example:
- error:
- code: invalid_token
- message: Valid API key required
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- application/octet-stream:
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/orders/{order_id}/line_items":
- post:
- summary: Add item to cart
- tags:
- - Line Items
- security:
- - api_key: []
- bearer_auth: []
- description: Adds a variant to the order. Creates a new line item or increases
- quantity if variant already in cart.
- parameters:
- - name: x-spree-api-key
- in: header
- required: true
- schema:
- type: string
- - name: Authorization
- in: header
- required: false
- description: Bearer token for authenticated customers
- schema:
- type: string
- - name: order_id
- in: path
- required: true
- description: Order ID or number
- schema:
- type: string
- - name: order_token
- in: query
- required: false
- description: Order token for guest access
- schema:
- type: string
- responses:
- '201':
- description: item added, returns updated order
- content:
- application/json:
- example:
- id: or_UkLWZg9DAJ
- number: R392776479
- state: cart
- token: PUVgbebYDtaPEjMQMSyBUbuzNFG3t7d56Cj
- special_instructions:
- currency: USD
- item_count: 3
- shipment_state:
- payment_state:
- item_total: '49.98'
- display_item_total: "$49.98"
- ship_total: '0.0'
- display_ship_total: "$0.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '49.98'
- display_total: "$49.98"
- completed_at:
- created_at: '2026-02-18T15:38:16.275Z'
- updated_at: '2026-02-18T15:38:16.428Z'
- order_promotions: []
- line_items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- name: Product 214767
- slug: product-214767
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
+ data:
+ - id: or_UkLWZg9DAJ
+ number: R597982834
+ state: cart
+ token: QwfF81XKATWhVtQrhTuD8JVd3oh5zax3toh
+ special_instructions:
+ currency: USD
+ item_count: 1
+ shipment_state:
+ payment_state:
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ ship_total: '100.0'
+ display_ship_total: "$100.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
promo_total: '0.0'
display_promo_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:16.336Z'
- updated_at: '2026-02-18T15:38:16.336Z'
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- - id: li_gbHJdmfrXB
- variant_id: variant_gbHJdmfrXB
- quantity: 2
- name: Product 224620
- slug: product-224620
- options_text: ''
- price: '19.99'
- display_price: "$19.99"
- total: '39.98'
- display_total: "$39.98"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
included_tax_total: '0.0'
display_included_tax_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- pre_tax_amount: '39.98'
- display_pre_tax_amount: "$39.98"
- discounted_amount: '39.98'
- display_discounted_amount: "$39.98"
- display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:16.428Z'
- updated_at: '2026-02-18T15:38:16.428Z'
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- shipments: []
- payments: []
- bill_address:
- id: addr_EfhxLZ9ck8
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 119 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_119
- state_abbr: STATE_ABBR_119
- state_name: STATE_NAME_119
- ship_address:
- payment_methods: []
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ completed_at:
+ created_at: '2026-02-19T12:52:31.955Z'
+ updated_at: '2026-02-19T12:52:32.073Z'
+ order_promotions: []
+ line_items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 133414
+ slug: product-133414
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ created_at: '2026-02-19T12:52:32.022Z'
+ updated_at: '2026-02-19T12:52:32.022Z'
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ shipments:
+ - id: ship_UkLWZg9DAJ
+ number: H82177123688
+ state: pending
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ shipped_at:
+ created_at: '2026-02-19T12:52:32.035Z'
+ updated_at: '2026-02-19T12:52:32.059Z'
+ shipping_method:
+ id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: STATE_ABBR_100
+ name: Cornelia Oga
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: STATE_ABBR_100
+ shipping_rates:
+ - id: shpr_UkLWZg9DAJ
+ shipping_method_id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: 100.0
+ display_cost: "$100.00"
+ shipping_method:
+ id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ bill_address:
+ id: addr_EfhxLZ9ck8
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 99 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_99
+ state_abbr: STATE_ABBR_99
+ state_name: STATE_NAME_99
+ ship_address:
+ id: addr_VqXmZF31wY
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 100 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_100
+ state_abbr: STATE_ABBR_100
+ state_name: STATE_NAME_100
+ payment_methods: []
+ meta:
+ page: 1
+ limit: 25
+ count: 1
+ pages: 1
+ from: 1
+ to: 1
+ in: 1
+ previous:
+ next:
schema:
- "$ref": "#/components/schemas/StoreOrder"
- '404':
- description: order not found
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/StoreOrder"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ '401':
+ description: unauthorized - authentication required
content:
application/json:
example:
error:
- code: order_not_found
- message: Order not found
+ code: authentication_required
+ message: Authentication required
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- variant_id:
- type: string
- example: variant_abc123
- description: Variant ID to add
- quantity:
- type: integer
- example: 2
- description: 'Quantity to add (default: 1)'
- required:
- - variant_id
- "/api/v3/store/orders/{order_id}/line_items/{id}":
- patch:
- summary: Update line item quantity
+ "/api/v3/store/customer":
+ get:
+ summary: Get current customer profile
tags:
- - Line Items
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Updates the quantity of a line item in the cart
+ description: Returns the profile of the currently authenticated customer
parameters:
- name: x-spree-api-key
in: header
@@ -2327,99 +2113,28 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- schema:
- type: string
- - name: order_id
- in: path
- required: true
- schema:
- type: string
- - name: id
- in: path
required: true
- description: Line item ID
- schema:
- type: string
- - name: order_token
- in: query
- required: false
+ description: Bearer JWT token
schema:
type: string
responses:
'200':
- description: quantity updated, returns updated order
+ description: profile found
content:
application/json:
example:
- id: or_UkLWZg9DAJ
- number: R006172220
- state: cart
- token: bDVN1Lxk8DepDdvSxfj1idnmUnPh7zSDXK9
- special_instructions:
- currency: USD
- item_count: 5
- shipment_state:
- payment_state:
- item_total: '99.95'
- display_item_total: "$99.95"
- ship_total: '0.0'
- display_ship_total: "$0.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '99.95'
- display_total: "$99.95"
- completed_at:
- created_at: '2026-02-18T15:38:18.303Z'
- updated_at: '2026-02-18T15:38:18.388Z'
- order_promotions: []
- line_items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 5
- name: Product 255553
- slug: product-255553
- options_text: ''
- price: '19.99'
- display_price: "$19.99"
- total: '99.95'
- display_total: "$99.95"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- pre_tax_amount: '99.95'
- display_pre_tax_amount: "$99.95"
- discounted_amount: '99.95'
- display_discounted_amount: "$99.95"
- display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:18.366Z'
- updated_at: '2026-02-18T15:38:18.400Z'
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- shipments: []
- payments: []
- bill_address:
- id: addr_EfhxLZ9ck8
+ id: cus_UkLWZg9DAJ
+ first_name: Meagan
+ last_name: Schumm
+ created_at: '2026-02-19T12:52:33.042Z'
+ updated_at: '2026-02-19T12:52:33.319Z'
+ addresses:
+ - id: addr_gbHJdmfrXB
firstname: John
lastname: Doe
full_name: John Doe
- address1: 128 Lovely Street
+ address1: 106 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -2427,33 +2142,76 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_128
- state_abbr: STATE_ABBR_128
- state_name: STATE_NAME_128
- ship_address:
- payment_methods: []
+ state_text: STATE_ABBR_106
+ state_abbr: STATE_ABBR_106
+ state_name: STATE_NAME_106
+ - id: addr_UkLWZg9DAJ
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 105 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_105
+ state_abbr: STATE_ABBR_105
+ state_name: STATE_NAME_105
+ default_billing_address:
+ id: addr_gbHJdmfrXB
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 106 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_106
+ state_abbr: STATE_ABBR_106
+ state_name: STATE_NAME_106
+ default_shipping_address:
+ id: addr_UkLWZg9DAJ
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 105 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_105
+ state_abbr: STATE_ABBR_105
+ state_name: STATE_NAME_105
schema:
- "$ref": "#/components/schemas/StoreOrder"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- quantity:
- type: integer
- minimum: 1
- example: 5
- required:
- - quantity
- delete:
- summary: Remove line item from cart
+ "$ref": "#/components/schemas/StoreCustomer"
+ '401':
+ description: unauthorized - invalid token
+ content:
+ application/json:
+ example:
+ error:
+ code: authentication_required
+ message: Authentication required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ patch:
+ summary: Update current customer profile
tags:
- - Line Items
+ - Customers
security:
- api_key: []
bearer_auth: []
- description: Removes a line item from the order
+ description: Updates the profile of the currently authenticated customer
parameters:
- name: x-spree-api-key
in: header
@@ -2462,69 +2220,27 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- schema:
- type: string
- - name: order_id
- in: path
required: true
schema:
type: string
- - name: id
- in: path
- required: true
- schema:
- type: string
- - name: order_token
- in: query
- required: false
- schema:
- type: string
responses:
'200':
- description: line item removed, returns updated order
+ description: profile updated
content:
application/json:
example:
- id: or_UkLWZg9DAJ
- number: R814289744
- state: cart
- token: KT1dvhiMdHNFzy41wBaSsxr9SStehJFYtXF
- special_instructions:
- currency: USD
- item_count: 0
- shipment_state:
- payment_state:
- item_total: '0.0'
- display_item_total: "$0.00"
- ship_total: '0.0'
- display_ship_total: "$0.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
- completed_at:
- created_at: '2026-02-18T15:38:18.981Z'
- updated_at: '2026-02-18T15:38:19.073Z'
- order_promotions: []
- line_items: []
- shipments: []
- payments: []
- bill_address:
- id: addr_EfhxLZ9ck8
+ id: cus_UkLWZg9DAJ
+ first_name: Updated
+ last_name: Name
+ created_at: '2026-02-19T12:52:33.625Z'
+ updated_at: '2026-02-19T12:52:33.911Z'
+ addresses:
+ - id: addr_gbHJdmfrXB
firstname: John
lastname: Doe
full_name: John Doe
- address1: 131 Lovely Street
+ address1: 108 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -2532,240 +2248,177 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_131
- state_abbr: STATE_ABBR_131
- state_name: STATE_NAME_131
- ship_address:
- payment_methods: []
+ state_text: STATE_ABBR_108
+ state_abbr: STATE_ABBR_108
+ state_name: STATE_NAME_108
+ - id: addr_UkLWZg9DAJ
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 107 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_107
+ state_abbr: STATE_ABBR_107
+ state_name: STATE_NAME_107
+ default_billing_address:
+ id: addr_gbHJdmfrXB
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 108 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_108
+ state_abbr: STATE_ABBR_108
+ state_name: STATE_NAME_108
+ default_shipping_address:
+ id: addr_UkLWZg9DAJ
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 107 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_107
+ state_abbr: STATE_ABBR_107
+ state_name: STATE_NAME_107
schema:
- "$ref": "#/components/schemas/StoreOrder"
- '404':
- description: line item not found
+ "$ref": "#/components/schemas/StoreCustomer"
+ '422':
+ description: validation error
content:
application/json:
example:
error:
- code: line_item_not_found
- message: Line item not found
+ code: validation_error
+ message: Email can't be blank
+ details:
+ email:
+ - can't be blank
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/orders":
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ first_name:
+ type: string
+ example: John
+ last_name:
+ type: string
+ example: Doe
+ email:
+ type: string
+ format: email
+ password:
+ type: string
+ example: newpassword123
+ password_confirmation:
+ type: string
+ example: newpassword123
+ accepts_email_marketing:
+ type: boolean
+ example: true
+ phone:
+ type: string
+ example: "+1 555 123 4567"
+ "/api/v3/store/digitals/{token}":
get:
- summary: List orders
+ summary: Download a digital product
tags:
- - Orders
+ - Digitals
security:
- api_key: []
- bearer_auth: []
- description: Returns a paginated list of orders for the authenticated customer
+ description: |
+ Downloads a digital product file using the digital link token.
+ The token is provided in the order confirmation or digital links list.
+ Each download increments the access counter. Downloads may be limited by
+ store settings (number of downloads and/or time-based expiration).
parameters:
- name: x-spree-api-key
in: header
required: true
schema:
type: string
- - name: Authorization
- in: header
+ - name: token
+ in: path
required: true
- schema:
- type: string
- - name: page
- in: query
- required: false
- schema:
- type: integer
- - name: per_page
- in: query
- required: false
- schema:
- type: integer
- - name: q[state_eq]
- in: query
- required: false
- description: Filter by order state
- schema:
- type: string
- - name: q[completed_at_gte]
- in: query
- required: false
- description: Filter by completion date (after)
+ description: Digital link token
schema:
type: string
responses:
'200':
- description: orders found
+ description: file downloaded
+ content:
+ application/json: {}
+ '403':
+ description: download link expired or limit exceeded
content:
application/json:
example:
- data:
- - id: or_UkLWZg9DAJ
- number: R232788032
- state: cart
- token: tDDtsGJzP1VJDpTE8Xz6r5BLk2JywbwhMXZ
- special_instructions:
- currency: USD
- item_count: 1
- shipment_state:
- payment_state:
- item_total: '10.0'
- display_item_total: "$10.00"
- ship_total: '100.0'
- display_ship_total: "$100.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- tax_total: '0.0'
- display_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- completed_at:
- created_at: '2026-02-18T15:38:20.276Z'
- updated_at: '2026-02-18T15:38:20.391Z'
- order_promotions: []
- line_items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- name: Product 2890
- slug: product-2890
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:20.334Z'
- updated_at: '2026-02-18T15:38:20.334Z'
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- shipments:
- - id: ship_UkLWZg9DAJ
- number: H09293228453
- state: pending
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- shipped_at:
- created_at: '2026-02-18T15:38:20.347Z'
- updated_at: '2026-02-18T15:38:20.375Z'
- shipping_method:
- id: shpm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_135
- name: Edmundo Block
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: STATE_ABBR_135
- shipping_rates:
- - id: shpr_UkLWZg9DAJ
- shipping_method_id: shpm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: 100.0
- display_cost: "$100.00"
- shipping_method:
- id: shpm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- payments: []
- bill_address:
- id: addr_EfhxLZ9ck8
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 137 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_137
- state_abbr: STATE_ABBR_137
- state_name: STATE_NAME_137
- ship_address:
- id: addr_VqXmZF31wY
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 138 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_138
- state_abbr: STATE_ABBR_138
- state_name: STATE_NAME_138
- payment_methods: []
- meta:
- page: 1
- limit: 25
- count: 1
- pages: 1
- from: 1
- to: 1
- in: 1
- previous:
- next:
+ error:
+ code: digital_link_expired
+ message: Download link expired or invalid
schema:
- type: object
- properties:
- data:
- type: array
- items:
- "$ref": "#/components/schemas/StoreOrder"
- meta:
- "$ref": "#/components/schemas/PaginationMeta"
+ "$ref": "#/components/schemas/ErrorResponse"
+ application/octet-stream:
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ '404':
+ description: digital link not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Digital link not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ application/octet-stream:
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
'401':
- description: unauthorized - authentication required
+ description: unauthorized - invalid API key
content:
application/json:
example:
error:
- code: authentication_required
- message: Authentication required
+ code: invalid_token
+ message: Valid API key required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ application/octet-stream:
schema:
"$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/orders/{order_id}/line_items":
post:
- summary: Create a cart
+ summary: Add item to cart
tags:
- - Orders
+ - Cart
security:
- api_key: []
- description: |
- Creates a new order (shopping cart). Can be created by guests or authenticated customers.
- Returns an `order_token` that must be used for guest access to the order.
+ bearer_auth: []
+ description: Adds a variant to the order. Creates a new line item or increases
+ quantity if variant already in cart.
parameters:
- name: x-spree-api-key
in: header
@@ -2775,27 +2428,39 @@ paths:
- name: Authorization
in: header
required: false
- description: Bearer JWT token (optional - for authenticated customers)
+ description: Bearer token for authenticated customers
+ schema:
+ type: string
+ - name: order_id
+ in: path
+ required: true
+ description: Order ID or number
+ schema:
+ type: string
+ - name: order_token
+ in: query
+ required: false
+ description: Order token for guest access
schema:
type: string
responses:
'201':
- description: cart created (authenticated)
+ description: item added, returns updated order
content:
application/json:
example:
- id: or_gbHJdmfrXB
- number: R487646106
+ id: or_UkLWZg9DAJ
+ number: R312104970
state: cart
- token: ZUbS8bsrszoGDJ84k39hbFWFrCMRmwcx8yt
+ token: G5ppMHEenqvk4SfyCvuQoVhRdLcaTprJypy
special_instructions:
currency: USD
- item_count: 0
+ item_count: 3
shipment_state:
payment_state:
- item_total: '0.0'
- display_item_total: "$0.00"
+ item_total: '49.98'
+ display_item_total: "$49.98"
ship_total: '0.0'
display_ship_total: "$0.00"
adjustment_total: '0.0'
@@ -2808,46 +2473,130 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '0.0'
- display_total: "$0.00"
+ total: '49.98'
+ display_total: "$49.98"
completed_at:
- created_at: '2026-02-18T15:38:22.402Z'
- updated_at: '2026-02-18T15:38:22.402Z'
+ created_at: '2026-02-19T12:52:38.132Z'
+ updated_at: '2026-02-19T12:52:38.295Z'
order_promotions: []
- line_items: []
+ line_items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 232343
+ slug: product-232343
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ created_at: '2026-02-19T12:52:38.199Z'
+ updated_at: '2026-02-19T12:52:38.199Z'
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ - id: li_gbHJdmfrXB
+ variant_id: variant_gbHJdmfrXB
+ quantity: 2
+ currency: USD
+ name: Product 243050
+ slug: product-243050
+ options_text: ''
+ price: '19.99'
+ display_price: "$19.99"
+ total: '39.98'
+ display_total: "$39.98"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ pre_tax_amount: '39.98'
+ display_pre_tax_amount: "$39.98"
+ discounted_amount: '39.98'
+ display_discounted_amount: "$39.98"
+ display_compare_at_amount: "$0.00"
+ created_at: '2026-02-19T12:52:38.295Z'
+ updated_at: '2026-02-19T12:52:38.295Z'
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
shipments: []
payments: []
bill_address:
+ id: addr_EfhxLZ9ck8
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 129 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_129
+ state_abbr: STATE_ABBR_129
+ state_name: STATE_NAME_129
ship_address:
payment_methods: []
- order_token: ZUbS8bsrszoGDJ84k39hbFWFrCMRmwcx8yt
schema:
- type: object
- allOf:
- - "$ref": "#/components/schemas/StoreOrder"
- - type: object
- properties:
- order_token:
- type: string
- '401':
- description: unauthorized - invalid API key
+ "$ref": "#/components/schemas/StoreOrder"
+ '404':
+ description: order not found
content:
application/json:
example:
error:
- code: invalid_token
- message: Valid API key required
+ code: order_not_found
+ message: Order not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/orders/{id}":
- get:
- summary: Get an order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ variant_id:
+ type: string
+ example: variant_abc123
+ description: Variant ID to add
+ quantity:
+ type: integer
+ example: 2
+ description: 'Quantity to add (default: 1)'
+ required:
+ - variant_id
+ "/api/v3/store/orders/{order_id}/line_items/{id}":
+ patch:
+ summary: Update line item quantity
tags:
- - Orders
+ - Cart
security:
- api_key: []
bearer_auth: []
- description: Returns a single order by ID or number. Guests must provide order_token.
+ description: Updates the quantity of a line item in the cart
parameters:
- name: x-spree-api-key
in: header
@@ -2859,44 +2608,42 @@ paths:
required: false
schema:
type: string
- - name: id
+ - name: order_id
in: path
required: true
- description: Order ID (prefixed) or order number
schema:
type: string
- - name: order_token
- in: query
- required: false
- description: Order token for guest access
+ - name: id
+ in: path
+ required: true
+ description: Line item ID
schema:
type: string
- - name: includes
+ - name: order_token
in: query
required: false
- description: Include associations (line_items, shipments, payments)
schema:
type: string
responses:
'200':
- description: order found (guest with token)
+ description: quantity updated, returns updated order
content:
application/json:
example:
- id: or_gbHJdmfrXB
- number: R997117633
+ id: or_UkLWZg9DAJ
+ number: R748239223
state: cart
- token: gYRjVcQQ8k8CdSe9W6bvtX9opvhwoc4R7uy
- email:
+ token: kWZEWzyhYcR43FdpFXwAaUFmmNcmcGYP9fJ
special_instructions:
currency: USD
- item_count: 1
+ item_count: 5
shipment_state:
payment_state:
- item_total: '10.0'
- display_item_total: "$10.00"
- ship_total: '100.0'
- display_ship_total: "$100.00"
+ item_total: '99.95'
+ display_item_total: "$99.95"
+ ship_total: '0.0'
+ display_ship_total: "$0.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
promo_total: '0.0'
@@ -2907,23 +2654,24 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
+ total: '99.95'
+ display_total: "$99.95"
completed_at:
- created_at: '2026-02-18T15:38:24.431Z'
- updated_at: '2026-02-18T15:38:24.542Z'
+ created_at: '2026-02-19T12:52:40.218Z'
+ updated_at: '2026-02-19T12:52:40.306Z'
order_promotions: []
line_items:
- - id: li_gbHJdmfrXB
- variant_id: variant_gbHJdmfrXB
- quantity: 1
- name: Product 352179
- slug: product-352179
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 5
+ currency: USD
+ name: Product 273519
+ slug: product-273519
options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
+ price: '19.99'
+ display_price: "$19.99"
+ total: '99.95'
+ display_total: "$99.95"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
@@ -2932,60 +2680,25 @@ paths:
display_included_tax_total: "$0.00"
promo_total: '0.0'
display_promo_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
+ pre_tax_amount: '99.95'
+ display_pre_tax_amount: "$99.95"
+ discounted_amount: '99.95'
+ display_discounted_amount: "$99.95"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:24.493Z'
- updated_at: '2026-02-18T15:38:24.493Z'
+ created_at: '2026-02-19T12:52:40.282Z'
+ updated_at: '2026-02-19T12:52:40.312Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
- shipments:
- - id: ship_gbHJdmfrXB
- number: H29970283842
- state: pending
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- shipped_at:
- created_at: '2026-02-18T15:38:24.510Z'
- updated_at: '2026-02-18T15:38:24.529Z'
- shipping_method:
- id: shpm_gbHJdmfrXB
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_159
- name: Bok Russel
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: STATE_ABBR_159
- shipping_rates:
- - id: shpr_gbHJdmfrXB
- shipping_method_id: shpm_gbHJdmfrXB
- name: UPS Ground
- selected: true
- cost: 100.0
- display_cost: "$100.00"
- shipping_method:
- id: shpm_gbHJdmfrXB
- name: UPS Ground
- code: UPS_GROUND
+ shipments: []
payments: []
bill_address:
- id: addr_uw2YK1rnl0
+ id: addr_EfhxLZ9ck8
firstname: John
lastname: Doe
full_name: John Doe
- address1: 163 Lovely Street
+ address1: 138 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -2993,46 +2706,33 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_163
- state_abbr: STATE_ABBR_163
- state_name: STATE_NAME_163
+ state_text: STATE_ABBR_138
+ state_abbr: STATE_ABBR_138
+ state_name: STATE_NAME_138
ship_address:
- id: addr_OIJLhNcSbf
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 164 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_164
- state_abbr: STATE_ABBR_164
- state_name: STATE_NAME_164
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
- '404':
- description: not found - order belongs to another user
- content:
- application/json:
- example:
- error:
- code: order_not_found
- message: Order not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Update an order
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ quantity:
+ type: integer
+ minimum: 1
+ example: 5
+ required:
+ - quantity
+ delete:
+ summary: Remove line item from cart
tags:
- - Orders
+ - Cart
security:
- api_key: []
bearer_auth: []
- description: Updates order attributes like email, special instructions, or addresses
+ description: Removes a line item from the order
parameters:
- name: x-spree-api-key
in: header
@@ -3044,6 +2744,11 @@ paths:
required: false
schema:
type: string
+ - name: order_id
+ in: path
+ required: true
+ schema:
+ type: string
- name: id
in: path
required: true
@@ -3056,24 +2761,24 @@ paths:
type: string
responses:
'200':
- description: order updated
+ description: line item removed, returns updated order
content:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R716584855
+ number: R083455257
state: cart
- token: m3hc1oZvCTAeaoKgomjovVcHua1hrtwpXsM
- special_instructions: Leave at door
+ token: NgJmv2UKqzGErRQeDWPts2MsMerfnsg8x23
+ special_instructions:
currency: USD
- item_count: 1
+ item_count: 0
shipment_state:
payment_state:
- item_total: '10.0'
- display_item_total: "$10.00"
- ship_total: '100.0'
- display_ship_total: "$100.00"
+ item_total: '0.0'
+ display_item_total: "$0.00"
+ ship_total: '0.0'
+ display_ship_total: "$0.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
promo_total: '0.0'
@@ -3084,85 +2789,21 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
+ total: '0.0'
+ display_total: "$0.00"
completed_at:
- created_at: '2026-02-18T15:38:26.748Z'
- updated_at: '2026-02-18T15:38:26.886Z'
+ created_at: '2026-02-19T12:52:40.888Z'
+ updated_at: '2026-02-19T12:52:40.967Z'
order_promotions: []
- line_items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
- quantity: 1
- name: Product 388468
- slug: product-388468
- options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
- adjustment_total: '0.0'
- display_adjustment_total: "$0.00"
- additional_tax_total: '0.0'
- display_additional_tax_total: "$0.00"
- included_tax_total: '0.0'
- display_included_tax_total: "$0.00"
- promo_total: '0.0'
- display_promo_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
- display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:26.811Z'
- updated_at: '2026-02-18T15:38:26.811Z'
- compare_at_amount:
- thumbnail_url:
- option_values: []
- digital_links: []
- shipments:
- - id: ship_UkLWZg9DAJ
- number: H57401556915
- state: pending
- tracking: U10000
- tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
- shipped_at:
- created_at: '2026-02-18T15:38:26.825Z'
- updated_at: '2026-02-18T15:38:26.854Z'
- shipping_method:
- id: shpm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- stock_location:
- id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_174
- name: Lavina Bartoletti
- address1: 1600 Pennsylvania Ave NW
- city: Washington
- zipcode: '20500'
- country_iso: US
- country_name: United States of America
- state_text: STATE_ABBR_174
- shipping_rates:
- - id: shpr_UkLWZg9DAJ
- shipping_method_id: shpm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: 100.0
- display_cost: "$100.00"
- shipping_method:
- id: shpm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
+ line_items: []
+ shipments: []
payments: []
bill_address:
id: addr_EfhxLZ9ck8
firstname: John
lastname: Doe
full_name: John Doe
- address1: 176 Lovely Street
+ address1: 141 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -3170,125 +2811,32 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_176
- state_abbr: STATE_ABBR_176
- state_name: STATE_NAME_176
+ state_text: STATE_ABBR_141
+ state_abbr: STATE_ABBR_141
+ state_name: STATE_NAME_141
ship_address:
- id: addr_VqXmZF31wY
- firstname: John
- lastname: Doe
- full_name: John Doe
- address1: 177 Lovely Street
- address2: Northwest
- city: Herndon
- zipcode: '35005'
- phone: 555-555-0199
- company: Company
- country_name: United States of America
- country_iso: US
- state_text: STATE_ABBR_177
- state_abbr: STATE_ABBR_177
- state_name: STATE_NAME_177
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
- '403':
- description: cannot update completed order
+ '404':
+ description: line item not found
content:
application/json:
example:
error:
- code: access_denied
- message: You are not authorized to access this page.
+ code: line_item_not_found
+ message: Line item not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- email:
- type: string
- format: email
- special_instructions:
- type: string
- example: Leave at door
- bill_address:
- type: object
- properties:
- firstname:
- type: string
- example: John
- lastname:
- type: string
- example: Doe
- address1:
- type: string
- example: 123 Main St
- address2:
- type: string
- example: Apt 4B
- city:
- type: string
- example: New York
- zipcode:
- type: string
- example: '10001'
- phone:
- type: string
- example: "+1 555 123 4567"
- company:
- type: string
- example: Acme Inc
- country_iso:
- type: string
- example: US
- state_abbr:
- type: string
- example: NY
- ship_address:
- type: object
- properties:
- firstname:
- type: string
- example: Jane
- lastname:
- type: string
- example: Smith
- address1:
- type: string
- example: 456 Oak Ave
- address2:
- type: string
- example: Suite 200
- city:
- type: string
- example: Los Angeles
- zipcode:
- type: string
- example: '90001'
- phone:
- type: string
- example: "+1 555 987 6543"
- company:
- type: string
- country_iso:
- type: string
- example: US
- state_abbr:
- type: string
- example: CA
- "/api/v3/store/orders/{id}/next":
- patch:
- summary: Advance to next checkout step
+ "/api/v3/store/orders/{id}":
+ get:
+ summary: Get an order
tags:
- Orders
security:
- api_key: []
bearer_auth: []
- description: Advances the order to the next state in the checkout flow
+ description: Returns a single order by ID or number. Guests must provide order_token.
parameters:
- name: x-spree-api-key
in: header
@@ -3303,24 +2851,32 @@ paths:
- name: id
in: path
required: true
+ description: Order ID (prefixed) or order number
schema:
type: string
- name: order_token
in: query
required: false
+ description: Order token for guest access
+ schema:
+ type: string
+ - name: includes
+ in: query
+ required: false
+ description: Include associations (line_items, shipments, payments)
schema:
type: string
responses:
'200':
- description: order advanced
+ description: order found (guest with token)
content:
application/json:
example:
id: or_gbHJdmfrXB
- number: R782355643
- state: address
- token: hztNTBiUZjKUFUFo3G5jEL49jFZo5j7x8rs
+ number: R117871033
+ state: cart
+ token: cbziPBzpLf55uRKKpvbpBBGUWU3gEDW987s
+ email:
special_instructions:
currency: USD
item_count: 1
@@ -3343,15 +2899,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-18T15:38:28.414Z'
- updated_at: '2026-02-18T15:38:28.525Z'
+ created_at: '2026-02-19T12:52:42.982Z'
+ updated_at: '2026-02-19T12:52:43.091Z'
order_promotions: []
line_items:
- id: li_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 42396
- slug: product-42396
+ currency: USD
+ name: Product 325349
+ slug: product-325349
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3370,37 +2927,37 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:28.474Z'
- updated_at: '2026-02-18T15:38:28.474Z'
+ created_at: '2026-02-19T12:52:43.046Z'
+ updated_at: '2026-02-19T12:52:43.046Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_gbHJdmfrXB
- number: H81933444443
+ number: H10138370011
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:28.487Z'
- updated_at: '2026-02-18T15:38:28.505Z'
+ created_at: '2026-02-19T12:52:43.060Z'
+ updated_at: '2026-02-19T12:52:43.079Z'
shipping_method:
id: shpm_gbHJdmfrXB
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_184
- name: Brunilda Heathcote
+ state_abbr: STATE_ABBR_149
+ name: Nohemi Emard
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_184
+ state_text: STATE_ABBR_149
shipping_rates:
- id: shpr_gbHJdmfrXB
shipping_method_id: shpm_gbHJdmfrXB
@@ -3418,7 +2975,7 @@ paths:
firstname: John
lastname: Doe
full_name: John Doe
- address1: 188 Lovely Street
+ address1: 153 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -3426,15 +2983,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_188
- state_abbr: STATE_ABBR_188
- state_name: STATE_NAME_188
+ state_text: STATE_ABBR_153
+ state_abbr: STATE_ABBR_153
+ state_name: STATE_NAME_153
ship_address:
id: addr_OIJLhNcSbf
firstname: John
lastname: Doe
full_name: John Doe
- address1: 189 Lovely Street
+ address1: 154 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -3442,32 +2999,30 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_189
- state_abbr: STATE_ABBR_189
- state_name: STATE_NAME_189
+ state_text: STATE_ABBR_154
+ state_abbr: STATE_ABBR_154
+ state_name: STATE_NAME_154
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
- '422':
- description: cannot advance - validation errors
+ '404':
+ description: not found - order belongs to another user
content:
application/json:
example:
error:
- code: order_cannot_transition
- message: We are unable to calculate shipping rates for the selected
- items.
+ code: order_not_found
+ message: Order not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/orders/{id}/advance":
patch:
- summary: Advance through checkout
+ summary: Update an order
tags:
- - Orders
+ - Checkout
security:
- api_key: []
bearer_auth: []
- description: Advances the order through all possible checkout states
+ description: Updates order attributes like email, special instructions, or addresses
parameters:
- name: x-spree-api-key
in: header
@@ -3491,24 +3046,24 @@ paths:
type: string
responses:
'200':
- description: order advanced
+ description: order updated
content:
application/json:
example:
- id: or_gbHJdmfrXB
- number: R415935816
- state: payment
- token: pxFv8EFg6cjXd7HCGhvWk8Z8a7T6q1Gr4vG
- special_instructions:
+ id: or_UkLWZg9DAJ
+ number: R865539878
+ state: cart
+ token: 2Zi5PVqJWoMDLfkqJPWv6mhVGRWZrGDrVBg
+ special_instructions: Leave at door
currency: USD
item_count: 1
- shipment_state: backorder
- payment_state: balance_due
- item_total: '19.99'
- display_item_total: "$19.99"
- ship_total: '10.0'
- display_ship_total: "$10.00"
+ shipment_state:
+ payment_state:
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ ship_total: '100.0'
+ display_ship_total: "$100.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
promo_total: '0.0'
@@ -3519,23 +3074,24 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '29.99'
- display_total: "$29.99"
+ total: '110.0'
+ display_total: "$110.00"
completed_at:
- created_at: '2026-02-18T15:38:29.900Z'
- updated_at: '2026-02-18T15:38:30.099Z'
+ created_at: '2026-02-19T12:52:45.367Z'
+ updated_at: '2026-02-19T12:52:45.514Z'
order_promotions: []
line_items:
- - id: li_gbHJdmfrXB
- variant_id: variant_gbHJdmfrXB
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 459147
- slug: product-459147
+ currency: USD
+ name: Product 35644
+ slug: product-35644
options_text: ''
- price: '19.99'
- display_price: "$19.99"
- total: '19.99'
- display_total: "$19.99"
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
@@ -3544,70 +3100,60 @@ paths:
display_included_tax_total: "$0.00"
promo_total: '0.0'
display_promo_total: "$0.00"
- pre_tax_amount: '19.99'
- display_pre_tax_amount: "$19.99"
- discounted_amount: '19.99'
- display_discounted_amount: "$19.99"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:29.955Z'
- updated_at: '2026-02-18T15:38:30.019Z'
+ created_at: '2026-02-19T12:52:45.443Z'
+ updated_at: '2026-02-19T12:52:45.443Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- - id: ship_EfhxLZ9ck8
- number: H74531540631
+ - id: ship_UkLWZg9DAJ
+ number: H13849345321
state: pending
- tracking:
+ tracking: U10000
tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
+ cost: '100.0'
+ display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:30.038Z'
- updated_at: '2026-02-18T15:38:30.061Z'
+ created_at: '2026-02-19T12:52:45.458Z'
+ updated_at: '2026-02-19T12:52:45.484Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_194
- name: Jesse Buckridge
+ state_abbr: STATE_ABBR_164
+ name: Milo Feeney
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_194
+ state_text: STATE_ABBR_164
shipping_rates:
- - id: shpr_EfhxLZ9ck8
+ - id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
name: UPS Ground
selected: true
- cost: 10.0
- display_cost: "$10.00"
+ cost: 100.0
+ display_cost: "$100.00"
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
- - id: shpr_VqXmZF31wY
- shipping_method_id: shpm_gbHJdmfrXB
- name: UPS Ground
- selected: false
- cost: 10.0
- display_cost: "$10.00"
- shipping_method:
- id: shpm_gbHJdmfrXB
- name: UPS Ground
- code: UPS_GROUND
payments: []
bill_address:
- id: addr_uw2YK1rnl0
+ id: addr_EfhxLZ9ck8
firstname: John
lastname: Doe
full_name: John Doe
- address1: 198 Lovely Street
+ address1: 166 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -3615,15 +3161,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_198
- state_abbr: STATE_ABBR_198
- state_name: STATE_NAME_198
+ state_text: STATE_ABBR_166
+ state_abbr: STATE_ABBR_166
+ state_name: STATE_NAME_166
ship_address:
- id: addr_OIJLhNcSbf
+ id: addr_VqXmZF31wY
firstname: John
lastname: Doe
full_name: John Doe
- address1: 199 Lovely Street
+ address1: 167 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -3631,21 +3177,109 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_199
- state_abbr: STATE_ABBR_199
- state_name: STATE_NAME_199
+ state_text: STATE_ABBR_167
+ state_abbr: STATE_ABBR_167
+ state_name: STATE_NAME_167
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
- "/api/v3/store/orders/{id}/complete":
+ '403':
+ description: cannot update completed order
+ content:
+ application/json:
+ example:
+ error:
+ code: access_denied
+ message: You are not authorized to access this page.
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ email:
+ type: string
+ format: email
+ special_instructions:
+ type: string
+ example: Leave at door
+ bill_address:
+ type: object
+ properties:
+ firstname:
+ type: string
+ example: John
+ lastname:
+ type: string
+ example: Doe
+ address1:
+ type: string
+ example: 123 Main St
+ address2:
+ type: string
+ example: Apt 4B
+ city:
+ type: string
+ example: New York
+ zipcode:
+ type: string
+ example: '10001'
+ phone:
+ type: string
+ example: "+1 555 123 4567"
+ company:
+ type: string
+ example: Acme Inc
+ country_iso:
+ type: string
+ example: US
+ state_abbr:
+ type: string
+ example: NY
+ ship_address:
+ type: object
+ properties:
+ firstname:
+ type: string
+ example: Jane
+ lastname:
+ type: string
+ example: Smith
+ address1:
+ type: string
+ example: 456 Oak Ave
+ address2:
+ type: string
+ example: Suite 200
+ city:
+ type: string
+ example: Los Angeles
+ zipcode:
+ type: string
+ example: '90001'
+ phone:
+ type: string
+ example: "+1 555 987 6543"
+ company:
+ type: string
+ country_iso:
+ type: string
+ example: US
+ state_abbr:
+ type: string
+ example: CA
+ "/api/v3/store/orders/{id}/next":
patch:
- summary: Complete the order
+ summary: Advance to next checkout step
tags:
- - Orders
+ - Checkout
security:
- api_key: []
bearer_auth: []
- description: Completes the order (finalizes the purchase)
+ description: Advances the order to the next state in the checkout flow
parameters:
- name: x-spree-api-key
in: header
@@ -3669,24 +3303,24 @@ paths:
type: string
responses:
'200':
- description: order completed
+ description: order advanced
content:
application/json:
example:
id: or_gbHJdmfrXB
- number: R199361072
- state: complete
- token: eXtxEKsJryL1AWMo3BQgmTtUPyvvFVSaXeN
+ number: R222930634
+ state: address
+ token: YHwGTmN3c7hW8dqa8Lc1GE84LopAuaPSQqf
special_instructions:
currency: USD
item_count: 1
- shipment_state: backorder
- payment_state: balance_due
- item_total: '19.99'
- display_item_total: "$19.99"
- ship_total: '10.0'
- display_ship_total: "$10.00"
+ shipment_state:
+ payment_state:
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ ship_total: '100.0'
+ display_ship_total: "$100.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
promo_total: '0.0'
@@ -3697,23 +3331,24 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '29.99'
- display_total: "$29.99"
- completed_at: '2026-02-18T15:38:31.121Z'
- created_at: '2026-02-18T15:38:30.783Z'
- updated_at: '2026-02-18T15:38:31.121Z'
+ total: '110.0'
+ display_total: "$110.00"
+ completed_at:
+ created_at: '2026-02-19T12:52:47.124Z'
+ updated_at: '2026-02-19T12:52:47.238Z'
order_promotions: []
line_items:
- id: li_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 474623
- slug: product-474623
+ currency: USD
+ name: Product 399615
+ slug: product-399615
options_text: ''
- price: '19.99'
- display_price: "$19.99"
- total: '19.99'
- display_total: "$19.99"
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
@@ -3722,96 +3357,60 @@ paths:
display_included_tax_total: "$0.00"
promo_total: '0.0'
display_promo_total: "$0.00"
- pre_tax_amount: '19.99'
- display_pre_tax_amount: "$19.99"
- discounted_amount: '19.99'
- display_discounted_amount: "$19.99"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:30.839Z'
- updated_at: '2026-02-18T15:38:31.114Z'
+ created_at: '2026-02-19T12:52:47.184Z'
+ updated_at: '2026-02-19T12:52:47.184Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- - id: ship_EfhxLZ9ck8
- number: H83048651928
+ - id: ship_gbHJdmfrXB
+ number: H63655291066
state: pending
- tracking:
+ tracking: U10000
tracking_url:
- cost: '10.0'
- display_cost: "$10.00"
+ cost: '100.0'
+ display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:30.943Z'
- updated_at: '2026-02-18T15:38:31.091Z'
+ created_at: '2026-02-19T12:52:47.198Z'
+ updated_at: '2026-02-19T12:52:47.217Z'
shipping_method:
- id: shpm_UkLWZg9DAJ
+ id: shpm_gbHJdmfrXB
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_200
- name: Sadie Bogisich
+ state_abbr: STATE_ABBR_174
+ name: Elodia Ziemann
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_200
+ state_text: STATE_ABBR_174
shipping_rates:
- - id: shpr_EfhxLZ9ck8
- shipping_method_id: shpm_UkLWZg9DAJ
- name: UPS Ground
- selected: true
- cost: 10.0
- display_cost: "$10.00"
- shipping_method:
- id: shpm_UkLWZg9DAJ
- name: UPS Ground
- code: UPS_GROUND
- - id: shpr_VqXmZF31wY
+ - id: shpr_gbHJdmfrXB
shipping_method_id: shpm_gbHJdmfrXB
name: UPS Ground
- selected: false
- cost: 10.0
- display_cost: "$10.00"
+ selected: true
+ cost: 100.0
+ display_cost: "$100.00"
shipping_method:
id: shpm_gbHJdmfrXB
name: UPS Ground
code: UPS_GROUND
- payments:
- - id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- state: checkout
- response_code: '12345'
- number: P40TU144
- amount: '29.99'
- display_amount: "$29.99"
- created_at: '2026-02-18T15:38:31.052Z'
- updated_at: '2026-02-18T15:38:31.052Z'
- source_type: credit_card
- source_id: card_UkLWZg9DAJ
- source:
- id: card_UkLWZg9DAJ
- cc_type: visa
- last_digits: '1111'
- month: 12
- year: 2027
- name: Spree Commerce
- default: true
- gateway_payment_profile_id:
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Check
- description:
- type: Spree::PaymentMethod::Check
- session_required: false
+ payments: []
bill_address:
id: addr_uw2YK1rnl0
firstname: John
lastname: Doe
full_name: John Doe
- address1: 204 Lovely Street
+ address1: 178 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -3819,15 +3418,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_204
- state_abbr: STATE_ABBR_204
- state_name: STATE_NAME_204
+ state_text: STATE_ABBR_178
+ state_abbr: STATE_ABBR_178
+ state_name: STATE_NAME_178
ship_address:
id: addr_OIJLhNcSbf
firstname: John
lastname: Doe
full_name: John Doe
- address1: 205 Lovely Street
+ address1: 179 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -3835,41 +3434,32 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_205
- state_abbr: STATE_ABBR_205
- state_name: STATE_NAME_205
- payment_methods:
- - id: pm_UkLWZg9DAJ
- name: Check
- description:
- type: Spree::PaymentMethod::Check
- session_required: false
- - id: pm_gbHJdmfrXB
- name: Credit Card
- description:
- type: Spree::Gateway::Bogus
- session_required: true
+ state_text: STATE_ABBR_179
+ state_abbr: STATE_ABBR_179
+ state_name: STATE_NAME_179
+ payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
'422':
- description: cannot complete
+ description: cannot advance - validation errors
content:
application/json:
example:
error:
- code: order_already_completed
- message: No payment found
+ code: order_cannot_transition
+ message: We are unable to calculate shipping rates for the selected
+ items.
schema:
"$ref": "#/components/schemas/ErrorResponse"
- "/api/v3/store/orders/{order_id}/store_credits":
- post:
- summary: Add store credit
+ "/api/v3/store/orders/{id}/advance":
+ patch:
+ summary: Advance through checkout
tags:
- - Orders
+ - Checkout
security:
- api_key: []
bearer_auth: []
- description: Applies store credit to the order
+ description: Advances the order through all possible checkout states
parameters:
- name: x-spree-api-key
in: header
@@ -3878,10 +3468,10 @@ paths:
type: string
- name: Authorization
in: header
- required: true
+ required: false
schema:
type: string
- - name: order_id
+ - name: id
in: path
required: true
schema:
@@ -3893,24 +3483,24 @@ paths:
type: string
responses:
'200':
- description: store credit applied
+ description: order advanced
content:
application/json:
example:
- id: or_UkLWZg9DAJ
- number: R019751217
- state: cart
- token: sZcgHMQVFBjsvK21FCLD7tZHm79fmcRTdbL
- special_instructions:
- currency: USD
- item_count: 1
- shipment_state:
- payment_state:
- item_total: '10.0'
- display_item_total: "$10.00"
- ship_total: '100.0'
- display_ship_total: "$100.00"
+ id: or_gbHJdmfrXB
+ number: R759426541
+ state: payment
+ token: ErZ3v9tDMf8K2KmiF3bqf1H4WvkkQCKEbZP
+ special_instructions:
+ currency: USD
+ item_count: 1
+ shipment_state: backorder
+ payment_state: balance_due
+ item_total: '19.99'
+ display_item_total: "$19.99"
+ ship_total: '10.0'
+ display_ship_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
promo_total: '0.0'
@@ -3921,23 +3511,24 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
+ total: '29.99'
+ display_total: "$29.99"
completed_at:
- created_at: '2026-02-18T15:38:32.603Z'
- updated_at: '2026-02-18T15:38:33.033Z'
+ created_at: '2026-02-19T12:52:48.649Z'
+ updated_at: '2026-02-19T12:52:48.862Z'
order_promotions: []
line_items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
+ - id: li_gbHJdmfrXB
+ variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 506264
- slug: product-506264
+ currency: USD
+ name: Product 424943
+ slug: product-424943
options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
+ price: '19.99'
+ display_price: "$19.99"
+ total: '19.99'
+ display_total: "$19.99"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
@@ -3946,86 +3537,70 @@ paths:
display_included_tax_total: "$0.00"
promo_total: '0.0'
display_promo_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
+ pre_tax_amount: '19.99'
+ display_pre_tax_amount: "$19.99"
+ discounted_amount: '19.99'
+ display_discounted_amount: "$19.99"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:32.661Z'
- updated_at: '2026-02-18T15:38:32.661Z'
+ created_at: '2026-02-19T12:52:48.711Z'
+ updated_at: '2026-02-19T12:52:48.785Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- - id: ship_UkLWZg9DAJ
- number: H10572317912
+ - id: ship_EfhxLZ9ck8
+ number: H56656966977
state: pending
- tracking: U10000
+ tracking:
tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
+ cost: '10.0'
+ display_cost: "$10.00"
shipped_at:
- created_at: '2026-02-18T15:38:32.676Z'
- updated_at: '2026-02-18T15:38:32.695Z'
+ created_at: '2026-02-19T12:52:48.803Z'
+ updated_at: '2026-02-19T12:52:48.826Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_212
- name: Bridgett Upton
+ state_abbr: STATE_ABBR_184
+ name: Marti Abernathy
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_212
+ state_text: STATE_ABBR_184
shipping_rates:
- - id: shpr_UkLWZg9DAJ
+ - id: shpr_EfhxLZ9ck8
shipping_method_id: shpm_UkLWZg9DAJ
name: UPS Ground
selected: true
- cost: 100.0
- display_cost: "$100.00"
+ cost: 10.0
+ display_cost: "$10.00"
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
- payments:
- - id: py_UkLWZg9DAJ
- payment_method_id: pm_UkLWZg9DAJ
- state: checkout
- response_code: 1-SC-20260218153833027849
- number: PKE7YP77
- amount: '10.0'
- display_amount: "$10.00"
- created_at: '2026-02-18T15:38:33.033Z'
- updated_at: '2026-02-18T15:38:33.033Z'
- source_type: store_credit
- source_id: credit_UkLWZg9DAJ
- source:
- id: credit_UkLWZg9DAJ
- amount: '50.0'
- amount_used: '0.0'
- amount_remaining: '50.0'
- display_amount: "$50.00"
- display_amount_used: "$0.00"
- display_amount_remaining: "$50.00"
- currency: USD
- payment_method:
- id: pm_UkLWZg9DAJ
- name: Store Credit
- description: Store Credit
- type: Spree::PaymentMethod::StoreCredit
- session_required: false
+ - id: shpr_VqXmZF31wY
+ shipping_method_id: shpm_gbHJdmfrXB
+ name: UPS Ground
+ selected: false
+ cost: 10.0
+ display_cost: "$10.00"
+ shipping_method:
+ id: shpm_gbHJdmfrXB
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
bill_address:
- id: addr_EfhxLZ9ck8
+ id: addr_uw2YK1rnl0
firstname: John
lastname: Doe
full_name: John Doe
- address1: 214 Lovely Street
+ address1: 188 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -4033,15 +3608,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_214
- state_abbr: STATE_ABBR_214
- state_name: STATE_NAME_214
+ state_text: STATE_ABBR_188
+ state_abbr: STATE_ABBR_188
+ state_name: STATE_NAME_188
ship_address:
- id: addr_VqXmZF31wY
+ id: addr_OIJLhNcSbf
firstname: John
lastname: Doe
full_name: John Doe
- address1: 215 Lovely Street
+ address1: 189 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -4049,45 +3624,21 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_215
- state_abbr: STATE_ABBR_215
- state_name: STATE_NAME_215
- payment_methods:
- - id: pm_UkLWZg9DAJ
- name: Store Credit
- description: Store Credit
- type: Spree::PaymentMethod::StoreCredit
- session_required: false
+ state_text: STATE_ABBR_189
+ state_abbr: STATE_ABBR_189
+ state_name: STATE_NAME_189
+ payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
- '422':
- description: no store credit available
- content:
- application/json:
- example:
- error:
- code: processing_error
- message: User does not have any Store Credits available
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- amount:
- type: number
- example: 10.0
- description: Amount to apply (optional - defaults to max available)
- delete:
- summary: Remove store credit
+ "/api/v3/store/orders/{id}/complete":
+ patch:
+ summary: Complete the order
tags:
- - Orders
+ - Checkout
security:
- api_key: []
bearer_auth: []
- description: Removes store credit from the order
+ description: Completes the order (finalizes the purchase)
parameters:
- name: x-spree-api-key
in: header
@@ -4096,10 +3647,10 @@ paths:
type: string
- name: Authorization
in: header
- required: true
+ required: false
schema:
type: string
- - name: order_id
+ - name: id
in: path
required: true
schema:
@@ -4111,24 +3662,24 @@ paths:
type: string
responses:
'200':
- description: store credit removed
+ description: order completed
content:
application/json:
example:
- id: or_UkLWZg9DAJ
- number: R106812842
- state: cart
- token: Md8caqwam8cJGRtLjbgmha6BiEk9jaFCQGG
+ id: or_gbHJdmfrXB
+ number: R197629911
+ state: complete
+ token: STtf9vScj5YWNRpECYEiDW1WT7b4LBXpfPE
special_instructions:
currency: USD
item_count: 1
- shipment_state:
- payment_state:
- item_total: '10.0'
- display_item_total: "$10.00"
- ship_total: '100.0'
- display_ship_total: "$100.00"
+ shipment_state: backorder
+ payment_state: balance_due
+ item_total: '19.99'
+ display_item_total: "$19.99"
+ ship_total: '10.0'
+ display_ship_total: "$10.00"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
promo_total: '0.0'
@@ -4139,23 +3690,24 @@ paths:
display_included_tax_total: "$0.00"
additional_tax_total: '0.0'
display_additional_tax_total: "$0.00"
- total: '110.0'
- display_total: "$110.00"
- completed_at:
- created_at: '2026-02-18T15:38:34.297Z'
- updated_at: '2026-02-18T15:38:34.423Z'
+ total: '29.99'
+ display_total: "$29.99"
+ completed_at: '2026-02-19T12:52:49.880Z'
+ created_at: '2026-02-19T12:52:49.562Z'
+ updated_at: '2026-02-19T12:52:49.880Z'
order_promotions: []
line_items:
- - id: li_UkLWZg9DAJ
- variant_id: variant_UkLWZg9DAJ
+ - id: li_gbHJdmfrXB
+ variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 528055
- slug: product-528055
+ currency: USD
+ name: Product 445394
+ slug: product-445394
options_text: ''
- price: '10.0'
- display_price: "$10.00"
- total: '10.0'
- display_total: "$10.00"
+ price: '19.99'
+ display_price: "$19.99"
+ total: '19.99'
+ display_total: "$19.99"
adjustment_total: '0.0'
display_adjustment_total: "$0.00"
additional_tax_total: '0.0'
@@ -4164,60 +3716,96 @@ paths:
display_included_tax_total: "$0.00"
promo_total: '0.0'
display_promo_total: "$0.00"
- pre_tax_amount: '10.0'
- display_pre_tax_amount: "$10.00"
- discounted_amount: '10.0'
- display_discounted_amount: "$10.00"
+ pre_tax_amount: '19.99'
+ display_pre_tax_amount: "$19.99"
+ discounted_amount: '19.99'
+ display_discounted_amount: "$19.99"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:34.361Z'
- updated_at: '2026-02-18T15:38:34.361Z'
+ created_at: '2026-02-19T12:52:49.623Z'
+ updated_at: '2026-02-19T12:52:49.874Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- - id: ship_UkLWZg9DAJ
- number: H48439659868
+ - id: ship_EfhxLZ9ck8
+ number: H85585093802
state: pending
- tracking: U10000
+ tracking:
tracking_url:
- cost: '100.0'
- display_cost: "$100.00"
+ cost: '10.0'
+ display_cost: "$10.00"
shipped_at:
- created_at: '2026-02-18T15:38:34.376Z'
- updated_at: '2026-02-18T15:38:34.409Z'
+ created_at: '2026-02-19T12:52:49.721Z'
+ updated_at: '2026-02-19T12:52:49.857Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_220
- name: Jeffie Murray
+ state_abbr: STATE_ABBR_190
+ name: Laquita Ratke
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_220
+ state_text: STATE_ABBR_190
shipping_rates:
- - id: shpr_UkLWZg9DAJ
+ - id: shpr_EfhxLZ9ck8
shipping_method_id: shpm_UkLWZg9DAJ
name: UPS Ground
selected: true
- cost: 100.0
- display_cost: "$100.00"
+ cost: 10.0
+ display_cost: "$10.00"
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
- payments: []
+ - id: shpr_VqXmZF31wY
+ shipping_method_id: shpm_gbHJdmfrXB
+ name: UPS Ground
+ selected: false
+ cost: 10.0
+ display_cost: "$10.00"
+ shipping_method:
+ id: shpm_gbHJdmfrXB
+ name: UPS Ground
+ code: UPS_GROUND
+ payments:
+ - id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ state: checkout
+ response_code: '12345'
+ number: PDSEJAQF
+ amount: '29.99'
+ display_amount: "$29.99"
+ created_at: '2026-02-19T12:52:49.821Z'
+ updated_at: '2026-02-19T12:52:49.821Z'
+ source_type: credit_card
+ source_id: card_UkLWZg9DAJ
+ source:
+ id: card_UkLWZg9DAJ
+ cc_type: visa
+ last_digits: '1111'
+ month: 12
+ year: 2027
+ name: Spree Commerce
+ default: true
+ gateway_payment_profile_id:
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Check
+ description:
+ type: Spree::PaymentMethod::Check
+ session_required: false
bill_address:
- id: addr_EfhxLZ9ck8
+ id: addr_uw2YK1rnl0
firstname: John
lastname: Doe
full_name: John Doe
- address1: 222 Lovely Street
+ address1: 194 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -4225,15 +3813,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_222
- state_abbr: STATE_ABBR_222
- state_name: STATE_NAME_222
+ state_text: STATE_ABBR_194
+ state_abbr: STATE_ABBR_194
+ state_name: STATE_NAME_194
ship_address:
- id: addr_VqXmZF31wY
+ id: addr_OIJLhNcSbf
firstname: John
lastname: Doe
full_name: John Doe
- address1: 223 Lovely Street
+ address1: 195 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -4241,17 +3829,37 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_223
- state_abbr: STATE_ABBR_223
- state_name: STATE_NAME_223
- payment_methods: []
+ state_text: STATE_ABBR_195
+ state_abbr: STATE_ABBR_195
+ state_name: STATE_NAME_195
+ payment_methods:
+ - id: pm_UkLWZg9DAJ
+ name: Check
+ description:
+ type: Spree::PaymentMethod::Check
+ session_required: false
+ - id: pm_gbHJdmfrXB
+ name: Credit Card
+ description:
+ type: Spree::Gateway::Bogus
+ session_required: true
schema:
"$ref": "#/components/schemas/StoreOrder"
+ '422':
+ description: cannot complete
+ content:
+ application/json:
+ example:
+ error:
+ code: order_already_completed
+ message: No payment found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
"/api/v3/store/orders/{order_id}/payment_methods":
get:
summary: List available payment methods
tags:
- - Payment Methods
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -4328,7 +3936,7 @@ paths:
post:
summary: Create payment session
tags:
- - Payment Sessions
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -4368,13 +3976,13 @@ paths:
id: ps_gbHJdmfrXB
status: pending
currency: USD
- external_id: bogus_660b601106992096c54e7dda
+ external_id: bogus_dedf02049debd44f58d01982
external_data:
- client_secret: bogus_secret_d16dc3434b2cff16
+ client_secret: bogus_secret_f985af7298fc90df
customer_external_id:
expires_at:
- created_at: '2026-02-18T15:38:36.439Z'
- updated_at: '2026-02-18T15:38:36.439Z'
+ created_at: '2026-02-19T12:52:52.787Z'
+ updated_at: '2026-02-19T12:52:52.787Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4450,7 +4058,7 @@ paths:
get:
summary: Get payment session
tags:
- - Payment Sessions
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -4465,13 +4073,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_209206c444ce98c917679901
+ external_id: bogus_9968ad9e217c48428fea7fc9
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-02-18T15:38:37.804Z'
- updated_at: '2026-02-18T15:38:37.804Z'
+ created_at: '2026-02-19T12:52:54.300Z'
+ updated_at: '2026-02-19T12:52:54.300Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4496,7 +4104,7 @@ paths:
patch:
summary: Update payment session
tags:
- - Payment Sessions
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -4512,13 +4120,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_1d974ff43e7e76523ce6e2a6
+ external_id: bogus_17296ec4d0af447867d38b8d
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-02-18T15:38:39.319Z'
- updated_at: '2026-02-18T15:38:39.333Z'
+ created_at: '2026-02-19T12:52:55.713Z'
+ updated_at: '2026-02-19T12:52:55.727Z'
amount: '50.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4577,7 +4185,7 @@ paths:
patch:
summary: Complete payment session
tags:
- - Payment Sessions
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -4593,13 +4201,13 @@ paths:
id: ps_UkLWZg9DAJ
status: completed
currency: USD
- external_id: bogus_5dd6ae0d241b2fdf703a06f8
+ external_id: bogus_fb0e12395e43ef40646adc7d
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-02-18T15:38:40.017Z'
- updated_at: '2026-02-18T15:38:40.030Z'
+ created_at: '2026-02-19T12:52:56.433Z'
+ updated_at: '2026-02-19T12:52:56.444Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4637,7 +4245,7 @@ paths:
post:
summary: Create payment setup session
tags:
- - Payment Setup Sessions
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -4663,11 +4271,11 @@ paths:
example:
id: pss_gbHJdmfrXB
status: pending
- external_id: bogus_seti_b9a4c4bbc5f889c93877d8a5
- external_client_secret: bogus_seti_secret_e83e634f103f1af4
+ external_id: bogus_seti_9b3562fb9671f5895b4e7496
+ external_client_secret: bogus_seti_secret_dd4a5e232aa14985
external_data: {}
- created_at: '2026-02-18T15:38:41.393Z'
- updated_at: '2026-02-18T15:38:41.393Z'
+ created_at: '2026-02-19T12:52:57.808Z'
+ updated_at: '2026-02-19T12:52:57.808Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id:
payment_source_type:
@@ -4736,7 +4344,7 @@ paths:
get:
summary: Get payment setup session
tags:
- - Payment Setup Sessions
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -4750,12 +4358,12 @@ paths:
example:
id: pss_UkLWZg9DAJ
status: pending
- external_id: seti_test_491aacbcb8bf7f0e3c183b60
- external_client_secret: seti_secret_f95f6d4ca5393da7dd8ba227
+ external_id: seti_test_cf896347312093667f04bb61
+ external_client_secret: seti_secret_d4685bf66b7f892837109566
external_data:
client_secret: secret_123
- created_at: '2026-02-18T15:38:43.216Z'
- updated_at: '2026-02-18T15:38:43.216Z'
+ created_at: '2026-02-19T12:52:59.608Z'
+ updated_at: '2026-02-19T12:52:59.608Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id:
payment_source_type:
@@ -4799,7 +4407,7 @@ paths:
patch:
summary: Complete payment setup session
tags:
- - Payment Setup Sessions
+ - Customers
security:
- api_key: []
bearer_auth: []
@@ -4814,12 +4422,12 @@ paths:
example:
id: pss_UkLWZg9DAJ
status: completed
- external_id: seti_test_03ec8b5c29fadaf6be025604
- external_client_secret: seti_secret_955401c652da34d952b6fa6f
+ external_id: seti_test_f4c0da5e070920925362b895
+ external_client_secret: seti_secret_d856dc03e2cb2c4ef326e924
external_data:
client_secret: secret_123
- created_at: '2026-02-18T15:38:44.385Z'
- updated_at: '2026-02-18T15:38:44.403Z'
+ created_at: '2026-02-19T12:53:00.743Z'
+ updated_at: '2026-02-19T12:53:00.757Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id: card_UkLWZg9DAJ
payment_source_type: Spree::CreditCard
@@ -4872,7 +4480,7 @@ paths:
get:
summary: List payments
tags:
- - Payments
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -4888,11 +4496,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: P83F5K6F
+ number: PKHN04VM
amount: '110.0'
display_amount: "$110.00"
- created_at: '2026-02-18T15:38:45.714Z'
- updated_at: '2026-02-18T15:38:45.714Z'
+ created_at: '2026-02-19T12:53:02.001Z'
+ updated_at: '2026-02-19T12:53:02.001Z'
source_type: credit_card
source_id: card_UkLWZg9DAJ
source:
@@ -4957,7 +4565,7 @@ paths:
get:
summary: Get payment
tags:
- - Payments
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -4972,11 +4580,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PNK9E4XQ
+ number: P9PFK2UT
amount: '110.0'
display_amount: "$110.00"
- created_at: '2026-02-18T15:38:47.126Z'
- updated_at: '2026-02-18T15:38:47.126Z'
+ created_at: '2026-02-19T12:53:03.416Z'
+ updated_at: '2026-02-19T12:53:03.416Z'
source_type: credit_card
source_id: card_UkLWZg9DAJ
source:
@@ -5060,19 +4668,18 @@ paths:
example:
data:
- id: prod_UkLWZg9DAJ
- name: Product 677067
- description: |-
- Velit amet similique laudantium ad. Veritatis provident quae vero culpa consectetur. Ducimus modi magni labore eius inventore numquam. Assumenda dicta dolores magni aliquam.
- Totam maiores quia consequuntur placeat nisi. Repellat omnis perferendis sint amet. Laboriosam ea nesciunt cupiditate dignissimos repellendus. Accusamus nobis cum assumenda inventore neque porro praesentium. Omnis quidem aspernatur odio tempore doloribus laudantium.
- Corporis doloremque consequatur dolor nisi. Labore recusandae necessitatibus nemo numquam nobis. Totam nesciunt doloremque ut ratione qui nihil et est. Architecto error laboriosam est ex cumque perspiciatis. Expedita sapiente voluptatem deleniti vero doloribus.
- Iusto molestias amet odit consequuntur dignissimos veniam enim eos. Alias temporibus blanditiis quam doloremque vitae a laborum. Placeat aliquid ipsum laborum rem blanditiis at.
- slug: product-677067
+ name: Product 614806
+ description: Ratione corporis magnam reprehenderit asperiores. Autem
+ ipsa inventore aliquam placeat quidem repellendus. Delectus ad
+ fugiat qui odit. Tempore et quam assumenda voluptate dolorum commodi
+ quidem. Alias ad quisquam consequuntur aliquam.
+ slug: product-614806
meta_description:
meta_keywords:
variant_count: 1
- available_on: '2025-02-18T15:38:47.878Z'
- created_at: '2026-02-18T15:38:47.897Z'
- updated_at: '2026-02-18T15:38:48.006Z'
+ available_on: '2025-02-19T12:53:04.184Z'
+ created_at: '2026-02-19T12:53:04.205Z'
+ updated_at: '2026-02-19T12:53:04.297Z'
purchasable: true
in_stock: false
backorderable: true
@@ -5092,17 +4699,18 @@ paths:
price_list_id:
original_price:
- id: prod_gbHJdmfrXB
- name: Product 68335
+ name: Product 629799
description: |-
- Maiores facilis ut numquam animi hic. Libero delectus voluptas officia maiores. Harum mollitia itaque vero sequi.
- Fugit excepturi repellendus nulla perferendis odio dolorum. Consequuntur debitis aperiam omnis sed consectetur est libero eveniet. Asperiores alias ipsum eligendi quasi possimus at atque. Vero neque repellat iste quod cumque.
- slug: product-68335
+ Ducimus omnis exercitationem fugit explicabo. Eius labore aperiam soluta voluptas praesentium. Labore culpa rem aliquid porro nam neque. Vero velit esse voluptates dolores. Aliquid voluptas quidem ipsam earum.
+ Atque facilis id sapiente mollitia laborum dolore. Sequi ea saepe dicta aspernatur. Accusamus maiores unde at corrupti recusandae quia debitis ipsum.
+ Adipisci incidunt accusantium natus sit saepe praesentium. Aliquam rerum quaerat commodi dolores hic. Placeat ex dolores animi consectetur dolor voluptatibus.
+ slug: product-629799
meta_description:
meta_keywords:
variant_count: 0
- available_on: '2025-02-18T15:38:48.028Z'
- created_at: '2026-02-18T15:38:48.039Z'
- updated_at: '2026-02-18T15:38:48.068Z'
+ available_on: '2025-02-19T12:53:04.318Z'
+ created_at: '2026-02-19T12:53:04.329Z'
+ updated_at: '2026-02-19T12:53:04.356Z'
purchasable: true
in_stock: false
backorderable: true
@@ -5187,20 +4795,19 @@ paths:
application/json:
example:
id: prod_UkLWZg9DAJ
- name: Product 794796
+ name: Product 73260
description: |-
- Ea totam maiores commodi natus facere enim corrupti doloremque. Unde incidunt eos quos optio rerum. Explicabo mollitia ipsa vitae aperiam at atque. Architecto quo ad quas quaerat qui.
- Eos veniam esse officiis aut temporibus facilis ipsa. Fuga repellendus recusandae quasi veniam. Maiores doloremque accusantium beatae magni earum. Soluta aliquid reiciendis tenetur repellendus deleniti saepe labore. Itaque natus maiores adipisci incidunt culpa.
- Expedita vero quia iure eum voluptatum corrupti quas iste. Expedita blanditiis corporis quaerat inventore quis libero. Voluptate nostrum sit autem iusto est. Quis in praesentium nostrum aperiam corrupti temporibus aliquid.
- Esse autem amet fugiat dolorum earum vel odit. Quas ex id repudiandae dicta ipsa minima ab saepe. Quod porro expedita provident repudiandae. Inventore quasi enim assumenda unde voluptate.
- Itaque voluptates eos consequatur aliquam sint. Iure unde eum ex nisi saepe repellendus harum ipsam. Dicta harum incidunt ex cum consectetur veritatis cupiditate. Tenetur impedit adipisci doloribus dolorum nostrum rem alias distinctio.
- slug: product-794796
+ Temporibus officiis quia nobis similique. Cumque consectetur fugit eius repellat laborum. Ipsam incidunt voluptatem impedit pariatur est laboriosam id amet.
+ Ducimus excepturi animi quisquam placeat. Laborum incidunt enim qui non pariatur quasi veritatis quas. Ea accusamus tenetur culpa facere suscipit ipsum.
+ Rerum molestias corporis dolores veritatis maiores corrupti. Rerum omnis maiores quia tempore. Adipisci exercitationem earum architecto reprehenderit eveniet optio corporis error.
+ Porro debitis velit aspernatur rem voluptatibus illo soluta. Ratione tempore eveniet iste libero dolorem dolorum. Veritatis voluptate praesentium blanditiis ratione dolore non iure.
+ slug: product-73260
meta_description:
meta_keywords:
variant_count: 1
- available_on: '2025-02-18T15:38:49.321Z'
- created_at: '2026-02-18T15:38:49.339Z'
- updated_at: '2026-02-18T15:38:49.424Z'
+ available_on: '2025-02-19T12:53:05.567Z'
+ created_at: '2026-02-19T12:53:05.587Z'
+ updated_at: '2026-02-19T12:53:05.676Z'
purchasable: true
in_stock: false
backorderable: true
@@ -5370,7 +4977,7 @@ paths:
get:
summary: List shipments for an order
tags:
- - Shipments
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -5405,29 +5012,29 @@ paths:
example:
data:
- id: ship_UkLWZg9DAJ
- number: H53243452822
+ number: H13350511671
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:53.267Z'
- updated_at: '2026-02-18T15:38:53.291Z'
+ created_at: '2026-02-19T12:53:09.204Z'
+ updated_at: '2026-02-19T12:53:09.225Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_298
- name: Lon Purdy
+ state_abbr: STATE_ABBR_276
+ name: Asa Lubowitz
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_298
+ state_text: STATE_ABBR_276
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -5472,7 +5079,7 @@ paths:
get:
summary: Get a shipment
tags:
- - Shipments
+ - Checkout
security:
- api_key: []
bearer_auth: []
@@ -5518,29 +5125,29 @@ paths:
application/json:
example:
id: ship_UkLWZg9DAJ
- number: H44900152874
+ number: H27396860428
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:54.644Z'
- updated_at: '2026-02-18T15:38:54.666Z'
+ created_at: '2026-02-19T12:53:10.547Z'
+ updated_at: '2026-02-19T12:53:10.570Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_306
- name: Lolita Altenwerth
+ state_abbr: STATE_ABBR_284
+ name: Anjelica Witting
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_306
+ state_text: STATE_ABBR_284
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -5553,25 +5160,442 @@ paths:
name: UPS Ground
code: UPS_GROUND
schema:
- "$ref": "#/components/schemas/StoreShipment"
- '404':
- description: shipment not found
+ "$ref": "#/components/schemas/StoreShipment"
+ '404':
+ description: shipment not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Shipment not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ patch:
+ summary: Select shipping rate for shipment
+ tags:
+ - Checkout
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Selects a shipping rate for the shipment
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: false
+ schema:
+ type: string
+ - name: order_id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: id
+ in: path
+ required: true
+ description: Shipment ID
+ schema:
+ type: string
+ - name: token
+ in: query
+ required: false
+ description: Order token for guest access
+ schema:
+ type: string
+ responses:
+ '200':
+ description: shipping rate selected, returns updated order
+ content:
+ application/json:
+ example:
+ id: or_UkLWZg9DAJ
+ number: R775501119
+ state: delivery
+ token: yeBRKDLWHz1quDUfnJoxNJtDUcYFYkWM4ax
+ special_instructions:
+ currency: USD
+ item_count: 1
+ shipment_state:
+ payment_state:
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ ship_total: '100.0'
+ display_ship_total: "$100.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ completed_at:
+ created_at: '2026-02-19T12:53:11.830Z'
+ updated_at: '2026-02-19T12:53:11.946Z'
+ order_promotions: []
+ line_items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 1055395
+ slug: product-1055395
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ created_at: '2026-02-19T12:53:11.885Z'
+ updated_at: '2026-02-19T12:53:11.885Z'
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ shipments:
+ - id: ship_UkLWZg9DAJ
+ number: H42558868346
+ state: pending
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ shipped_at:
+ created_at: '2026-02-19T12:53:11.899Z'
+ updated_at: '2026-02-19T12:53:11.945Z'
+ shipping_method:
+ id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: STATE_ABBR_292
+ name: Dillon Ratke
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: STATE_ABBR_292
+ shipping_rates:
+ - id: shpr_UkLWZg9DAJ
+ shipping_method_id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: 100.0
+ display_cost: "$100.00"
+ shipping_method:
+ id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments: []
+ bill_address:
+ id: addr_EfhxLZ9ck8
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 284 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_294
+ state_abbr: STATE_ABBR_294
+ state_name: STATE_NAME_294
+ ship_address:
+ id: addr_VqXmZF31wY
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 285 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_295
+ state_abbr: STATE_ABBR_295
+ state_name: STATE_NAME_295
+ payment_methods: []
+ schema:
+ "$ref": "#/components/schemas/StoreOrder"
+ '404':
+ description: shipping rate not found
+ content:
+ application/json:
+ example:
+ error:
+ code: record_not_found
+ message: Shipping rate not found
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ selected_shipping_rate_id:
+ type: string
+ example: shprt_abc123
+ description: Shipping rate ID to select
+ required:
+ - selected_shipping_rate_id
+ "/api/v3/store/orders/{order_id}/store_credits":
+ post:
+ summary: Add store credit
+ tags:
+ - Checkout
+ security:
+ - api_key: []
+ bearer_auth: []
+ description: Applies store credit to the order
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: Authorization
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: order_id
+ in: path
+ required: true
+ schema:
+ type: string
+ - name: order_token
+ in: query
+ required: false
+ schema:
+ type: string
+ responses:
+ '200':
+ description: store credit applied
+ content:
+ application/json:
+ example:
+ id: or_UkLWZg9DAJ
+ number: R330567723
+ state: cart
+ token: 9pLwuq4u3p6xzL3U9ok6ptjC9QNEmewqpiJ
+ special_instructions:
+ currency: USD
+ item_count: 1
+ shipment_state:
+ payment_state:
+ item_total: '10.0'
+ display_item_total: "$10.00"
+ ship_total: '100.0'
+ display_ship_total: "$100.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ tax_total: '0.0'
+ display_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ total: '110.0'
+ display_total: "$110.00"
+ completed_at:
+ created_at: '2026-02-19T12:53:13.209Z'
+ updated_at: '2026-02-19T12:53:13.629Z'
+ order_promotions: []
+ line_items:
+ - id: li_UkLWZg9DAJ
+ variant_id: variant_UkLWZg9DAJ
+ quantity: 1
+ currency: USD
+ name: Product 1073422
+ slug: product-1073422
+ options_text: ''
+ price: '10.0'
+ display_price: "$10.00"
+ total: '10.0'
+ display_total: "$10.00"
+ adjustment_total: '0.0'
+ display_adjustment_total: "$0.00"
+ additional_tax_total: '0.0'
+ display_additional_tax_total: "$0.00"
+ included_tax_total: '0.0'
+ display_included_tax_total: "$0.00"
+ promo_total: '0.0'
+ display_promo_total: "$0.00"
+ pre_tax_amount: '10.0'
+ display_pre_tax_amount: "$10.00"
+ discounted_amount: '10.0'
+ display_discounted_amount: "$10.00"
+ display_compare_at_amount: "$0.00"
+ created_at: '2026-02-19T12:53:13.270Z'
+ updated_at: '2026-02-19T12:53:13.270Z'
+ compare_at_amount:
+ thumbnail_url:
+ option_values: []
+ digital_links: []
+ shipments:
+ - id: ship_UkLWZg9DAJ
+ number: H31519350834
+ state: pending
+ tracking: U10000
+ tracking_url:
+ cost: '100.0'
+ display_cost: "$100.00"
+ shipped_at:
+ created_at: '2026-02-19T12:53:13.285Z'
+ updated_at: '2026-02-19T12:53:13.310Z'
+ shipping_method:
+ id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ stock_location:
+ id: sloc_UkLWZg9DAJ
+ state_abbr: STATE_ABBR_300
+ name: Dannette Roob
+ address1: 1600 Pennsylvania Ave NW
+ city: Washington
+ zipcode: '20500'
+ country_iso: US
+ country_name: United States of America
+ state_text: STATE_ABBR_300
+ shipping_rates:
+ - id: shpr_UkLWZg9DAJ
+ shipping_method_id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ selected: true
+ cost: 100.0
+ display_cost: "$100.00"
+ shipping_method:
+ id: shpm_UkLWZg9DAJ
+ name: UPS Ground
+ code: UPS_GROUND
+ payments:
+ - id: py_UkLWZg9DAJ
+ payment_method_id: pm_UkLWZg9DAJ
+ state: checkout
+ response_code: 1-SC-20260219125313624888
+ number: POLU5RPG
+ amount: '10.0'
+ display_amount: "$10.00"
+ created_at: '2026-02-19T12:53:13.628Z'
+ updated_at: '2026-02-19T12:53:13.628Z'
+ source_type: store_credit
+ source_id: credit_UkLWZg9DAJ
+ source:
+ id: credit_UkLWZg9DAJ
+ amount: '50.0'
+ amount_used: '0.0'
+ amount_remaining: '50.0'
+ display_amount: "$50.00"
+ display_amount_used: "$0.00"
+ display_amount_remaining: "$50.00"
+ currency: USD
+ payment_method:
+ id: pm_UkLWZg9DAJ
+ name: Store Credit
+ description: Store Credit
+ type: Spree::PaymentMethod::StoreCredit
+ session_required: false
+ bill_address:
+ id: addr_EfhxLZ9ck8
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 292 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_302
+ state_abbr: STATE_ABBR_302
+ state_name: STATE_NAME_302
+ ship_address:
+ id: addr_VqXmZF31wY
+ firstname: John
+ lastname: Doe
+ full_name: John Doe
+ address1: 293 Lovely Street
+ address2: Northwest
+ city: Herndon
+ zipcode: '35005'
+ phone: 555-555-0199
+ company: Company
+ country_name: United States of America
+ country_iso: US
+ state_text: STATE_ABBR_303
+ state_abbr: STATE_ABBR_303
+ state_name: STATE_NAME_303
+ payment_methods:
+ - id: pm_UkLWZg9DAJ
+ name: Store Credit
+ description: Store Credit
+ type: Spree::PaymentMethod::StoreCredit
+ session_required: false
+ schema:
+ "$ref": "#/components/schemas/StoreOrder"
+ '422':
+ description: no store credit available
content:
application/json:
example:
error:
- code: record_not_found
- message: Shipment not found
+ code: processing_error
+ message: User does not have any Store Credits available
schema:
"$ref": "#/components/schemas/ErrorResponse"
- patch:
- summary: Select shipping rate for shipment
+ requestBody:
+ content:
+ application/json:
+ schema:
+ type: object
+ properties:
+ amount:
+ type: number
+ example: 10.0
+ description: Amount to apply (optional - defaults to max available)
+ delete:
+ summary: Remove store credit
tags:
- - Shipments
+ - Checkout
security:
- api_key: []
bearer_auth: []
- description: Selects a shipping rate for the shipment
+ description: Removes store credit from the order
parameters:
- name: x-spree-api-key
in: header
@@ -5580,37 +5604,30 @@ paths:
type: string
- name: Authorization
in: header
- required: false
- schema:
- type: string
- - name: order_id
- in: path
required: true
schema:
type: string
- - name: id
+ - name: order_id
in: path
required: true
- description: Shipment ID
schema:
type: string
- - name: token
+ - name: order_token
in: query
required: false
- description: Order token for guest access
schema:
type: string
responses:
'200':
- description: shipping rate selected, returns updated order
+ description: store credit removed
content:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R144752355
- state: delivery
- token: 1oyQ9qui1qwcVDF85XCK7XYZjevgBCNda6n
+ number: R937562069
+ state: cart
+ token: 4PgVviSf1B8taR99rrjsepbkDVPiKx6DGbS
special_instructions:
currency: USD
item_count: 1
@@ -5633,15 +5650,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-18T15:38:55.902Z'
- updated_at: '2026-02-18T15:38:56.014Z'
+ created_at: '2026-02-19T12:53:14.888Z'
+ updated_at: '2026-02-19T12:53:14.993Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 111604
- slug: product-111604
+ currency: USD
+ name: Product 1095183
+ slug: product-1095183
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -5660,37 +5678,37 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-18T15:38:55.957Z'
- updated_at: '2026-02-18T15:38:55.957Z'
+ created_at: '2026-02-19T12:53:14.950Z'
+ updated_at: '2026-02-19T12:53:14.950Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H37851186338
+ number: H07331985578
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-18T15:38:55.968Z'
- updated_at: '2026-02-18T15:38:56.012Z'
+ created_at: '2026-02-19T12:53:14.962Z'
+ updated_at: '2026-02-19T12:53:14.983Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_314
- name: Tyesha Johnston
+ state_abbr: STATE_ABBR_308
+ name: Ardell Gutkowski
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_314
+ state_text: STATE_ABBR_308
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -5708,7 +5726,7 @@ paths:
firstname: John
lastname: Doe
full_name: John Doe
- address1: 306 Lovely Street
+ address1: 300 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -5716,15 +5734,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_316
- state_abbr: STATE_ABBR_316
- state_name: STATE_NAME_316
+ state_text: STATE_ABBR_310
+ state_abbr: STATE_ABBR_310
+ state_name: STATE_NAME_310
ship_address:
id: addr_VqXmZF31wY
firstname: John
lastname: Doe
full_name: John Doe
- address1: 307 Lovely Street
+ address1: 301 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -5732,34 +5750,12 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_317
- state_abbr: STATE_ABBR_317
- state_name: STATE_NAME_317
+ state_text: STATE_ABBR_311
+ state_abbr: STATE_ABBR_311
+ state_name: STATE_NAME_311
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
- '404':
- description: shipping rate not found
- content:
- application/json:
- example:
- error:
- code: record_not_found
- message: Shipping rate not found
- schema:
- "$ref": "#/components/schemas/ErrorResponse"
- requestBody:
- content:
- application/json:
- schema:
- type: object
- properties:
- selected_shipping_rate_id:
- type: string
- example: shprt_abc123
- description: Shipping rate ID to select
- required:
- - selected_shipping_rate_id
"/api/v3/store/store":
get:
summary: Get current store
@@ -5794,8 +5790,8 @@ paths:
instagram: spreecommerce
customer_support_email: [email protected]
default_locale: en
- created_at: '2026-02-18T15:37:49.418Z'
- updated_at: '2026-02-18T15:37:49.580Z'
+ created_at: '2026-02-19T12:52:09.108Z'
+ updated_at: '2026-02-19T12:52:09.278Z'
default_country_iso: US
supported_currencies:
- USD
@@ -5823,7 +5819,7 @@ paths:
get:
summary: List taxonomies
tags:
- - Taxonomies
+ - Taxons
security:
- api_key: []
description: Returns a list of taxonomies (category hierarchies) for the current
@@ -5860,32 +5856,32 @@ paths:
- id: txnmy_UkLWZg9DAJ
name: Categories
position: 1
- created_at: '2026-02-18T15:37:49.440Z'
- updated_at: '2026-02-18T15:37:49.497Z'
+ created_at: '2026-02-19T12:52:09.127Z'
+ updated_at: '2026-02-19T12:52:09.194Z'
root_id: txn_UkLWZg9DAJ
- id: txnmy_gbHJdmfrXB
name: Brands
position: 2
- created_at: '2026-02-18T15:37:49.498Z'
- updated_at: '2026-02-18T15:37:49.508Z'
+ created_at: '2026-02-19T12:52:09.195Z'
+ updated_at: '2026-02-19T12:52:09.206Z'
root_id: txn_gbHJdmfrXB
- id: txnmy_EfhxLZ9ck8
name: Collections
position: 3
- created_at: '2026-02-18T15:37:49.510Z'
- updated_at: '2026-02-18T15:37:49.582Z'
+ created_at: '2026-02-19T12:52:09.207Z'
+ updated_at: '2026-02-19T12:52:09.281Z'
root_id: txn_EfhxLZ9ck8
- id: txnmy_VqXmZF31wY
name: taxonomy_11
position: 4
- created_at: '2026-02-18T15:38:56.742Z'
- updated_at: '2026-02-18T15:38:56.752Z'
+ created_at: '2026-02-19T12:53:15.051Z'
+ updated_at: '2026-02-19T12:53:15.061Z'
root_id: txn_OIJLhNcSbf
- id: txnmy_uw2YK1rnl0
name: taxonomy_12
position: 5
- created_at: '2026-02-18T15:38:56.754Z'
- updated_at: '2026-02-18T15:38:56.761Z'
+ created_at: '2026-02-19T12:53:15.062Z'
+ updated_at: '2026-02-19T12:53:15.072Z'
root_id: txn_AXs1igzRC6
meta:
page: 1
@@ -5920,7 +5916,7 @@ paths:
get:
summary: Get a taxonomy
tags:
- - Taxonomies
+ - Taxons
security:
- api_key: []
description: Returns a single taxonomy with its taxon tree
@@ -5951,8 +5947,8 @@ paths:
id: txnmy_VqXmZF31wY
name: taxonomy_17
position: 4
- created_at: '2026-02-18T15:38:57.021Z'
- updated_at: '2026-02-18T15:38:57.030Z'
+ created_at: '2026-02-19T12:53:15.365Z'
+ updated_at: '2026-02-19T12:53:15.376Z'
root_id: txn_OIJLhNcSbf
schema:
"$ref": "#/components/schemas/StoreTaxonomy"
@@ -5966,6 +5962,233 @@ paths:
message: Taxonomy not found
schema:
"$ref": "#/components/schemas/ErrorResponse"
+ "/api/v3/store/taxons":
+ get:
+ summary: List taxons
+ tags:
+ - Taxons
+ security:
+ - api_key: []
+ description: Returns a paginated list of taxons (categories) for the current
+ store
+ parameters:
+ - name: x-spree-api-key
+ in: header
+ required: true
+ schema:
+ type: string
+ - name: page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: per_page
+ in: query
+ required: false
+ schema:
+ type: integer
+ - name: q[name_cont]
+ in: query
+ required: false
+ description: Filter by name
+ schema:
+ type: string
+ responses:
+ '200':
+ description: taxons found
+ content:
+ application/json:
+ example:
+ data:
+ - id: txn_UkLWZg9DAJ
+ name: Categories
+ permalink: categories
+ position: 0
+ depth: 0
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 0
+ created_at: '2026-02-19T12:52:09.180Z'
+ updated_at: '2026-02-19T12:52:09.192Z'
+ parent_id:
+ taxonomy_id: txnmy_UkLWZg9DAJ
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: true
+ is_child: false
+ is_leaf: true
+ - id: txn_gbHJdmfrXB
+ name: Brands
+ permalink: brands
+ position: 0
+ depth: 0
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 0
+ created_at: '2026-02-19T12:52:09.199Z'
+ updated_at: '2026-02-19T12:52:09.203Z'
+ parent_id:
+ taxonomy_id: txnmy_gbHJdmfrXB
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: true
+ is_child: false
+ is_leaf: true
+ - id: txn_EfhxLZ9ck8
+ name: Collections
+ permalink: collections
+ position: 0
+ depth: 0
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 2
+ created_at: '2026-02-19T12:52:09.211Z'
+ updated_at: '2026-02-19T12:52:09.280Z'
+ parent_id:
+ taxonomy_id: txnmy_EfhxLZ9ck8
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: true
+ is_child: false
+ is_leaf: false
+ - id: txn_VqXmZF31wY
+ name: On sale
+ permalink: collections/on-sale
+ position: 0
+ depth: 1
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 0
+ created_at: '2026-02-19T12:52:09.225Z'
+ updated_at: '2026-02-19T12:52:09.227Z'
+ parent_id: txn_EfhxLZ9ck8
+ taxonomy_id: txnmy_EfhxLZ9ck8
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: false
+ is_child: true
+ is_leaf: true
+ - id: txn_uw2YK1rnl0
+ name: New arrivals
+ permalink: collections/new-arrivals
+ position: 0
+ depth: 1
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 0
+ created_at: '2026-02-19T12:52:09.237Z'
+ updated_at: '2026-02-19T12:52:09.239Z'
+ parent_id: txn_EfhxLZ9ck8
+ taxonomy_id: txnmy_EfhxLZ9ck8
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: false
+ is_child: true
+ is_leaf: true
+ - id: txn_OIJLhNcSbf
+ name: taxonomy_26
+ permalink: taxonomy-26
+ position: 0
+ depth: 0
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 1
+ created_at: '2026-02-19T12:53:15.788Z'
+ updated_at: '2026-02-19T12:53:15.823Z'
+ parent_id:
+ taxonomy_id: txnmy_VqXmZF31wY
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: true
+ is_child: false
+ is_leaf: false
+ - id: txn_AXs1igzRC6
+ name: taxon_11
+ permalink: taxonomy-26/taxon-11
+ position: 0
+ depth: 1
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 1
+ created_at: '2026-02-19T12:53:15.803Z'
+ updated_at: '2026-02-19T12:53:15.823Z'
+ parent_id: txn_OIJLhNcSbf
+ taxonomy_id: txnmy_VqXmZF31wY
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: false
+ is_child: true
+ is_leaf: false
+ - id: txn_p6klVeMgbn
+ name: taxon_12
+ permalink: taxonomy-26/taxon-11/taxon-12
+ position: 0
+ depth: 2
+ meta_title:
+ meta_description:
+ meta_keywords:
+ children_count: 0
+ created_at: '2026-02-19T12:53:15.812Z'
+ updated_at: '2026-02-19T12:53:15.821Z'
+ parent_id: txn_AXs1igzRC6
+ taxonomy_id: txnmy_VqXmZF31wY
+ description: ''
+ description_html: ''
+ image_url:
+ square_image_url:
+ is_root: false
+ is_child: true
+ is_leaf: true
+ meta:
+ page: 1
+ limit: 25
+ count: 8
+ pages: 1
+ from: 1
+ to: 8
+ in: 8
+ previous:
+ next:
+ schema:
+ type: object
+ properties:
+ data:
+ type: array
+ items:
+ "$ref": "#/components/schemas/StoreTaxon"
+ meta:
+ "$ref": "#/components/schemas/PaginationMeta"
+ '401':
+ description: unauthorized
+ content:
+ application/json:
+ example:
+ error:
+ code: invalid_token
+ message: Valid API key required
+ schema:
+ "$ref": "#/components/schemas/ErrorResponse"
"/api/v3/store/taxons/{id}":
get:
summary: Get a taxon
@@ -6000,16 +6223,16 @@ paths:
application/json:
example:
id: txn_AXs1igzRC6
- name: taxon_14
- permalink: taxonomy-28/taxon-14
+ name: taxon_20
+ permalink: taxonomy-32/taxon-20
position: 0
depth: 1
meta_title:
meta_description:
meta_keywords:
children_count: 1
- created_at: '2026-02-18T15:38:57.636Z'
- updated_at: '2026-02-18T15:38:57.656Z'
+ created_at: '2026-02-19T12:53:16.311Z'
+ updated_at: '2026-02-19T12:53:16.328Z'
parent_id: txn_OIJLhNcSbf
taxonomy_id: txnmy_VqXmZF31wY
description: ''
@@ -6080,9 +6303,9 @@ paths:
data:
- id: wl_UkLWZg9DAJ
name: My Wishlist
- token: 5BgfJPiMCemnkZSJG7eGCrqv
- created_at: '2026-02-18T15:38:58.986Z'
- updated_at: '2026-02-18T15:38:58.986Z'
+ token: N4ET1NhPVDHwTF4ci67AzbBt
+ created_at: '2026-02-19T12:53:17.589Z'
+ updated_at: '2026-02-19T12:53:17.589Z'
is_default: false
is_private: true
meta:
@@ -6141,9 +6364,9 @@ paths:
example:
id: wl_gbHJdmfrXB
name: Birthday Ideas
- token: 4Z5vgBZKBHxUQDNfntGz2QHC
- created_at: '2026-02-18T15:39:00.355Z'
- updated_at: '2026-02-18T15:39:00.355Z'
+ token: BDmpHTJ8vjbSJqb2kk4k3oP9
+ created_at: '2026-02-19T12:53:18.937Z'
+ updated_at: '2026-02-19T12:53:18.937Z'
is_default: false
is_private: true
schema:
@@ -6216,9 +6439,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: My Wishlist
- token: WzbN6m2GACb6wzZnRgWw7D57
- created_at: '2026-02-18T15:39:01.533Z'
- updated_at: '2026-02-18T15:39:01.533Z'
+ token: QYfDpxuBFSwUU15K3U4CdyGh
+ created_at: '2026-02-19T12:53:20.139Z'
+ updated_at: '2026-02-19T12:53:20.139Z'
is_default: false
is_private: true
schema:
@@ -6264,9 +6487,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: Updated Name
- token: vDjDXhN94bam9Jna5WijKgu8
- created_at: '2026-02-18T15:39:02.812Z'
- updated_at: '2026-02-18T15:39:02.894Z'
+ token: Tjob443eyPVfZ9i6eag3vFuD
+ created_at: '2026-02-19T12:53:21.406Z'
+ updated_at: '2026-02-19T12:53:21.489Z'
is_default: false
is_private: true
schema:
@@ -6347,18 +6570,18 @@ paths:
variant_id: variant_gbHJdmfrXB
wishlist_id: wl_UkLWZg9DAJ
quantity: 1
- created_at: '2026-02-18T15:39:04.294Z'
- updated_at: '2026-02-18T15:39:04.294Z'
+ created_at: '2026-02-19T12:53:22.805Z'
+ updated_at: '2026-02-19T12:53:22.805Z'
variant:
id: variant_gbHJdmfrXB
product_id: prod_gbHJdmfrXB
- sku: SKU-132
+ sku: SKU-129
is_master: true
options_text: ''
track_inventory: true
image_count: 0
- created_at: '2026-02-18T15:39:04.248Z'
- updated_at: '2026-02-18T15:39:04.270Z'
+ created_at: '2026-02-19T12:53:22.759Z'
+ updated_at: '2026-02-19T12:53:22.782Z'
thumbnail:
purchasable: true
in_stock: false
@@ -6447,36 +6670,18 @@ tags:
description: Store information and settings
- name: Products
description: Product catalog browsing
-- name: Taxonomies
- description: Category hierarchies
- name: Taxons
- description: Individual categories
+ description: Taxonomies and categories
- name: Countries
description: Available shipping countries
- name: Cart
description: Shopping cart management
+- name: Checkout
+ description: Checkout flow and order updates
- name: Orders
- description: Order management and checkout
-- name: Line Items
- description: Cart item management
-- name: Coupon Codes
- description: Coupon code and gift card management
-- name: Payments
- description: Payment processing
-- name: Payment Sessions
- description: Provider-agnostic payment session management
-- name: Payment Methods
- description: Available payment options
-- name: Shipments
- description: Shipping and delivery
+ description: Order lookup
- name: Customers
- description: Customer account management
-- name: Addresses
- description: Customer address book
-- name: Credit Cards
- description: Saved payment methods
-- name: Payment Setup Sessions
- description: Save payment methods for future use via gateway-agnostic setup sessions
+ description: Customer account, addresses, saved payment methods, and order history
- name: Wishlists
description: Customer wishlists
- name: Digitals
@@ -6489,25 +6694,20 @@ x-tagGroups:
- name: Catalog
tags:
- Products
- - Taxonomies
- Taxons
-- name: Checkout
+- name: Cart
tags:
- Cart
+- name: Checkout
+ tags:
+ - Checkout
+- name: Orders
+ tags:
- Orders
- - Line Items
- - Coupon Codes
- - Payments
- - Payment Sessions
- - Payment Methods
- - Shipments
- name: Customer
tags:
- Authentication
- Customers
- - Addresses
- - Credit Cards
- - Payment Setup Sessions
- Wishlists
- Digitals
components:
@@ -7501,6 +7701,8 @@ components:
type: string
quantity:
type: number
+ currency:
+ type: string
name:
type: string
slug:
@@ -7565,6 +7767,7 @@ components:
- id
- variant_id
- quantity
+ - currency
- name
- slug
- options_text
@@ -7969,8 +8172,7 @@ components:
type: string
nullable: true
public_metadata:
- allOf:
- - "$ref": "#/components/schemas/Record<string, unknown>"
+ type: object
nullable: true
x-typelizer: true
required:
diff --git a/packages/next/CHANGELOG.md b/packages/next/CHANGELOG.md
index da88dd8ba6..ddd6428b92 100644
--- a/packages/next/CHANGELOG.md
+++ b/packages/next/CHANGELOG.md
@@ -1,5 +1,14 @@
# @spree/next
+## 0.3.0
+
+### Minor Changes
+
+- **Breaking:** Update to match @spree/sdk 0.3.0 Store API restructure
+ - `listOrders()` now calls `GET /customer/orders` (was `GET /orders`) — requires authenticated customer
+ - `getOrCreateCart()` now creates carts via `POST /cart` (was `POST /orders`)
+- Bump `@spree/sdk` peer dependency to `>=0.3.0`
+
## 0.2.4
### Patch Changes
diff --git a/packages/next/package.json b/packages/next/package.json
index c1275d9b38..708d504f59 100644
--- a/packages/next/package.json
+++ b/packages/next/package.json
@@ -1,6 +1,6 @@
{
"name": "@spree/next",
- "version": "0.2.4",
+ "version": "0.3.0",
"description": "Next.js integration for Spree Commerce — server actions, caching, and cookie-based auth",
"type": "module",
"main": "./dist/index.js",
@@ -55,7 +55,7 @@
"url": "https://github.com/spree/spree/issues"
},
"peerDependencies": {
- "@spree/sdk": ">=0.2.5",
+ "@spree/sdk": ">=0.3.0",
"next": ">=15.0.0",
"react": ">=19.0.0"
},
diff --git a/packages/next/src/actions/orders.ts b/packages/next/src/actions/orders.ts
index 0f50134cb7..47370473cb 100644
--- a/packages/next/src/actions/orders.ts
+++ b/packages/next/src/actions/orders.ts
@@ -11,7 +11,7 @@ export async function listOrders(
params?: Record<string, unknown>
): Promise<PaginatedResponse<StoreOrder>> {
return withAuthRefresh(async (options) => {
- return getClient().store.orders.list(params, options);
+ return getClient().store.customer.orders.list(params, options);
});
}
diff --git a/packages/next/tests/actions/orders.test.ts b/packages/next/tests/actions/orders.test.ts
index 448b8985cd..210b8f1967 100644
--- a/packages/next/tests/actions/orders.test.ts
+++ b/packages/next/tests/actions/orders.test.ts
@@ -5,9 +5,13 @@ import { initSpreeNext, resetClient } from '../../src/config';
const mockClient = {
store: {
orders: {
- list: vi.fn(),
get: vi.fn(),
},
+ customer: {
+ orders: {
+ list: vi.fn(),
+ },
+ },
auth: {
refresh: vi.fn(),
},
@@ -47,11 +51,11 @@ describe('order actions', () => {
data: [{ id: '1', number: 'R001' }],
meta: { total_count: 1, total_pages: 1 },
};
- mockClient.store.orders.list.mockResolvedValue(mockResponse);
+ mockClient.store.customer.orders.list.mockResolvedValue(mockResponse);
const result = await listOrders({ page: 1 });
expect(result).toEqual(mockResponse);
- expect(mockClient.store.orders.list).toHaveBeenCalledWith(
+ expect(mockClient.store.customer.orders.list).toHaveBeenCalledWith(
{ page: 1 },
expect.objectContaining({ token: expect.any(String) })
);
@@ -59,11 +63,11 @@ describe('order actions', () => {
it('works without params', async () => {
const mockResponse = { data: [], meta: { total_count: 0, total_pages: 0 } };
- mockClient.store.orders.list.mockResolvedValue(mockResponse);
+ mockClient.store.customer.orders.list.mockResolvedValue(mockResponse);
const result = await listOrders();
expect(result).toEqual(mockResponse);
- expect(mockClient.store.orders.list).toHaveBeenCalledWith(
+ expect(mockClient.store.customer.orders.list).toHaveBeenCalledWith(
undefined,
expect.objectContaining({ token: expect.any(String) })
);
diff --git a/packages/sdk/CHANGELOG.md b/packages/sdk/CHANGELOG.md
index 780bd8599a..3293107744 100644
--- a/packages/sdk/CHANGELOG.md
+++ b/packages/sdk/CHANGELOG.md
@@ -1,5 +1,18 @@
# @spree/sdk
+## 0.3.0
+
+### Minor Changes
+
+- **Breaking:** Restructure Store API endpoints for Cart, Checkout & Orders
+ - Cart creation moved from `POST /orders` to `POST /cart` — use `client.store.cart.create()` instead of `client.store.orders.create()`
+ - Customer order history moved from `GET /orders` to `GET /customer/orders` — use `client.store.customer.orders.list()` instead of `client.store.orders.list()`
+ - `orders.create()` removed — use `cart.create()` instead
+ - `orders.list()` removed — use `customer.orders.list()` instead
+ - Orders namespace now focuses on individual order management and checkout: `get`, `update`, `next`, `advance`, `complete`, plus nested resources (lineItems, payments, shipments, etc.)
+- Add `customer.orders.list()` method for fetching authenticated customer's order history
+- Add Payment Setup Sessions support: `client.store.customer.paymentSetupSessions` with `create`, `get`, and `complete` methods for saving payment methods for future use
+
## 0.2.5
### Patch Changes
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index 9e32c446aa..2562d15f1a 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -1,6 +1,6 @@
{
"name": "@spree/sdk",
- "version": "0.2.5",
+ "version": "0.3.0",
"description": "Official TypeScript SDK for Spree Commerce API",
"type": "module",
"main": "./dist/index.cjs",
diff --git a/packages/sdk/src/store-client.ts b/packages/sdk/src/store-client.ts
index 18ffbe7204..01528f8934 100644
--- a/packages/sdk/src/store-client.ts
+++ b/packages/sdk/src/store-client.ts
@@ -239,10 +239,10 @@ export class StoreClient {
this.request<StoreOrder & { token: string }>('GET', '/cart', options),
/**
- * Create a new cart (alias for orders.create)
+ * Create a new cart
*/
create: (options?: RequestOptions): Promise<StoreOrder & { token: string }> =>
- this.request<StoreOrder & { token: string }>('POST', '/orders', options),
+ this.request<StoreOrder & { token: string }>('POST', '/cart', options),
/**
* Associate a guest cart with the currently authenticated user
@@ -254,28 +254,10 @@ export class StoreClient {
};
// ============================================
- // Orders (all orders - complete and incomplete)
+ // Orders (individual order management & checkout)
// ============================================
readonly orders = {
- /**
- * List orders for the authenticated customer
- */
- list: (
- params?: OrderListParams,
- options?: RequestOptions
- ): Promise<PaginatedResponse<StoreOrder>> =>
- this.request<PaginatedResponse<StoreOrder>>('GET', '/orders', {
- ...options,
- params: params as Record<string, string | number | undefined>,
- }),
-
- /**
- * Create a new order (cart)
- */
- create: (options?: RequestOptions): Promise<StoreOrder & { order_token: string }> =>
- this.request<StoreOrder & { order_token: string }>('POST', '/orders', options),
-
/**
* Get an order by ID or number
*/
@@ -730,6 +712,23 @@ export class StoreClient {
this.request<StoreGiftCard>('GET', `/customer/gift_cards/${id}`, options),
},
+ /**
+ * Nested resource: Orders (customer order history)
+ */
+ orders: {
+ /**
+ * List orders for the authenticated customer
+ */
+ list: (
+ params?: OrderListParams,
+ options?: RequestOptions
+ ): Promise<PaginatedResponse<StoreOrder>> =>
+ this.request<PaginatedResponse<StoreOrder>>('GET', '/customer/orders', {
+ ...options,
+ params: params as Record<string, string | number | undefined>,
+ }),
+ },
+
/**
* Nested resource: Payment Setup Sessions (save payment methods for future use)
*/
diff --git a/packages/sdk/tests/cart.test.ts b/packages/sdk/tests/cart.test.ts
index 65317efb5d..2ea40f9ef7 100644
--- a/packages/sdk/tests/cart.test.ts
+++ b/packages/sdk/tests/cart.test.ts
@@ -23,7 +23,7 @@ describe('cart', () => {
describe('create', () => {
it('creates a new cart', async () => {
const result = await client.store.cart.create();
- expect(result.token).toBeDefined();
+ expect(result.token).toBe('new-cart-token');
});
});
diff --git a/packages/sdk/tests/countries.test.ts b/packages/sdk/tests/countries.test.ts
new file mode 100644
index 0000000000..be9787772c
--- /dev/null
+++ b/packages/sdk/tests/countries.test.ts
@@ -0,0 +1,26 @@
+import { describe, it, expect, beforeAll } from 'vitest';
+import { createTestClient } from './helpers';
+import { fixtures } from './mocks/handlers';
+import type { SpreeClient } from '../src';
+
+describe('countries', () => {
+ let client: SpreeClient;
+ beforeAll(() => { client = createTestClient(); });
+
+ describe('list', () => {
+ it('returns available countries', async () => {
+ const result = await client.store.countries.list();
+
+ expect(result.data).toHaveLength(1);
+ expect(result.data[0].iso).toBe('US');
+ });
+ });
+
+ describe('get', () => {
+ it('returns a country by ISO code', async () => {
+ const result = await client.store.countries.get('US');
+ expect(result.name).toBe(fixtures.country.name);
+ expect(result.iso).toBe('US');
+ });
+ });
+});
diff --git a/packages/sdk/tests/customer.test.ts b/packages/sdk/tests/customer.test.ts
index fd5c5d7b89..ce73d5d6ce 100644
--- a/packages/sdk/tests/customer.test.ts
+++ b/packages/sdk/tests/customer.test.ts
@@ -84,6 +84,14 @@ describe('customer', () => {
});
});
+ describe('orders', () => {
+ it('lists customer orders', async () => {
+ const result = await client.store.customer.orders.list(undefined, opts);
+ expect(result.data).toHaveLength(1);
+ expect(result.meta.page).toBe(1);
+ });
+ });
+
describe('giftCards', () => {
it('lists gift cards', async () => {
const result = await client.store.customer.giftCards.list(undefined, opts);
diff --git a/packages/sdk/tests/mocks/handlers.ts b/packages/sdk/tests/mocks/handlers.ts
index 5eb65c854c..beb259cd19 100644
--- a/packages/sdk/tests/mocks/handlers.ts
+++ b/packages/sdk/tests/mocks/handlers.ts
@@ -158,18 +158,20 @@ export const handlers = [
HttpResponse.json({ ...fixtures.order, token: 'guest-order-token' })
),
+ http.post(`${API_PREFIX}/cart`, () =>
+ HttpResponse.json({ ...fixtures.order, token: 'new-cart-token' })
+ ),
+
http.patch(`${API_PREFIX}/cart/associate`, () =>
HttpResponse.json({ ...fixtures.order, token: 'guest-order-token' })
),
- // Orders
- http.get(`${API_PREFIX}/orders`, () =>
+ // Customer Orders
+ http.get(`${API_PREFIX}/customer/orders`, () =>
HttpResponse.json({ data: [fixtures.order], meta: paginationMeta })
),
- http.post(`${API_PREFIX}/orders`, () =>
- HttpResponse.json({ ...fixtures.order, order_token: 'new-order-token' })
- ),
+ // Orders
http.get(`${API_PREFIX}/orders/:id`, () =>
HttpResponse.json(fixtures.order)
diff --git a/packages/sdk/tests/orders.test.ts b/packages/sdk/tests/orders.test.ts
index c7678419bc..a965818956 100644
--- a/packages/sdk/tests/orders.test.ts
+++ b/packages/sdk/tests/orders.test.ts
@@ -7,21 +7,6 @@ describe('orders', () => {
beforeAll(() => { client = createTestClient(); });
const opts = { token: 'user-jwt' };
- describe('list', () => {
- it('returns paginated orders', async () => {
- const result = await client.store.orders.list(undefined, opts);
- expect(result.data).toHaveLength(1);
- expect(result.meta.page).toBe(1);
- });
- });
-
- describe('create', () => {
- it('creates a new order and returns order_token', async () => {
- const result = await client.store.orders.create();
- expect(result.order_token).toBe('new-order-token');
- });
- });
-
describe('get', () => {
it('returns an order by number', async () => {
const result = await client.store.orders.get('R123456', undefined, opts);
diff --git a/packages/sdk/tests/store.test.ts b/packages/sdk/tests/store.test.ts
new file mode 100644
index 0000000000..c59b9bbcc0
--- /dev/null
+++ b/packages/sdk/tests/store.test.ts
@@ -0,0 +1,18 @@
+import { describe, it, expect, beforeAll } from 'vitest';
+import { createTestClient } from './helpers';
+import { fixtures } from './mocks/handlers';
+import type { SpreeClient } from '../src';
+
+describe('store', () => {
+ let client: SpreeClient;
+ beforeAll(() => { client = createTestClient(); });
+
+ describe('get', () => {
+ it('returns store information', async () => {
+ const result = await client.store.store.get();
+
+ expect(result.name).toBe(fixtures.store.name);
+ expect(result.default_currency).toBe('USD');
+ });
+ });
+});
diff --git a/packages/sdk/tests/taxonomies.test.ts b/packages/sdk/tests/taxonomies.test.ts
new file mode 100644
index 0000000000..d370afc70a
--- /dev/null
+++ b/packages/sdk/tests/taxonomies.test.ts
@@ -0,0 +1,26 @@
+import { describe, it, expect, beforeAll } from 'vitest';
+import { createTestClient } from './helpers';
+import { fixtures } from './mocks/handlers';
+import type { SpreeClient } from '../src';
+
+describe('taxonomies', () => {
+ let client: SpreeClient;
+ beforeAll(() => { client = createTestClient(); });
+
+ describe('list', () => {
+ it('returns paginated taxonomies', async () => {
+ const result = await client.store.taxonomies.list();
+
+ expect(result.data).toHaveLength(1);
+ expect(result.data[0].name).toBe('Categories');
+ expect(result.meta.page).toBe(1);
+ });
+ });
+
+ describe('get', () => {
+ it('returns a taxonomy by ID', async () => {
+ const result = await client.store.taxonomies.get('tax_1');
+ expect(result.name).toBe(fixtures.taxonomy.name);
+ });
+ });
+});
diff --git a/packages/sdk/tests/taxons.test.ts b/packages/sdk/tests/taxons.test.ts
new file mode 100644
index 0000000000..a9b96451df
--- /dev/null
+++ b/packages/sdk/tests/taxons.test.ts
@@ -0,0 +1,44 @@
+import { describe, it, expect, beforeAll } from 'vitest';
+import { createTestClient } from './helpers';
+import { fixtures } from './mocks/handlers';
+import type { SpreeClient } from '../src';
+
+describe('taxons', () => {
+ let client: SpreeClient;
+ beforeAll(() => { client = createTestClient(); });
+
+ describe('list', () => {
+ it('returns paginated taxons', async () => {
+ const result = await client.store.taxons.list();
+
+ expect(result.data).toHaveLength(1);
+ expect(result.data[0].name).toBe('Clothing');
+ expect(result.meta.page).toBe(1);
+ });
+
+ it('passes query parameters', async () => {
+ const result = await client.store.taxons.list({
+ 'q[taxonomy_id_eq]': 'tax_1',
+ });
+ expect(result.data).toBeDefined();
+ });
+ });
+
+ describe('get', () => {
+ it('returns a taxon by ID', async () => {
+ const result = await client.store.taxons.get('taxon_1');
+ expect(result.name).toBe(fixtures.taxon.name);
+ });
+
+});
+
+ describe('products', () => {
+ it('lists products in a taxon', async () => {
+ const result = await client.store.taxons.products.list('taxon_1');
+
+ expect(result.data).toHaveLength(1);
+ expect(result.data[0].name).toBe('Test Product');
+ expect(result.meta.page).toBe(1);
+ });
+ });
+});