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.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Add PaymentSetupSession — gateway-agnostic API for saving payment methods (#13620)
Damian Legawiec195658fab626
diff --git a/backend/db/schema.rb b/backend/db/schema.rbindex 9b3d36ccc4..f003947d8e 100644--- a/backend/db/schema.rb+++ b/backend/db/schema.rb@@ -10,7 +10,7 @@## It's strongly recommended that you check this file into your version control system.-ActiveRecord::Schema[8.1].define(version: 2026_02_16_150246) do+ActiveRecord::Schema[8.1].define(version: 2026_02_18_156042) do# These are extensions that must be enabled in order to support this databaseenable_extension "pg_catalog.plpgsql"enable_extension "pg_trgm"@@ -805,6 +805,26 @@ ActiveRecord::Schema[8.1].define(version: 2026_02_16_150246) dot.index ["type"], name: "index_spree_payment_sessions_on_type"end+ create_table "spree_payment_setup_sessions", force: :cascade do |t|+ t.datetime "created_at", null: false+ t.bigint "customer_id"+ t.datetime "deleted_at"+ t.string "external_client_secret"+ t.jsonb "external_data"+ t.string "external_id"+ t.bigint "payment_method_id", null: false+ t.bigint "payment_source_id"+ t.string "payment_source_type"+ t.string "status", null: false+ t.datetime "updated_at", null: false+ t.index ["customer_id"], name: "index_spree_payment_setup_sessions_on_customer_id"+ t.index ["deleted_at"], name: "index_spree_payment_setup_sessions_on_deleted_at"+ t.index ["external_id", "payment_method_id"], name: "idx_spree_pss_unique_external_id_per_pm", unique: true+ t.index ["payment_method_id"], name: "index_spree_payment_setup_sessions_on_payment_method_id"+ t.index ["payment_source_type", "payment_source_id"], name: "idx_spree_pss_on_payment_source"+ t.index ["status"], name: "index_spree_payment_setup_sessions_on_status"+ end+create_table "spree_payment_sources", force: :cascade do |t|t.datetime "created_at", precision: nil, null: falset.string "gateway_customer_profile_id"diff --git a/backend/engines/api/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rb b/backend/engines/api/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rbnew file mode 100644index 0000000000..470c9451b6--- /dev/null+++ b/backend/engines/api/app/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller.rb@@ -0,0 +1,83 @@+module Spree+ module Api+ module V3+ module Store+ module Customer+ class PaymentSetupSessionsController < ResourceController+ prepend_before_action :require_authentication!++ skip_before_action :set_resource+ before_action :set_payment_setup_session, only: [:show, :complete]++ # POST /api/v3/store/customer/payment_setup_sessions+ def create+ payment_method = current_store.payment_methods.find_by_prefix_id!(permitted_params[:payment_method_id])++ @payment_setup_session = payment_method.create_payment_setup_session(+ customer: current_user,+ external_data: permitted_params[:external_data] || {}+ )++ if @payment_setup_session.persisted?+ render json: serialize_resource(@payment_setup_session), status: :created+ else+ render_errors(@payment_setup_session.errors)+ end+ end++ # GET /api/v3/store/customer/payment_setup_sessions/:id+ def show+ render json: serialize_resource(@payment_setup_session)+ end++ # PATCH /api/v3/store/customer/payment_setup_sessions/:id/complete+ def complete+ @payment_setup_session.payment_method.complete_payment_setup_session(+ setup_session: @payment_setup_session,+ params: complete_params+ )++ if @payment_setup_session.errors.empty?+ render json: serialize_resource(@payment_setup_session.reload)+ else+ render_errors(@payment_setup_session.errors)+ end+ end++ protected++ def set_parent+ @parent = current_user+ end++ def parent_association+ :payment_setup_sessions+ end++ def model_class+ Spree::PaymentSetupSession+ end++ def serializer_class+ Spree.api.payment_setup_session_serializer+ end++ def permitted_params+ params.permit(Spree::PermittedAttributes.payment_setup_session_attributes)+ end++ def complete_params+ params.permit({ external_data: {} })+ end++ private++ def set_payment_setup_session+ @payment_setup_session = current_user.payment_setup_sessions.find_by_prefix_id!(params[:id])+ end+ end+ end+ end+ end+ end+enddiff --git a/backend/engines/api/app/serializers/spree/api/v3/payment_setup_session_serializer.rb b/backend/engines/api/app/serializers/spree/api/v3/payment_setup_session_serializer.rbnew file mode 100644index 0000000000..90aff3f0cb--- /dev/null+++ b/backend/engines/api/app/serializers/spree/api/v3/payment_setup_session_serializer.rb@@ -0,0 +1,33 @@+module Spree+ module Api+ module V3+ class PaymentSetupSessionSerializer < BaseSerializer+ typelize status: :string, external_id: 'string | null', external_client_secret: 'string | null',+ external_data: 'Record<string, unknown>',+ payment_method_id: 'string | null', payment_source_id: 'string | null',+ payment_source_type: 'string | null', customer_id: 'string | null'++ attributes :status, :external_id, :external_client_secret, :external_data,+ created_at: :iso8601, updated_at: :iso8601++ attribute :payment_method_id do |session|+ session.payment_method&.prefixed_id+ end++ attribute :payment_source_id do |session|+ session.payment_source&.prefixed_id+ end++ attribute :payment_source_type do |session|+ session.payment_source_type+ end++ attribute :customer_id do |session|+ session.customer&.prefixed_id+ end++ one :payment_method, resource: Spree.api.payment_method_serializer+ end+ end+ end+enddiff --git a/backend/engines/api/config/routes.rb b/backend/engines/api/config/routes.rbindex ad6fb79079..62ae24fc98 100644--- a/backend/engines/api/config/routes.rb+++ b/backend/engines/api/config/routes.rb@@ -63,6 +63,11 @@ Spree::Core::Engine.add_routes doendresources :credit_cards, only: [:index, :show, :destroy]resources :gift_cards, only: [:index, :show]+ resources :payment_setup_sessions, only: [:create, :show] do+ member do+ patch :complete+ end+ endend# Wishlistsdiff --git a/backend/engines/api/lib/spree/api/dependencies.rb b/backend/engines/api/lib/spree/api/dependencies.rbindex cb735826b2..d362bec0bc 100644--- a/backend/engines/api/lib/spree/api/dependencies.rb+++ b/backend/engines/api/lib/spree/api/dependencies.rb@@ -102,6 +102,7 @@ module Spreeline_item_serializer: 'Spree::Api::V3::LineItemSerializer',payment_serializer: 'Spree::Api::V3::PaymentSerializer',payment_session_serializer: 'Spree::Api::V3::PaymentSessionSerializer',+ payment_setup_session_serializer: 'Spree::Api::V3::PaymentSetupSessionSerializer',payment_source_serializer: 'Spree::Api::V3::PaymentSourceSerializer',store_credit_serializer: 'Spree::Api::V3::StoreCreditSerializer',shipment_serializer: 'Spree::Api::V3::ShipmentSerializer',diff --git a/backend/engines/api/spec/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller_spec.rb b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller_spec.rbnew file mode 100644index 0000000000..9ccf8c74fe--- /dev/null+++ b/backend/engines/api/spec/controllers/spree/api/v3/store/customer/payment_setup_sessions_controller_spec.rb@@ -0,0 +1,113 @@+require 'spec_helper'++RSpec.describe Spree::Api::V3::Store::Customer::PaymentSetupSessionsController, type: :controller do+ render_views++ include_context 'API v3 Store'++ let(:payment_method) { create(:bogus_payment_method, stores: [store]) }+ let!(:payment_setup_session) do+ create(:payment_setup_session,+ customer: user,+ payment_method: payment_method,+ external_data: { 'client_secret' => 'secret_123' })+ end++ before do+ request.headers['X-Spree-Api-Key'] = api_key.token+ request.headers['Authorization'] = "Bearer #{jwt_token}"+ end++ describe 'POST #create' do+ it 'creates a payment setup session' do+ post :create, params: {+ payment_method_id: payment_method.prefixed_id+ }++ expect(response).to have_http_status(:created)+ expect(json_response['id']).to be_present+ expect(json_response['status']).to eq('pending')+ expect(json_response['payment_method_id']).to eq(payment_method.prefixed_id)+ expect(json_response['external_client_secret']).to be_present+ end++ context 'error handling' do+ it 'returns not found for non-existent payment method' do+ post :create, params: {+ payment_method_id: 'invalid'+ }++ expect(response).to have_http_status(:not_found)+ end+ end++ context 'without authentication' do+ before { request.headers['Authorization'] = nil }++ it 'returns unauthorized' do+ post :create, params: {+ payment_method_id: payment_method.prefixed_id+ }++ expect(response).to have_http_status(:unauthorized)+ end+ end+ end++ describe 'GET #show' do+ it 'returns the payment setup session' do+ get :show, params: { id: payment_setup_session.prefixed_id }++ expect(response).to have_http_status(:ok)+ expect(json_response['id']).to eq(payment_setup_session.prefixed_id)+ expect(json_response['status']).to eq('pending')+ expect(json_response['external_data']).to eq({ 'client_secret' => 'secret_123' })+ end++ context 'when session belongs to another user' do+ let(:other_user) { create(:user) }+ let(:other_session) { create(:payment_setup_session, customer: other_user, payment_method: payment_method) }++ it 'returns not found' do+ get :show, params: { id: other_session.prefixed_id }++ expect(response).to have_http_status(:not_found)+ end+ end++ context 'without authentication' do+ before { request.headers['Authorization'] = nil }++ it 'returns unauthorized' do+ get :show, params: { id: payment_setup_session.prefixed_id }++ expect(response).to have_http_status(:unauthorized)+ end+ end+ end++ describe 'PATCH #complete' do+ it 'completes the payment setup session and saves a payment source' do+ patch :complete, params: {+ id: payment_setup_session.prefixed_id+ }++ expect(response).to have_http_status(:ok)+ expect(json_response['status']).to eq('completed')+ expect(json_response['payment_source_id']).to be_present+ expect(json_response['payment_source_type']).to eq('Spree::CreditCard')+ end++ context 'without authentication' do+ before { request.headers['Authorization'] = nil }++ it 'returns unauthorized' do+ patch :complete, params: {+ id: payment_setup_session.prefixed_id+ }++ expect(response).to have_http_status(:unauthorized)+ end+ end+ end+enddiff --git a/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rbnew file mode 100644index 0000000000..050a4e6bb1--- /dev/null+++ b/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb@@ -0,0 +1,154 @@+# frozen_string_literal: true++require 'swagger_helper'++RSpec.describe 'Payment Setup Sessions API', type: :request, swagger_doc: 'api-reference/store.yaml' do+ include_context 'API v3 Store'++ let(:payment_method) { create(:bogus_payment_method, stores: [store]) }+ let!(:payment_setup_session) do+ create(:payment_setup_session,+ customer: user,+ payment_method: payment_method,+ external_data: { 'client_secret' => 'secret_123' })+ end++ path '/api/v3/store/customer/payment_setup_sessions' do+ post 'Create payment setup session' do+ tags 'Payment Setup Sessions'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Creates a new payment setup session for saving a payment method for future use. Delegates to the payment gateway to initialize a provider-specific setup flow (e.g. Stripe SetupIntent, Adyen zero-auth tokenization).'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: true+ parameter name: :body, in: :body, schema: {+ type: :object,+ properties: {+ payment_method_id: { type: :string, example: 'pm_abc123', description: 'Payment method ID' },+ external_data: { type: :object, description: 'Provider-specific data passed to the gateway' }+ },+ required: %w[payment_method_id]+ }++ response '201', 'payment setup session created' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:body) { { payment_method_id: payment_method.prefixed_id } }++ schema '$ref' => '#/components/schemas/StorePaymentSetupSession'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('pending')+ expect(data['payment_method_id']).to eq(payment_method.prefixed_id)+ expect(data['external_client_secret']).to be_present+ end+ end++ response '401', 'unauthorized' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { '' }+ let(:body) { { payment_method_id: payment_method.prefixed_id } }++ schema '$ref' => '#/components/schemas/ErrorResponse'+ run_test!+ end++ response '404', 'payment method not found' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:body) { { payment_method_id: 'invalid' } }++ schema '$ref' => '#/components/schemas/ErrorResponse'+ run_test!+ end+ end+ end++ path '/api/v3/store/customer/payment_setup_sessions/{id}' do+ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: true+ parameter name: :id, in: :path, type: :string, required: true,+ description: 'Payment setup session ID'++ get 'Get payment setup session' do+ tags 'Payment Setup Sessions'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Returns a payment setup session with its current status and provider data.'++ response '200', 'payment setup session found' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:id) { payment_setup_session.to_param }++ schema '$ref' => '#/components/schemas/StorePaymentSetupSession'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['id']).to eq(payment_setup_session.prefixed_id)+ expect(data['status']).to eq('pending')+ end+ end++ response '404', 'payment setup session not found' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:id) { 'invalid' }++ schema '$ref' => '#/components/schemas/ErrorResponse'+ run_test!+ end+ end+ end++ path '/api/v3/store/customer/payment_setup_sessions/{id}/complete' do+ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: 'Authorization', in: :header, type: :string, required: true+ parameter name: :id, in: :path, type: :string, required: true,+ description: 'Payment setup session ID'++ patch 'Complete payment setup session' do+ tags 'Payment Setup Sessions'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Completes a payment setup session by confirming the setup with the provider, resulting in a saved payment method.'++ parameter name: :body, in: :body, required: false, schema: {+ type: :object,+ properties: {+ external_data: { type: :object, description: 'Provider-specific completion data' }+ }+ }++ response '200', 'payment setup session completed' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:id) { payment_setup_session.to_param }+ let(:body) { {} }++ schema '$ref' => '#/components/schemas/StorePaymentSetupSession'++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['status']).to eq('completed')+ expect(data['payment_source_id']).to be_present+ expect(data['payment_source_type']).to eq('Spree::CreditCard')+ end+ end++ response '404', 'payment setup session not found' do+ let(:'x-spree-api-key') { api_key.token }+ let(:'Authorization') { "Bearer #{jwt_token}" }+ let(:id) { 'invalid' }+ let(:body) { {} }++ schema '$ref' => '#/components/schemas/ErrorResponse'+ run_test!+ end+ end+ end+enddiff --git a/backend/engines/api/spec/swagger_helper.rb b/backend/engines/api/spec/swagger_helper.rbindex e1af691384..3b444853a1 100644--- a/backend/engines/api/spec/swagger_helper.rb+++ b/backend/engines/api/spec/swagger_helper.rb@@ -100,6 +100,7 @@ RSpec.configure do |config|{ name: 'Customers', description: 'Customer account management' },{ name: 'Addresses', description: 'Customer address book' },{ name: 'Credit Cards', description: 'Saved payment methods' },+ { name: 'Payment Setup Sessions', description: 'Save payment methods for future use via gateway-agnostic setup sessions' },{ name: 'Wishlists', description: 'Customer wishlists' },{ name: 'Digitals', description: 'Digital product downloads' }],@@ -107,7 +108,7 @@ RSpec.configure do |config|{ name: 'Store', tags: %w[Store Countries] },{ name: 'Catalog', tags: %w[Products Taxonomies Taxons] },{ name: 'Checkout', tags: ['Cart', 'Orders', 'Line Items', 'Coupon Codes', 'Payments', 'Payment Sessions', 'Payment Methods', 'Shipments'] },- { name: 'Customer', tags: ['Authentication', 'Customers', 'Addresses', 'Credit Cards', 'Wishlists', 'Digitals'] }+ { name: 'Customer', tags: ['Authentication', 'Customers', 'Addresses', 'Credit Cards', 'Payment Setup Sessions', 'Wishlists', 'Digitals'] }],components: {securitySchemes: {diff --git a/backend/engines/core/app/models/concerns/spree/user_payment_source.rb b/backend/engines/core/app/models/concerns/spree/user_payment_source.rbindex fe30214db1..eb7b69ad07 100644--- a/backend/engines/core/app/models/concerns/spree/user_payment_source.rb+++ b/backend/engines/core/app/models/concerns/spree/user_payment_source.rb@@ -4,6 +4,8 @@ module Spreeincluded dohas_many :credit_cards, class_name: 'Spree::CreditCard', foreign_key: :user_id, dependent: :destroy+ has_many :payment_setup_sessions, class_name: 'Spree::PaymentSetupSession', foreign_key: :customer_id, dependent: :destroy+def default_credit_cardcredit_cards.default.firstenddiff --git a/backend/engines/core/app/models/spree/gateway/bogus.rb b/backend/engines/core/app/models/spree/gateway/bogus.rbindex 5193fcd443..a9c28396cf 100644--- a/backend/engines/core/app/models/spree/gateway/bogus.rb+++ b/backend/engines/core/app/models/spree/gateway/bogus.rb@@ -116,6 +116,34 @@ module Spreepayment_session.completeend+ def setup_session_supported?+ true+ end++ def create_payment_setup_session(customer:, external_data: {})+ payment_setup_sessions.create(+ customer: customer,+ status: 'pending',+ external_id: "bogus_seti_#{SecureRandom.hex(12)}",+ external_client_secret: "bogus_seti_secret_#{SecureRandom.hex(8)}",+ external_data: external_data+ )+ end++ def complete_payment_setup_session(setup_session:, params: {})+ credit_card = CreditCard.create!(+ user: setup_session.customer,+ payment_method: self,+ name: 'Bogus Card',+ last_digits: '4242',+ month: '12',+ year: 1.year.from_now.year.to_s,+ gateway_customer_profile_id: "BGS-#{Array.new(6) { rand(6) }.join}"+ )+ setup_session.update!(payment_source: credit_card)+ setup_session.complete+ end+def actions%w(capture void credit)enddiff --git a/backend/engines/core/app/models/spree/payment_method.rb b/backend/engines/core/app/models/spree/payment_method.rbindex fba99e756b..2735506780 100644--- a/backend/engines/core/app/models/spree/payment_method.rb+++ b/backend/engines/core/app/models/spree/payment_method.rb@@ -29,6 +29,7 @@ module Spreehas_many :credit_cards, class_name: 'Spree::CreditCard', dependent: :destroy # CCs are soft deletedhas_many :payment_sessions, class_name: 'Spree::PaymentSession', dependent: :destroy+ has_many :payment_setup_sessions, class_name: 'Spree::PaymentSetupSession', dependent: :destroyhas_many :gateway_customers, class_name: 'Spree::GatewayCustomer', dependent: :destroydef self.providers@@ -74,6 +75,30 @@ module Spreeraise ::NotImplementedError, 'You must implement complete_payment_session method for this gateway.'end+ # Whether this payment method supports setup sessions (saving payment methods for future use).+ # Override in gateway subclasses that support tokenization without a payment.+ def setup_session_supported?+ false+ end++ # The class used for payment setup sessions with this payment method.+ # Override in gateway subclasses to provide a provider-specific session class.+ def payment_setup_session_class+ nil+ end++ # Creates a payment setup session via the provider for saving a payment method.+ # Override in gateway subclasses to implement provider-specific setup session creation.+ def create_payment_setup_session(customer:, external_data: {})+ raise ::NotImplementedError, "#{self.class.name} does not implement #create_payment_setup_session"+ end++ # Completes a payment setup session via the provider.+ # Override in gateway subclasses to implement provider-specific setup session completion.+ def complete_payment_setup_session(setup_session:, params: {})+ raise ::NotImplementedError, "#{self.class.name} does not implement #complete_payment_setup_session"+ end+def method_typetype.demodulize.downcaseenddiff --git a/backend/engines/core/app/models/spree/payment_setup_session.rb b/backend/engines/core/app/models/spree/payment_setup_session.rbnew file mode 100644index 0000000000..9b2f333405--- /dev/null+++ b/backend/engines/core/app/models/spree/payment_setup_session.rb@@ -0,0 +1,79 @@+module Spree+ class PaymentSetupSession < Spree.base_class+ has_prefix_id :pss++ acts_as_paranoid++ include Spree::Metafields++ self.event_prefix = 'payment_setup_session'++ publishes_lifecycle_events++ belongs_to :customer, class_name: Spree.user_class.to_s, optional: true+ belongs_to :payment_method, class_name: 'Spree::PaymentMethod'+ belongs_to :payment_source, polymorphic: true, optional: true++ validates :payment_method, :status, presence: true+ validates :external_id, uniqueness: { scope: :payment_method_id }, allow_nil: true++ state_machine :status, initial: :pending do+ state :pending+ state :processing+ state :completed+ state :failed+ state :canceled+ state :expired++ event :process do+ transition pending: :processing+ end++ event :complete do+ transition [:pending, :processing] => :completed+ end++ event :fail do+ transition [:pending, :processing] => :failed+ end++ event :cancel do+ transition [:pending, :processing] => :canceled+ end++ event :expire do+ transition [:pending, :processing] => :expired+ end++ after_transition to: :processing, do: :publish_processing_event+ after_transition to: :completed, do: :publish_completed_event+ after_transition to: :failed, do: :publish_failed_event+ after_transition to: :canceled, do: :publish_canceled_event+ after_transition to: :expired, do: :publish_expired_event+ end++ scope :active, -> { where(status: %w[pending processing]) }++ private++ def publish_processing_event+ publish_event('payment_setup_session.processing')+ end++ def publish_completed_event+ publish_event('payment_setup_session.completed')+ end++ def publish_failed_event+ publish_event('payment_setup_session.failed')+ end++ def publish_canceled_event+ publish_event('payment_setup_session.canceled')+ end++ def publish_expired_event+ publish_event('payment_setup_session.expired')+ end+ end+enddiff --git a/backend/engines/core/app/serializers/spree/events/payment_setup_session_serializer.rb b/backend/engines/core/app/serializers/spree/events/payment_setup_session_serializer.rbnew file mode 100644index 0000000000..f4bac085a5--- /dev/null+++ b/backend/engines/core/app/serializers/spree/events/payment_setup_session_serializer.rb@@ -0,0 +1,23 @@+# frozen_string_literal: true++module Spree+ module Events+ class PaymentSetupSessionSerializer < BaseSerializer+ protected++ def attributes+ {+ id: public_id(resource),+ status: resource.status.to_s,+ external_id: resource.external_id,+ payment_method_id: public_id(resource.payment_method),+ customer_id: public_id(resource.customer),+ payment_source_id: public_id(resource.payment_source),+ payment_source_type: resource.payment_source_type,+ created_at: timestamp(resource.created_at),+ updated_at: timestamp(resource.updated_at)+ }+ end+ end+ end+enddiff --git a/backend/engines/core/db/migrate/20260218000000_create_spree_payment_setup_sessions.rb b/backend/engines/core/db/migrate/20260218000000_create_spree_payment_setup_sessions.rbnew file mode 100644index 0000000000..3d50a7650a--- /dev/null+++ b/backend/engines/core/db/migrate/20260218000000_create_spree_payment_setup_sessions.rb@@ -0,0 +1,24 @@+class CreateSpreePaymentSetupSessions < ActiveRecord::Migration[7.2]+ def change+ create_table :spree_payment_setup_sessions do |t|+ t.references :customer, index: true+ t.references :payment_method, null: false, index: true+ t.references :payment_source, polymorphic: true, index: { name: 'idx_spree_pss_on_payment_source' }+ t.string :status, null: false+ t.string :external_id+ t.string :external_client_secret+ if t.respond_to? :jsonb+ t.jsonb :external_data+ else+ t.json :external_data+ end+ t.datetime :deleted_at, index: true+ t.timestamps+ end++ add_index :spree_payment_setup_sessions, :status+ add_index :spree_payment_setup_sessions, [:external_id, :payment_method_id],+ unique: true,+ name: 'idx_spree_pss_unique_external_id_per_pm'+ end+enddiff --git a/backend/engines/core/lib/spree/permitted_attributes.rb b/backend/engines/core/lib/spree/permitted_attributes.rbindex e98200cb01..ab8dad1804 100644--- a/backend/engines/core/lib/spree/permitted_attributes.rb+++ b/backend/engines/core/lib/spree/permitted_attributes.rb@@ -36,6 +36,7 @@ module Spree:payment_attributes,:payment_method_attributes,:payment_session_attributes,+ :payment_setup_session_attributes,:policy_attributes,:post_attributes,:post_category_attributes,@@ -168,6 +169,8 @@ module Spree@@payment_session_attributes = [:amount, :payment_method_id, { external_data: {} }]+ @@payment_setup_session_attributes = [:payment_method_id, { external_data: {} }]+@@policy_attributes = [:name, :slug, :body]@@post_attributes = [:title, :meta_title, :meta_description, :slug, :author_id, :post_category_id, :published_at, :content, :excerpt, :image, tag_list: []]diff --git a/backend/engines/core/lib/spree/testing_support/factories/payment_setup_session_factory.rb b/backend/engines/core/lib/spree/testing_support/factories/payment_setup_session_factory.rbnew file mode 100644index 0000000000..203702c158--- /dev/null+++ b/backend/engines/core/lib/spree/testing_support/factories/payment_setup_session_factory.rb@@ -0,0 +1,31 @@+FactoryBot.define do+ factory :payment_setup_session, class: 'Spree::PaymentSetupSession' do+ customer { create(:user) }+ payment_method { create(:credit_card_payment_method) }+ status { 'pending' }+ external_id { "seti_test_#{SecureRandom.hex(12)}" }+ external_client_secret { "seti_secret_#{SecureRandom.hex(12)}" }+ external_data { {} }++ trait :processing do+ status { 'processing' }+ end++ trait :completed do+ status { 'completed' }+ payment_source { create(:credit_card, user: customer) }+ end++ trait :failed do+ status { 'failed' }+ end++ trait :canceled do+ status { 'canceled' }+ end++ trait :expired do+ status { 'expired' }+ end+ end+enddiff --git a/backend/engines/core/spec/models/spree/payment_setup_session_spec.rb b/backend/engines/core/spec/models/spree/payment_setup_session_spec.rbnew file mode 100644index 0000000000..3e8b8ef426--- /dev/null+++ b/backend/engines/core/spec/models/spree/payment_setup_session_spec.rb@@ -0,0 +1,208 @@+# frozen_string_literal: true++require 'spec_helper'++RSpec.describe Spree::PaymentSetupSession, type: :model do+ let(:store) { @default_store }+ let(:user) { create(:user) }+ let(:payment_method) { create(:bogus_payment_method, stores: [store]) }+ let(:payment_setup_session) { create(:payment_setup_session, customer: user, payment_method: payment_method) }++ describe 'validations' do+ it { expect(payment_setup_session).to be_valid }++ it 'requires payment_method' do+ payment_setup_session.payment_method = nil+ expect(payment_setup_session).not_to be_valid+ end++ it 'enforces unique external_id per payment_method' do+ payment_setup_session.update!(external_id: 'seti_123')+ duplicate = build(:payment_setup_session, payment_method: payment_method, external_id: 'seti_123')+ expect(duplicate).not_to be_valid+ expect(duplicate.errors[:external_id]).to be_present+ end++ it 'allows same external_id on different payment methods' do+ payment_setup_session.update!(external_id: 'seti_123')+ other_pm = create(:bogus_payment_method, stores: [store])+ other = build(:payment_setup_session, payment_method: other_pm, external_id: 'seti_123')+ expect(other).to be_valid+ end++ it 'allows nil external_id' do+ session1 = create(:payment_setup_session, customer: user, payment_method: payment_method, external_id: nil)+ session2 = build(:payment_setup_session, customer: user, payment_method: payment_method, external_id: nil)+ expect(session2).to be_valid+ end+ end++ describe 'associations' do+ it 'belongs to customer' do+ expect(payment_setup_session.customer).to eq(user)+ end++ it 'belongs to payment_method' do+ expect(payment_setup_session.payment_method).to eq(payment_method)+ end++ it 'can have a payment_source (CreditCard)' do+ credit_card = create(:credit_card, user: user)+ payment_setup_session.update!(payment_source: credit_card)+ expect(payment_setup_session.payment_source).to eq(credit_card)+ expect(payment_setup_session.payment_source_type).to eq('Spree::CreditCard')+ end+ end++ describe 'state machine' do+ describe '#process' do+ it 'transitions from pending to processing' do+ expect(payment_setup_session.process).to be true+ expect(payment_setup_session.status).to eq('processing')+ end+ end++ describe '#complete' do+ it 'transitions from pending to completed' do+ expect(payment_setup_session.complete).to be true+ expect(payment_setup_session.status).to eq('completed')+ end++ it 'transitions from processing to completed' do+ payment_setup_session.process+ expect(payment_setup_session.complete).to be true+ expect(payment_setup_session.status).to eq('completed')+ end+ end++ describe '#fail' do+ it 'transitions from pending to failed' do+ expect(payment_setup_session.fail).to be true+ expect(payment_setup_session.status).to eq('failed')+ end++ it 'transitions from processing to failed' do+ payment_setup_session.process+ expect(payment_setup_session.fail).to be true+ expect(payment_setup_session.status).to eq('failed')+ end+ end++ describe '#cancel' do+ it 'transitions from pending to canceled' do+ expect(payment_setup_session.cancel).to be true+ expect(payment_setup_session.status).to eq('canceled')+ end+ end++ describe '#expire' do+ it 'transitions from pending to expired' do+ expect(payment_setup_session.expire).to be true+ expect(payment_setup_session.status).to eq('expired')+ end+ end++ it 'does not allow transitioning from completed' do+ payment_setup_session.complete+ expect(payment_setup_session.cancel).to be false+ expect(payment_setup_session.status).to eq('completed')+ end++ it 'does not allow transitioning from failed' do+ payment_setup_session.fail+ expect(payment_setup_session.complete).to be false+ expect(payment_setup_session.status).to eq('failed')+ end+ end++ describe 'scopes' do+ describe '.active' do+ it 'includes pending sessions' do+ expect(described_class.active).to include(payment_setup_session)+ end++ it 'includes processing sessions' do+ payment_setup_session.process+ expect(described_class.active).to include(payment_setup_session)+ end++ it 'excludes completed sessions' do+ payment_setup_session.complete+ expect(described_class.active).not_to include(payment_setup_session)+ end++ it 'excludes expired sessions' do+ expired = create(:payment_setup_session, :expired, customer: user, payment_method: payment_method)+ expect(described_class.active).not_to include(expired)+ end+ end+ end++ describe '#prefixed_id' do+ it 'starts with pss_' do+ expect(payment_setup_session.prefixed_id).to start_with('pss_')+ end+ end++ describe 'soft delete' do+ it 'soft deletes with acts_as_paranoid' do+ payment_setup_session.destroy+ expect(described_class.with_deleted.find(payment_setup_session.id)).to be_present+ expect(described_class.find_by(id: payment_setup_session.id)).to be_nil+ end+ end++ describe 'events' do+ before do+ allow(Spree::Events).to receive(:enabled?).and_return(true)+ allow(Spree::Events).to receive(:publish)+ end++ describe 'lifecycle events' do+ it 'publishes payment_setup_session.created on create' do+ create(:payment_setup_session, customer: user, payment_method: payment_method)+ expect(Spree::Events).to have_received(:publish).with('payment_setup_session.created', anything, anything)+ end++ it 'publishes payment_setup_session.updated on update' do+ payment_setup_session.update!(external_id: 'new_id')+ expect(Spree::Events).to have_received(:publish).with('payment_setup_session.updated', anything, anything)+ end+ end++ describe 'state transition events' do+ it 'publishes payment_setup_session.processing on process' do+ payment_setup_session.process+ expect(Spree::Events).to have_received(:publish).with('payment_setup_session.processing', anything, anything)+ end++ it 'publishes payment_setup_session.completed on complete' do+ payment_setup_session.complete+ expect(Spree::Events).to have_received(:publish).with('payment_setup_session.completed', anything, anything)+ end++ it 'publishes payment_setup_session.failed on fail' do+ payment_setup_session.fail+ expect(Spree::Events).to have_received(:publish).with('payment_setup_session.failed', anything, anything)+ end++ it 'publishes payment_setup_session.canceled on cancel' do+ payment_setup_session.cancel+ expect(Spree::Events).to have_received(:publish).with('payment_setup_session.canceled', anything, anything)+ end++ it 'publishes payment_setup_session.expired on expire' do+ payment_setup_session.expire+ expect(Spree::Events).to have_received(:publish).with('payment_setup_session.expired', anything, anything)+ end++ it 'does not publish events when events are disabled' do+ allow(Spree::Events).to receive(:enabled?).and_return(false)++ payment_setup_session.complete++ expect(Spree::Events).not_to have_received(:publish).with('payment_setup_session.completed', anything, anything)+ end+ end+ end+enddiff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yamlindex 06b277df81..8f1171bc47 100644--- a/docs/api-reference/store.yaml+++ b/docs/api-reference/store.yaml@@ -530,14 +530,14 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTQ0MjY4OH0.OQxeO3Uw0RMb2DR3z93fHl4WQY9_2Bna0kNMBY2swH0+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTUxNTQ3N30.uBxiFkcVbnJSQwrzLgYSczuKI6ODdzJakv1MKow6VDsuser:id: cus_UkLWZg9DAJemail: [email protected]- first_name: Virgie- last_name: Bergstrom- created_at: '2026-02-17T19:24:48.560Z'- updated_at: '2026-02-17T19:24:48.560Z'+ first_name: Sharyn+ last_name: Walker+ created_at: '2026-02-18T15:37:56.798Z'+ updated_at: '2026-02-18T15:37:56.798Z'addresses: []default_billing_address:default_shipping_address:@@ -593,14 +593,14 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTQ0MjY5MH0.hdzPNDOKZM8dYCBHpUdsFUB7yeHsyMTKGf2mbJEq8LA+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTUxNTQ3OH0.J3-t-bhAEKPgLrpqvx9jk8QQ_yMLA2hpxKtUPOcbp84user:id: cus_UkLWZg9DAJemail: [email protected]first_name: Johnlast_name: Doe- created_at: '2026-02-17T19:24:50.020Z'- updated_at: '2026-02-17T19:24:50.020Z'+ created_at: '2026-02-18T15:37:58.195Z'+ updated_at: '2026-02-18T15:37:58.195Z'addresses: []default_billing_address:default_shipping_address:@@ -672,14 +672,14 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTQ0MjY5MH0.hdzPNDOKZM8dYCBHpUdsFUB7yeHsyMTKGf2mbJEq8LA+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImV4cCI6MTc3MTUxNTQ3OH0.J3-t-bhAEKPgLrpqvx9jk8QQ_yMLA2hpxKtUPOcbp84user:id: cus_UkLWZg9DAJemail: [email protected]- first_name: Rosena- last_name: Friesen- created_at: '2026-02-17T19:24:50.796Z'- updated_at: '2026-02-17T19:24:50.796Z'+ first_name: Val+ last_name: Grady+ created_at: '2026-02-18T15:37:58.749Z'+ updated_at: '2026-02-18T15:37:58.749Z'addresses: []default_billing_address:default_shipping_address:@@ -731,10 +731,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R583280854+ number: R921530365state: cart- token: Wi1UQKhBmGmLU81neav8sAjcXDDy7QfosZ5- email: [email protected]+ token: ZQcGqyL8DFcsCBXfQdaufSaUqiFF5D7LX4b+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -757,15 +757,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:24:52.091Z'- updated_at: '2026-02-17T19:24:52.256Z'+ created_at: '2026-02-18T15:37:59.851Z'+ updated_at: '2026-02-18T15:37:59.979Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 23242- slug: product-23242+ name: Product 21619+ slug: product-21619options_text: ''price: '10.0'display_price: "$10.00"@@ -784,23 +784,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:24:52.193Z'- updated_at: '2026-02-17T19:24:52.193Z'+ created_at: '2026-02-18T15:37:59.929Z'+ updated_at: '2026-02-18T15:37:59.929Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H61149080451+ number: H55596258871state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:24:52.208Z'- updated_at: '2026-02-17T19:24:52.238Z'+ created_at: '2026-02-18T15:37:59.943Z'+ updated_at: '2026-02-18T15:37:59.967Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -808,7 +808,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_39- name: Santa Batz+ name: Hyacinth Gorczanyaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -921,10 +921,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R964697181+ number: R065272221state: cart- token: n1QUueEgfyzRdXyj479s1qQRjs4gKWLQ28D- email: [email protected]+ token: PUhQjPRauiYXZKmi6853BQvBUqrWpVRWrkz+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -947,15 +947,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:24:52.300Z'- updated_at: '2026-02-17T19:24:52.432Z'+ created_at: '2026-02-18T15:38:00.082Z'+ updated_at: '2026-02-18T15:38:00.206Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 33613- slug: product-33613+ name: Product 33013+ slug: product-33013options_text: ''price: '10.0'display_price: "$10.00"@@ -974,23 +974,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:24:52.385Z'- updated_at: '2026-02-17T19:24:52.385Z'+ created_at: '2026-02-18T15:38:00.157Z'+ updated_at: '2026-02-18T15:38:00.157Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H06046394202+ number: H69760617547state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:24:52.399Z'- updated_at: '2026-02-17T19:24:52.421Z'+ created_at: '2026-02-18T15:38:00.172Z'+ updated_at: '2026-02-18T15:38:00.194Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -998,7 +998,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_43- name: Sha Moen+ name: Damien Bashirianaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -1277,10 +1277,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R510873096+ number: R485145561state: cart- token: akd8SvtkLYcH3Lh3QCQguNNhhrQWWkdW65u- email: [email protected]+ token: YDFHZM9TTmeQseeCbKbfKH5uLCjJhSsX19U+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -1303,15 +1303,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:24:56.743Z'- updated_at: '2026-02-17T19:24:56.909Z'+ created_at: '2026-02-18T15:38:04.524Z'+ updated_at: '2026-02-18T15:38:04.695Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 87524- slug: product-87524+ name: Product 87978+ slug: product-87978options_text: ''price: '10.0'display_price: "$10.00"@@ -1330,23 +1330,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:24:56.809Z'- updated_at: '2026-02-17T19:24:56.809Z'+ created_at: '2026-02-18T15:38:04.593Z'+ updated_at: '2026-02-18T15:38:04.593Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H14422393259+ number: H42941571817state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:24:56.823Z'- updated_at: '2026-02-17T19:24:56.847Z'+ created_at: '2026-02-18T15:38:04.607Z'+ updated_at: '2026-02-18T15:38:04.629Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -1354,7 +1354,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_63- name: Josef Larkin+ name: Maudie Macejkovicaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -1376,12 +1376,12 @@ paths:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJstate: checkout- response_code: 1-SC-20260217192456904204- number: P79RVZAS+ response_code: 1-SC-20260218153804690376+ number: PYSNCMMUamount: '50.0'display_amount: "$50.00"- created_at: '2026-02-17T19:24:56.909Z'- updated_at: '2026-02-17T19:24:56.909Z'+ created_at: '2026-02-18T15:38:04.695Z'+ updated_at: '2026-02-18T15:38:04.695Z'source_type: store_creditsource_id: credit_UkLWZg9DAJsource:@@ -1517,10 +1517,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R633165399+ number: R842138853state: cart- token: NVPcNrAndQKRDuop2gxK1w1pUdtgecdhMhN- email: [email protected]+ token: tSbqYxqF1VXAsE4pdWK1vsTLdzgdbk38fm3+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -1543,15 +1543,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:24:58.900Z'- updated_at: '2026-02-17T19:24:59.073Z'+ created_at: '2026-02-18T15:38:06.613Z'+ updated_at: '2026-02-18T15:38:06.811Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 113548- slug: product-113548+ name: Product 115354+ slug: product-115354options_text: ''price: '10.0'display_price: "$10.00"@@ -1570,23 +1570,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:24:58.960Z'- updated_at: '2026-02-17T19:24:59.062Z'+ created_at: '2026-02-18T15:38:06.673Z'+ updated_at: '2026-02-18T15:38:06.797Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H50877894357+ number: H80039652239state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:24:58.971Z'- updated_at: '2026-02-17T19:24:58.991Z'+ created_at: '2026-02-18T15:38:06.688Z'+ updated_at: '2026-02-18T15:38:06.712Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -1594,7 +1594,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_75- name: Adah Graham+ name: Cassidy Gutkowskiaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -1848,11 +1848,11 @@ paths:application/json:example:id: cus_UkLWZg9DAJ- email: [email protected]- first_name: Deeann- last_name: Green- created_at: '2026-02-17T19:25:03.443Z'- updated_at: '2026-02-17T19:25:03.721Z'+ email: [email protected]+ first_name: Shanika+ last_name: Schaden+ created_at: '2026-02-18T15:38:11.179Z'+ updated_at: '2026-02-18T15:38:11.460Z'addresses:- id: addr_gbHJdmfrXBfirstname: John@@ -1954,11 +1954,11 @@ paths:application/json:example:id: cus_UkLWZg9DAJ- email: [email protected]+ email: [email protected]first_name: Updatedlast_name: Name- created_at: '2026-02-17T19:25:04.021Z'- updated_at: '2026-02-17T19:25:04.308Z'+ created_at: '2026-02-18T15:38:11.763Z'+ updated_at: '2026-02-18T15:38:12.056Z'addresses:- id: addr_gbHJdmfrXBfirstname: John@@ -2174,10 +2174,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R871324435+ number: R392776479state: cart- token: 67hZ9WWvtzr23ude1fWKphFyWvXTZL9reSk- email: [email protected]+ token: PUVgbebYDtaPEjMQMSyBUbuzNFG3t7d56Cj+ email: [email protected]special_instructions:currency: USDitem_count: 3@@ -2200,15 +2200,15 @@ paths:total: '49.98'display_total: "$49.98"completed_at:- created_at: '2026-02-17T19:25:08.827Z'- updated_at: '2026-02-17T19:25:09.028Z'+ created_at: '2026-02-18T15:38:16.275Z'+ updated_at: '2026-02-18T15:38:16.428Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 217954- slug: product-217954+ name: Product 214767+ slug: product-214767options_text: ''price: '10.0'display_price: "$10.00"@@ -2227,8 +2227,8 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:08.915Z'- updated_at: '2026-02-17T19:25:08.915Z'+ created_at: '2026-02-18T15:38:16.336Z'+ updated_at: '2026-02-18T15:38:16.336Z'compare_at_amount:thumbnail_url:option_values: []@@ -2236,8 +2236,8 @@ paths:- id: li_gbHJdmfrXBvariant_id: variant_gbHJdmfrXBquantity: 2- name: Product 225081- slug: product-225081+ name: Product 224620+ slug: product-224620options_text: ''price: '19.99'display_price: "$19.99"@@ -2256,8 +2256,8 @@ paths:discounted_amount: '39.98'display_discounted_amount: "$39.98"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:09.027Z'- updated_at: '2026-02-17T19:25:09.027Z'+ created_at: '2026-02-18T15:38:16.428Z'+ updated_at: '2026-02-18T15:38:16.428Z'compare_at_amount:thumbnail_url:option_values: []@@ -2353,10 +2353,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R044751422+ number: R006172220state: cart- token: dorh3XAYb1JwCMoYYbUQxizYLb1RVrD4MBZ- email: [email protected]+ token: bDVN1Lxk8DepDdvSxfj1idnmUnPh7zSDXK9+ email: [email protected]special_instructions:currency: USDitem_count: 5@@ -2379,15 +2379,15 @@ paths:total: '99.95'display_total: "$99.95"completed_at:- created_at: '2026-02-17T19:25:10.987Z'- updated_at: '2026-02-17T19:25:11.076Z'+ created_at: '2026-02-18T15:38:18.303Z'+ updated_at: '2026-02-18T15:38:18.388Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 5- name: Product 254413- slug: product-254413+ name: Product 255553+ slug: product-255553options_text: ''price: '19.99'display_price: "$19.99"@@ -2406,8 +2406,8 @@ paths:discounted_amount: '99.95'display_discounted_amount: "$99.95"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:11.054Z'- updated_at: '2026-02-17T19:25:11.083Z'+ created_at: '2026-02-18T15:38:18.366Z'+ updated_at: '2026-02-18T15:38:18.400Z'compare_at_amount:thumbnail_url:option_values: []@@ -2487,10 +2487,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R477418870+ number: R814289744state: cart- token: pbPHcyeSTYJE7Wvn573Hm49J4Ej5GJz3f7S- email: [email protected]+ token: KT1dvhiMdHNFzy41wBaSsxr9SStehJFYtXF+ email: [email protected]special_instructions:currency: USDitem_count: 0@@ -2513,8 +2513,8 @@ paths:total: '0.0'display_total: "$0.00"completed_at:- created_at: '2026-02-17T19:25:11.690Z'- updated_at: '2026-02-17T19:25:11.784Z'+ created_at: '2026-02-18T15:38:18.981Z'+ updated_at: '2026-02-18T15:38:19.073Z'order_promotions: []line_items: []shipments: []@@ -2599,10 +2599,10 @@ paths:example:data:- id: or_UkLWZg9DAJ- number: R785375026+ number: R232788032state: cart- token: zvpfvyRF3pYiFYhMXFMZapboVVZZsmda26u- email: [email protected]+ token: tDDtsGJzP1VJDpTE8Xz6r5BLk2JywbwhMXZ+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -2625,15 +2625,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:25:13.112Z'- updated_at: '2026-02-17T19:25:13.231Z'+ created_at: '2026-02-18T15:38:20.276Z'+ updated_at: '2026-02-18T15:38:20.391Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 28820- slug: product-28820+ name: Product 2890+ slug: product-2890options_text: ''price: '10.0'display_price: "$10.00"@@ -2652,23 +2652,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:13.185Z'- updated_at: '2026-02-17T19:25:13.185Z'+ created_at: '2026-02-18T15:38:20.334Z'+ updated_at: '2026-02-18T15:38:20.334Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H66606773852+ number: H09293228453state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:13.199Z'- updated_at: '2026-02-17T19:25:13.220Z'+ created_at: '2026-02-18T15:38:20.347Z'+ updated_at: '2026-02-18T15:38:20.375Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -2676,7 +2676,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_135- name: Orville Ritchie+ name: Edmundo Blockaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -2785,10 +2785,10 @@ paths:application/json:example:id: or_gbHJdmfrXB- number: R036180477+ number: R487646106state: cart- token: 12hR5Bf4gWFz8iUmV1pqEi4CxQijoYjqWSH- email: [email protected]+ token: ZUbS8bsrszoGDJ84k39hbFWFrCMRmwcx8yt+ email: [email protected]special_instructions:currency: USDitem_count: 0@@ -2811,8 +2811,8 @@ paths:total: '0.0'display_total: "$0.00"completed_at:- created_at: '2026-02-17T19:25:15.274Z'- updated_at: '2026-02-17T19:25:15.274Z'+ created_at: '2026-02-18T15:38:22.402Z'+ updated_at: '2026-02-18T15:38:22.402Z'order_promotions: []line_items: []shipments: []@@ -2820,7 +2820,7 @@ paths:bill_address:ship_address:payment_methods: []- order_token: 12hR5Bf4gWFz8iUmV1pqEi4CxQijoYjqWSH+ order_token: ZUbS8bsrszoGDJ84k39hbFWFrCMRmwcx8ytschema:type: objectallOf:@@ -2884,9 +2884,9 @@ paths:application/json:example:id: or_gbHJdmfrXB- number: R928256158+ number: R997117633state: cart- token: yeyLz4qgAWitexKnrNaWvmKuC439APGUDeF+ token: gYRjVcQQ8k8CdSe9W6bvtX9opvhwoc4R7uyemail:special_instructions:currency: USD@@ -2910,15 +2910,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:25:17.287Z'- updated_at: '2026-02-17T19:25:17.406Z'+ created_at: '2026-02-18T15:38:24.431Z'+ updated_at: '2026-02-18T15:38:24.542Z'order_promotions: []line_items:- id: li_gbHJdmfrXBvariant_id: variant_gbHJdmfrXBquantity: 1- name: Product 352156- slug: product-352156+ name: Product 352179+ slug: product-352179options_text: ''price: '10.0'display_price: "$10.00"@@ -2937,23 +2937,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:17.352Z'- updated_at: '2026-02-17T19:25:17.352Z'+ created_at: '2026-02-18T15:38:24.493Z'+ updated_at: '2026-02-18T15:38:24.493Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_gbHJdmfrXB- number: H62173674634+ number: H29970283842state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:17.373Z'- updated_at: '2026-02-17T19:25:17.394Z'+ created_at: '2026-02-18T15:38:24.510Z'+ updated_at: '2026-02-18T15:38:24.529Z'shipping_method:id: shpm_gbHJdmfrXBname: UPS Ground@@ -2961,7 +2961,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_159- name: Florencio Wisozk+ name: Bok Russeladdress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -3061,10 +3061,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R837606828+ number: R716584855state: cart- token: sZsevNtMuEbyFF4fThQYP1m3sHBCd2qkFND- email: [email protected]+ token: m3hc1oZvCTAeaoKgomjovVcHua1hrtwpXsM+ email: [email protected]special_instructions: Leave at doorcurrency: USDitem_count: 1@@ -3087,15 +3087,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:25:19.618Z'- updated_at: '2026-02-17T19:25:19.813Z'+ created_at: '2026-02-18T15:38:26.748Z'+ updated_at: '2026-02-18T15:38:26.886Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 383108- slug: product-383108+ name: Product 388468+ slug: product-388468options_text: ''price: '10.0'display_price: "$10.00"@@ -3114,23 +3114,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:19.750Z'- updated_at: '2026-02-17T19:25:19.750Z'+ created_at: '2026-02-18T15:38:26.811Z'+ updated_at: '2026-02-18T15:38:26.811Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H37254553909+ number: H57401556915state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:19.766Z'- updated_at: '2026-02-17T19:25:19.792Z'+ created_at: '2026-02-18T15:38:26.825Z'+ updated_at: '2026-02-18T15:38:26.854Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -3138,7 +3138,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_174- name: Arthur Feil+ name: Lavina Bartolettiaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -3317,10 +3317,10 @@ paths:application/json:example:id: or_gbHJdmfrXB- number: R438644715+ number: R782355643state: address- token: AuWCzf7DZXQWTYoJmsakisGMKeKtanBHFyz- email: [email protected]+ token: hztNTBiUZjKUFUFo3G5jEL49jFZo5j7x8rs+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -3343,15 +3343,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:25:21.344Z'- updated_at: '2026-02-17T19:25:21.470Z'+ created_at: '2026-02-18T15:38:28.414Z'+ updated_at: '2026-02-18T15:38:28.525Z'order_promotions: []line_items:- id: li_gbHJdmfrXBvariant_id: variant_gbHJdmfrXBquantity: 1- name: Product 426868- slug: product-426868+ name: Product 42396+ slug: product-42396options_text: ''price: '10.0'display_price: "$10.00"@@ -3370,23 +3370,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:21.412Z'- updated_at: '2026-02-17T19:25:21.412Z'+ created_at: '2026-02-18T15:38:28.474Z'+ updated_at: '2026-02-18T15:38:28.474Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_gbHJdmfrXB- number: H76951365409+ number: H81933444443state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:21.427Z'- updated_at: '2026-02-17T19:25:21.449Z'+ created_at: '2026-02-18T15:38:28.487Z'+ updated_at: '2026-02-18T15:38:28.505Z'shipping_method:id: shpm_gbHJdmfrXBname: UPS Ground@@ -3394,7 +3394,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_184- name: Edmund Schmeler+ name: Brunilda Heathcoteaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -3496,10 +3496,10 @@ paths:application/json:example:id: or_gbHJdmfrXB- number: R094067239+ number: R415935816state: payment- token: zTxHMd8N1xdkPw9XqqYWjM2HuPtyCfZGcMC- email: [email protected]+ token: pxFv8EFg6cjXd7HCGhvWk8Z8a7T6q1Gr4vG+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -3522,15 +3522,15 @@ paths:total: '29.99'display_total: "$29.99"completed_at:- created_at: '2026-02-17T19:25:22.865Z'- updated_at: '2026-02-17T19:25:23.084Z'+ created_at: '2026-02-18T15:38:29.900Z'+ updated_at: '2026-02-18T15:38:30.099Z'order_promotions: []line_items:- id: li_gbHJdmfrXBvariant_id: variant_gbHJdmfrXBquantity: 1- name: Product 455562- slug: product-455562+ name: Product 459147+ slug: product-459147options_text: ''price: '19.99'display_price: "$19.99"@@ -3549,23 +3549,23 @@ paths:discounted_amount: '19.99'display_discounted_amount: "$19.99"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:22.926Z'- updated_at: '2026-02-17T19:25:23.002Z'+ created_at: '2026-02-18T15:38:29.955Z'+ updated_at: '2026-02-18T15:38:30.019Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_EfhxLZ9ck8- number: H56071118347+ number: H74531540631state: pendingtracking:tracking_url:cost: '10.0'display_cost: "$10.00"shipped_at:- created_at: '2026-02-17T19:25:23.022Z'- updated_at: '2026-02-17T19:25:23.044Z'+ created_at: '2026-02-18T15:38:30.038Z'+ updated_at: '2026-02-18T15:38:30.061Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -3573,7 +3573,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_194- name: Mauricio Lesch+ name: Jesse Buckridgeaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -3674,10 +3674,10 @@ paths:application/json:example:id: or_gbHJdmfrXB- number: R385481093+ number: R199361072state: complete- token: HF87ZsCJrMvWASFCyHvFiM41k3XsRxvr1Er- email: [email protected]+ token: eXtxEKsJryL1AWMo3BQgmTtUPyvvFVSaXeN+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -3699,16 +3699,16 @@ paths:display_additional_tax_total: "$0.00"total: '29.99'display_total: "$29.99"- completed_at: '2026-02-17T19:25:24.108Z'- created_at: '2026-02-17T19:25:23.784Z'- updated_at: '2026-02-17T19:25:24.108Z'+ completed_at: '2026-02-18T15:38:31.121Z'+ created_at: '2026-02-18T15:38:30.783Z'+ updated_at: '2026-02-18T15:38:31.121Z'order_promotions: []line_items:- id: li_gbHJdmfrXBvariant_id: variant_gbHJdmfrXBquantity: 1- name: Product 47491- slug: product-47491+ name: Product 474623+ slug: product-474623options_text: ''price: '19.99'display_price: "$19.99"@@ -3727,23 +3727,23 @@ paths:discounted_amount: '19.99'display_discounted_amount: "$19.99"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:23.842Z'- updated_at: '2026-02-17T19:25:24.103Z'+ created_at: '2026-02-18T15:38:30.839Z'+ updated_at: '2026-02-18T15:38:31.114Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_EfhxLZ9ck8- number: H37213394817+ number: H83048651928state: pendingtracking:tracking_url:cost: '10.0'display_cost: "$10.00"shipped_at:- created_at: '2026-02-17T19:25:23.948Z'- updated_at: '2026-02-17T19:25:24.083Z'+ created_at: '2026-02-18T15:38:30.943Z'+ updated_at: '2026-02-18T15:38:31.091Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -3751,7 +3751,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_200- name: Katy Schumm+ name: Sadie Bogisichaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -3784,11 +3784,11 @@ paths:payment_method_id: pm_UkLWZg9DAJstate: checkoutresponse_code: '12345'- number: PX5F5C33+ number: P40TU144amount: '29.99'display_amount: "$29.99"- created_at: '2026-02-17T19:25:24.048Z'- updated_at: '2026-02-17T19:25:24.048Z'+ created_at: '2026-02-18T15:38:31.052Z'+ updated_at: '2026-02-18T15:38:31.052Z'source_type: credit_cardsource_id: card_UkLWZg9DAJsource:@@ -3898,10 +3898,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R046163448+ number: R019751217state: cart- token: JtB1mh6UumKubHtxm6xqXAHwyzEJno76mDx- email: [email protected]+ token: sZcgHMQVFBjsvK21FCLD7tZHm79fmcRTdbL+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -3924,15 +3924,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:25:25.572Z'- updated_at: '2026-02-17T19:25:25.993Z'+ created_at: '2026-02-18T15:38:32.603Z'+ updated_at: '2026-02-18T15:38:33.033Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 501630- slug: product-501630+ name: Product 506264+ slug: product-506264options_text: ''price: '10.0'display_price: "$10.00"@@ -3951,23 +3951,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:25.638Z'- updated_at: '2026-02-17T19:25:25.638Z'+ created_at: '2026-02-18T15:38:32.661Z'+ updated_at: '2026-02-18T15:38:32.661Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H91021843116+ number: H10572317912state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:25.652Z'- updated_at: '2026-02-17T19:25:25.678Z'+ created_at: '2026-02-18T15:38:32.676Z'+ updated_at: '2026-02-18T15:38:32.695Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -3975,7 +3975,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_212- name: Tracey Kreiger+ name: Bridgett Uptonaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -3997,12 +3997,12 @@ paths:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJstate: checkout- response_code: 1-SC-20260217192525989905- number: PXVHX7LH+ response_code: 1-SC-20260218153833027849+ number: PKE7YP77amount: '10.0'display_amount: "$10.00"- created_at: '2026-02-17T19:25:25.993Z'- updated_at: '2026-02-17T19:25:25.993Z'+ created_at: '2026-02-18T15:38:33.033Z'+ updated_at: '2026-02-18T15:38:33.033Z'source_type: store_creditsource_id: credit_UkLWZg9DAJsource:@@ -4116,10 +4116,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R624402698+ number: R106812842state: cart- token: mfxtnUkZCbhimi6fujRxSMzngNASsqkACc1- email: [email protected]+ token: Md8caqwam8cJGRtLjbgmha6BiEk9jaFCQGG+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -4142,15 +4142,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:25:27.262Z'- updated_at: '2026-02-17T19:25:27.369Z'+ created_at: '2026-02-18T15:38:34.297Z'+ updated_at: '2026-02-18T15:38:34.423Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 526664- slug: product-526664+ name: Product 528055+ slug: product-528055options_text: ''price: '10.0'display_price: "$10.00"@@ -4169,23 +4169,23 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:27.325Z'- updated_at: '2026-02-17T19:25:27.325Z'+ created_at: '2026-02-18T15:38:34.361Z'+ updated_at: '2026-02-18T15:38:34.361Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H39247857925+ number: H48439659868state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:27.339Z'- updated_at: '2026-02-17T19:25:27.360Z'+ created_at: '2026-02-18T15:38:34.376Z'+ updated_at: '2026-02-18T15:38:34.409Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Ground@@ -4193,7 +4193,7 @@ paths:stock_location:id: sloc_UkLWZg9DAJstate_abbr: STATE_ABBR_220- name: Star Paucek+ name: Jeffie Murrayaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'@@ -4368,13 +4368,13 @@ paths:id: ps_gbHJdmfrXBstatus: pendingcurrency: USD- external_id: bogus_3e7d7077c129609933f0ecbb+ external_id: bogus_660b601106992096c54e7ddaexternal_data:- client_secret: bogus_secret_32e67dff904cfaab+ client_secret: bogus_secret_d16dc3434b2cff16customer_external_id:expires_at:- created_at: '2026-02-17T19:25:29.288Z'- updated_at: '2026-02-17T19:25:29.288Z'+ created_at: '2026-02-18T15:38:36.439Z'+ updated_at: '2026-02-18T15:38:36.439Z'amount: '110.0'payment_method_id: pm_UkLWZg9DAJorder_id: or_UkLWZg9DAJ@@ -4465,13 +4465,13 @@ paths:id: ps_UkLWZg9DAJstatus: pendingcurrency: USD- external_id: bogus_d69726fbf0af1df5addb808c+ external_id: bogus_209206c444ce98c917679901external_data:client_secret: secret_123customer_external_id:expires_at:- created_at: '2026-02-17T19:25:30.695Z'- updated_at: '2026-02-17T19:25:30.695Z'+ created_at: '2026-02-18T15:38:37.804Z'+ updated_at: '2026-02-18T15:38:37.804Z'amount: '110.0'payment_method_id: pm_UkLWZg9DAJorder_id: or_UkLWZg9DAJ@@ -4512,13 +4512,13 @@ paths:id: ps_UkLWZg9DAJstatus: pendingcurrency: USD- external_id: bogus_032b639c99a3b5d596b9f2ac+ external_id: bogus_1d974ff43e7e76523ce6e2a6external_data:client_secret: secret_123customer_external_id:expires_at:- created_at: '2026-02-17T19:25:32.126Z'- updated_at: '2026-02-17T19:25:32.139Z'+ created_at: '2026-02-18T15:38:39.319Z'+ updated_at: '2026-02-18T15:38:39.333Z'amount: '50.0'payment_method_id: pm_UkLWZg9DAJorder_id: or_UkLWZg9DAJ@@ -4593,13 +4593,13 @@ paths:id: ps_UkLWZg9DAJstatus: completedcurrency: USD- external_id: bogus_e09cb41d0b879e86266d1573+ external_id: bogus_5dd6ae0d241b2fdf703a06f8external_data:client_secret: secret_123customer_external_id:expires_at:- created_at: '2026-02-17T19:25:32.827Z'- updated_at: '2026-02-17T19:25:32.839Z'+ created_at: '2026-02-18T15:38:40.017Z'+ updated_at: '2026-02-18T15:38:40.030Z'amount: '110.0'payment_method_id: pm_UkLWZg9DAJorder_id: or_UkLWZg9DAJ@@ -4633,6 +4633,224 @@ paths:external_data:type: objectdescription: Provider-specific completion data+ "/api/v3/store/customer/payment_setup_sessions":+ post:+ summary: Create payment setup session+ tags:+ - Payment Setup Sessions+ security:+ - api_key: []+ bearer_auth: []+ description: Creates a new payment setup session for saving a payment method+ for future use. Delegates to the payment gateway to initialize a provider-specific+ setup flow (e.g. Stripe SetupIntent, Adyen zero-auth tokenization).+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '201':+ description: payment setup session created+ content:+ application/json:+ example:+ id: pss_gbHJdmfrXB+ status: pending+ external_id: bogus_seti_b9a4c4bbc5f889c93877d8a5+ external_client_secret: bogus_seti_secret_e83e634f103f1af4+ external_data: {}+ created_at: '2026-02-18T15:38:41.393Z'+ updated_at: '2026-02-18T15:38:41.393Z'+ payment_method_id: pm_UkLWZg9DAJ+ payment_source_id:+ payment_source_type:+ customer_id: cus_UkLWZg9DAJ+ payment_method:+ id: pm_UkLWZg9DAJ+ name: Credit Card+ description:+ type: Spree::Gateway::Bogus+ session_required: true+ schema:+ "$ref": "#/components/schemas/StorePaymentSetupSession"+ '401':+ description: unauthorized+ content:+ application/json:+ example:+ error:+ code: authentication_required+ message: Authentication required+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ '404':+ description: payment method not found+ content:+ application/json:+ example:+ error:+ code: record_not_found+ message: Payment method not found+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ payment_method_id:+ type: string+ example: pm_abc123+ description: Payment method ID+ external_data:+ type: object+ description: Provider-specific data passed to the gateway+ required:+ - payment_method_id+ "/api/v3/store/customer/payment_setup_sessions/{id}":+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ description: Payment setup session ID+ schema:+ type: string+ get:+ summary: Get payment setup session+ tags:+ - Payment Setup Sessions+ security:+ - api_key: []+ bearer_auth: []+ description: Returns a payment setup session with its current status and provider+ data.+ responses:+ '200':+ description: payment setup session found+ content:+ application/json:+ example:+ id: pss_UkLWZg9DAJ+ status: pending+ external_id: seti_test_491aacbcb8bf7f0e3c183b60+ external_client_secret: seti_secret_f95f6d4ca5393da7dd8ba227+ external_data:+ client_secret: secret_123+ created_at: '2026-02-18T15:38:43.216Z'+ updated_at: '2026-02-18T15:38:43.216Z'+ payment_method_id: pm_UkLWZg9DAJ+ payment_source_id:+ payment_source_type:+ customer_id: cus_UkLWZg9DAJ+ payment_method:+ id: pm_UkLWZg9DAJ+ name: Credit Card+ description:+ type: Spree::Gateway::Bogus+ session_required: true+ schema:+ "$ref": "#/components/schemas/StorePaymentSetupSession"+ '404':+ description: payment setup session not found+ content:+ application/json:+ example:+ error:+ code: record_not_found+ message: Payment setup session not found+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ "/api/v3/store/customer/payment_setup_sessions/{id}/complete":+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ - name: id+ in: path+ required: true+ description: Payment setup session ID+ schema:+ type: string+ patch:+ summary: Complete payment setup session+ tags:+ - Payment Setup Sessions+ security:+ - api_key: []+ bearer_auth: []+ description: Completes a payment setup session by confirming the setup with+ the provider, resulting in a saved payment method.+ parameters: []+ responses:+ '200':+ description: payment setup session completed+ content:+ application/json:+ example:+ id: pss_UkLWZg9DAJ+ status: completed+ external_id: seti_test_03ec8b5c29fadaf6be025604+ external_client_secret: seti_secret_955401c652da34d952b6fa6f+ external_data:+ client_secret: secret_123+ created_at: '2026-02-18T15:38:44.385Z'+ updated_at: '2026-02-18T15:38:44.403Z'+ payment_method_id: pm_UkLWZg9DAJ+ payment_source_id: card_UkLWZg9DAJ+ payment_source_type: Spree::CreditCard+ customer_id: cus_UkLWZg9DAJ+ payment_method:+ id: pm_UkLWZg9DAJ+ name: Credit Card+ description:+ type: Spree::Gateway::Bogus+ session_required: true+ schema:+ "$ref": "#/components/schemas/StorePaymentSetupSession"+ '404':+ description: payment setup session not found+ content:+ application/json:+ example:+ error:+ code: record_not_found+ message: Payment setup session not found+ schema:+ "$ref": "#/components/schemas/ErrorResponse"+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ external_data:+ type: object+ description: Provider-specific completion data"/api/v3/store/orders/{order_id}/payments":parameters:- name: x-spree-api-key@@ -4670,11 +4888,11 @@ paths:payment_method_id: pm_UkLWZg9DAJstate: checkoutresponse_code: '12345'- number: PEE7ILQ9+ number: P83F5K6Famount: '110.0'display_amount: "$110.00"- created_at: '2026-02-17T19:25:34.246Z'- updated_at: '2026-02-17T19:25:34.246Z'+ created_at: '2026-02-18T15:38:45.714Z'+ updated_at: '2026-02-18T15:38:45.714Z'source_type: credit_cardsource_id: card_UkLWZg9DAJsource:@@ -4754,11 +4972,11 @@ paths:payment_method_id: pm_UkLWZg9DAJstate: checkoutresponse_code: '12345'- number: PRFVT59T+ number: PNK9E4XQamount: '110.0'display_amount: "$110.00"- created_at: '2026-02-17T19:25:35.645Z'- updated_at: '2026-02-17T19:25:35.645Z'+ created_at: '2026-02-18T15:38:47.126Z'+ updated_at: '2026-02-18T15:38:47.126Z'source_type: credit_cardsource_id: card_UkLWZg9DAJsource:@@ -4842,20 +5060,19 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 671077+ name: Product 677067description: |-- Tenetur minima dolorum velit laudantium libero. Iure recusandae unde labore nisi natus dicta. Quam beatae tempora distinctio tempore.- Esse ducimus explicabo omnis illo nisi. Delectus facere distinctio reiciendis sed ratione quod. Sint voluptates culpa ducimus distinctio nostrum. Porro enim cumque explicabo veniam ab vero accusamus.- Itaque perspiciatis quidem ea odit. Sint hic quae deserunt quasi maxime itaque possimus. Nulla rerum delectus ipsum a ea fugit.- Omnis dolor quas porro totam similique impedit. Facere doloremque neque debitis sint consequuntur nihil placeat. Molestiae reiciendis dolorum assumenda perferendis voluptatem temporibus eius.- Cumque unde non ex numquam sunt mollitia velit illo. Quas inventore error veniam magni. Nihil provident dignissimos fuga aut iste nam possimus. Harum optio temporibus consequatur voluptatibus occaecati.- slug: product-671077+ Velit amet similique laudantium ad. Veritatis provident quae vero culpa consectetur. Ducimus modi magni labore eius inventore numquam. Assumenda dicta dolores magni aliquam.+ Totam maiores quia consequuntur placeat nisi. Repellat omnis perferendis sint amet. Laboriosam ea nesciunt cupiditate dignissimos repellendus. Accusamus nobis cum assumenda inventore neque porro praesentium. Omnis quidem aspernatur odio tempore doloribus laudantium.+ Corporis doloremque consequatur dolor nisi. Labore recusandae necessitatibus nemo numquam nobis. Totam nesciunt doloremque ut ratione qui nihil et est. Architecto error laboriosam est ex cumque perspiciatis. Expedita sapiente voluptatem deleniti vero doloribus.+ Iusto molestias amet odit consequuntur dignissimos veniam enim eos. Alias temporibus blanditiis quam doloremque vitae a laborum. Placeat aliquid ipsum laborum rem blanditiis at.+ slug: product-677067meta_description:meta_keywords:variant_count: 1- available_on: '2025-02-17T19:25:36.407Z'- created_at: '2026-02-17T19:25:36.425Z'- updated_at: '2026-02-17T19:25:36.514Z'+ available_on: '2025-02-18T15:38:47.878Z'+ created_at: '2026-02-18T15:38:47.897Z'+ updated_at: '2026-02-18T15:38:48.006Z'purchasable: truein_stock: falsebackorderable: true@@ -4875,20 +5092,17 @@ paths:price_list_id:original_price:- id: prod_gbHJdmfrXB- name: Product 681206+ name: Product 68335description: |-- Similique unde tenetur fuga vero voluptatem reiciendis. Quod facilis officiis blanditiis illo perspiciatis distinctio. Quas nam temporibus sequi expedita praesentium iusto aperiam beatae. Explicabo consectetur nihil aliquam eum. Assumenda sunt explicabo ab aperiam eveniet molestiae labore quo.- Eius at sapiente corporis possimus perferendis aliquid. Dolorem reiciendis id nisi quos architecto molestiae odio autem. Minus quam impedit expedita laborum minima assumenda occaecati.- Doloribus numquam quas voluptas quaerat. Fuga aut modi voluptatibus cumque sunt est fugit. Ex alias eligendi sequi saepe aspernatur enim. Suscipit cumque tempora inventore et.- Debitis aut dolore optio odio aperiam quia veniam. Reiciendis ratione eligendi suscipit at consequuntur consectetur deserunt. Nemo tenetur maiores cumque deleniti totam. Accusamus saepe explicabo possimus quibusdam. Molestias commodi tenetur minima vel cum perferendis nobis aliquid.- Voluptatibus alias ratione rem impedit inventore iure porro. Incidunt consequuntur assumenda qui natus consequatur doloremque hic. Excepturi ea ullam officiis perferendis est corporis dolores eius.- slug: product-681206+ Maiores facilis ut numquam animi hic. Libero delectus voluptas officia maiores. Harum mollitia itaque vero sequi.+ Fugit excepturi repellendus nulla perferendis odio dolorum. Consequuntur debitis aperiam omnis sed consectetur est libero eveniet. Asperiores alias ipsum eligendi quasi possimus at atque. Vero neque repellat iste quod cumque.+ slug: product-68335meta_description:meta_keywords:variant_count: 0- available_on: '2025-02-17T19:25:36.532Z'- created_at: '2026-02-17T19:25:36.544Z'- updated_at: '2026-02-17T19:25:36.569Z'+ available_on: '2025-02-18T15:38:48.028Z'+ created_at: '2026-02-18T15:38:48.039Z'+ updated_at: '2026-02-18T15:38:48.068Z'purchasable: truein_stock: falsebackorderable: true@@ -4973,19 +5187,20 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 799073+ name: Product 794796description: |-- Iure asperiores expedita labore quos aliquid voluptatibus quidem alias. Sint minus tempore placeat dolorem dolorum expedita aspernatur omnis. Consequatur quasi consequuntur quisquam occaecati at voluptate. Sint culpa delectus autem voluptatum nesciunt. Esse deleniti dicta veniam voluptas.- Ipsam rem nihil fuga veniam qui quas ut. Sequi qui unde totam consequuntur blanditiis sint sapiente dolore. Ducimus recusandae doloribus quos et.- Beatae suscipit quia commodi voluptatum quaerat laborum. Rem temporibus vero deserunt vitae quod doloremque nulla impedit. Adipisci dolores fuga beatae omnis eius suscipit magnam doloremque.- Commodi quidem autem hic quo consectetur tempora quod. Natus deserunt et eum corporis aspernatur. Officiis soluta a dolores saepe nostrum voluptas. Esse exercitationem quae neque molestias.- slug: product-799073+ Ea totam maiores commodi natus facere enim corrupti doloremque. Unde incidunt eos quos optio rerum. Explicabo mollitia ipsa vitae aperiam at atque. Architecto quo ad quas quaerat qui.+ Eos veniam esse officiis aut temporibus facilis ipsa. Fuga repellendus recusandae quasi veniam. Maiores doloremque accusantium beatae magni earum. Soluta aliquid reiciendis tenetur repellendus deleniti saepe labore. Itaque natus maiores adipisci incidunt culpa.+ Expedita vero quia iure eum voluptatum corrupti quas iste. Expedita blanditiis corporis quaerat inventore quis libero. Voluptate nostrum sit autem iusto est. Quis in praesentium nostrum aperiam corrupti temporibus aliquid.+ Esse autem amet fugiat dolorum earum vel odit. Quas ex id repudiandae dicta ipsa minima ab saepe. Quod porro expedita provident repudiandae. Inventore quasi enim assumenda unde voluptate.+ Itaque voluptates eos consequatur aliquam sint. Iure unde eum ex nisi saepe repellendus harum ipsam. Dicta harum incidunt ex cum consectetur veritatis cupiditate. Tenetur impedit adipisci doloribus dolorum nostrum rem alias distinctio.+ slug: product-794796meta_description:meta_keywords:variant_count: 1- available_on: '2025-02-17T19:25:37.832Z'- created_at: '2026-02-17T19:25:37.847Z'- updated_at: '2026-02-17T19:25:37.931Z'+ available_on: '2025-02-18T15:38:49.321Z'+ created_at: '2026-02-18T15:38:49.339Z'+ updated_at: '2026-02-18T15:38:49.424Z'purchasable: truein_stock: falsebackorderable: true@@ -5190,29 +5405,29 @@ paths:example:data:- id: ship_UkLWZg9DAJ- number: H27362422771+ number: H53243452822state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:41.701Z'- updated_at: '2026-02-17T19:25:41.734Z'+ created_at: '2026-02-18T15:38:53.267Z'+ updated_at: '2026-02-18T15:38:53.291Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDstock_location:id: sloc_UkLWZg9DAJ- state_abbr: STATE_ABBR_284- name: Marivel Wolff+ state_abbr: STATE_ABBR_298+ name: Lon Purdyaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of America- state_text: STATE_ABBR_284+ state_text: STATE_ABBR_298shipping_rates:- id: shpr_UkLWZg9DAJshipping_method_id: shpm_UkLWZg9DAJ@@ -5303,29 +5518,29 @@ paths:application/json:example:id: ship_UkLWZg9DAJ- number: H81909682950+ number: H44900152874state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:43.079Z'- updated_at: '2026-02-17T19:25:43.102Z'+ created_at: '2026-02-18T15:38:54.644Z'+ updated_at: '2026-02-18T15:38:54.666Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDstock_location:id: sloc_UkLWZg9DAJ- state_abbr: STATE_ABBR_292- name: Irena Raynor+ state_abbr: STATE_ABBR_306+ name: Lolita Altenwerthaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of America- state_text: STATE_ABBR_292+ state_text: STATE_ABBR_306shipping_rates:- id: shpr_UkLWZg9DAJshipping_method_id: shpm_UkLWZg9DAJ@@ -5392,10 +5607,10 @@ paths:application/json:example:id: or_UkLWZg9DAJ- number: R003729769+ number: R144752355state: delivery- token: uMtaSWypFkRBaumyfWZSHoToFWwDPpG9JKg- email: [email protected]+ token: 1oyQ9qui1qwcVDF85XCK7XYZjevgBCNda6n+ email: [email protected]special_instructions:currency: USDitem_count: 1@@ -5418,15 +5633,15 @@ paths:total: '110.0'display_total: "$110.00"completed_at:- created_at: '2026-02-17T19:25:44.404Z'- updated_at: '2026-02-17T19:25:44.524Z'+ created_at: '2026-02-18T15:38:55.902Z'+ updated_at: '2026-02-18T15:38:56.014Z'order_promotions: []line_items:- id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJquantity: 1- name: Product 1112928- slug: product-1112928+ name: Product 111604+ slug: product-111604options_text: ''price: '10.0'display_price: "$10.00"@@ -5445,37 +5660,37 @@ paths:discounted_amount: '10.0'display_discounted_amount: "$10.00"display_compare_at_amount: "$0.00"- created_at: '2026-02-17T19:25:44.463Z'- updated_at: '2026-02-17T19:25:44.463Z'+ created_at: '2026-02-18T15:38:55.957Z'+ updated_at: '2026-02-18T15:38:55.957Z'compare_at_amount:thumbnail_url:option_values: []digital_links: []shipments:- id: ship_UkLWZg9DAJ- number: H26496424751+ number: H37851186338state: pendingtracking: U10000tracking_url:cost: '100.0'display_cost: "$100.00"shipped_at:- created_at: '2026-02-17T19:25:44.476Z'- updated_at: '2026-02-17T19:25:44.523Z'+ created_at: '2026-02-18T15:38:55.968Z'+ updated_at: '2026-02-18T15:38:56.012Z'shipping_method:id: shpm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUNDstock_location:id: sloc_UkLWZg9DAJ- state_abbr: STATE_ABBR_300- name: Moses Zieme+ state_abbr: STATE_ABBR_314+ name: Tyesha Johnstonaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of America- state_text: STATE_ABBR_300+ state_text: STATE_ABBR_314shipping_rates:- id: shpr_UkLWZg9DAJshipping_method_id: shpm_UkLWZg9DAJ@@ -5493,7 +5708,7 @@ paths:firstname: Johnlastname: Doefull_name: John Doe- address1: 292 Lovely Street+ address1: 306 Lovely Streetaddress2: Northwestcity: Herndonzipcode: '35005'@@ -5501,15 +5716,15 @@ paths:company: Companycountry_name: United States of Americacountry_iso: US- state_text: STATE_ABBR_302- state_abbr: STATE_ABBR_302- state_name: STATE_NAME_302+ state_text: STATE_ABBR_316+ state_abbr: STATE_ABBR_316+ state_name: STATE_NAME_316ship_address:id: addr_VqXmZF31wYfirstname: Johnlastname: Doefull_name: John Doe- address1: 293 Lovely Street+ address1: 307 Lovely Streetaddress2: Northwestcity: Herndonzipcode: '35005'@@ -5517,9 +5732,9 @@ paths:company: Companycountry_name: United States of Americacountry_iso: US- state_text: STATE_ABBR_303- state_abbr: STATE_ABBR_303- state_name: STATE_NAME_303+ state_text: STATE_ABBR_317+ state_abbr: STATE_ABBR_317+ state_name: STATE_NAME_317payment_methods: []schema:"$ref": "#/components/schemas/StoreOrder"@@ -5579,8 +5794,8 @@ paths:instagram: spreecommercecustomer_support_email: [email protected]default_locale: en- created_at: '2026-02-17T19:24:40.742Z'- updated_at: '2026-02-17T19:24:40.853Z'+ created_at: '2026-02-18T15:37:49.418Z'+ updated_at: '2026-02-18T15:37:49.580Z'default_country_iso: USsupported_currencies:- USD@@ -5645,32 +5860,32 @@ paths:- id: txnmy_UkLWZg9DAJname: Categoriesposition: 1- created_at: '2026-02-17T19:24:40.750Z'- updated_at: '2026-02-17T19:24:40.778Z'+ created_at: '2026-02-18T15:37:49.440Z'+ updated_at: '2026-02-18T15:37:49.497Z'root_id: txn_UkLWZg9DAJ- id: txnmy_gbHJdmfrXBname: Brandsposition: 2- created_at: '2026-02-17T19:24:40.780Z'- updated_at: '2026-02-17T19:24:40.787Z'+ created_at: '2026-02-18T15:37:49.498Z'+ updated_at: '2026-02-18T15:37:49.508Z'root_id: txn_gbHJdmfrXB- id: txnmy_EfhxLZ9ck8name: Collectionsposition: 3- created_at: '2026-02-17T19:24:40.788Z'- updated_at: '2026-02-17T19:24:40.856Z'+ created_at: '2026-02-18T15:37:49.510Z'+ updated_at: '2026-02-18T15:37:49.582Z'root_id: txn_EfhxLZ9ck8- id: txnmy_VqXmZF31wYname: taxonomy_11position: 4- created_at: '2026-02-17T19:25:45.261Z'- updated_at: '2026-02-17T19:25:45.269Z'+ created_at: '2026-02-18T15:38:56.742Z'+ updated_at: '2026-02-18T15:38:56.752Z'root_id: txn_OIJLhNcSbf- id: txnmy_uw2YK1rnl0name: taxonomy_12position: 5- created_at: '2026-02-17T19:25:45.270Z'- updated_at: '2026-02-17T19:25:45.278Z'+ created_at: '2026-02-18T15:38:56.754Z'+ updated_at: '2026-02-18T15:38:56.761Z'root_id: txn_AXs1igzRC6meta:page: 1@@ -5736,8 +5951,8 @@ paths:id: txnmy_VqXmZF31wYname: taxonomy_17position: 4- created_at: '2026-02-17T19:25:45.562Z'- updated_at: '2026-02-17T19:25:45.572Z'+ created_at: '2026-02-18T15:38:57.021Z'+ updated_at: '2026-02-18T15:38:57.030Z'root_id: txn_OIJLhNcSbfschema:"$ref": "#/components/schemas/StoreTaxonomy"@@ -5793,8 +6008,8 @@ paths:meta_description:meta_keywords:children_count: 1- created_at: '2026-02-17T19:25:46.254Z'- updated_at: '2026-02-17T19:25:46.271Z'+ created_at: '2026-02-18T15:38:57.636Z'+ updated_at: '2026-02-18T15:38:57.656Z'parent_id: txn_OIJLhNcSbftaxonomy_id: txnmy_VqXmZF31wYdescription: ''@@ -5865,9 +6080,9 @@ paths:data:- id: wl_UkLWZg9DAJname: My Wishlist- token: 5X6AMEMnsCF8dHoRnEraDftC- created_at: '2026-02-17T19:25:47.450Z'- updated_at: '2026-02-17T19:25:47.450Z'+ token: 5BgfJPiMCemnkZSJG7eGCrqv+ created_at: '2026-02-18T15:38:58.986Z'+ updated_at: '2026-02-18T15:38:58.986Z'is_default: falseis_private: truemeta:@@ -5926,9 +6141,9 @@ paths:example:id: wl_gbHJdmfrXBname: Birthday Ideas- token: HesfFKP6FsMdQnWKusJLnLVB- created_at: '2026-02-17T19:25:48.817Z'- updated_at: '2026-02-17T19:25:48.817Z'+ token: 4Z5vgBZKBHxUQDNfntGz2QHC+ created_at: '2026-02-18T15:39:00.355Z'+ updated_at: '2026-02-18T15:39:00.355Z'is_default: falseis_private: trueschema:@@ -6001,9 +6216,9 @@ paths:example:id: wl_UkLWZg9DAJname: My Wishlist- token: hxzxNzxy7BvSftuYUWdGE8kp- created_at: '2026-02-17T19:25:49.993Z'- updated_at: '2026-02-17T19:25:49.993Z'+ token: WzbN6m2GACb6wzZnRgWw7D57+ created_at: '2026-02-18T15:39:01.533Z'+ updated_at: '2026-02-18T15:39:01.533Z'is_default: falseis_private: trueschema:@@ -6049,9 +6264,9 @@ paths:example:id: wl_UkLWZg9DAJname: Updated Name- token: zsjNesBK7U2uQTntcT8kEHxo- created_at: '2026-02-17T19:25:51.231Z'- updated_at: '2026-02-17T19:25:51.305Z'+ token: vDjDXhN94bam9Jna5WijKgu8+ created_at: '2026-02-18T15:39:02.812Z'+ updated_at: '2026-02-18T15:39:02.894Z'is_default: falseis_private: trueschema:@@ -6132,8 +6347,8 @@ paths:variant_id: variant_gbHJdmfrXBwishlist_id: wl_UkLWZg9DAJquantity: 1- created_at: '2026-02-17T19:25:52.626Z'- updated_at: '2026-02-17T19:25:52.626Z'+ created_at: '2026-02-18T15:39:04.294Z'+ updated_at: '2026-02-18T15:39:04.294Z'variant:id: variant_gbHJdmfrXBproduct_id: prod_gbHJdmfrXB@@ -6142,8 +6357,8 @@ paths:options_text: ''track_inventory: trueimage_count: 0- created_at: '2026-02-17T19:25:52.579Z'- updated_at: '2026-02-17T19:25:52.601Z'+ created_at: '2026-02-18T15:39:04.248Z'+ updated_at: '2026-02-18T15:39:04.270Z'thumbnail:purchasable: truein_stock: false@@ -6260,6 +6475,8 @@ tags:description: Customer address book- name: Credit Cardsdescription: Saved payment methods+- name: Payment Setup Sessions+ description: Save payment methods for future use via gateway-agnostic setup sessions- name: Wishlistsdescription: Customer wishlists- name: Digitals@@ -6290,6 +6507,7 @@ x-tagGroups:- Customers- Addresses- Credit Cards+ - Payment Setup Sessions- Wishlists- Digitalscomponents:@@ -7701,6 +7919,47 @@ components:- payment_method_id- order_id- payment_method+ StorePaymentSetupSession:+ type: object+ properties:+ id:+ type: string+ status:+ type: string+ external_id:+ type: string+ nullable: true+ external_client_secret:+ type: string+ nullable: true+ external_data:+ type: object+ created_at:+ type: string+ updated_at:+ type: string+ payment_method_id:+ type: string+ nullable: true+ payment_source_id:+ type: string+ nullable: true+ payment_source_type:+ type: string+ nullable: true+ customer_id:+ type: string+ nullable: true+ payment_method:+ "$ref": "#/components/schemas/StorePaymentMethod"+ x-typelizer: true+ required:+ - id+ - status+ - external_data+ - created_at+ - updated_at+ - payment_methodStorePaymentSource:type: objectproperties:diff --git a/packages/next/src/actions/payment-setup-sessions.ts b/packages/next/src/actions/payment-setup-sessions.tsnew file mode 100644index 0000000000..1c41c1516d--- /dev/null+++ b/packages/next/src/actions/payment-setup-sessions.ts@@ -0,0 +1,45 @@+'use server';++import type {+ StorePaymentSetupSession,+ CreatePaymentSetupSessionParams,+ CompletePaymentSetupSessionParams,+} from '@spree/sdk';+import { withAuthRefresh } from '../auth-helpers';+import { getClient } from '../config';++/**+ * Create a payment setup session for saving a payment method.+ * Delegates to the payment gateway to initialize a setup flow.+ */+export async function createPaymentSetupSession(+ params: CreatePaymentSetupSessionParams+): Promise<StorePaymentSetupSession> {+ return withAuthRefresh(async (options) => {+ return getClient().store.customer.paymentSetupSessions.create(params, options);+ });+}++/**+ * Get a payment setup session by ID.+ */+export async function getPaymentSetupSession(+ id: string+): Promise<StorePaymentSetupSession> {+ return withAuthRefresh(async (options) => {+ return getClient().store.customer.paymentSetupSessions.get(id, options);+ });+}++/**+ * Complete a payment setup session.+ * Confirms the setup with the provider, resulting in a saved payment method.+ */+export async function completePaymentSetupSession(+ id: string,+ params?: CompletePaymentSetupSessionParams+): Promise<StorePaymentSetupSession> {+ return withAuthRefresh(async (options) => {+ return getClient().store.customer.paymentSetupSessions.complete(id, params, options);+ });+}diff --git a/packages/next/src/index.ts b/packages/next/src/index.tsindex ff694e0c8c..b28eab7bcc 100644--- a/packages/next/src/index.ts+++ b/packages/next/src/index.ts@@ -59,6 +59,12 @@ export {completePaymentSession,} from './actions/payment-sessions';+export {+ createPaymentSetupSession,+ getPaymentSetupSession,+ completePaymentSetupSession,+} from './actions/payment-setup-sessions';+// Re-export commonly used SDK types for convenienceexport type {StoreProduct,@@ -78,6 +84,7 @@ export type {StorePayment,StorePaymentMethod,StorePaymentSession,+ StorePaymentSetupSession,StoreImage,StoreOptionType,StoreOptionValue,@@ -89,5 +96,7 @@ export type {CreatePaymentSessionParams,UpdatePaymentSessionParams,CompletePaymentSessionParams,+ CreatePaymentSetupSessionParams,+ CompletePaymentSetupSessionParams,SpreeError,} from '@spree/sdk';diff --git a/packages/next/tsup.config.ts b/packages/next/tsup.config.tsindex a05591a7d8..7473b8b1cb 100644--- a/packages/next/tsup.config.ts+++ b/packages/next/tsup.config.ts@@ -31,6 +31,8 @@ export default defineConfig(['actions/orders': 'src/actions/orders.ts','actions/credit-cards': 'src/actions/credit-cards.ts','actions/gift-cards': 'src/actions/gift-cards.ts',+ 'actions/payment-sessions': 'src/actions/payment-sessions.ts',+ 'actions/payment-setup-sessions': 'src/actions/payment-setup-sessions.ts',},format: ['esm'],dts: true,diff --git a/packages/sdk/src/store-client.ts b/packages/sdk/src/store-client.tsindex 4b55f73a53..18ffbe7204 100644--- a/packages/sdk/src/store-client.ts+++ b/packages/sdk/src/store-client.ts@@ -17,6 +17,8 @@ import type {CreatePaymentSessionParams,UpdatePaymentSessionParams,CompletePaymentSessionParams,+ CreatePaymentSetupSessionParams,+ CompletePaymentSetupSessionParams,StoreCreditCard,StoreGiftCard,StoreProduct,@@ -27,6 +29,7 @@ import type {StorePayment,StorePaymentMethod,StorePaymentSession,+ StorePaymentSetupSession,StoreShipment,StoreStore,StoreWishlist,@@ -726,6 +729,46 @@ export class StoreClient {get: (id: string, options?: RequestOptions): Promise<StoreGiftCard> =>this.request<StoreGiftCard>('GET', `/customer/gift_cards/${id}`, options),},++ /**+ * Nested resource: Payment Setup Sessions (save payment methods for future use)+ */+ paymentSetupSessions: {+ /**+ * Create a payment setup session+ * Delegates to the payment gateway to initialize a setup flow for saving a payment method+ */+ create: (+ params: CreatePaymentSetupSessionParams,+ options?: RequestOptions+ ): Promise<StorePaymentSetupSession> =>+ this.request<StorePaymentSetupSession>(+ 'POST',+ '/customer/payment_setup_sessions',+ { ...options, body: params }+ ),++ /**+ * Get a payment setup session by ID+ */+ get: (id: string, options?: RequestOptions): Promise<StorePaymentSetupSession> =>+ this.request<StorePaymentSetupSession>('GET', `/customer/payment_setup_sessions/${id}`, options),++ /**+ * Complete a payment setup session+ * Confirms the setup with the provider, resulting in a saved payment method+ */+ complete: (+ id: string,+ params?: CompletePaymentSetupSessionParams,+ options?: RequestOptions+ ): Promise<StorePaymentSetupSession> =>+ this.request<StorePaymentSetupSession>(+ 'PATCH',+ `/customer/payment_setup_sessions/${id}/complete`,+ { ...options, body: params }+ ),+ },};// ============================================diff --git a/packages/sdk/src/types/generated/StorePayment.ts b/packages/sdk/src/types/generated/StorePayment.tsindex df179e6a98..9b0c9f5bb5 100644--- a/packages/sdk/src/types/generated/StorePayment.ts+++ b/packages/sdk/src/types/generated/StorePayment.ts@@ -1,4 +1,4 @@-// Typelizer digest 92c0180e9e1eb4ce89e9c158bb1dd039+// Typelizer digest 116db5ee96c83abecc4da501ba677ef7//// DO NOT MODIFY: This file was automatically generated by Typelizer.import type {StoreCreditCard, StoreStoreCredit, StorePaymentSource, StorePaymentMethod} from '@/types'diff --git a/packages/sdk/src/types/generated/StorePaymentSetupSession.ts b/packages/sdk/src/types/generated/StorePaymentSetupSession.tsnew file mode 100644index 0000000000..3edbd1bac7--- /dev/null+++ b/packages/sdk/src/types/generated/StorePaymentSetupSession.ts@@ -0,0 +1,21 @@+// Typelizer digest eed28b875c88b2865014f4f31b4f9cb5+//+// DO NOT MODIFY: This file was automatically generated by Typelizer.+import type {StorePaymentMethod} from '@/types'++type StorePaymentSetupSession = {+ id: string;+ status: string;+ external_id: string | null;+ external_client_secret: string | null;+ external_data: Record<string, unknown>;+ created_at: string;+ updated_at: string;+ payment_method_id: string | null;+ payment_source_id: string | null;+ payment_source_type: string | null;+ customer_id: string | null;+ payment_method: StorePaymentMethod;+}++export default StorePaymentSetupSession;diff --git a/packages/sdk/src/types/generated/index.ts b/packages/sdk/src/types/generated/index.tsindex d0a9cbcf96..2706cb90a3 100644--- a/packages/sdk/src/types/generated/index.ts+++ b/packages/sdk/src/types/generated/index.ts@@ -1,4 +1,4 @@-// Typelizer digest 48ded714555a5de588c64dd51726f82b+// Typelizer digest 02681b7b8bb8bc18318caf3b95a267d0//// DO NOT MODIFY: This file was automatically generated by Typelizer.export type { default as StoreAddress } from './StoreAddress'@@ -26,6 +26,7 @@ export type { default as StoreOrder } from './StoreOrder'export type { default as StorePaymentMethod } from './StorePaymentMethod'export type { default as StorePayment } from './StorePayment'export type { default as StorePaymentSession } from './StorePaymentSession'+export type { default as StorePaymentSetupSession } from './StorePaymentSetupSession'export type { default as StorePaymentSource } from './StorePaymentSource'export type { default as StorePrice } from './StorePrice'export type { default as StoreProduct } from './StoreProduct'diff --git a/packages/sdk/src/types/index.ts b/packages/sdk/src/types/index.tsindex 3fa7c2361d..730413eea2 100644--- a/packages/sdk/src/types/index.ts+++ b/packages/sdk/src/types/index.ts@@ -132,6 +132,16 @@ export interface CompletePaymentSessionParams {external_data?: Record<string, unknown>;}+// Payment Setup Sessions+export interface CreatePaymentSetupSessionParams {+ payment_method_id: string;+ external_data?: Record<string, unknown>;+}++export interface CompletePaymentSetupSessionParams {+ external_data?: Record<string, unknown>;+}+// Product Filters typesexport interface FilterOption {id: string;diff --git a/packages/sdk/tests/mocks/handlers.ts b/packages/sdk/tests/mocks/handlers.tsindex d278d74910..22740b6eeb 100644--- a/packages/sdk/tests/mocks/handlers.ts+++ b/packages/sdk/tests/mocks/handlers.ts@@ -420,6 +420,58 @@ export const handlers = [HttpResponse.json({ id: 'gc_1', code: 'GIFT123', balance: '50.00' })),+ // Customer Payment Setup Sessions+ http.post(`${API_PREFIX}/customer/payment_setup_sessions`, () =>+ HttpResponse.json({+ id: 'pss_1',+ status: 'pending',+ external_id: 'seti_abc123',+ external_client_secret: 'seti_secret_xyz',+ external_data: { client_secret: 'seti_secret_xyz' },+ payment_method_id: 'pm_1',+ payment_source_id: null,+ payment_source_type: null,+ customer_id: 'user_1',+ created_at: '2026-02-18T00:00:00.000Z',+ updated_at: '2026-02-18T00:00:00.000Z',+ payment_method: { id: 'pm_1', name: 'Credit Card', description: null, type: 'Spree::Gateway::Bogus' },+ }, { status: 201 })+ ),++ http.get(`${API_PREFIX}/customer/payment_setup_sessions/:id`, () =>+ HttpResponse.json({+ id: 'pss_1',+ status: 'pending',+ external_id: 'seti_abc123',+ external_client_secret: 'seti_secret_xyz',+ external_data: { client_secret: 'seti_secret_xyz' },+ payment_method_id: 'pm_1',+ payment_source_id: null,+ payment_source_type: null,+ customer_id: 'user_1',+ created_at: '2026-02-18T00:00:00.000Z',+ updated_at: '2026-02-18T00:00:00.000Z',+ payment_method: { id: 'pm_1', name: 'Credit Card', description: null, type: 'Spree::Gateway::Bogus' },+ })+ ),++ http.patch(`${API_PREFIX}/customer/payment_setup_sessions/:id/complete`, () =>+ HttpResponse.json({+ id: 'pss_1',+ status: 'completed',+ external_id: 'seti_abc123',+ external_client_secret: 'seti_secret_xyz',+ external_data: { client_secret: 'seti_secret_xyz' },+ payment_method_id: 'pm_1',+ payment_source_id: 'cc_1',+ payment_source_type: 'Spree::CreditCard',+ customer_id: 'user_1',+ created_at: '2026-02-18T00:00:00.000Z',+ updated_at: '2026-02-18T00:00:00.000Z',+ payment_method: { id: 'pm_1', name: 'Credit Card', description: null, type: 'Spree::Gateway::Bogus' },+ })+ ),+// Wishlistshttp.get(`${API_PREFIX}/wishlists`, () =>HttpResponse.json({ data: [fixtures.wishlist], meta: paginationMeta })diff --git a/packages/sdk/tests/payment-setup-sessions.test.ts b/packages/sdk/tests/payment-setup-sessions.test.tsnew file mode 100644index 0000000000..47f4dbd01e--- /dev/null+++ b/packages/sdk/tests/payment-setup-sessions.test.ts@@ -0,0 +1,66 @@+import { describe, it, expect, beforeAll } from 'vitest';+import { createTestClient } from './helpers';+import type { SpreeClient } from '../src';++describe('paymentSetupSessions', () => {+ let client: SpreeClient;+ beforeAll(() => { client = createTestClient(); });+ const opts = { token: 'user-jwt' };++ describe('create', () => {+ it('creates a payment setup session', async () => {+ const result = await client.store.customer.paymentSetupSessions.create(+ { payment_method_id: 'pm_1' },+ opts+ );+ expect(result.id).toBe('pss_1');+ expect(result.status).toBe('pending');+ expect(result.payment_method_id).toBe('pm_1');+ expect(result.external_client_secret).toBe('seti_secret_xyz');+ });++ it('accepts optional external_data', async () => {+ const result = await client.store.customer.paymentSetupSessions.create(+ { payment_method_id: 'pm_1', external_data: { channel: 'Web' } },+ opts+ );+ expect(result.id).toBe('pss_1');+ });+ });++ describe('get', () => {+ it('returns a payment setup session by ID', async () => {+ const result = await client.store.customer.paymentSetupSessions.get(+ 'pss_1',+ opts+ );+ expect(result.id).toBe('pss_1');+ expect(result.status).toBe('pending');+ expect(result.external_id).toBe('seti_abc123');+ expect(result.customer_id).toBe('user_1');+ });+ });++ describe('complete', () => {+ it('completes a payment setup session', async () => {+ const result = await client.store.customer.paymentSetupSessions.complete(+ 'pss_1',+ undefined,+ opts+ );+ expect(result.id).toBe('pss_1');+ expect(result.status).toBe('completed');+ expect(result.payment_source_id).toBe('cc_1');+ expect(result.payment_source_type).toBe('Spree::CreditCard');+ });++ it('completes with external_data', async () => {+ const result = await client.store.customer.paymentSetupSessions.complete(+ 'pss_1',+ { external_data: { setup_intent_id: 'seti_123' } },+ opts+ );+ expect(result.status).toBe('completed');+ });+ });+});