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.

Deprecate `checkout_zone` on Store in favor of Markets (#13638)

Damian Legawiec52a8364a9d08
diff --git a/backend/engines/admin/app/controllers/spree/admin/markets_controller.rb b/backend/engines/admin/app/controllers/spree/admin/markets_controller.rb
index 2499388c36..b2fab1fca7 100644
--- a/backend/engines/admin/app/controllers/spree/admin/markets_controller.rb
+++ b/backend/engines/admin/app/controllers/spree/admin/markets_controller.rb
@@ -9,7 +9,7 @@ module Spree
protected
def load_data
- @countries = Spree::Country.order(:name)
+ @countries = current_store.countries_with_shipping_coverage
end
def permitted_resource_params
diff --git a/backend/engines/admin/app/controllers/spree/admin/shipping_methods_controller.rb b/backend/engines/admin/app/controllers/spree/admin/shipping_methods_controller.rb
index b471f22ef8..32cb5c78c7 100644
--- a/backend/engines/admin/app/controllers/spree/admin/shipping_methods_controller.rb
+++ b/backend/engines/admin/app/controllers/spree/admin/shipping_methods_controller.rb
@@ -20,7 +20,7 @@ module Spree
end
def load_data
- @available_zones = current_store.supported_shipping_zones
+ @available_zones = Spree::Zone.all
@tax_categories = Spree::TaxCategory.order(:name)
@calculators = Spree::ShippingMethod.calculators
@shipping_categories = Spree::ShippingCategory.all
diff --git a/backend/engines/admin/app/controllers/spree/admin/stores_controller.rb b/backend/engines/admin/app/controllers/spree/admin/stores_controller.rb
index 1a9815f21b..1b0a00e8e3 100644
--- a/backend/engines/admin/app/controllers/spree/admin/stores_controller.rb
+++ b/backend/engines/admin/app/controllers/spree/admin/stores_controller.rb
@@ -7,7 +7,6 @@ module Spree
before_action :normalize_supported_currencies, only: [:update]
before_action :normalize_supported_locales, only: [:update]
before_action :load_all_countries, only: [:edit, :update]
- before_action :load_all_zones, only: [:edit, :update]
def edit
if params[:section] == 'emails'
@@ -62,11 +61,6 @@ module Spree
@countries = Spree::Country.pluck(:name, :id)
end
- def load_all_zones
- @zones = Spree::Zone.pluck(:name, :id)
- @zones.prepend([Spree.t(:no_limits_zone), ' '])
- end
-
def normalize_supported_currencies
if params.dig(:store, :supported_currencies)&.is_a?(Array)
params[:store][:supported_currencies] = params[:store][:supported_currencies].compact.uniq.reject(&:blank?).join(',')
diff --git a/backend/engines/admin/app/views/spree/admin/promotion_rules/forms/_country.html.erb b/backend/engines/admin/app/views/spree/admin/promotion_rules/forms/_country.html.erb
index 411de7e6ad..086633604e 100644
--- a/backend/engines/admin/app/views/spree/admin/promotion_rules/forms/_country.html.erb
+++ b/backend/engines/admin/app/views/spree/admin/promotion_rules/forms/_country.html.erb
@@ -2,6 +2,6 @@
<%= f.label :preferred_country_iso, Spree.t(:country) %>
<%= f.select :preferred_country_iso,
available_countries_iso.map { |iso| [Spree.t(iso, scope: 'country_names', default: iso), iso] },
- { selected: f.object.preferred_country_iso || current_store.default_country_iso },
+ { selected: f.object.preferred_country_iso || current_store.default_market&.default_country&.iso },
{ data: { controller: 'autocomplete-select' } } %>
</div>
diff --git a/backend/engines/admin/app/views/spree/admin/stores/form/_checkout.html.erb b/backend/engines/admin/app/views/spree/admin/stores/form/_checkout.html.erb
index 96e674fab7..36c42c550a 100644
--- a/backend/engines/admin/app/views/spree/admin/stores/form/_checkout.html.erb
+++ b/backend/engines/admin/app/views/spree/admin/stores/form/_checkout.html.erb
@@ -8,15 +8,12 @@
</div>
<div class="card-body">
- <%= f.spree_select :checkout_zone_id, options_for_select(@zones, @store.checkout_zone_id), { label: Spree.t(:shipping_zone), autocomplete: true } %>
- <span class="form-text mb-4">
- <%= Spree.t(:shipping_zone_help) %>
- <%= link_to Spree.t('admin.manage_zones'), spree.admin_zones_path, class: 'text-blue' %>
- </span>
+ <p class="text-muted mb-4">
+ <%= Spree.t('admin.checkout_settings.countries_managed_by_markets_html',
+ link: link_to(Spree.t('admin.markets.list'), spree.admin_markets_path)).html_safe %>
+ </p>
- <%= f.spree_select :default_country_iso, Spree::Country.pluck(:name, :iso).map { |name, iso| ["#{Spree::Country.iso_to_emoji_flag(iso)} #{name}", iso] }, { include_blank: false, label: Spree.t(:default_country), autocomplete: true, help: Spree.t(:default_country_help) } %>
-
- <hr class="my-6" />
+ <hr class="my-6">
<%= f.spree_check_box :preferred_guest_checkout, label: Spree.t('admin.checkout_settings.guest_checkout.label'), help: Spree.t('admin.checkout_settings.guest_checkout.description') %>
<%= f.spree_check_box :preferred_company_field_enabled, label: Spree.t('admin.store_form.company_field.label'), help: Spree.t('admin.store_form.company_field.description') %>
diff --git a/backend/engines/admin/config/locales/en.yml b/backend/engines/admin/config/locales/en.yml
index 30c3d5d943..efadaf82e3 100644
--- a/backend/engines/admin/config/locales/en.yml
+++ b/backend/engines/admin/config/locales/en.yml
@@ -74,6 +74,7 @@ en:
description: Links to these pages will be displayed in the checkout footer.
label: Checkout links
checkout_message_description: Visible to your customers on the checkout page in the right sidebar.
+ countries_managed_by_markets_html: Countries and shipping zones are managed through %{link}.
guest_checkout:
description: Allow customers to checkout without creating an account.
label: Allow guest checkout
diff --git a/backend/engines/admin/spec/controllers/spree/admin/markets_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/markets_controller_spec.rb
index 9720eb12c2..90b867d4cc 100644
--- a/backend/engines/admin/spec/controllers/spree/admin/markets_controller_spec.rb
+++ b/backend/engines/admin/spec/controllers/spree/admin/markets_controller_spec.rb
@@ -5,8 +5,16 @@ RSpec.describe Spree::Admin::MarketsController, type: :controller do
stub_authorization!
let(:store) { @default_store }
+ let(:shipping_zone) do
+ zone = create(:zone, name: 'Test Shipping Zone', kind: 'country')
+ zone.zone_members.create!(zoneable: country)
+ create(:shipping_method, zones: [zone])
+ zone
+ end
let(:country) { create(:country) }
+ before { shipping_zone }
+
describe 'GET #index' do
let!(:market) { create(:market, store: store, countries: [country]) }
diff --git a/backend/engines/admin/spec/controllers/spree/admin/shipping_methods_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
index ea87afe5ff..0437258269 100644
--- a/backend/engines/admin/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
+++ b/backend/engines/admin/spec/controllers/spree/admin/shipping_methods_controller_spec.rb
@@ -20,7 +20,7 @@ describe Spree::Admin::ShippingMethodsController, type: :controller do
get :new
expect(assigns(:shipping_method).display_on).to eq('both')
expect(assigns(:shipping_method).shipping_categories).to eq([shipping_category])
- expect(assigns(:shipping_method).zone_ids).to match_array(store.supported_shipping_zones.map(&:id))
+ expect(assigns(:shipping_method).zone_ids).to match_array(Spree::Zone.pluck(:id))
expect(assigns(:shipping_method).calculator_type).to eq(Spree::ShippingMethod.calculators.first.name)
end
end
diff --git a/backend/engines/admin/spec/controllers/spree/admin/stores_controller_spec.rb b/backend/engines/admin/spec/controllers/spree/admin/stores_controller_spec.rb
index 6406dbc54f..02da09c49d 100644
--- a/backend/engines/admin/spec/controllers/spree/admin/stores_controller_spec.rb
+++ b/backend/engines/admin/spec/controllers/spree/admin/stores_controller_spec.rb
@@ -42,7 +42,6 @@ describe Spree::Admin::StoresController do
{
name: 'New Store Name',
default_currency: 'GBR',
- default_country_iso: 'GB',
default_locale: 'pl',
preferred_timezone: 'Europe/Warsaw',
preferred_weight_unit: 'kg',
@@ -52,16 +51,11 @@ describe Spree::Admin::StoresController do
let(:other_params) { {} }
- before do
- store.update!(checkout_zone: nil)
- end
-
it 'updates the store data' do
subject
expect(store.reload.name).to eq('New Store Name')
expect(store.default_currency).to eq('GBR')
- expect(store.default_country).to eq(uk_country)
expect(store.default_locale).to eq('pl')
expect(store.preferred_timezone).to eq('Europe/Warsaw')
diff --git a/backend/engines/api/app/serializers/spree/api/v3/store_serializer.rb b/backend/engines/api/app/serializers/spree/api/v3/store_serializer.rb
index a7562ebcd2..06044236c0 100644
--- a/backend/engines/api/app/serializers/spree/api/v3/store_serializer.rb
+++ b/backend/engines/api/app/serializers/spree/api/v3/store_serializer.rb
@@ -4,26 +4,17 @@ module Spree
class StoreSerializer < BaseSerializer
typelize name: :string, url: :string, meta_description: [:string, nullable: true],
meta_keywords: [:string, nullable: true], seo_title: [:string, nullable: true],
- default_currency: :string, code: :string, default: :boolean,
+ code: :string,
facebook: [:string, nullable: true], twitter: [:string, nullable: true], instagram: [:string, nullable: true],
- customer_support_email: [:string, nullable: true], default_locale: :string,
- supported_currencies: [:string, multi: true], favicon_image_url: [:string, nullable: true],
- logo_image_url: [:string, nullable: true], social_image_url: [:string, nullable: true],
- supported_locales: [:string, multi: true], default_country_iso: [:string, nullable: true]
+ customer_support_email: [:string, nullable: true],
+ favicon_image_url: [:string, nullable: true],
+ logo_image_url: [:string, nullable: true], social_image_url: [:string, nullable: true]
attributes :name, :url, :meta_description, :meta_keywords, :seo_title,
- :default_currency, :code, :default, :facebook, :twitter,
- :instagram, :customer_support_email, :default_locale,
+ :code, :facebook, :twitter,
+ :instagram, :customer_support_email,
created_at: :iso8601, updated_at: :iso8601
- attribute :default_country_iso do |store|
- store.default_country&.iso
- end
-
- attribute :supported_currencies do |store|
- store.supported_currencies_list.map(&:iso_code)
- end
-
attribute :favicon_image_url do |store|
image_url_for(store.favicon_image)
end
@@ -36,10 +27,6 @@ module Spree
image_url_for(store.social_image)
end
- attribute :supported_locales do |store|
- store.supported_locales_list
- end
-
many :payment_methods,
proc { |payment_methods, _params|
payment_methods.select { |pm| pm.available_on_front_end? && pm.active? }
diff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/stores_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/stores_controller_spec.rb
index 73369f64e6..7d2c21f06b 100644
--- a/backend/engines/api/spec/controllers/spree/api/v3/store/stores_controller_spec.rb
+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/stores_controller_spec.rb
@@ -20,13 +20,7 @@ RSpec.describe Spree::Api::V3::Store::StoresController, type: :controller do
it 'returns store attributes' do
get :show
- expect(json_response).to include('id', 'name', 'url', 'default_currency')
- end
-
- it 'returns store settings' do
- get :show
-
- expect(json_response['default_currency']).to eq(store.default_currency)
+ expect(json_response).to include('id', 'name', 'url', 'code')
end
context 'without API key' do
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/stores_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/stores_spec.rb
index ed045318fd..1754b62bb5 100644
--- a/backend/engines/api/spec/integration/spree/api/v3/store/stores_spec.rb
+++ b/backend/engines/api/spec/integration/spree/api/v3/store/stores_spec.rb
@@ -24,7 +24,6 @@ RSpec.describe 'Store API', type: :request, swagger_doc: 'api-reference/store.ya
expect(data['id']).to be_present
expect(data['name']).to eq(store.name)
expect(data['url']).to eq(store.url)
- expect(data['default_currency']).to eq(store.default_currency)
end
end
diff --git a/backend/engines/core/app/helpers/spree/addresses_helper.rb b/backend/engines/core/app/helpers/spree/addresses_helper.rb
index f734ee5e0d..cf3e285339 100644
--- a/backend/engines/core/app/helpers/spree/addresses_helper.rb
+++ b/backend/engines/core/app/helpers/spree/addresses_helper.rb
@@ -4,8 +4,7 @@ module Spree
def address_form_countries_states_cache_key
@address_form_countries_states_cache_key ||= [
I18n.locale,
- current_store.cache_key_with_version,
- current_store.checkout_zone&.cache_key_with_version
+ current_store.cache_key_with_version
].compact
end
diff --git a/backend/engines/core/app/models/concerns/spree/stores/markets.rb b/backend/engines/core/app/models/concerns/spree/stores/markets.rb
index 67ef94c869..996135ca48 100644
--- a/backend/engines/core/app/models/concerns/spree/stores/markets.rb
+++ b/backend/engines/core/app/models/concerns/spree/stores/markets.rb
@@ -13,6 +13,26 @@ module Spree
@default_market ||= Spree::Market.default_for_store(self)
end
+ # Returns the default country, derived from the default market
+ # @return [Spree::Country, nil]
+ def default_country
+ if has_markets?
+ default_market&.default_country
+ else
+ super
+ end
+ end
+
+ # Returns the default country ID, derived from the default market
+ # @return [Integer, nil]
+ def default_country_id
+ if has_markets?
+ default_country&.id
+ else
+ read_attribute(:default_country_id)
+ end
+ end
+
# Returns the default locale, delegating to the default market when markets exist
# Falls back to the store's own default_locale column
# @return [String, nil]
@@ -50,14 +70,14 @@ module Spree
.order(:name)
end
- # Returns the countries available for checkout, derived from markets or checkout_zone
+ # Returns the countries available for checkout, derived from markets
# @return [Array<Spree::Country>]
def countries_available_for_checkout
@countries_available_for_checkout ||= Rails.cache.fetch(countries_available_for_checkout_cache_key) do
if markets.any?
markets.flat_map(&:countries).uniq.sort_by(&:name)
else
- (checkout_zone.try(:country_list) || Spree::Country.all).to_a
+ Spree::Country.all.to_a
end
end
end
diff --git a/backend/engines/core/app/models/spree/current.rb b/backend/engines/core/app/models/spree/current.rb
index e9227621d0..594199489d 100644
--- a/backend/engines/core/app/models/spree/current.rb
+++ b/backend/engines/core/app/models/spree/current.rb
@@ -15,7 +15,7 @@ module Spree
end
def zone
- super || Spree::Zone.default_tax || store&.checkout_zone
+ super || Spree::Zone.default_tax
end
def price_lists
diff --git a/backend/engines/core/app/models/spree/market.rb b/backend/engines/core/app/models/spree/market.rb
index 4a44b4b803..cce5b28542 100644
--- a/backend/engines/core/app/models/spree/market.rb
+++ b/backend/engines/core/app/models/spree/market.rb
@@ -10,7 +10,7 @@ module Spree
#
# Associations
#
- belongs_to :store, class_name: 'Spree::Store'
+ belongs_to :store, class_name: 'Spree::Store', touch: true
has_many :market_countries, class_name: 'Spree::MarketCountry', dependent: :destroy
has_many :countries, through: :market_countries, class_name: 'Spree::Country'
@@ -58,6 +58,13 @@ module Spree
store.markets.default.first || store.markets.order(:position).first
end
+ # Returns the first country by name from this market's countries
+ #
+ # @return [Spree::Country, nil]
+ def default_country
+ countries.order(:name).first
+ end
+
# Returns supported locales as an array, always including default_locale
#
# @return [Array<String>]
diff --git a/backend/engines/core/app/models/spree/market_country.rb b/backend/engines/core/app/models/spree/market_country.rb
index 5553c7761e..6ffb47c04c 100644
--- a/backend/engines/core/app/models/spree/market_country.rb
+++ b/backend/engines/core/app/models/spree/market_country.rb
@@ -7,5 +7,19 @@ module Spree
validates :market, :country, presence: true
validates :country_id, uniqueness: { scope: :market_id }
+ validate :country_covered_by_shipping_zone
+
+ private
+
+ def country_covered_by_shipping_zone
+ return if market.blank? || country.blank?
+
+ store = market.store
+ return if store.blank?
+
+ unless store.countries_with_shipping_coverage.exists?(id: country.id)
+ errors.add(:country, :not_in_shipping_zone)
+ end
+ end
end
end
diff --git a/backend/engines/core/app/models/spree/promotion/rules/country.rb b/backend/engines/core/app/models/spree/promotion/rules/country.rb
index 22141a940e..de100fca8e 100644
--- a/backend/engines/core/app/models/spree/promotion/rules/country.rb
+++ b/backend/engines/core/app/models/spree/promotion/rules/country.rb
@@ -30,7 +30,7 @@ module Spree
def validate_eligibility_by_country_iso(order)
country_iso = order.ship_address&.country_iso
- return true if country_iso == (preferred_country_iso || order.store.default_country_iso)
+ return true if country_iso == (preferred_country_iso || order.store.default_market&.default_country&.iso)
eligibility_errors.add(:base, eligibility_error_message(:wrong_country))
false
diff --git a/backend/engines/core/app/models/spree/store.rb b/backend/engines/core/app/models/spree/store.rb
index 4ed8d564ee..b6480dd974 100644
--- a/backend/engines/core/app/models/spree/store.rb
+++ b/backend/engines/core/app/models/spree/store.rb
@@ -136,7 +136,7 @@ module Spree
# Validations
#
with_options presence: true do
- validates :name, :url, :mail_from_address, :default_country, :code
+ validates :name, :url, :mail_from_address, :code
end
validates :preferred_digital_asset_authorized_clicks, numericality: { only_integer: true, greater_than: 0 }
validates :preferred_digital_asset_authorized_days, numericality: { only_integer: true, greater_than: 0 }
@@ -160,9 +160,9 @@ module Spree
#
# Callbacks
- before_validation :ensure_default_country
before_validation :set_default_code, on: :create
before_save :ensure_default_exists_and_is_unique
+ after_create :ensure_default_market
after_create :ensure_default_taxonomies_are_created
after_create :ensure_default_automatic_taxons
after_create :ensure_default_post_categories_are_created
@@ -177,7 +177,6 @@ module Spree
#
# Delegations
#
- delegate :iso, to: :default_country, prefix: true, allow_nil: true
def self.current(_url = nil)
Spree::Current.store
@@ -203,6 +202,22 @@ module Spree
Spree::Store.default&.supported_locales_list || []
end
+ # @deprecated Use Markets instead. Will be removed in Spree 5.5.
+ def checkout_zone
+ Spree::Deprecation.warn('Store#checkout_zone is deprecated and will be removed in Spree 5.5. Use Markets instead.')
+ super
+ end
+
+ # @deprecated Use Markets instead. Will be removed in Spree 5.5.
+ def checkout_zone=(zone)
+ Spree::Deprecation.warn('Store#checkout_zone= is deprecated and will be removed in Spree 5.5. Use Markets instead.')
+ super
+ end
+
+ # Virtual attribute — sets the country for the default market created on store creation.
+ # Not persisted on the store itself; only used by the after_create callback.
+ attr_reader :default_country_iso
+
def default_country_iso=(iso)
return if iso.blank?
@@ -210,10 +225,11 @@ module Spree
country = Spree::Country.by_iso(iso)
- if country.present?
- self.default_country = country
- elsif iso_country = ::Country[iso]
- new_country = Spree::Country.create!(
+ unless country
+ iso_country = ::Country[iso]
+ return unless iso_country
+
+ country = Spree::Country.create!(
iso_name: iso_country.local_name&.upcase,
iso: iso_country.alpha2,
iso3: iso_country.alpha3,
@@ -222,9 +238,9 @@ module Spree
states_required: Spree::Address::STATES_REQUIRED.include?(iso),
zipcode_required: !Spree::Address::NO_ZIPCODE_ISO_CODES.include?(iso)
)
-
- self.default_country = new_country
end
+
+ @default_country_for_market = country
end
def seo_meta_description
@@ -276,21 +292,55 @@ module Spree
formatted_url
end
- # Returns the states available for checkout for the store or creates a new one if it doesn't exist
+ # Returns the states available for checkout for the store
# @param country [Spree::Country] the country to get the states for
# @return [Array<Spree::State>]
def states_available_for_checkout(country)
Rails.cache.fetch(states_available_for_checkout_cache_key(country)) do
- (checkout_zone.try(:state_list_for, country) || country.states).to_a
+ country.states.to_a
end
end
+ # @deprecated Use {Spree::Zone.all} or {#countries_with_shipping_coverage} instead.
+ # Will be removed in Spree 5.5.
def supported_shipping_zones
- @supported_shipping_zones ||= if checkout_zone.present?
- [checkout_zone]
- else
- Spree::Zone.includes(zone_members: :zoneable).all
- end
+ Spree::Deprecation.warn(
+ 'Store#supported_shipping_zones is deprecated and will be removed in Spree 5.5. ' \
+ 'Use Spree::Zone.all or Store#countries_with_shipping_coverage instead.'
+ )
+ zone = Spree::Zone.find_by(id: read_attribute(:checkout_zone_id))
+ if zone.present?
+ [zone]
+ else
+ Spree::Zone.includes(zone_members: :zoneable).all
+ end
+ end
+
+ # Returns countries covered by at least one shipping zone
+ # that has an active shipping method attached.
+ # Handles both country-type zones (direct membership) and
+ # state-type zones (country inferred from state).
+ #
+ # @return [ActiveRecord::Relation<Spree::Country>]
+ def countries_with_shipping_coverage
+ zone_ids = Spree::Zone
+ .joins(:shipping_methods)
+ .select(:id)
+
+ country_zone_country_ids = Spree::ZoneMember
+ .where(zone_id: zone_ids, zoneable_type: 'Spree::Country')
+ .select(:zoneable_id)
+
+ state_zone_country_ids = Spree::State
+ .where(id: Spree::ZoneMember
+ .where(zone_id: zone_ids, zoneable_type: 'Spree::State')
+ .select(:zoneable_id))
+ .select(:country_id)
+
+ Spree::Country
+ .where(id: country_zone_country_ids)
+ .or(Spree::Country.where(id: state_zone_country_ids))
+ .order(:name)
end
# Returns the default stock location for the store or creates a new one if it doesn't exist
@@ -339,25 +389,34 @@ module Spree
private
def countries_available_for_checkout_cache_key
- "#{cache_key_with_version}/#{checkout_zone&.cache_key_with_version}/countries_available_for_checkout"
+ "#{cache_key_with_version}/countries_available_for_checkout"
end
def states_available_for_checkout_cache_key(country)
- "#{cache_key_with_version}/#{checkout_zone&.cache_key_with_version}/states_available_for_checkout/#{country&.cache_key_with_version}"
+ "#{cache_key_with_version}/states_available_for_checkout/#{country&.cache_key_with_version}"
end
def clear_cache
Rails.cache.delete('default_store')
end
- def ensure_default_country
- return if default_country.present? && (checkout_zone.blank? || checkout_zone.country_list.blank? || checkout_zone.country_list.include?(default_country))
+ def ensure_default_market
+ return if markets.exists?
- self.default_country = if checkout_zone.present? && checkout_zone.country_list.any?
- checkout_zone.country_list.first
- else
- Country.find_by(iso: 'US') || Country.first
- end
+ country = @default_country_for_market
+ return if country.blank?
+
+ iso_country = ISO3166::Country[country.iso]
+
+ Spree::Events.disable do
+ markets.create!(
+ name: country.name,
+ currency: iso_country&.currency_code || read_attribute(:default_currency) || 'USD',
+ default_locale: iso_country&.languages_official&.first || read_attribute(:default_locale) || 'en',
+ default: true,
+ countries: [country]
+ )
+ end
end
def ensure_default_taxonomies_are_created
diff --git a/backend/engines/core/app/models/spree/zone.rb b/backend/engines/core/app/models/spree/zone.rb
index 238cf1c423..aa15070d9b 100644
--- a/backend/engines/core/app/models/spree/zone.rb
+++ b/backend/engines/core/app/models/spree/zone.rb
@@ -20,7 +20,6 @@ module Spree
after_save :remove_defunct_members
after_save :remove_previous_default, if: %i[default_tax? saved_change_to_default_tax?]
- before_destroy :nullify_checkout_zone
alias members zone_members
accepts_nested_attributes_for :zone_members, allow_destroy: true, reject_if: proc { |a| a['zoneable_id'].blank? }
@@ -200,10 +199,5 @@ module Spree
end
end
- def nullify_checkout_zone
- if id == Spree::Store.current.checkout_zone_id
- Spree::Store.current.update(checkout_zone_id: nil)
- end
- end
end
end
diff --git a/backend/engines/core/app/services/spree/seeds/all.rb b/backend/engines/core/app/services/spree/seeds/all.rb
index 4fdc2c2fd3..2a60d0cf2a 100644
--- a/backend/engines/core/app/services/spree/seeds/all.rb
+++ b/backend/engines/core/app/services/spree/seeds/all.rb
@@ -26,7 +26,6 @@ module Spree
AdminUser.call
# add store resources
- Markets.call
PaymentMethods.call
end
end
diff --git a/backend/engines/core/app/services/spree/seeds/markets.rb b/backend/engines/core/app/services/spree/seeds/markets.rb
deleted file mode 100644
index 13d2ba3029..0000000000
--- a/backend/engines/core/app/services/spree/seeds/markets.rb
+++ /dev/null
@@ -1,28 +0,0 @@
-module Spree
- module Seeds
- class Markets
- prepend Spree::ServiceModule::Base
-
- def call
- Spree::Store.all.each do |store|
- next if store.markets.any?
-
- countries = if store.checkout_zone.present?
- store.checkout_zone.country_list
- else
- Spree::Country.all
- end
- next unless countries.any?
-
- store.markets.create!(
- name: 'Default',
- currency: store.default_currency,
- default_locale: store.default_locale || I18n.locale.to_s,
- default: true,
- countries: countries
- )
- end
- end
- end
- end
-end
diff --git a/backend/engines/core/app/services/spree/seeds/stores.rb b/backend/engines/core/app/services/spree/seeds/stores.rb
index af3bc2d120..65bb839f66 100644
--- a/backend/engines/core/app/services/spree/seeds/stores.rb
+++ b/backend/engines/core/app/services/spree/seeds/stores.rb
@@ -6,9 +6,7 @@ module Spree
def call
default_store = Spree::Store.default
- if default_store.persisted?
- default_store.update!(default_country: Spree::Country.find_by(iso: 'US') || Spree::Country.first)
- else
+ unless default_store.persisted?
Spree::Store.new do |s|
s.name = 'Shop'
s.code = 'shop'
@@ -16,7 +14,7 @@ module Spree
s.mail_from_address = '[email protected]'
s.customer_support_email = '[email protected]'
s.default_currency = 'USD'
- s.default_country = Spree::Country.find_by(iso: 'US') || Spree::Country.first
+ s.default_country_iso = 'US'
s.default_locale = I18n.locale
end.save!
end
diff --git a/backend/engines/core/config/locales/en.yml b/backend/engines/core/config/locales/en.yml
index 8e31fb8f46..8bae23cfb0 100644
--- a/backend/engines/core/config/locales/en.yml
+++ b/backend/engines/core/config/locales/en.yml
@@ -292,6 +292,10 @@ en:
attributes:
currency:
must_match_order_currency: Must match order currency
+ spree/market_country:
+ attributes:
+ country:
+ not_in_shipping_zone: is not covered by any shipping zone. Please set up a shipping zone first.
spree/payment:
attributes:
amount:
diff --git a/backend/engines/core/lib/spree/core/controller_helpers/store.rb b/backend/engines/core/lib/spree/core/controller_helpers/store.rb
index 04dca5f9db..f14600a4d8 100644
--- a/backend/engines/core/lib/spree/core/controller_helpers/store.rb
+++ b/backend/engines/core/lib/spree/core/controller_helpers/store.rb
@@ -61,7 +61,7 @@ module Spree
def current_tax_zone
@current_tax_zone ||= begin
- zone = @current_order&.tax_zone || Spree::Zone.default_tax || current_store.checkout_zone
+ zone = @current_order&.tax_zone || Spree::Zone.default_tax
Spree::Current.zone = zone
zone
end
diff --git a/backend/engines/core/lib/spree/core/pricing/context.rb b/backend/engines/core/lib/spree/core/pricing/context.rb
index 647d88c9ba..e8d7dc568f 100644
--- a/backend/engines/core/lib/spree/core/pricing/context.rb
+++ b/backend/engines/core/lib/spree/core/pricing/context.rb
@@ -38,7 +38,7 @@ module Spree
variant: variant,
currency: order.currency,
store: order.store,
- zone: order.tax_zone || order.store.checkout_zone,
+ zone: order.tax_zone || Spree::Zone.default_tax,
user: order.user,
quantity: quantity || order.line_items.find_by(variant: variant)&.quantity,
order: order
diff --git a/backend/engines/core/lib/spree/permitted_attributes.rb b/backend/engines/core/lib/spree/permitted_attributes.rb
index e4fa1686b1..c6020bf34c 100644
--- a/backend/engines/core/lib/spree/permitted_attributes.rb
+++ b/backend/engines/core/lib/spree/permitted_attributes.rb
@@ -275,10 +275,10 @@ module Spree
stock_movements_attributes: [:variant_id, :quantity, :originator_id, :stock_item_id]]
@@store_attributes = [:name, :url, :seo_title, :code, :meta_keywords,
- :meta_description, :default_currency, :mail_from_address,
+ :meta_description, :default_currency, :default_country_iso, :mail_from_address,
:customer_support_email, :description, :address, :contact_phone,
- :supported_locales, :default_locale, :default_country_id, :supported_currencies,
- :new_order_notifications_email, :checkout_zone_id, :seo_robots,
+ :supported_locales, :default_locale, :supported_currencies,
+ :new_order_notifications_email, :seo_robots,
:preferred_admin_locale, :preferred_timezone, :preferred_weight_unit, :preferred_unit_system,
:preferred_digital_asset_authorized_clicks, :preferred_digital_asset_authorized_days,
:preferred_limit_digital_download_count, :preferred_limit_digital_download_days,
@@ -286,7 +286,7 @@ module Spree
:logo, :mailer_logo, :social_logo, :favicon_image,
:checkout_message, :preferred_guest_checkout,
:customer_terms_of_service, :customer_privacy_policy,
- :customer_returns_policy, :customer_shipping_policy, :default_country_iso]
+ :customer_returns_policy, :customer_shipping_policy]
@@store_credit_attributes = %i[amount currency category_id memo]
diff --git a/backend/engines/core/lib/spree/testing_support/factories/market_factory.rb b/backend/engines/core/lib/spree/testing_support/factories/market_factory.rb
index 2a7552354e..8dd3e0480c 100644
--- a/backend/engines/core/lib/spree/testing_support/factories/market_factory.rb
+++ b/backend/engines/core/lib/spree/testing_support/factories/market_factory.rb
@@ -6,6 +6,21 @@ FactoryBot.define do
store
countries { [association(:country)] }
+ after(:build) do |market|
+ if market.countries.any?
+ zone = Spree::Zone.find_or_create_by!(name: 'Test Shipping Zone') do |z|
+ z.kind = 'country'
+ end
+ market.countries.each do |country|
+ zone.zone_members.find_or_create_by!(zoneable: country)
+ end
+ if zone.shipping_methods.empty?
+ shipping_category = Spree::ShippingCategory.first || FactoryBot.create(:shipping_category)
+ FactoryBot.create(:shipping_method, zones: [zone], shipping_categories: [shipping_category])
+ end
+ end
+ end
+
trait :default do
default { true }
end
diff --git a/backend/engines/core/lib/spree/testing_support/store.rb b/backend/engines/core/lib/spree/testing_support/store.rb
index 871ddac659..57326ef037 100644
--- a/backend/engines/core/lib/spree/testing_support/store.rb
+++ b/backend/engines/core/lib/spree/testing_support/store.rb
@@ -18,7 +18,8 @@ RSpec.configure do |config|
I18n.with_locale(:en) do
Spree::Events.disable do
@default_country = Spree::Country.find_by(iso: 'US') || FactoryBot.create(:country_us)
- @default_store = Spree::Store.find_by(default: true) || FactoryBot.create(:store, default: true, default_country: @default_country, default_currency: 'USD')
+ @default_store = Spree::Store.find_by(default: true) || FactoryBot.create(:store, default: true, default_currency: 'USD')
+ @default_store.update_column(:default_country_id, @default_country.id) unless @default_store.read_attribute(:default_country_id) == @default_country.id
end
end
end
@@ -28,7 +29,7 @@ RSpec.configure do |config|
unless self.class.metadata[:without_global_store]
@default_store&.products = []
@default_store&.promotions = []
- @default_store&.checkout_zone = nil
+ @default_store&.update_column(:checkout_zone_id, nil) if @default_store&.read_attribute(:checkout_zone_id).present?
@default_store&.payment_methods = []
end
end
diff --git a/backend/engines/core/lib/tasks/markets.rake b/backend/engines/core/lib/tasks/markets.rake
index 8eb5110c0c..cca3678b01 100644
--- a/backend/engines/core/lib/tasks/markets.rake
+++ b/backend/engines/core/lib/tasks/markets.rake
@@ -1,26 +1,39 @@
namespace :spree do
namespace :markets do
- desc 'Create default markets for stores that do not have any markets'
- task create_defaults: :environment do
+ desc 'Migrate checkout zones to markets and nullify checkout_zone_id'
+ task migrate_checkout_zones: :environment do
Spree::Store.find_each do |store|
next if store.markets.exists?
- zone = store.checkout_zone
- unless zone
- puts " Skipping store '#{store.name}' (#{store.code}) — no checkout zone configured"
+ checkout_zone_id = store.read_attribute(:checkout_zone_id)
+ zone = Spree::Zone.find_by(id: checkout_zone_id) if checkout_zone_id
+
+ countries = if zone
+ zone.country_list.to_a
+ else
+ default_country = Spree::Country.find_by(id: store.read_attribute(:default_country_id))
+ default_country ? [default_country] : []
+ end
+
+ if countries.empty?
+ puts " Skipping store '#{store.name}' (#{store.code}) — no countries to migrate"
next
end
+ primary_country = countries.first
+ iso_country = ISO3166::Country[primary_country.iso] if primary_country
+
market = store.markets.create!(
- name: 'Default',
- currency: store.default_currency,
- zone: zone,
- default_locale: store.default_locale || 'en',
- supported_locales: store.read_attribute(:supported_locales),
- default: true
+ name: primary_country&.name || 'Default',
+ currency: iso_country&.currency_code || store.read_attribute(:default_currency) || 'USD',
+ default_locale: iso_country&.languages_official&.first || store.read_attribute(:default_locale) || 'en',
+ default: true,
+ countries: countries
)
- puts " Created default market '#{market.name}' for store '#{store.name}' (#{store.code})"
+ store.update_column(:checkout_zone_id, nil) if checkout_zone_id
+
+ puts " Created market '#{market.name}' with #{countries.size} countries for store '#{store.name}' (#{store.code})"
end
end
end
diff --git a/backend/engines/core/spec/helpers/base_helper_spec.rb b/backend/engines/core/spec/helpers/base_helper_spec.rb
index e1bbcfde46..1c095bd3a3 100644
--- a/backend/engines/core/spec/helpers/base_helper_spec.rb
+++ b/backend/engines/core/spec/helpers/base_helper_spec.rb
@@ -11,31 +11,24 @@ describe Spree::BaseHelper, type: :helper do
end
context 'available_countries' do
- let(:country) { create(:country) }
-
before do
create_list(:country, 3)
end
- context 'with checkout zone assigned to the store' do
+ context 'with markets' do
+ let!(:country) { create(:country) }
+
before do
- @zone = create(:zone, name: 'No Limits', kind: 'country')
- @zone.members.create(zoneable: country)
- current_store.update(checkout_zone_id: @zone.id)
+ create(:market, store: current_store, countries: [country], currency: 'USD', default: true)
end
- it 'return only the countries defined by the checkout_zone_id' do
+ it 'returns only the countries from markets' do
expect(available_countries).to eq([country])
- expect(current_store.checkout_zone_id).to eq @zone.id
end
end
- context 'with no checkout zone defined' do
- before do
- current_store.update(checkout_zone_id: nil)
- end
-
- it 'return complete list of countries' do
+ context 'without markets' do
+ it 'returns complete list of countries' do
expect(available_countries).to contain_exactly(*Spree::Country.all)
end
end
diff --git a/backend/engines/core/spec/lib/spree/core/controller_helpers/store_spec.rb b/backend/engines/core/spec/lib/spree/core/controller_helpers/store_spec.rb
index 973d51d8ee..ae38b3f189 100644
--- a/backend/engines/core/spec/lib/spree/core/controller_helpers/store_spec.rb
+++ b/backend/engines/core/spec/lib/spree/core/controller_helpers/store_spec.rb
@@ -154,39 +154,14 @@ describe Spree::Core::ControllerHelpers::Store, type: :controller do
end
context 'when there is no current order' do
- context 'when store has a checkout_zone' do
- let(:checkout_zone) { Spree::Zone.new }
-
- before do
- allow(controller).to receive(:current_store).and_return(
- double('Store', checkout_zone: checkout_zone, url: 'test.com')
- )
- end
-
- it 'returns the store checkout_zone' do
- expect(current_price_options[:tax_zone]).to eq(checkout_zone)
- end
-
- it 'sets Spree::Current.zone to the store checkout_zone' do
- subject
- expect(Spree::Current.zone).to eq(checkout_zone)
- end
+ it 'returns nil when asked for the current tax zone' do
+ expect(current_price_options[:tax_zone]).to be_nil
end
- context 'when store has no checkout_zone' do
- before do
- allow(controller.current_store).to receive(:checkout_zone).and_return(nil)
- end
-
- it 'returns nil when asked for the current tax zone' do
- expect(current_price_options[:tax_zone]).to be_nil
- end
-
- it 'sets Spree::Current.zone to nil' do
- subject
- # Spree::Current.zone will call default_tax again, so we check the attributes hash
- expect(Spree::Current.attributes[:zone]).to be_nil
- end
+ it 'sets Spree::Current.zone to nil' do
+ subject
+ # Spree::Current.zone will call default_tax again, so we check the attributes hash
+ expect(Spree::Current.attributes[:zone]).to be_nil
end
end
diff --git a/backend/engines/core/spec/lib/spree/core/pricing/context_spec.rb b/backend/engines/core/spec/lib/spree/core/pricing/context_spec.rb
index 0baf20bfaa..a744ae928a 100644
--- a/backend/engines/core/spec/lib/spree/core/pricing/context_spec.rb
+++ b/backend/engines/core/spec/lib/spree/core/pricing/context_spec.rb
@@ -193,16 +193,16 @@ module Spree
end
end
- context 'with zone from store checkout_zone' do
- let(:checkout_zone) { create(:zone) }
+ context 'when order has no tax zone' do
+ let!(:default_tax_zone) { create(:zone, default_tax: true) }
before do
allow(order).to receive(:tax_zone).and_return(nil)
- order.store.update!(checkout_zone: checkout_zone)
+ Rails.cache.delete('default_tax')
end
- it 'sets zone from store checkout_zone' do
- expect(subject.zone).to eq(checkout_zone)
+ it 'falls back to default tax zone' do
+ expect(subject.zone).to eq(default_tax_zone)
end
end
diff --git a/backend/engines/core/spec/models/spree/current_spec.rb b/backend/engines/core/spec/models/spree/current_spec.rb
index aceb1603b2..16f970cf3f 100644
--- a/backend/engines/core/spec/models/spree/current_spec.rb
+++ b/backend/engines/core/spec/models/spree/current_spec.rb
@@ -63,21 +63,11 @@ RSpec.describe Spree::Current do
context 'when zone is not set and no default tax zone exists' do
before do
Spree::Zone.update_all(default_tax: false)
+ Rails.cache.delete('default_tax')
end
- context 'when store has a checkout_zone' do
- let(:checkout_zone) { create(:zone) }
- let!(:store) { create(:store, default: true, checkout_zone: checkout_zone) }
-
- it 'returns the store checkout_zone' do
- expect(described_class.zone).to eq(checkout_zone)
- end
- end
-
- context 'when store has no checkout_zone' do
- it 'returns nil' do
- expect(described_class.zone).to be_nil
- end
+ it 'returns nil' do
+ expect(described_class.zone).to be_nil
end
end
end
diff --git a/backend/engines/core/spec/models/spree/market_country_spec.rb b/backend/engines/core/spec/models/spree/market_country_spec.rb
new file mode 100644
index 0000000000..945182e03a
--- /dev/null
+++ b/backend/engines/core/spec/models/spree/market_country_spec.rb
@@ -0,0 +1,66 @@
+require 'spec_helper'
+
+RSpec.describe Spree::MarketCountry, type: :model do
+ describe 'validations' do
+ describe '#country_covered_by_shipping_zone' do
+ let(:store) { create(:store) }
+ let(:market) { create(:market, store: store) }
+
+ context 'when country is in a zone with a shipping method' do
+ let(:country) { create(:country) }
+ let!(:zone) { create(:zone, kind: 'country') }
+
+ before do
+ zone.zone_members.create!(zoneable: country)
+ create(:shipping_method, zones: [zone])
+ end
+
+ it 'is valid' do
+ market_country = Spree::MarketCountry.new(market: market, country: country)
+ expect(market_country).to be_valid
+ end
+ end
+
+ context 'when country has no shipping zone coverage' do
+ let(:country) { create(:country) }
+
+ it 'is invalid' do
+ market_country = Spree::MarketCountry.new(market: market, country: country)
+ expect(market_country).not_to be_valid
+ expect(market_country.errors[:country]).to include(/not covered by any shipping zone/)
+ end
+ end
+
+ context 'when country is in a zone without a shipping method' do
+ let(:country) { create(:country) }
+ let!(:zone) { create(:zone, kind: 'country') }
+
+ before do
+ zone.zone_members.create!(zoneable: country)
+ end
+
+ it 'is invalid' do
+ market_country = Spree::MarketCountry.new(market: market, country: country)
+ expect(market_country).not_to be_valid
+ expect(market_country.errors[:country]).to include(/not covered by any shipping zone/)
+ end
+ end
+
+ context 'when country is covered via a state-type zone' do
+ let(:country) { create(:country) }
+ let(:state) { create(:state, country: country) }
+ let!(:zone) { create(:zone, kind: 'state') }
+
+ before do
+ zone.zone_members.create!(zoneable: state)
+ create(:shipping_method, zones: [zone])
+ end
+
+ it 'is valid' do
+ market_country = Spree::MarketCountry.new(market: market, country: country)
+ expect(market_country).to be_valid
+ end
+ end
+ end
+ end
+end
diff --git a/backend/engines/core/spec/models/spree/store_spec.rb b/backend/engines/core/spec/models/spree/store_spec.rb
index 53dd10d5be..2a99271d94 100644
--- a/backend/engines/core/spec/models/spree/store_spec.rb
+++ b/backend/engines/core/spec/models/spree/store_spec.rb
@@ -182,6 +182,42 @@ describe Spree::Store, type: :model, without_global_store: true do
end
end
+ describe '#ensure_default_market' do
+ context 'when default_country_iso is set with shipping coverage' do
+ let(:country) { Spree::Country.first || create(:country) }
+ let(:store) { build(:store) }
+
+ before do
+ zone = create(:zone, name: 'Test Zone', kind: 'country')
+ zone.zone_members.create!(zoneable: country)
+ create(:shipping_method, zones: [zone])
+ store.default_country_iso = country.iso
+ end
+
+ it 'creates a default market named after the country' do
+ expect { store.save! }.to change(Spree::Market, :count).by(1)
+
+ market = store.markets.first
+ expect(market.name).to eq(country.name)
+ expect(market).to be_default
+ expect(market.countries).to include(country)
+ end
+
+ it 'does not create a second market on re-run' do
+ store.save!
+ expect { store.send(:ensure_default_market) }.not_to change(Spree::Market, :count)
+ end
+ end
+
+ context 'when default_country_iso is not set' do
+ let(:store) { build(:store) }
+
+ it 'does not create a market' do
+ expect { store.save! }.not_to change(Spree::Market, :count)
+ end
+ end
+ end
+
describe '#ensure_default_taxonomies_are_created' do
let(:store) { build(:store) }
@@ -373,27 +409,6 @@ describe Spree::Store, type: :model, without_global_store: true do
end
end
- shared_context 'with checkout zone set' do
- let!(:country1) { create(:country) }
- let!(:country2) { create(:country) }
-
- let!(:state1) { create(:state, country: country1) }
- let!(:state2) { create(:state, country: country2) }
-
- let(:zone) do
- create(:zone, kind: 'country').tap do |zone|
- zone.members.create(zoneable: country1)
- zone.members.create(zoneable: country2)
- end
- end
-
- before { subject.update(checkout_zone: zone) }
- end
-
- shared_context 'with checkout zone not set' do
- before { subject.update(checkout_zone: nil) }
- end
-
describe '#countries_available_for_checkout' do
subject { create(:store) }
@@ -412,17 +427,7 @@ describe Spree::Store, type: :model, without_global_store: true do
end
end
- context 'without markets (legacy)' do
- include_context 'with checkout zone set'
-
- it 'returns country list for checkout zone' do
- expect(subject.countries_available_for_checkout).to eq [country1, country2]
- end
- end
-
- context 'without markets and without checkout zone (legacy)' do
- include_context 'with checkout zone not set'
-
+ context 'without markets' do
it 'returns list of all countries' do
checkout_available_countries_ids = subject.countries_available_for_checkout.pluck(:id)
all_countries_ids = Spree::Country.all.ids
@@ -433,105 +438,45 @@ describe Spree::Store, type: :model, without_global_store: true do
end
describe '#states_available_for_checkout' do
- context do
- include_context 'with checkout zone set'
+ subject { create(:store) }
- it 'returns states list for checkout zone' do
- expect(subject.states_available_for_checkout(country1)).to eq [state1]
- expect(subject.states_available_for_checkout(country2)).to eq [state2]
+ let(:country_with_states) do
+ create(:country).tap do |country|
+ country.states << create(:state)
end
end
- context do
- include_context 'with checkout zone not set'
-
- context do
- let(:country_with_states) do
- create(:country).tap do |country|
- country.states << create(:state)
- end
- end
+ it 'returns list of states associated to country' do
+ checkout_available_states_ids = subject.states_available_for_checkout(country_with_states).pluck(:id)
+ all_state_ids = country_with_states.states.pluck(:id)
- it 'returns list of states associated to country' do
- checkout_available_states_ids3 = subject.states_available_for_checkout(country_with_states).pluck(:id)
- all_countries_ids = country_with_states.states.pluck(:id)
-
- expect(checkout_available_states_ids3).to eq(all_countries_ids)
- end
- end
+ expect(checkout_available_states_ids).to eq(all_state_ids)
end
end
- describe '#ensure_default_country' do
- subject { build(:store) }
-
- let!(:default_country) { Spree::Country.first || create(:country) }
- let!(:other_country) { create(:country) }
- let!(:other_country_2) { create(:country) }
-
- context 'checkout zone not set' do
- before { subject.save! }
-
- context 'with default country' do
- before { subject.default_country = other_country }
-
- it { expect(subject.default_country).to eq(other_country) }
- end
-
- it { expect(subject.default_country).to eq(default_country) }
- end
-
- context 'checkout zone set' do
- let!(:zone) { create(:zone, kind: 'country') }
+ describe '#default_country' do
+ context 'with markets' do
+ let!(:store) { create(:store) }
+ let!(:germany) { create(:country, name: 'Germany', iso: 'DE') }
+ let!(:france) { create(:country, name: 'France', iso: 'FR') }
before do
- zone.members.create(zoneable: other_country_2)
- subject.checkout_zone = zone
+ create(:market, store: store, countries: [germany, france], currency: 'EUR', default: true)
end
- context 'with default country set' do
- before { subject.default_country = other_country }
-
- context 'no zone members' do
- before do
- zone.members.delete_all
- subject.save!
- end
-
- it { expect(subject.default_country).to eq(other_country) }
- end
-
- context 'default country is a zone member' do
- before do
- zone.members.create(zoneable: other_country)
- subject.save!
- end
-
- it { expect(subject.default_country).to eq(other_country) }
- end
-
- context 'default country is not a zone member' do
- before { subject.save! }
-
- it { expect(subject.default_country).to eq(other_country_2) }
- end
+ it 'derives from the default market' do
+ expect(store.default_country).to eq(france) # France comes before Germany alphabetically
end
+ end
- context 'without default country set' do
- context 'no zone members' do
- before do
- zone.members.delete_all
- subject.save!
- end
-
- it { expect(subject.default_country).to eq(default_country) }
- end
+ context 'without markets' do
+ let!(:country) { Spree::Country.first || create(:country) }
+ let(:store) { build(:store) }
- context 'with zone members' do
- before { subject.save! }
+ before { store.write_attribute(:default_country_id, country.id) }
- it { expect(subject.default_country).to eq(other_country_2) }
- end
+ it 'returns the store column value' do
+ expect(store.default_country).to eq(country)
end
end
end
@@ -539,23 +484,31 @@ describe Spree::Store, type: :model, without_global_store: true do
describe '#default_country_iso=' do
let(:store) { build(:store) }
- context 'when country is not found' do
- it 'sets the default country' do
+ context 'when country is not found in the database' do
+ it 'creates the country from ISO3166 data' do
expect(Spree::Country.find_by(iso: 'GB')).to be_nil
expect { store.default_country_iso = 'GB' }.to change(Spree::Country, :count).by(1)
- expect(store.default_country).to be_an_instance_of(Spree::Country)
- expect(store.default_country.iso).to eq('GB')
- expect(store.default_country.numcode.to_s).to eq(::Country['GB'].number)
+
+ gb_country = Spree::Country.find_by(iso: 'GB')
+ expect(gb_country).to be_present
+ expect(gb_country.numcode.to_s).to eq(::Country['GB'].number)
expect(store.default_country_iso).to eq('GB')
end
end
- context 'when country is found' do
+ context 'when country exists in the database' do
let!(:country) { create(:country, iso: 'GB') }
- it 'sets the default country' do
+ it 'uses the existing country' do
expect { store.default_country_iso = 'GB' }.not_to change(Spree::Country, :count)
- expect(store.default_country.iso).to eq('GB')
+ expect(store.default_country_iso).to eq('GB')
+ end
+ end
+
+ context 'when iso is blank' do
+ it 'does nothing' do
+ store.default_country_iso = ''
+ expect(store.instance_variable_get(:@default_country_for_market)).to be_nil
end
end
end
@@ -869,19 +822,98 @@ describe Spree::Store, type: :model, without_global_store: true do
end
end
+ describe '#countries_with_shipping_coverage' do
+ let(:store) { create(:store) }
+
+ context 'with country-type zones with shipping methods' do
+ let(:country1) { create(:country) }
+ let(:country2) { create(:country) }
+ let!(:zone) { create(:zone, kind: 'country') }
+
+ before do
+ zone.zone_members.create!(zoneable: country1)
+ zone.zone_members.create!(zoneable: country2)
+ create(:shipping_method, zones: [zone])
+ end
+
+ it 'returns countries from those zones' do
+ result = store.countries_with_shipping_coverage
+ expect(result).to include(country1, country2)
+ end
+ end
+
+ context 'with state-type zones with shipping methods' do
+ let(:country) { create(:country) }
+ let(:state) { create(:state, country: country) }
+ let!(:zone) { create(:zone, kind: 'state') }
+
+ before do
+ zone.zone_members.create!(zoneable: state)
+ create(:shipping_method, zones: [zone])
+ end
+
+ it 'returns countries inferred from state-type zones' do
+ result = store.countries_with_shipping_coverage
+ expect(result).to include(country)
+ end
+ end
+
+ context 'when zone has no shipping method' do
+ let(:country) { create(:country) }
+ let!(:zone) { create(:zone, kind: 'country') }
+
+ before do
+ zone.zone_members.create!(zoneable: country)
+ end
+
+ it 'does not include countries from that zone' do
+ expect(store.countries_with_shipping_coverage).not_to include(country)
+ end
+ end
+
+ context 'when no shipping zones exist' do
+ before { Spree::Zone.delete_all }
+
+ it 'returns empty relation' do
+ expect(store.countries_with_shipping_coverage).to be_empty
+ end
+ end
+
+ context 'when country appears in multiple zones' do
+ let(:country) { create(:country) }
+ let!(:zone1) { create(:zone, kind: 'country') }
+ let!(:zone2) { create(:zone, kind: 'country') }
+
+ before do
+ zone1.zone_members.create!(zoneable: country)
+ zone2.zone_members.create!(zoneable: country)
+ create(:shipping_method, zones: [zone1])
+ create(:shipping_method, zones: [zone2])
+ end
+
+ it 'deduplicates countries' do
+ result = store.countries_with_shipping_coverage
+ expect(result.where(id: country.id).count).to eq(1)
+ end
+ end
+ end
+
describe '#supported_shipping_zones' do
context 'with checkout zone set' do
let!(:checkout_zone) { create(:zone) }
+ let(:store) { create(:store) }
- subject { build(:store, checkout_zone: checkout_zone) }
+ before { store.update_column(:checkout_zone_id, checkout_zone.id) }
- it 'returns the checkout zone' do
- expect(subject.supported_shipping_zones).to eq([checkout_zone])
+ it 'returns the checkout zone and emits deprecation warning' do
+ expect(Spree::Deprecation).to receive(:warn).with(/supported_shipping_zones is deprecated/)
+ expect(store.supported_shipping_zones).to eq([checkout_zone])
end
end
context 'when checkout zone not set' do
- it 'returns all shipping zones' do
+ it 'returns all shipping zones and emits deprecation warning' do
+ expect(Spree::Deprecation).to receive(:warn).with(/supported_shipping_zones is deprecated/)
expect(subject.supported_shipping_zones).to eq(Spree::Zone.includes(zone_members: :zoneable).all)
end
end
diff --git a/backend/engines/core/spec/models/spree/zone_spec.rb b/backend/engines/core/spec/models/spree/zone_spec.rb
index 7fd0f657dc..727a92c005 100644
--- a/backend/engines/core/spec/models/spree/zone_spec.rb
+++ b/backend/engines/core/spec/models/spree/zone_spec.rb
@@ -43,17 +43,6 @@ describe Spree::Zone, type: :model do
end
end
- describe '#nullify_checkout_zone' do
- let!(:zone) { create(:zone) }
-
- it 'is expected to nullify checkout zone' do
- Spree::Store.current.update(checkout_zone: zone)
-
- expect { zone.destroy }
- .to change { Spree::Store.current.reload.checkout_zone_id }
- .to(nil)
- end
- end
end
context 'when there is only one qualifying zone' do
diff --git a/backend/engines/multi_store/app/controllers/spree/admin/multi_store/stores_controller.rb b/backend/engines/multi_store/app/controllers/spree/admin/multi_store/stores_controller.rb
index aa6be11d12..d02d914980 100644
--- a/backend/engines/multi_store/app/controllers/spree/admin/multi_store/stores_controller.rb
+++ b/backend/engines/multi_store/app/controllers/spree/admin/multi_store/stores_controller.rb
@@ -3,10 +3,7 @@ module Spree
module MultiStore
class StoresController < Spree::Admin::BaseController
def new
- @store = Spree::Store.new(
- default_country_iso: current_store.default_country_iso,
- default_currency: current_store.default_currency
- )
+ @store = Spree::Store.new
render :new, layout: 'spree/admin_wizard'
end
diff --git a/backend/engines/multi_store/app/views/spree/admin/multi_store/stores/new.html.erb b/backend/engines/multi_store/app/views/spree/admin/multi_store/stores/new.html.erb
index 198c288793..dae8642629 100644
--- a/backend/engines/multi_store/app/views/spree/admin/multi_store/stores/new.html.erb
+++ b/backend/engines/multi_store/app/views/spree/admin/multi_store/stores/new.html.erb
@@ -18,17 +18,7 @@
<div class="form-group">
<%= f.label :default_country_iso, Spree.t(:country) %>
- <%= f.collection_select :default_country_iso, Spree::Country.order(:name), :iso, :name, { }, { data: { controller: 'autocomplete-select', enable_button_target: 'input', action: 'store-form#updateCurrency' } } %>
- </div>
-
- <div class="form-group">
- <%= f.label :default_locale %>
- <%= f.select :default_locale, options_from_collection_for_select(all_locales_options, :last, :first, current_store.default_locale || I18n.locale), { }, { data: { controller: 'autocomplete-select', enable_button_target: 'input', action: 'store-form#updateCurrency' } } %>
- </div>
-
- <div class="form-group">
- <%= f.label :default_currency, Spree.t(:currency) %>
- <%= f.select :default_currency, currency_options, {}, { data: { controller: 'autocomplete-select', enable_button_target: 'input', store_form_target: 'currency' } } %>
+ <%= f.collection_select :default_country_iso, Spree::Country.order(:name), :iso, :name, { }, { data: { controller: 'autocomplete-select', enable_button_target: 'input' } } %>
</div>
<% if available_stores.any? %>
diff --git a/backend/engines/multi_store/spec/controllers/spree/admin/multi_store/stores_controller_spec.rb b/backend/engines/multi_store/spec/controllers/spree/admin/multi_store/stores_controller_spec.rb
index 7887be3372..d3dabbf791 100644
--- a/backend/engines/multi_store/spec/controllers/spree/admin/multi_store/stores_controller_spec.rb
+++ b/backend/engines/multi_store/spec/controllers/spree/admin/multi_store/stores_controller_spec.rb
@@ -19,21 +19,26 @@ describe Spree::Admin::MultiStore::StoresController, type: :controller do
expect(response).to have_http_status(:ok)
end
- it 'initializes store with current store defaults' do
+ it 'initializes a new store' do
subject
- new_store = assigns(:store)
- expect(new_store.default_currency).to eq(store.default_currency)
+ expect(assigns(:store)).to be_a_new(Spree::Store)
end
end
describe 'POST #create' do
subject { post :create, params: { store: store_params } }
+ let!(:country) { Spree::Country.find_by(iso: 'US') || create(:country_us) }
+ let!(:zone) do
+ zone = create(:zone, name: 'US Zone', kind: 'country')
+ zone.zone_members.create!(zoneable: country)
+ create(:shipping_method, zones: [zone])
+ zone
+ end
let(:store_params) do
{
name: 'New Store',
- default_currency: 'USD',
- default_locale: 'en'
+ default_country_iso: country.iso
}
end
@@ -42,6 +47,17 @@ describe Spree::Admin::MultiStore::StoresController, type: :controller do
expect { subject }.to change(Spree::Store, :count).by(1)
end
+ it 'creates a default market with the selected country' do
+ subject
+ new_store = Spree::Store.last
+ expect(new_store.markets.count).to eq(1)
+
+ market = new_store.markets.first
+ expect(market.name).to eq(country.name)
+ expect(market).to be_default
+ expect(market.countries).to include(country)
+ end
+
it 'sets the mail_from_address from the current store' do
subject
expect(Spree::Store.last.mail_from_address).to eq(store.mail_from_address)
@@ -70,6 +86,15 @@ describe Spree::Admin::MultiStore::StoresController, type: :controller do
end
end
+ context 'without country' do
+ let(:store_params) { { name: 'Store Without Country' } }
+
+ it 'creates the store without a market' do
+ expect { subject }.to change(Spree::Store, :count).by(1)
+ expect(Spree::Store.last.markets.count).to eq(0)
+ end
+ end
+
context 'with invalid params' do
let(:store_params) { { name: '' } }
@@ -89,8 +114,7 @@ describe Spree::Admin::MultiStore::StoresController, type: :controller do
let(:store_params) do
{
name: 'Store With Products',
- default_currency: 'USD',
- default_locale: 'en',
+ default_country_iso: country.iso,
import_products_from_store_id: store.id
}
end
diff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yaml
index 751c2be4a7..f2c92c176e 100644
--- a/docs/api-reference/store.yaml
+++ b/docs/api-reference/store.yaml
@@ -530,14 +530,14 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTc1MTIxMH0.rQScCOhPN-AoB2H_liaHoZU0FgU7WMoJUjEfvO8tidE
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTc2NjA2NH0.-0GvkA8M14_l5q-3XDJOiVZ0vSRMKod2Ik6jZOGShRg
user:
id: cus_UkLWZg9DAJ
- first_name: Lashaunda
- last_name: Schoen
- created_at: '2026-02-21T09:06:50.419Z'
- updated_at: '2026-02-21T09:06:50.419Z'
+ first_name: Lacresha
+ last_name: Von
+ created_at: '2026-02-21T13:14:24.163Z'
+ updated_at: '2026-02-21T13:14:24.163Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -593,14 +593,14 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTc1MTIxMX0.ZnuzcK1EWXfR4Lj1UBjp7kZK8dI3aqtwbfswAWh_0eY
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTc2NjA2NX0.7Z7E94ErOVfkvDwh24XVXkJtsh5-6LCI5jJGvf2UFt4
user:
id: cus_UkLWZg9DAJ
first_name: John
last_name: Doe
- created_at: '2026-02-21T09:06:51.801Z'
- updated_at: '2026-02-21T09:06:51.801Z'
+ created_at: '2026-02-21T13:14:25.507Z'
+ updated_at: '2026-02-21T13:14:25.507Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -672,14 +672,14 @@ paths:
content:
application/json:
example:
- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTc1MTIxMn0.pl5BztnaRkK4P9RGHpUz4NyyqGo3X0sLa8I8FUGWVxU
+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTc2NjA2Nn0.xqUwogbX7hlxDGDMpRligxfp9jmd2kB3HY9hwQPDE2M
user:
id: cus_UkLWZg9DAJ
- first_name: Lindsy
- last_name: O'Conner
- created_at: '2026-02-21T09:06:52.361Z'
- updated_at: '2026-02-21T09:06:52.361Z'
+ first_name: Chase
+ last_name: Rath
+ created_at: '2026-02-21T13:14:26.047Z'
+ updated_at: '2026-02-21T13:14:26.047Z'
addresses: []
default_billing_address:
default_shipping_address:
@@ -724,10 +724,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R816477482
+ number: R790284236
state: cart
- token: 6MP4Pf9hQcQDg3pwBDTPc2u5Fq2pVWFaczb
+ token: vVGkjNVhGm2vKSccjkJAB3nsRhJkk8bbSR6
special_instructions:
currency: USD
item_count: 0
@@ -750,8 +750,8 @@ paths:
total: '0.0'
display_total: "$0.00"
completed_at:
- created_at: '2026-02-21T09:06:52.989Z'
- updated_at: '2026-02-21T09:06:52.989Z'
+ created_at: '2026-02-21T13:14:26.650Z'
+ updated_at: '2026-02-21T13:14:26.650Z'
order_promotions: []
line_items: []
shipments: []
@@ -806,10 +806,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R155147700
+ number: R665157049
state: cart
- token: 1jEpcbHpNKxjGeQ2AUiyCaZKS6JMaYvKjtD
+ token: xzKUHQUoUM2ufkAE363vCfRCC2xABJQi2zF
special_instructions:
currency: USD
item_count: 1
@@ -832,16 +832,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:06:54.057Z'
- updated_at: '2026-02-21T09:06:54.197Z'
+ created_at: '2026-02-21T13:14:27.708Z'
+ updated_at: '2026-02-21T13:14:27.835Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 22878
- slug: product-22878
+ name: Product 23813
+ slug: product-23813
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -860,23 +860,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:06:54.143Z'
- updated_at: '2026-02-21T09:06:54.143Z'
+ created_at: '2026-02-21T13:14:27.785Z'
+ updated_at: '2026-02-21T13:14:27.785Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H14672948036
+ number: H91318205372
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:06:54.160Z'
- updated_at: '2026-02-21T09:06:54.185Z'
+ created_at: '2026-02-21T13:14:27.799Z'
+ updated_at: '2026-02-21T13:14:27.824Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -884,7 +884,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_41
- name: Lurlene Hayes
+ name: Rigoberto Pfeffer
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -991,10 +991,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R432918187
+ number: R390415698
state: cart
- token: mryDfe3AJ3HX73KQa3V5K6qTHBiroM3hKso
+ token: dMRZGq4snZQgzikvNgaHNhGzJ9pKDcTiG5F
special_instructions:
currency: USD
item_count: 1
@@ -1017,16 +1017,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:06:54.231Z'
- updated_at: '2026-02-21T09:06:54.389Z'
+ created_at: '2026-02-21T13:14:27.866Z'
+ updated_at: '2026-02-21T13:14:28.007Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 37379
- slug: product-37379
+ name: Product 34760
+ slug: product-34760
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1045,23 +1045,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:06:54.296Z'
- updated_at: '2026-02-21T09:06:54.296Z'
+ created_at: '2026-02-21T13:14:27.925Z'
+ updated_at: '2026-02-21T13:14:27.925Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H87220099802
+ number: H56908199808
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:06:54.317Z'
- updated_at: '2026-02-21T09:06:54.366Z'
+ created_at: '2026-02-21T13:14:27.938Z'
+ updated_at: '2026-02-21T13:14:27.984Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -1069,7 +1069,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_45
- name: Jacquelyne Wehner
+ name: Dusti Terry
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1334,10 +1334,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R122441799
+ number: R775489583
state: cart
- token: ZTQhWqNG7KNsFjExwEcRdL2MJqTi8TQrvwB
+ token: 2SqLe9DabCPyHiZVU6e4RUXgR3mfvUDkRUJ
special_instructions:
currency: USD
item_count: 1
@@ -1360,16 +1360,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:06:58.888Z'
- updated_at: '2026-02-21T09:06:59.056Z'
+ created_at: '2026-02-21T13:14:32.287Z'
+ updated_at: '2026-02-21T13:14:32.446Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 87116
- slug: product-87116
+ name: Product 85793
+ slug: product-85793
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1388,23 +1388,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:06:58.941Z'
- updated_at: '2026-02-21T09:06:58.941Z'
+ created_at: '2026-02-21T13:14:32.354Z'
+ updated_at: '2026-02-21T13:14:32.354Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H96877656792
+ number: H07733890383
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:06:58.957Z'
- updated_at: '2026-02-21T09:06:58.989Z'
+ created_at: '2026-02-21T13:14:32.366Z'
+ updated_at: '2026-02-21T13:14:32.385Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -1412,7 +1412,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_65
- name: Ann Fahey
+ name: Philip Emmerich
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1434,12 +1434,12 @@ paths:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
state: checkout
- response_code: 1-SC-20260221090659051384
- number: P5YZDW18
+ response_code: 1-SC-20260221131432441048
+ number: PYVZD6HJ
amount: '50.0'
display_amount: "$50.00"
- created_at: '2026-02-21T09:06:59.055Z'
- updated_at: '2026-02-21T09:06:59.055Z'
+ created_at: '2026-02-21T13:14:32.445Z'
+ updated_at: '2026-02-21T13:14:32.445Z'
source_type: store_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -1575,10 +1575,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R079222725
+ number: R356212957
state: cart
- token: aQwnCvMgDqKB23ZgNWYiiuBks9zhU9LYie5
+ token: 7mgXaPCnUXDVAsR6aJtvUj7d3DH7hhLZEpd
special_instructions:
currency: USD
item_count: 1
@@ -1601,16 +1601,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:01.095Z'
- updated_at: '2026-02-21T09:07:01.298Z'
+ created_at: '2026-02-21T13:14:34.390Z'
+ updated_at: '2026-02-21T13:14:34.575Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 112419
- slug: product-112419
+ name: Product 116873
+ slug: product-116873
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -1629,23 +1629,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:01.157Z'
- updated_at: '2026-02-21T09:07:01.285Z'
+ created_at: '2026-02-21T13:14:34.454Z'
+ updated_at: '2026-02-21T13:14:34.563Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H86601737123
+ number: H38218564535
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:01.171Z'
- updated_at: '2026-02-21T09:07:01.192Z'
+ created_at: '2026-02-21T13:14:34.469Z'
+ updated_at: '2026-02-21T13:14:34.490Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -1653,7 +1653,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_77
- name: Fransisca Champlin
+ name: Dennis Mraz
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1975,10 +1975,10 @@ paths:
example:
data:
- id: or_UkLWZg9DAJ
- number: R877690416
+ number: R592741797
state: cart
- token: cWNrHnapnP2zHKVu69b4DAdSorWJUhgdQXb
+ token: of6cJeWunVfTbPt5JoqXhdpdixjHPP9o6Gj
special_instructions:
currency: USD
item_count: 1
@@ -2001,16 +2001,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:06.066Z'
- updated_at: '2026-02-21T09:07:06.205Z'
+ created_at: '2026-02-21T13:14:39.173Z'
+ updated_at: '2026-02-21T13:14:39.272Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 13907
- slug: product-13907
+ name: Product 138807
+ slug: product-138807
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -2029,23 +2029,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:06.149Z'
- updated_at: '2026-02-21T09:07:06.149Z'
+ created_at: '2026-02-21T13:14:39.228Z'
+ updated_at: '2026-02-21T13:14:39.228Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H77753424595
+ number: H24853465283
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:06.167Z'
- updated_at: '2026-02-21T09:07:06.193Z'
+ created_at: '2026-02-21T13:14:39.240Z'
+ updated_at: '2026-02-21T13:14:39.261Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -2053,7 +2053,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_100
- name: Lamar Murazik
+ name: Derek Nitzsche
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -2162,11 +2162,11 @@ paths:
application/json:
example:
id: cus_UkLWZg9DAJ
- first_name: Shona
- last_name: Hoppe
- created_at: '2026-02-21T09:07:07.252Z'
- updated_at: '2026-02-21T09:07:07.541Z'
+ first_name: Marguerite
+ last_name: Corkery
+ created_at: '2026-02-21T13:14:40.207Z'
+ updated_at: '2026-02-21T13:14:40.482Z'
addresses:
- id: addr_gbHJdmfrXB
firstname: John
@@ -2268,11 +2268,11 @@ paths:
application/json:
example:
id: cus_UkLWZg9DAJ
first_name: Updated
last_name: Name
- created_at: '2026-02-21T09:07:08.049Z'
- updated_at: '2026-02-21T09:07:08.344Z'
+ created_at: '2026-02-21T13:14:40.765Z'
+ updated_at: '2026-02-21T13:14:41.046Z'
addresses:
- id: addr_gbHJdmfrXB
firstname: John
@@ -2467,7 +2467,7 @@ paths:
example:
data:
- id: gc_UkLWZg9DAJ
- code: 7B2B71E47E69119F
+ code: 0F62C3B0C3676D9B
state: active
currency: USD
amount: 10.0
@@ -2481,8 +2481,8 @@ paths:
redeemed_at:
expired: false
active: true
- created_at: '2026-02-21T09:07:12.773Z'
- updated_at: '2026-02-21T09:07:12.773Z'
+ created_at: '2026-02-21T13:14:44.473Z'
+ updated_at: '2026-02-21T13:14:44.473Z'
meta:
page: 1
limit: 25
@@ -2544,7 +2544,7 @@ paths:
application/json:
example:
id: gc_UkLWZg9DAJ
- code: 84263A77811BCCD5
+ code: FFDEA12223C06FD6
state: active
currency: USD
amount: 10.0
@@ -2558,8 +2558,8 @@ paths:
redeemed_at:
expired: false
active: true
- created_at: '2026-02-21T09:07:13.939Z'
- updated_at: '2026-02-21T09:07:13.939Z'
+ created_at: '2026-02-21T13:14:45.569Z'
+ updated_at: '2026-02-21T13:14:45.569Z'
schema:
"$ref": "#/components/schemas/StoreGiftCard"
'404':
@@ -2613,10 +2613,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R605735545
+ number: R211893424
state: cart
- token: rGXPHttNAV6ckpe3pzNUaGenxxKG9z3PURQ
+ token: fFpRkJ4x9nj1NYro2BMUD37dZX3148AJ72N
special_instructions:
currency: USD
item_count: 3
@@ -2639,16 +2639,16 @@ paths:
total: '49.98'
display_total: "$49.98"
completed_at:
- created_at: '2026-02-21T09:07:15.156Z'
- updated_at: '2026-02-21T09:07:15.325Z'
+ created_at: '2026-02-21T13:14:46.674Z'
+ updated_at: '2026-02-21T13:14:46.801Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 215856
- slug: product-215856
+ name: Product 21292
+ slug: product-21292
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -2667,8 +2667,8 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:15.239Z'
- updated_at: '2026-02-21T09:07:15.239Z'
+ created_at: '2026-02-21T13:14:46.733Z'
+ updated_at: '2026-02-21T13:14:46.733Z'
compare_at_amount:
thumbnail_url:
option_values: []
@@ -2677,8 +2677,8 @@ paths:
variant_id: variant_gbHJdmfrXB
quantity: 2
currency: USD
- name: Product 227913
- slug: product-227913
+ name: Product 229746
+ slug: product-229746
options_text: ''
price: '19.99'
display_price: "$19.99"
@@ -2697,8 +2697,8 @@ paths:
discounted_amount: '39.98'
display_discounted_amount: "$39.98"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:15.325Z'
- updated_at: '2026-02-21T09:07:15.325Z'
+ created_at: '2026-02-21T13:14:46.801Z'
+ updated_at: '2026-02-21T13:14:46.801Z'
compare_at_amount:
thumbnail_url:
option_values: []
@@ -2794,10 +2794,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R647337648
+ number: R435429727
state: cart
- token: pp3CURpVczFpgM7Khvt5spjVgajjcdDvP7H
+ token: KgejSJmgUNXjq4rmrjLjXMCH1AMSU2EhzDS
special_instructions:
currency: USD
item_count: 5
@@ -2820,16 +2820,16 @@ paths:
total: '99.95'
display_total: "$99.95"
completed_at:
- created_at: '2026-02-21T09:07:17.485Z'
- updated_at: '2026-02-21T09:07:17.569Z'
+ created_at: '2026-02-21T13:14:48.678Z'
+ updated_at: '2026-02-21T13:14:48.750Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 5
currency: USD
- name: Product 251142
- slug: product-251142
+ name: Product 253688
+ slug: product-253688
options_text: ''
price: '19.99'
display_price: "$19.99"
@@ -2848,8 +2848,8 @@ paths:
discounted_amount: '99.95'
display_discounted_amount: "$99.95"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:17.549Z'
- updated_at: '2026-02-21T09:07:17.579Z'
+ created_at: '2026-02-21T13:14:48.731Z'
+ updated_at: '2026-02-21T13:14:48.762Z'
compare_at_amount:
thumbnail_url:
option_values: []
@@ -2929,10 +2929,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R991780472
+ number: R694206085
state: cart
- token: MmFvas1navEcBEhwhynWnBQaKi7TqR11eLP
+ token: Dp4UXKLRmhWnMgR3mkfHj6dsNSREfJ7fwqJ
special_instructions:
currency: USD
item_count: 0
@@ -2955,8 +2955,8 @@ paths:
total: '0.0'
display_total: "$0.00"
completed_at:
- created_at: '2026-02-21T09:07:18.184Z'
- updated_at: '2026-02-21T09:07:18.282Z'
+ created_at: '2026-02-21T13:14:49.326Z'
+ updated_at: '2026-02-21T13:14:49.400Z'
order_promotions: []
line_items: []
shipments: []
@@ -3080,9 +3080,9 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R229150177
+ number: R219765085
state: cart
- token: WZpkoykp3EaZ3ryQd8KJRQ8z74rGdRkuc3e
+ token: mwNKy3cXsRu1g2GsbBC558Smr4DMCzryL3u
email:
special_instructions:
currency: USD
@@ -3106,16 +3106,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:20.345Z'
- updated_at: '2026-02-21T09:07:20.446Z'
+ created_at: '2026-02-21T13:14:51.404Z'
+ updated_at: '2026-02-21T13:14:51.496Z'
order_promotions: []
line_items:
- id: li_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
currency: USD
- name: Product 303826
- slug: product-303826
+ name: Product 30439
+ slug: product-30439
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3134,23 +3134,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:20.402Z'
- updated_at: '2026-02-21T09:07:20.402Z'
+ created_at: '2026-02-21T13:14:51.458Z'
+ updated_at: '2026-02-21T13:14:51.458Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_gbHJdmfrXB
- number: H09969643397
+ number: H62904080951
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:20.417Z'
- updated_at: '2026-02-21T09:07:20.436Z'
+ created_at: '2026-02-21T13:14:51.470Z'
+ updated_at: '2026-02-21T13:14:51.486Z'
shipping_method:
id: shpm_gbHJdmfrXB
name: UPS Ground
@@ -3158,7 +3158,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_153
- name: Lanell O'Hara
+ name: Alesia Heaney
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3258,10 +3258,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R461378992
+ number: R485751379
state: cart
- token: mqcN8FVETFH8D8f8uEkepQnfUyWAnppAQBv
+ token: gceKHM5uHUtRGHvtAg5T929xTfN2gckcSX1
special_instructions: Leave at door
currency: USD
item_count: 1
@@ -3284,16 +3284,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:22.886Z'
- updated_at: '2026-02-21T09:07:23.039Z'
+ created_at: '2026-02-21T13:14:53.715Z'
+ updated_at: '2026-02-21T13:14:53.825Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 332045
- slug: product-332045
+ name: Product 332751
+ slug: product-332751
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3312,23 +3312,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:22.965Z'
- updated_at: '2026-02-21T09:07:22.965Z'
+ created_at: '2026-02-21T13:14:53.775Z'
+ updated_at: '2026-02-21T13:14:53.775Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H59904077682
+ number: H92376262746
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:22.985Z'
- updated_at: '2026-02-21T09:07:23.015Z'
+ created_at: '2026-02-21T13:14:53.788Z'
+ updated_at: '2026-02-21T13:14:53.807Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -3336,7 +3336,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_168
- name: Retha Douglas
+ name: Meg Glover
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3515,10 +3515,10 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R407702133
+ number: R870204765
state: address
- token: NQs5rFVzST6ssaZ9xxrRttk5cN9RWZDydvF
+ token: 5wC8XqRQnEkzfTJQQyw5fw4xSG3rtq1gYi3
special_instructions:
currency: USD
item_count: 1
@@ -3541,16 +3541,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:24.668Z'
- updated_at: '2026-02-21T09:07:24.971Z'
+ created_at: '2026-02-21T13:14:55.266Z'
+ updated_at: '2026-02-21T13:14:55.376Z'
order_promotions: []
line_items:
- id: li_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
currency: USD
- name: Product 373827
- slug: product-373827
+ name: Product 379614
+ slug: product-379614
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -3569,23 +3569,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:24.830Z'
- updated_at: '2026-02-21T09:07:24.830Z'
+ created_at: '2026-02-21T13:14:55.327Z'
+ updated_at: '2026-02-21T13:14:55.327Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_gbHJdmfrXB
- number: H32914381966
+ number: H97432923641
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:24.906Z'
- updated_at: '2026-02-21T09:07:24.947Z'
+ created_at: '2026-02-21T13:14:55.339Z'
+ updated_at: '2026-02-21T13:14:55.355Z'
shipping_method:
id: shpm_gbHJdmfrXB
name: UPS Ground
@@ -3593,7 +3593,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_178
- name: Clarice Leannon
+ name: Ninfa Stiedemann
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3695,10 +3695,10 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R546557324
+ number: R251442384
state: payment
- token: 8c3aerLqrskXdYa5cp2r2peqbxFkhVDE83z
+ token: Ude9R1p9Ge4XW89VMHrr7rhCruMX8ZXVVDf
special_instructions:
currency: USD
item_count: 1
@@ -3721,16 +3721,16 @@ paths:
total: '29.99'
display_total: "$29.99"
completed_at:
- created_at: '2026-02-21T09:07:26.636Z'
- updated_at: '2026-02-21T09:07:26.850Z'
+ created_at: '2026-02-21T13:14:56.710Z'
+ updated_at: '2026-02-21T13:14:56.986Z'
order_promotions: []
line_items:
- id: li_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
currency: USD
- name: Product 403723
- slug: product-403723
+ name: Product 403652
+ slug: product-403652
options_text: ''
price: '19.99'
display_price: "$19.99"
@@ -3749,23 +3749,23 @@ paths:
discounted_amount: '19.99'
display_discounted_amount: "$19.99"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:26.693Z'
- updated_at: '2026-02-21T09:07:26.760Z'
+ created_at: '2026-02-21T13:14:56.822Z'
+ updated_at: '2026-02-21T13:14:56.920Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_EfhxLZ9ck8
- number: H16916321354
+ number: H91529409828
state: pending
tracking:
tracking_url:
cost: '10.0'
display_cost: "$10.00"
shipped_at:
- created_at: '2026-02-21T09:07:26.788Z'
- updated_at: '2026-02-21T09:07:26.815Z'
+ created_at: '2026-02-21T13:14:56.938Z'
+ updated_at: '2026-02-21T13:14:56.958Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -3773,7 +3773,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_188
- name: Melba Little
+ name: Cassidy Emmerich
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3874,10 +3874,10 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R509490059
+ number: R823487303
state: complete
- token: mA7jJSYpRFm6sLrpT5yRPLcmasfBf7rPMgB
+ token: 9hdbiq4ctmKjFkFEiMzJX8xVrjkFEk9uU1X
special_instructions:
currency: USD
item_count: 1
@@ -3899,17 +3899,17 @@ paths:
display_additional_tax_total: "$0.00"
total: '29.99'
display_total: "$29.99"
- completed_at: '2026-02-21T09:07:27.877Z'
- created_at: '2026-02-21T09:07:27.526Z'
- updated_at: '2026-02-21T09:07:27.877Z'
+ completed_at: '2026-02-21T13:14:57.932Z'
+ created_at: '2026-02-21T13:14:57.645Z'
+ updated_at: '2026-02-21T13:14:57.932Z'
order_promotions: []
line_items:
- id: li_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
currency: USD
- name: Product 424406
- slug: product-424406
+ name: Product 42214
+ slug: product-42214
options_text: ''
price: '19.99'
display_price: "$19.99"
@@ -3928,23 +3928,23 @@ paths:
discounted_amount: '19.99'
display_discounted_amount: "$19.99"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:27.584Z'
- updated_at: '2026-02-21T09:07:27.870Z'
+ created_at: '2026-02-21T13:14:57.702Z'
+ updated_at: '2026-02-21T13:14:57.926Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_EfhxLZ9ck8
- number: H75437754070
+ number: H84681343579
state: pending
tracking:
tracking_url:
cost: '10.0'
display_cost: "$10.00"
shipped_at:
- created_at: '2026-02-21T09:07:27.715Z'
- updated_at: '2026-02-21T09:07:27.851Z'
+ created_at: '2026-02-21T13:14:57.799Z'
+ updated_at: '2026-02-21T13:14:57.902Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -3952,7 +3952,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_194
- name: Camelia Kuphal
+ name: Julietta Weber
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3985,11 +3985,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PHZPD89J
+ number: P6W65IG7
amount: '29.99'
display_amount: "$29.99"
- created_at: '2026-02-21T09:07:27.815Z'
- updated_at: '2026-02-21T09:07:27.815Z'
+ created_at: '2026-02-21T13:14:57.870Z'
+ updated_at: '2026-02-21T13:14:57.870Z'
source_type: credit_card
source_id: card_UkLWZg9DAJ
source:
@@ -4183,13 +4183,13 @@ paths:
id: ps_gbHJdmfrXB
status: pending
currency: USD
- external_id: bogus_c46f6004f924d4dec2d106bb
+ external_id: bogus_8b884aa28632ce7f3577a5e8
external_data:
- client_secret: bogus_secret_cfe4c7cadb9016c6
+ client_secret: bogus_secret_160742e3e1f61410
customer_external_id:
expires_at:
- created_at: '2026-02-21T09:07:30.974Z'
- updated_at: '2026-02-21T09:07:30.974Z'
+ created_at: '2026-02-21T13:15:00.709Z'
+ updated_at: '2026-02-21T13:15:00.709Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4280,13 +4280,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_278f0c1827f2b180959055db
+ external_id: bogus_1a0d02a686ff7da4b85b6132
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-02-21T09:07:32.466Z'
- updated_at: '2026-02-21T09:07:32.466Z'
+ created_at: '2026-02-21T13:15:02.025Z'
+ updated_at: '2026-02-21T13:15:02.025Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4327,13 +4327,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_d5930cb89cfc96efbc3bfc9c
+ external_id: bogus_c09a7a687e7508e6d3c822a2
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-02-21T09:07:33.913Z'
- updated_at: '2026-02-21T09:07:33.926Z'
+ created_at: '2026-02-21T13:15:03.417Z'
+ updated_at: '2026-02-21T13:15:03.435Z'
amount: '50.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4408,13 +4408,13 @@ paths:
id: ps_UkLWZg9DAJ
status: completed
currency: USD
- external_id: bogus_16d73598a2ad31b8ed790224
+ external_id: bogus_feb7f1151c0dfb5074c2987e
external_data:
client_secret: secret_123
customer_external_id:
expires_at:
- created_at: '2026-02-21T09:07:34.601Z'
- updated_at: '2026-02-21T09:07:34.613Z'
+ created_at: '2026-02-21T13:15:04.094Z'
+ updated_at: '2026-02-21T13:15:04.105Z'
amount: '110.0'
payment_method_id: pm_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4478,11 +4478,11 @@ paths:
example:
id: pss_gbHJdmfrXB
status: pending
- external_id: bogus_seti_703c412fe38e6b8630fac999
- external_client_secret: bogus_seti_secret_bbff2501d5972a54
+ external_id: bogus_seti_7e7facbd1ad73e6e3cb81d9e
+ external_client_secret: bogus_seti_secret_dac647897d74c085
external_data: {}
- created_at: '2026-02-21T09:07:35.877Z'
- updated_at: '2026-02-21T09:07:35.877Z'
+ created_at: '2026-02-21T13:15:05.340Z'
+ updated_at: '2026-02-21T13:15:05.340Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id:
payment_source_type:
@@ -4565,12 +4565,12 @@ paths:
example:
id: pss_UkLWZg9DAJ
status: pending
- external_id: seti_test_81df5ce2552aadf28f39cb74
- external_client_secret: seti_secret_eaa6962ddb545d1620a53258
+ external_id: seti_test_f591e3df347d08bb2d366087
+ external_client_secret: seti_secret_45bebc3c7db600473c4dfabc
external_data:
client_secret: secret_123
- created_at: '2026-02-21T09:07:37.566Z'
- updated_at: '2026-02-21T09:07:37.566Z'
+ created_at: '2026-02-21T13:15:06.997Z'
+ updated_at: '2026-02-21T13:15:06.997Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id:
payment_source_type:
@@ -4629,12 +4629,12 @@ paths:
example:
id: pss_UkLWZg9DAJ
status: completed
- external_id: seti_test_0057f0f2d25d0db0c8db5d6d
- external_client_secret: seti_secret_8af79e81d0c7168674850aba
+ external_id: seti_test_c1de3a42cf3e7d445471877a
+ external_client_secret: seti_secret_a403e04eb5ea9e01ec9f4305
external_data:
client_secret: secret_123
- created_at: '2026-02-21T09:07:38.934Z'
- updated_at: '2026-02-21T09:07:38.953Z'
+ created_at: '2026-02-21T13:15:08.134Z'
+ updated_at: '2026-02-21T13:15:08.149Z'
payment_method_id: pm_UkLWZg9DAJ
payment_source_id: card_UkLWZg9DAJ
payment_source_type: Spree::CreditCard
@@ -4703,11 +4703,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PXRM3TYH
+ number: PXR973PO
amount: '110.0'
display_amount: "$110.00"
- created_at: '2026-02-21T09:07:40.332Z'
- updated_at: '2026-02-21T09:07:40.332Z'
+ created_at: '2026-02-21T13:15:09.356Z'
+ updated_at: '2026-02-21T13:15:09.356Z'
source_type: credit_card
source_id: card_UkLWZg9DAJ
source:
@@ -4787,11 +4787,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PKKGFQV9
+ number: PHXQC56T
amount: '110.0'
display_amount: "$110.00"
- created_at: '2026-02-21T09:07:41.839Z'
- updated_at: '2026-02-21T09:07:41.839Z'
+ created_at: '2026-02-21T13:15:10.790Z'
+ updated_at: '2026-02-21T13:15:10.790Z'
source_type: credit_card
source_id: card_UkLWZg9DAJ
source:
@@ -4875,20 +4875,18 @@ paths:
example:
data:
- id: prod_UkLWZg9DAJ
- name: Product 596465
+ name: Product 598417
description: |-
- Neque suscipit qui eum temporibus doloribus quisquam consectetur nostrum. Est repudiandae quidem cumque unde consectetur possimus dignissimos. Voluptas repellat vero temporibus praesentium minima. Neque eius a tempore adipisci esse asperiores. Aspernatur officiis nulla harum ipsum nisi.
- Laboriosam deserunt deleniti amet iste quod tempora corrupti. Inventore sequi magnam asperiores assumenda. Soluta culpa deserunt repellat mollitia quibusdam. Atque maiores nihil totam rerum velit in.
- Veniam expedita aliquid laboriosam necessitatibus amet eligendi nobis nam. Exercitationem fugiat veritatis non illum labore cum esse. Distinctio optio facere velit est.
- Qui magni porro labore cum facilis impedit eos fugit. Totam debitis ab provident voluptatibus. Accusantium deleniti ipsum voluptas nisi aperiam quae.
- Omnis eos vero aperiam qui nesciunt voluptate mollitia. Fuga minima ullam autem nihil necessitatibus nobis assumenda reiciendis. Velit iusto autem voluptatem excepturi. Magni recusandae nesciunt excepturi fugit voluptatem quos nihil.
- slug: product-596465
+ Distinctio consequatur vitae voluptatum nihil deleniti quaerat. Libero soluta assumenda nulla sapiente inventore dolores nihil. Blanditiis dignissimos ea aspernatur eveniet maxime ab rerum. Cumque incidunt atque voluptas aspernatur.
+ Sed dicta cupiditate beatae quasi. Sunt unde dolores explicabo pariatur similique ipsa. Aspernatur dolor nostrum ad repellendus.
+ Sequi similique natus iure at quidem mollitia eos. Fugit distinctio dolore corrupti perspiciatis eius quidem expedita officia. Molestias saepe facere quod maiores ab. Cumque dignissimos maxime ex minima quidem vero aliquam maiores.
+ slug: product-598417
meta_description:
meta_keywords:
variant_count: 1
- available_on: '2025-02-21T09:07:42.613Z'
- created_at: '2026-02-21T09:07:42.633Z'
- updated_at: '2026-02-21T09:07:42.728Z'
+ available_on: '2025-02-21T13:15:11.518Z'
+ created_at: '2026-02-21T13:15:11.534Z'
+ updated_at: '2026-02-21T13:15:11.613Z'
purchasable: true
in_stock: false
backorderable: true
@@ -4908,18 +4906,20 @@ paths:
price_list_id:
original_price:
- id: prod_gbHJdmfrXB
- name: Product 604179
+ name: Product 605301
description: |-
- Aliquid provident eaque repellat odio. Beatae in vitae nesciunt quis vel neque laboriosam. Explicabo sint doloremque vel nobis mollitia pariatur. Saepe cupiditate accusamus in quos nulla delectus tempora.
- Velit natus quod laborum error. Illo aut cum atque nobis. Magni officia rerum laudantium quidem. Saepe cumque enim earum quia.
- Ullam facilis vel commodi voluptates blanditiis corporis quasi. Alias labore qui laborum corporis cum dignissimos quo. Et sapiente occaecati voluptate voluptas doloremque est porro. Amet quasi ipsum quis laborum nam iste sed. Repellat illum numquam animi minima voluptatem tempora.
- slug: product-604179
+ Laborum dolor occaecati nisi iure enim reiciendis blanditiis eum. Porro quas omnis corporis hic. Et minima voluptate vero ipsam. Sed facere repellat aspernatur maiores explicabo. Quisquam asperiores sunt nam dignissimos veritatis facilis.
+ Ipsa accusamus vel odit quaerat ut illo necessitatibus. Sunt officiis aspernatur perferendis laboriosam. Quaerat minima fugiat tempore nemo.
+ Impedit nobis nihil eum tenetur fuga. Quos quasi debitis ab dignissimos aut quibusdam. Molestias quidem harum rem voluptatem dignissimos et.
+ Sunt nobis vitae omnis nihil. Accusamus sed iusto omnis unde possimus. Doloremque minus soluta aperiam quaerat minima hic et impedit. Veniam maiores a hic magnam sequi aliquam.
+ Fugit fuga repellendus dignissimos veritatis placeat magnam doloremque. Magnam dolores porro iste quasi quo fugit quia. Quidem cupiditate tempore est incidunt. Facere dolor quis fugit laboriosam repellendus optio.
+ slug: product-605301
meta_description:
meta_keywords:
variant_count: 0
- available_on: '2025-02-21T09:07:42.747Z'
- created_at: '2026-02-21T09:07:42.758Z'
- updated_at: '2026-02-21T09:07:42.784Z'
+ available_on: '2025-02-21T13:15:11.630Z'
+ created_at: '2026-02-21T13:15:11.639Z'
+ updated_at: '2026-02-21T13:15:11.661Z'
purchasable: true
in_stock: false
backorderable: true
@@ -5004,20 +5004,17 @@ paths:
application/json:
example:
id: prod_UkLWZg9DAJ
- name: Product 717071
+ name: Product 719800
description: |-
- In placeat nesciunt numquam magnam modi reiciendis ratione at. Eum eos quo assumenda corrupti pariatur quia qui. Ratione odio in suscipit cumque qui sed atque. Iusto qui laboriosam veritatis sunt maxime nemo. Non perferendis atque recusandae nulla pariatur quae veritatis consequatur.
- Assumenda esse sunt consequatur voluptatem culpa occaecati quasi. Molestias veniam odit optio fugiat sequi cumque nam. Suscipit accusamus animi quis quos debitis amet. Reprehenderit deleniti magni exercitationem unde aliquid perspiciatis. Ea sapiente quod iusto magnam adipisci beatae.
- Minus libero impedit expedita tempora sit omnis. Saepe corporis explicabo ipsam consequuntur iure id debitis. Consectetur sint ipsam rem pariatur. Culpa eum fugiat voluptates incidunt quasi cupiditate.
- Nam optio facere veniam distinctio minima voluptas ipsam. Quidem veniam quae voluptates minus. Harum quo deserunt repellat fugit recusandae soluta facilis. Quasi quibusdam rerum sapiente odio labore velit. Modi doloribus temporibus porro ipsa eum iusto.
- Qui iure alias quas hic. Unde pariatur autem doloremque facere. Numquam tenetur molestias repudiandae sequi. Laudantium nesciunt vero sint illum excepturi ducimus qui. Reprehenderit dolorum aliquid fuga repellat nobis.
- slug: product-717071
+ Expedita esse nesciunt quam maxime sed. Perferendis fuga repudiandae numquam itaque iusto odit quia. A quos atque eos sed dolorum tenetur quam earum.
+ Inventore consectetur delectus illo dignissimos veritatis. Distinctio dolor debitis exercitationem dolore. Neque sint ab et libero ipsum voluptates adipisci consequuntur. Suscipit aut libero deleniti iste aspernatur qui nobis.
+ slug: product-719800
meta_description:
meta_keywords:
variant_count: 1
- available_on: '2025-02-21T09:07:44.066Z'
- created_at: '2026-02-21T09:07:44.089Z'
- updated_at: '2026-02-21T09:07:44.249Z'
+ available_on: '2025-02-21T13:15:12.788Z'
+ created_at: '2026-02-21T13:15:12.801Z'
+ updated_at: '2026-02-21T13:15:12.866Z'
purchasable: true
in_stock: false
backorderable: true
@@ -5222,15 +5219,15 @@ paths:
example:
data:
- id: ship_UkLWZg9DAJ
- number: H92321187493
+ number: H93280087825
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:48.108Z'
- updated_at: '2026-02-21T09:07:48.132Z'
+ created_at: '2026-02-21T13:15:16.725Z'
+ updated_at: '2026-02-21T13:15:16.755Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -5238,7 +5235,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_280
- name: Wilburn Abernathy
+ name: Lucienne Roob
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -5335,15 +5332,15 @@ paths:
application/json:
example:
id: ship_UkLWZg9DAJ
- number: H97897945880
+ number: H70983960718
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:49.564Z'
- updated_at: '2026-02-21T09:07:49.587Z'
+ created_at: '2026-02-21T13:15:18.138Z'
+ updated_at: '2026-02-21T13:15:18.159Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -5351,7 +5348,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_288
- name: Deanna Hartmann
+ name: Idell Gerhold
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -5424,10 +5421,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R114491162
+ number: R867738286
state: delivery
- token: pYoCRrQGvWFMyA3Z32dyJZkrgj7i44ZMPT3
+ token: TrPmsLVRMfd48DvocnKdAmTMCZ9FyuS4iuW
special_instructions:
currency: USD
item_count: 1
@@ -5450,16 +5447,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:50.911Z'
- updated_at: '2026-02-21T09:07:51.041Z'
+ created_at: '2026-02-21T13:15:19.388Z'
+ updated_at: '2026-02-21T13:15:19.511Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1033509
- slug: product-1033509
+ name: Product 103951
+ slug: product-103951
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -5478,23 +5475,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:50.978Z'
- updated_at: '2026-02-21T09:07:50.978Z'
+ created_at: '2026-02-21T13:15:19.451Z'
+ updated_at: '2026-02-21T13:15:19.451Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H23772260292
+ number: H45832111747
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:50.991Z'
- updated_at: '2026-02-21T09:07:51.040Z'
+ created_at: '2026-02-21T13:15:19.464Z'
+ updated_at: '2026-02-21T13:15:19.510Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -5502,7 +5499,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_296
- name: Ranae Miller
+ name: Rosalie Runolfsson
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -5615,10 +5612,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R653643949
+ number: R636671590
state: cart
- token: vYxQnmaQZqaAYneLrntLhXrqJrXknEQYAYy
+ token: Ad2nUggyc5atSdr2B5sv4vf1y2KSDbpCjgG
special_instructions:
currency: USD
item_count: 1
@@ -5641,16 +5638,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:52.285Z'
- updated_at: '2026-02-21T09:07:52.783Z'
+ created_at: '2026-02-21T13:15:20.734Z'
+ updated_at: '2026-02-21T13:15:21.135Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1053008
- slug: product-1053008
+ name: Product 105259
+ slug: product-105259
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -5669,23 +5666,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:52.342Z'
- updated_at: '2026-02-21T09:07:52.342Z'
+ created_at: '2026-02-21T13:15:20.791Z'
+ updated_at: '2026-02-21T13:15:20.791Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H60098250614
+ number: H93461201044
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:52.355Z'
- updated_at: '2026-02-21T09:07:52.389Z'
+ created_at: '2026-02-21T13:15:20.803Z'
+ updated_at: '2026-02-21T13:15:20.824Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -5693,7 +5690,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_304
- name: Debra Luettgen
+ name: Aracely Wisoky
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -5715,12 +5712,12 @@ paths:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
state: checkout
- response_code: 1-SC-20260221090752778888
- number: PBDEME1X
+ response_code: 1-SC-20260221131521131701
+ number: PH1FCG37
amount: '10.0'
display_amount: "$10.00"
- created_at: '2026-02-21T09:07:52.783Z'
- updated_at: '2026-02-21T09:07:52.783Z'
+ created_at: '2026-02-21T13:15:21.135Z'
+ updated_at: '2026-02-21T13:15:21.135Z'
source_type: store_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -5834,10 +5831,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R619244500
+ number: R063543006
state: cart
- token: NccsrUrGDLnU3qCgaVK6EK3op4oczEuMyou
+ token: DBckefMfwia72wzVFKFJjMzfDzxDWr5ux2k
special_instructions:
currency: USD
item_count: 1
@@ -5860,16 +5857,16 @@ paths:
total: '110.0'
display_total: "$110.00"
completed_at:
- created_at: '2026-02-21T09:07:54.112Z'
- updated_at: '2026-02-21T09:07:54.235Z'
+ created_at: '2026-02-21T13:15:22.436Z'
+ updated_at: '2026-02-21T13:15:22.568Z'
order_promotions: []
line_items:
- id: li_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
currency: USD
- name: Product 1075408
- slug: product-1075408
+ name: Product 1074959
+ slug: product-1074959
options_text: ''
price: '10.0'
display_price: "$10.00"
@@ -5888,23 +5885,23 @@ paths:
discounted_amount: '10.0'
display_discounted_amount: "$10.00"
display_compare_at_amount: "$0.00"
- created_at: '2026-02-21T09:07:54.177Z'
- updated_at: '2026-02-21T09:07:54.177Z'
+ created_at: '2026-02-21T13:15:22.522Z'
+ updated_at: '2026-02-21T13:15:22.522Z'
compare_at_amount:
thumbnail_url:
option_values: []
digital_links: []
shipments:
- id: ship_UkLWZg9DAJ
- number: H46331343101
+ number: H04660718515
state: pending
tracking: U10000
tracking_url:
cost: '100.0'
display_cost: "$100.00"
shipped_at:
- created_at: '2026-02-21T09:07:54.193Z'
- updated_at: '2026-02-21T09:07:54.222Z'
+ created_at: '2026-02-21T13:15:22.535Z'
+ updated_at: '2026-02-21T13:15:22.558Z'
shipping_method:
id: shpm_UkLWZg9DAJ
name: UPS Ground
@@ -5912,7 +5909,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_312
- name: Ora Beahan
+ name: Ed Collier
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -5992,26 +5989,16 @@ paths:
meta_description: Sample store description.
meta_keywords:
seo_title:
- default_currency: USD
code: spree_1
- default: true
facebook: spreecommerce
twitter: spreecommerce
instagram: spreecommerce
customer_support_email: [email protected]
- default_locale: en
- created_at: '2026-02-21T09:06:42.736Z'
- updated_at: '2026-02-21T09:06:42.881Z'
- default_country_iso: US
- supported_currencies:
- - USD
- - EUR
- - GBP
+ created_at: '2026-02-21T13:14:17.007Z'
+ updated_at: '2026-02-21T13:14:17.101Z'
favicon_image_url:
logo_image_url:
social_image_url:
- supported_locales:
- - en
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreStore"
@@ -6066,32 +6053,32 @@ paths:
- id: txnmy_UkLWZg9DAJ
name: Categories
position: 1
- created_at: '2026-02-21T09:06:42.746Z'
- updated_at: '2026-02-21T09:06:42.776Z'
+ created_at: '2026-02-21T13:14:17.015Z'
+ updated_at: '2026-02-21T13:14:17.035Z'
root_id: txn_UkLWZg9DAJ
- id: txnmy_gbHJdmfrXB
name: Brands
position: 2
- created_at: '2026-02-21T09:06:42.777Z'
- updated_at: '2026-02-21T09:06:42.791Z'
+ created_at: '2026-02-21T13:14:17.036Z'
+ updated_at: '2026-02-21T13:14:17.042Z'
root_id: txn_gbHJdmfrXB
- id: txnmy_EfhxLZ9ck8
name: Collections
position: 3
- created_at: '2026-02-21T09:06:42.793Z'
- updated_at: '2026-02-21T09:06:42.884Z'
+ created_at: '2026-02-21T13:14:17.043Z'
+ updated_at: '2026-02-21T13:14:17.103Z'
root_id: txn_EfhxLZ9ck8
- id: txnmy_VqXmZF31wY
name: taxonomy_11
position: 4
- created_at: '2026-02-21T09:07:54.290Z'
- updated_at: '2026-02-21T09:07:54.299Z'
+ created_at: '2026-02-21T13:15:22.615Z'
+ updated_at: '2026-02-21T13:15:22.623Z'
root_id: txn_OIJLhNcSbf
- id: txnmy_uw2YK1rnl0
name: taxonomy_12
position: 5
- created_at: '2026-02-21T09:07:54.300Z'
- updated_at: '2026-02-21T09:07:54.308Z'
+ created_at: '2026-02-21T13:15:22.624Z'
+ updated_at: '2026-02-21T13:15:22.631Z'
root_id: txn_AXs1igzRC6
meta:
page: 1
@@ -6157,8 +6144,8 @@ paths:
id: txnmy_VqXmZF31wY
name: taxonomy_17
position: 4
- created_at: '2026-02-21T09:07:54.577Z'
- updated_at: '2026-02-21T09:07:54.585Z'
+ created_at: '2026-02-21T13:15:22.880Z'
+ updated_at: '2026-02-21T13:15:22.893Z'
root_id: txn_OIJLhNcSbf
schema:
"$ref": "#/components/schemas/StoreTaxonomy"
@@ -6219,8 +6206,8 @@ paths:
meta_description:
meta_keywords:
children_count: 0
- created_at: '2026-02-21T09:06:42.762Z'
- updated_at: '2026-02-21T09:06:42.773Z'
+ created_at: '2026-02-21T13:14:17.025Z'
+ updated_at: '2026-02-21T13:14:17.034Z'
parent_id:
taxonomy_id: txnmy_UkLWZg9DAJ
description: ''
@@ -6239,8 +6226,8 @@ paths:
meta_description:
meta_keywords:
children_count: 0
- created_at: '2026-02-21T09:06:42.779Z'
- updated_at: '2026-02-21T09:06:42.784Z'
+ created_at: '2026-02-21T13:14:17.038Z'
+ updated_at: '2026-02-21T13:14:17.041Z'
parent_id:
taxonomy_id: txnmy_gbHJdmfrXB
description: ''
@@ -6259,8 +6246,8 @@ paths:
meta_description:
meta_keywords:
children_count: 2
- created_at: '2026-02-21T09:06:42.802Z'
- updated_at: '2026-02-21T09:06:42.884Z'
+ created_at: '2026-02-21T13:14:17.045Z'
+ updated_at: '2026-02-21T13:14:17.103Z'
parent_id:
taxonomy_id: txnmy_EfhxLZ9ck8
description: ''
@@ -6279,8 +6266,8 @@ paths:
meta_description:
meta_keywords:
children_count: 0
- created_at: '2026-02-21T09:06:42.820Z'
- updated_at: '2026-02-21T09:06:42.822Z'
+ created_at: '2026-02-21T13:14:17.055Z'
+ updated_at: '2026-02-21T13:14:17.057Z'
parent_id: txn_EfhxLZ9ck8
taxonomy_id: txnmy_EfhxLZ9ck8
description: ''
@@ -6299,8 +6286,8 @@ paths:
meta_description:
meta_keywords:
children_count: 0
- created_at: '2026-02-21T09:06:42.832Z'
- updated_at: '2026-02-21T09:06:42.833Z'
+ created_at: '2026-02-21T13:14:17.065Z'
+ updated_at: '2026-02-21T13:14:17.066Z'
parent_id: txn_EfhxLZ9ck8
taxonomy_id: txnmy_EfhxLZ9ck8
description: ''
@@ -6319,8 +6306,8 @@ paths:
meta_description:
meta_keywords:
children_count: 1
- created_at: '2026-02-21T09:07:55.114Z'
- updated_at: '2026-02-21T09:07:55.177Z'
+ created_at: '2026-02-21T13:15:23.281Z'
+ updated_at: '2026-02-21T13:15:23.336Z'
parent_id:
taxonomy_id: txnmy_VqXmZF31wY
description: ''
@@ -6339,8 +6326,8 @@ paths:
meta_description:
meta_keywords:
children_count: 1
- created_at: '2026-02-21T09:07:55.122Z'
- updated_at: '2026-02-21T09:07:55.177Z'
+ created_at: '2026-02-21T13:15:23.291Z'
+ updated_at: '2026-02-21T13:15:23.335Z'
parent_id: txn_OIJLhNcSbf
taxonomy_id: txnmy_VqXmZF31wY
description: ''
@@ -6359,8 +6346,8 @@ paths:
meta_description:
meta_keywords:
children_count: 0
- created_at: '2026-02-21T09:07:55.132Z'
- updated_at: '2026-02-21T09:07:55.138Z'
+ created_at: '2026-02-21T13:15:23.301Z'
+ updated_at: '2026-02-21T13:15:23.308Z'
parent_id: txn_AXs1igzRC6
taxonomy_id: txnmy_VqXmZF31wY
description: ''
@@ -6441,8 +6428,8 @@ paths:
meta_description:
meta_keywords:
children_count: 1
- created_at: '2026-02-21T09:07:56.096Z'
- updated_at: '2026-02-21T09:07:56.145Z'
+ created_at: '2026-02-21T13:15:24.038Z'
+ updated_at: '2026-02-21T13:15:24.074Z'
parent_id: txn_OIJLhNcSbf
taxonomy_id: txnmy_VqXmZF31wY
description: ''
@@ -6513,19 +6500,18 @@ paths:
example:
data:
- id: prod_UkLWZg9DAJ
- name: Product 1157954
- description: Exercitationem vitae commodi non aliquam rem eos architecto
- ex. Eius iusto cumque maiores expedita repellat excepturi. Molestiae
- omnis atque unde harum neque delectus officia maxime. Debitis
- rerum fuga praesentium officia mollitia assumenda. Non id optio
- inventore minus harum nisi temporibus.
- slug: product-1157954
+ name: Product 1157840
+ description: |-
+ Voluptatibus qui sint nam similique sapiente deleniti temporibus. Id accusamus consequuntur qui quis. Ad iste debitis nesciunt nulla architecto officia doloremque consectetur. Libero temporibus officiis architecto occaecati.
+ Ipsam veniam corporis maiores labore assumenda. Nam eos nisi exercitationem architecto tempore dolore quisquam. Officia quam magnam accusamus iste sint eveniet asperiores atque. Ratione tempora nesciunt consectetur officia. Suscipit vel quod itaque repellat deleniti dolorum fuga.
+ Ipsa itaque repellendus quae sed laudantium consequatur vero neque. Quod quae necessitatibus dolorum tempore inventore dolore. Culpa iste quae doloremque fugiat omnis commodi hic sed. Dicta veritatis cupiditate placeat porro perferendis aperiam.
+ slug: product-1157840
meta_description:
meta_keywords:
variant_count: 0
- available_on: '2025-02-21T09:07:57.397Z'
- created_at: '2026-02-21T09:07:57.414Z'
- updated_at: '2026-02-21T09:07:57.442Z'
+ available_on: '2025-02-21T13:15:24.917Z'
+ created_at: '2026-02-21T13:15:24.957Z'
+ updated_at: '2026-02-21T13:15:25.018Z'
purchasable: true
in_stock: false
backorderable: true
@@ -6622,9 +6608,9 @@ paths:
data:
- id: wl_UkLWZg9DAJ
name: My Wishlist
- token: PnNzDNuBRb2AiEZGqqcnV1PK
- created_at: '2026-02-21T09:07:59.938Z'
- updated_at: '2026-02-21T09:07:59.938Z'
+ token: QRBW8BqsQFx2nkrG5n133ig3
+ created_at: '2026-02-21T13:15:26.140Z'
+ updated_at: '2026-02-21T13:15:26.140Z'
is_default: false
is_private: true
meta:
@@ -6683,9 +6669,9 @@ paths:
example:
id: wl_gbHJdmfrXB
name: Birthday Ideas
- token: gvkadCSc5Xs344Qg9exv4Het
- created_at: '2026-02-21T09:08:01.511Z'
- updated_at: '2026-02-21T09:08:01.511Z'
+ token: bYMTYA3ZJpWDCmDr7N7oBLhL
+ created_at: '2026-02-21T13:15:27.523Z'
+ updated_at: '2026-02-21T13:15:27.523Z'
is_default: false
is_private: true
schema:
@@ -6758,9 +6744,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: My Wishlist
- token: BQAgT3BnmVVCttFTCtAgqzi5
- created_at: '2026-02-21T09:08:02.762Z'
- updated_at: '2026-02-21T09:08:02.762Z'
+ token: 7jmtradyxyGJ8wjYnn9zqRap
+ created_at: '2026-02-21T13:15:28.717Z'
+ updated_at: '2026-02-21T13:15:28.717Z'
is_default: false
is_private: true
schema:
@@ -6806,9 +6792,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: Updated Name
- token: B4dNAawiCFZso3cYvooe8bFM
- created_at: '2026-02-21T09:08:04.053Z'
- updated_at: '2026-02-21T09:08:04.137Z'
+ token: t7sZTvnfS9KDCYXxtAt8a5yr
+ created_at: '2026-02-21T13:15:29.984Z'
+ updated_at: '2026-02-21T13:15:30.058Z'
is_default: false
is_private: true
schema:
@@ -6889,8 +6875,8 @@ paths:
variant_id: variant_gbHJdmfrXB
wishlist_id: wl_UkLWZg9DAJ
quantity: 1
- created_at: '2026-02-21T09:08:05.469Z'
- updated_at: '2026-02-21T09:08:05.469Z'
+ created_at: '2026-02-21T13:15:31.391Z'
+ updated_at: '2026-02-21T13:15:31.391Z'
variant:
id: variant_gbHJdmfrXB
product_id: prod_gbHJdmfrXB
@@ -6899,8 +6885,8 @@ paths:
options_text: ''
track_inventory: true
image_count: 0
- created_at: '2026-02-21T09:08:05.421Z'
- updated_at: '2026-02-21T09:08:05.445Z'
+ created_at: '2026-02-21T13:15:31.343Z'
+ updated_at: '2026-02-21T13:15:31.367Z'
thumbnail:
purchasable: true
in_stock: false
@@ -8947,12 +8933,8 @@ components:
seo_title:
type: string
nullable: true
- default_currency:
- type: string
code:
type: string
- default:
- type: boolean
facebook:
type: string
nullable: true
@@ -8965,19 +8947,10 @@ components:
customer_support_email:
type: string
nullable: true
- default_locale:
- type: string
created_at:
type: string
updated_at:
type: string
- default_country_iso:
- type: string
- nullable: true
- supported_currencies:
- type: array
- items:
- type: string
favicon_image_url:
type: string
nullable: true
@@ -8987,10 +8960,6 @@ components:
social_image_url:
type: string
nullable: true
- supported_locales:
- type: array
- items:
- type: string
payment_methods:
type: array
items:
@@ -9002,22 +8971,16 @@ components:
- meta_description
- meta_keywords
- seo_title
- - default_currency
- code
- - default
- facebook
- twitter
- instagram
- customer_support_email
- - default_locale
- created_at
- updated_at
- - default_country_iso
- - supported_currencies
- favicon_image_url
- logo_image_url
- social_image_url
- - supported_locales
- payment_methods
x-typelizer: true
StoreTaxon:
diff --git a/docs/developer/upgrades/5.3-to-5.4.mdx b/docs/developer/upgrades/5.3-to-5.4.mdx
index 8297cc06f9..e18eaa9af6 100644
--- a/docs/developer/upgrades/5.3-to-5.4.mdx
+++ b/docs/developer/upgrades/5.3-to-5.4.mdx
@@ -85,6 +85,48 @@ end
Prefix length isn't limited by default, but we recommend to keep it short.
+### Migrate Checkout Zones to Markets
+
+Spree 5.4 introduces [Markets](/developer/core-concepts/markets) as the primary way to manage which countries are available for checkout, along with their currencies and locales. The legacy `checkout_zone` field on the Store model is now deprecated and will be removed in Spree 5.5.
+
+New stores automatically get a default market created from their `default_country` — no manual setup needed. For existing stores that used `checkout_zone`, run the migration rake task:
+
+ ```bash
+ bin/rake spree:markets:migrate_checkout_zones
+ ```
+
+This will:
+1. Read the `checkout_zone` countries from each store
+2. Create a default Market with those countries, currency, and locale
+3. Clear the `checkout_zone_id` column
+
+<Warning>
+ You will need to run this rake task locally and on your production environment. After running, verify your markets are set up correctly in the Admin Dashboard under **Settings → Markets**.
+</Warning>
+
+#### Deprecated Store methods
+
+The following Store methods now emit deprecation warnings and will be removed in Spree 5.5:
+
+| Deprecated method | Replacement |
+|---|---|
+| `store.checkout_zone` | Use [Markets](/developer/core-concepts/markets) to manage countries |
+| `store.checkout_zone=` | Use [Markets](/developer/core-concepts/markets) to manage countries |
+
+The `store.default_country` reader now returns the first country (by name) from the store's default market. The `store.default_country_iso=` setter still works and is used to set the country when creating a store — a default market is automatically created from it.
+
+#### Code that references `checkout_zone` for tax
+
+If your application used `store.checkout_zone` as a tax zone fallback, update it to use `Spree::Zone.default_tax` instead:
+
+```ruby
+# Before
+zone = current_store.checkout_zone
+
+# After
+zone = Spree::Zone.default_tax
+```
+
### (Optional) Install API v2
Spree 5.4 ships with API v3, which marks deprecation of API v2. API v2 is still available but you need to install it separately. If you currently use API v2, you can do this by running the following command:
diff --git a/docs/docs.json b/docs/docs.json
index e7cc0f2c4b..d5092f968d 100644
--- a/docs/docs.json
+++ b/docs/docs.json
@@ -229,6 +229,7 @@
{
"group": "Upgrade Guides",
"pages": [
+ "developer/upgrades/5.3-to-5.4",
"developer/upgrades/5.2-to-5.3",
"developer/upgrades/5.1-to-5.2",
"developer/upgrades/5.0-to-5.1",
diff --git a/packages/next/.changeset/deprecate-store-checkout-zone.md b/packages/next/.changeset/deprecate-store-checkout-zone.md
new file mode 100644
index 0000000000..ed2ece9344
--- /dev/null
+++ b/packages/next/.changeset/deprecate-store-checkout-zone.md
@@ -0,0 +1,5 @@
+---
+'@spree/next': patch
+---
+
+Update `StoreStore` type — fields removed upstream in `@spree/sdk` (`default_currency`, `default_locale`, `default`, `supported_currencies`, `supported_locales`, `default_country_iso`) are no longer part of the store response. Use dedicated `listCurrencies`, `listLocales`, and `listCountries` functions instead.
diff --git a/packages/sdk/.changeset/deprecate-store-checkout-zone.md b/packages/sdk/.changeset/deprecate-store-checkout-zone.md
new file mode 100644
index 0000000000..606c091c0e
--- /dev/null
+++ b/packages/sdk/.changeset/deprecate-store-checkout-zone.md
@@ -0,0 +1,12 @@
+---
+'@spree/sdk': minor
+---
+
+Remove deprecated fields from `StoreStore` type — these are now managed through Markets and dedicated API endpoints
+
+- Remove `default_currency` — use `store.currencies.list()` or the `X-Spree-Country` header for automatic currency resolution
+- Remove `default_locale` — use `store.locales.list()` or the `X-Spree-Country` header for automatic locale resolution
+- Remove `default` — internal flag, not useful for storefront clients
+- Remove `supported_currencies` — use `store.currencies.list()` instead
+- Remove `supported_locales` — use `store.locales.list()` instead
+- Remove `default_country_iso` — use `store.countries.list()` instead
diff --git a/packages/sdk/src/types/generated/StoreStore.ts b/packages/sdk/src/types/generated/StoreStore.ts
index c08e6763d6..a5798f0240 100644
--- a/packages/sdk/src/types/generated/StoreStore.ts
+++ b/packages/sdk/src/types/generated/StoreStore.ts
@@ -1,4 +1,4 @@
-// Typelizer digest b0ecec6ce200842afc076bf2ec1b8716
+// Typelizer digest e86d34b6d54b848c8389f2075e9f2a51
//
// DO NOT MODIFY: This file was automatically generated by Typelizer.
import type {StorePaymentMethod} from '@/types'
@@ -10,22 +10,16 @@ type StoreStore = {
meta_description: string | null;
meta_keywords: string | null;
seo_title: string | null;
- default_currency: string;
code: string;
- default: boolean;
facebook: string | null;
twitter: string | null;
instagram: string | null;
customer_support_email: string | null;
- default_locale: string;
created_at: string;
updated_at: string;
- default_country_iso: string | null;
- supported_currencies: Array<string>;
favicon_image_url: string | null;
logo_image_url: string | null;
social_image_url: string | null;
- supported_locales: Array<string>;
payment_methods: Array<StorePaymentMethod>;
}
diff --git a/packages/sdk/src/zod/generated/StoreStore.ts b/packages/sdk/src/zod/generated/StoreStore.ts
index 8f12e86f0a..d89b022ef2 100644
--- a/packages/sdk/src/zod/generated/StoreStore.ts
+++ b/packages/sdk/src/zod/generated/StoreStore.ts
@@ -9,22 +9,16 @@ export const StoreStoreSchema = z.object({
meta_description: z.string().nullable(),
meta_keywords: z.string().nullable(),
seo_title: z.string().nullable(),
- default_currency: z.string(),
code: z.string(),
- default: z.boolean(),
facebook: z.string().nullable(),
twitter: z.string().nullable(),
instagram: z.string().nullable(),
customer_support_email: z.string().nullable(),
- default_locale: z.string(),
created_at: z.string(),
updated_at: z.string(),
- default_country_iso: z.string().nullable(),
- supported_currencies: z.array(z.string()),
favicon_image_url: z.string().nullable(),
logo_image_url: z.string().nullable(),
social_image_url: z.string().nullable(),
- supported_locales: z.array(z.string()),
payment_methods: z.array(StorePaymentMethodSchema),
});