Skip to content

armgit / spree

Public Imported from GitHub
0

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

Add PaymentSetupSession — gateway-agnostic API for saving payment methods (#13620)

Damian Legawiec195658fab626
diff --git a/backend/db/schema.rb b/backend/db/schema.rb
index 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 database
enable_extension "pg_catalog.plpgsql"
enable_extension "pg_trgm"
@@ -805,6 +805,26 @@ ActiveRecord::Schema[8.1].define(version: 2026_02_16_150246) do
t.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: false
t.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.rb
new file mode 100644
index 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
+end
diff --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.rb
new file mode 100644
index 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
+end
diff --git a/backend/engines/api/config/routes.rb b/backend/engines/api/config/routes.rb
index 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 do
end
resources :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
+ end
end
# Wishlists
diff --git a/backend/engines/api/lib/spree/api/dependencies.rb b/backend/engines/api/lib/spree/api/dependencies.rb
index 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 Spree
line_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.rb
new file mode 100644
index 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
+end
diff --git a/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb b/backend/engines/api/spec/integration/spree/api/v3/store/payment_setup_sessions_spec.rb
new file mode 100644
index 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
+end
diff --git a/backend/engines/api/spec/swagger_helper.rb b/backend/engines/api/spec/swagger_helper.rb
index 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.rb
index 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 Spree
included do
has_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_card
credit_cards.default.first
end
diff --git a/backend/engines/core/app/models/spree/gateway/bogus.rb b/backend/engines/core/app/models/spree/gateway/bogus.rb
index 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 Spree
payment_session.complete
end
+ 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)
end
diff --git a/backend/engines/core/app/models/spree/payment_method.rb b/backend/engines/core/app/models/spree/payment_method.rb
index 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 Spree
has_many :credit_cards, class_name: 'Spree::CreditCard', dependent: :destroy # CCs are soft deleted
has_many :payment_sessions, class_name: 'Spree::PaymentSession', dependent: :destroy
+ has_many :payment_setup_sessions, class_name: 'Spree::PaymentSetupSession', dependent: :destroy
has_many :gateway_customers, class_name: 'Spree::GatewayCustomer', dependent: :destroy
def self.providers
@@ -74,6 +75,30 @@ module Spree
raise ::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_type
type.demodulize.downcase
end
diff --git a/backend/engines/core/app/models/spree/payment_setup_session.rb b/backend/engines/core/app/models/spree/payment_setup_session.rb
new file mode 100644
index 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
+end
diff --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.rb
new file mode 100644
index 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
+end
diff --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.rb
new file mode 100644
index 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
+end
diff --git a/backend/engines/core/lib/spree/permitted_attributes.rb b/backend/engines/core/lib/spree/permitted_attributes.rb
index 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.rb
new file mode 100644
index 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
+end
diff --git a/backend/engines/core/spec/models/spree/payment_setup_session_spec.rb b/backend/engines/core/spec/models/spree/payment_setup_session_spec.rb
new file mode 100644
index 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
+end
diff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yaml
index 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.uBxiFkcVbnJSQwrzLgYSczuKI6ODdzJakv1MKow6VDs
user:
id: cus_UkLWZg9DAJ
- 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_yMLA2hpxKtUPOcbp84
user:
id: cus_UkLWZg9DAJ
first_name: John
last_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_yMLA2hpxKtUPOcbp84
user:
id: cus_UkLWZg9DAJ
- 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: R921530365
state: cart
- token: Wi1UQKhBmGmLU81neav8sAjcXDDy7QfosZ5
+ token: ZQcGqyL8DFcsCBXfQdaufSaUqiFF5D7LX4b
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 23242
- slug: product-23242
+ name: Product 21619
+ slug: product-21619
options_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: H55596258871
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -808,7 +808,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_39
- name: Santa Batz
+ name: Hyacinth Gorczany
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -921,10 +921,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R964697181
+ number: R065272221
state: cart
- token: n1QUueEgfyzRdXyj479s1qQRjs4gKWLQ28D
+ token: PUhQjPRauiYXZKmi6853BQvBUqrWpVRWrkz
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 33613
- slug: product-33613
+ name: Product 33013
+ slug: product-33013
options_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: H69760617547
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -998,7 +998,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_43
- name: Sha Moen
+ name: Damien Bashirian
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1277,10 +1277,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R510873096
+ number: R485145561
state: cart
- token: akd8SvtkLYcH3Lh3QCQguNNhhrQWWkdW65u
+ token: YDFHZM9TTmeQseeCbKbfKH5uLCjJhSsX19U
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 87524
- slug: product-87524
+ name: Product 87978
+ slug: product-87978
options_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: H42941571817
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -1354,7 +1354,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_63
- name: Josef Larkin
+ name: Maudie Macejkovic
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1376,12 +1376,12 @@ paths:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
state: checkout
- response_code: 1-SC-20260217192456904204
- number: P79RVZAS
+ response_code: 1-SC-20260218153804690376
+ number: PYSNCMMU
amount: '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_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -1517,10 +1517,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R633165399
+ number: R842138853
state: cart
- token: NVPcNrAndQKRDuop2gxK1w1pUdtgecdhMhN
+ token: tSbqYxqF1VXAsE4pdWK1vsTLdzgdbk38fm3
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 113548
- slug: product-113548
+ name: Product 115354
+ slug: product-115354
options_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: H80039652239
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -1594,7 +1594,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_75
- name: Adah Graham
+ name: Cassidy Gutkowski
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -1848,11 +1848,11 @@ paths:
application/json:
example:
id: cus_UkLWZg9DAJ
- first_name: Deeann
- last_name: Green
- created_at: '2026-02-17T19:25:03.443Z'
- updated_at: '2026-02-17T19:25:03.721Z'
+ first_name: Shanika
+ last_name: Schaden
+ created_at: '2026-02-18T15:38:11.179Z'
+ updated_at: '2026-02-18T15:38:11.460Z'
addresses:
- id: addr_gbHJdmfrXB
firstname: John
@@ -1954,11 +1954,11 @@ paths:
application/json:
example:
id: cus_UkLWZg9DAJ
first_name: Updated
last_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_gbHJdmfrXB
firstname: John
@@ -2174,10 +2174,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R871324435
+ number: R392776479
state: cart
- token: 67hZ9WWvtzr23ude1fWKphFyWvXTZL9reSk
+ token: PUVgbebYDtaPEjMQMSyBUbuzNFG3t7d56Cj
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 217954
- slug: product-217954
+ name: Product 214767
+ slug: product-214767
options_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_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 2
- name: Product 225081
- slug: product-225081
+ name: Product 224620
+ slug: product-224620
options_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: R006172220
state: cart
- token: dorh3XAYb1JwCMoYYbUQxizYLb1RVrD4MBZ
+ token: bDVN1Lxk8DepDdvSxfj1idnmUnPh7zSDXK9
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 5
- name: Product 254413
- slug: product-254413
+ name: Product 255553
+ slug: product-255553
options_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: R814289744
state: cart
- token: pbPHcyeSTYJE7Wvn573Hm49J4Ej5GJz3f7S
+ token: KT1dvhiMdHNFzy41wBaSsxr9SStehJFYtXF
special_instructions:
currency: USD
item_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: R232788032
state: cart
- token: zvpfvyRF3pYiFYhMXFMZapboVVZZsmda26u
+ token: tDDtsGJzP1VJDpTE8Xz6r5BLk2JywbwhMXZ
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 28820
- slug: product-28820
+ name: Product 2890
+ slug: product-2890
options_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: H09293228453
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -2676,7 +2676,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_135
- name: Orville Ritchie
+ name: Edmundo Block
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -2785,10 +2785,10 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R036180477
+ number: R487646106
state: cart
- token: 12hR5Bf4gWFz8iUmV1pqEi4CxQijoYjqWSH
+ token: ZUbS8bsrszoGDJ84k39hbFWFrCMRmwcx8yt
special_instructions:
currency: USD
item_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: ZUbS8bsrszoGDJ84k39hbFWFrCMRmwcx8yt
schema:
type: object
allOf:
@@ -2884,9 +2884,9 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R928256158
+ number: R997117633
state: cart
- token: yeyLz4qgAWitexKnrNaWvmKuC439APGUDeF
+ token: gYRjVcQQ8k8CdSe9W6bvtX9opvhwoc4R7uy
email:
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_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 352156
- slug: product-352156
+ name: Product 352179
+ slug: product-352179
options_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: H29970283842
state: pending
tracking: U10000
tracking_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_gbHJdmfrXB
name: UPS Ground
@@ -2961,7 +2961,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_159
- name: Florencio Wisozk
+ name: Bok Russel
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3061,10 +3061,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R837606828
+ number: R716584855
state: cart
- token: sZsevNtMuEbyFF4fThQYP1m3sHBCd2qkFND
+ token: m3hc1oZvCTAeaoKgomjovVcHua1hrtwpXsM
special_instructions: Leave at door
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 383108
- slug: product-383108
+ name: Product 388468
+ slug: product-388468
options_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: H57401556915
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -3138,7 +3138,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_174
- name: Arthur Feil
+ name: Lavina Bartoletti
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3317,10 +3317,10 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R438644715
+ number: R782355643
state: address
- token: AuWCzf7DZXQWTYoJmsakisGMKeKtanBHFyz
+ token: hztNTBiUZjKUFUFo3G5jEL49jFZo5j7x8rs
special_instructions:
currency: USD
item_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_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 426868
- slug: product-426868
+ name: Product 42396
+ slug: product-42396
options_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: H81933444443
state: pending
tracking: U10000
tracking_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_gbHJdmfrXB
name: UPS Ground
@@ -3394,7 +3394,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_184
- name: Edmund Schmeler
+ name: Brunilda Heathcote
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3496,10 +3496,10 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R094067239
+ number: R415935816
state: payment
- token: zTxHMd8N1xdkPw9XqqYWjM2HuPtyCfZGcMC
+ token: pxFv8EFg6cjXd7HCGhvWk8Z8a7T6q1Gr4vG
special_instructions:
currency: USD
item_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_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 455562
- slug: product-455562
+ name: Product 459147
+ slug: product-459147
options_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: H74531540631
state: pending
tracking:
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_UkLWZg9DAJ
name: UPS Ground
@@ -3573,7 +3573,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_194
- name: Mauricio Lesch
+ name: Jesse Buckridge
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3674,10 +3674,10 @@ paths:
application/json:
example:
id: or_gbHJdmfrXB
- number: R385481093
+ number: R199361072
state: complete
- token: HF87ZsCJrMvWASFCyHvFiM41k3XsRxvr1Er
+ token: eXtxEKsJryL1AWMo3BQgmTtUPyvvFVSaXeN
special_instructions:
currency: USD
item_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_gbHJdmfrXB
variant_id: variant_gbHJdmfrXB
quantity: 1
- name: Product 47491
- slug: product-47491
+ name: Product 474623
+ slug: product-474623
options_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: H83048651928
state: pending
tracking:
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_UkLWZg9DAJ
name: UPS Ground
@@ -3751,7 +3751,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_200
- name: Katy Schumm
+ name: Sadie Bogisich
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3784,11 +3784,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PX5F5C33
+ number: P40TU144
amount: '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_card
source_id: card_UkLWZg9DAJ
source:
@@ -3898,10 +3898,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R046163448
+ number: R019751217
state: cart
- token: JtB1mh6UumKubHtxm6xqXAHwyzEJno76mDx
+ token: sZcgHMQVFBjsvK21FCLD7tZHm79fmcRTdbL
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 501630
- slug: product-501630
+ name: Product 506264
+ slug: product-506264
options_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: H10572317912
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -3975,7 +3975,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_212
- name: Tracey Kreiger
+ name: Bridgett Upton
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -3997,12 +3997,12 @@ paths:
- id: py_UkLWZg9DAJ
payment_method_id: pm_UkLWZg9DAJ
state: checkout
- response_code: 1-SC-20260217192525989905
- number: PXVHX7LH
+ response_code: 1-SC-20260218153833027849
+ number: PKE7YP77
amount: '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_credit
source_id: credit_UkLWZg9DAJ
source:
@@ -4116,10 +4116,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R624402698
+ number: R106812842
state: cart
- token: mfxtnUkZCbhimi6fujRxSMzngNASsqkACc1
+ token: Md8caqwam8cJGRtLjbgmha6BiEk9jaFCQGG
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 526664
- slug: product-526664
+ name: Product 528055
+ slug: product-528055
options_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: H48439659868
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
@@ -4193,7 +4193,7 @@ paths:
stock_location:
id: sloc_UkLWZg9DAJ
state_abbr: STATE_ABBR_220
- name: Star Paucek
+ name: Jeffie Murray
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
@@ -4368,13 +4368,13 @@ paths:
id: ps_gbHJdmfrXB
status: pending
currency: USD
- external_id: bogus_3e7d7077c129609933f0ecbb
+ external_id: bogus_660b601106992096c54e7dda
external_data:
- client_secret: bogus_secret_32e67dff904cfaab
+ client_secret: bogus_secret_d16dc3434b2cff16
customer_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_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4465,13 +4465,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_d69726fbf0af1df5addb808c
+ external_id: bogus_209206c444ce98c917679901
external_data:
client_secret: secret_123
customer_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_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4512,13 +4512,13 @@ paths:
id: ps_UkLWZg9DAJ
status: pending
currency: USD
- external_id: bogus_032b639c99a3b5d596b9f2ac
+ external_id: bogus_1d974ff43e7e76523ce6e2a6
external_data:
client_secret: secret_123
customer_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_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4593,13 +4593,13 @@ paths:
id: ps_UkLWZg9DAJ
status: completed
currency: USD
- external_id: bogus_e09cb41d0b879e86266d1573
+ external_id: bogus_5dd6ae0d241b2fdf703a06f8
external_data:
client_secret: secret_123
customer_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_UkLWZg9DAJ
order_id: or_UkLWZg9DAJ
@@ -4633,6 +4633,224 @@ paths:
external_data:
type: object
description: 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_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PEE7ILQ9
+ number: P83F5K6F
amount: '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_card
source_id: card_UkLWZg9DAJ
source:
@@ -4754,11 +4972,11 @@ paths:
payment_method_id: pm_UkLWZg9DAJ
state: checkout
response_code: '12345'
- number: PRFVT59T
+ number: PNK9E4XQ
amount: '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_card
source_id: card_UkLWZg9DAJ
source:
@@ -4842,20 +5060,19 @@ paths:
example:
data:
- id: prod_UkLWZg9DAJ
- name: Product 671077
+ name: Product 677067
description: |-
- 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-677067
meta_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: true
in_stock: false
backorderable: true
@@ -4875,20 +5092,17 @@ paths:
price_list_id:
original_price:
- id: prod_gbHJdmfrXB
- name: Product 681206
+ name: Product 68335
description: |-
- 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-68335
meta_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: true
in_stock: false
backorderable: true
@@ -4973,19 +5187,20 @@ paths:
application/json:
example:
id: prod_UkLWZg9DAJ
- name: Product 799073
+ name: Product 794796
description: |-
- 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-794796
meta_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: true
in_stock: false
backorderable: true
@@ -5190,29 +5405,29 @@ paths:
example:
data:
- id: ship_UkLWZg9DAJ
- number: H27362422771
+ number: H53243452822
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_284
- name: Marivel Wolff
+ state_abbr: STATE_ABBR_298
+ name: Lon Purdy
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_284
+ state_text: STATE_ABBR_298
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -5303,29 +5518,29 @@ paths:
application/json:
example:
id: ship_UkLWZg9DAJ
- number: H81909682950
+ number: H44900152874
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_292
- name: Irena Raynor
+ state_abbr: STATE_ABBR_306
+ name: Lolita Altenwerth
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_292
+ state_text: STATE_ABBR_306
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -5392,10 +5607,10 @@ paths:
application/json:
example:
id: or_UkLWZg9DAJ
- number: R003729769
+ number: R144752355
state: delivery
- token: uMtaSWypFkRBaumyfWZSHoToFWwDPpG9JKg
+ token: 1oyQ9qui1qwcVDF85XCK7XYZjevgBCNda6n
special_instructions:
currency: USD
item_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_UkLWZg9DAJ
variant_id: variant_UkLWZg9DAJ
quantity: 1
- name: Product 1112928
- slug: product-1112928
+ name: Product 111604
+ slug: product-111604
options_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: H37851186338
state: pending
tracking: U10000
tracking_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_UkLWZg9DAJ
name: UPS Ground
code: UPS_GROUND
stock_location:
id: sloc_UkLWZg9DAJ
- state_abbr: STATE_ABBR_300
- name: Moses Zieme
+ state_abbr: STATE_ABBR_314
+ name: Tyesha Johnston
address1: 1600 Pennsylvania Ave NW
city: Washington
zipcode: '20500'
country_iso: US
country_name: United States of America
- state_text: STATE_ABBR_300
+ state_text: STATE_ABBR_314
shipping_rates:
- id: shpr_UkLWZg9DAJ
shipping_method_id: shpm_UkLWZg9DAJ
@@ -5493,7 +5708,7 @@ paths:
firstname: John
lastname: Doe
full_name: John Doe
- address1: 292 Lovely Street
+ address1: 306 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -5501,15 +5716,15 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_302
- state_abbr: STATE_ABBR_302
- state_name: STATE_NAME_302
+ state_text: STATE_ABBR_316
+ state_abbr: STATE_ABBR_316
+ state_name: STATE_NAME_316
ship_address:
id: addr_VqXmZF31wY
firstname: John
lastname: Doe
full_name: John Doe
- address1: 293 Lovely Street
+ address1: 307 Lovely Street
address2: Northwest
city: Herndon
zipcode: '35005'
@@ -5517,9 +5732,9 @@ paths:
company: Company
country_name: United States of America
country_iso: US
- state_text: STATE_ABBR_303
- state_abbr: STATE_ABBR_303
- state_name: STATE_NAME_303
+ state_text: STATE_ABBR_317
+ state_abbr: STATE_ABBR_317
+ state_name: STATE_NAME_317
payment_methods: []
schema:
"$ref": "#/components/schemas/StoreOrder"
@@ -5579,8 +5794,8 @@ paths:
instagram: spreecommerce
customer_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: US
supported_currencies:
- USD
@@ -5645,32 +5860,32 @@ paths:
- id: txnmy_UkLWZg9DAJ
name: Categories
position: 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_gbHJdmfrXB
name: Brands
position: 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_EfhxLZ9ck8
name: Collections
position: 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_VqXmZF31wY
name: taxonomy_11
position: 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_uw2YK1rnl0
name: taxonomy_12
position: 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_AXs1igzRC6
meta:
page: 1
@@ -5736,8 +5951,8 @@ paths:
id: txnmy_VqXmZF31wY
name: taxonomy_17
position: 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_OIJLhNcSbf
schema:
"$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_OIJLhNcSbf
taxonomy_id: txnmy_VqXmZF31wY
description: ''
@@ -5865,9 +6080,9 @@ paths:
data:
- id: wl_UkLWZg9DAJ
name: 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: false
is_private: true
meta:
@@ -5926,9 +6141,9 @@ paths:
example:
id: wl_gbHJdmfrXB
name: 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: false
is_private: true
schema:
@@ -6001,9 +6216,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: 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: false
is_private: true
schema:
@@ -6049,9 +6264,9 @@ paths:
example:
id: wl_UkLWZg9DAJ
name: 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: false
is_private: true
schema:
@@ -6132,8 +6347,8 @@ paths:
variant_id: variant_gbHJdmfrXB
wishlist_id: wl_UkLWZg9DAJ
quantity: 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_gbHJdmfrXB
product_id: prod_gbHJdmfrXB
@@ -6142,8 +6357,8 @@ paths:
options_text: ''
track_inventory: true
image_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: true
in_stock: false
@@ -6260,6 +6475,8 @@ tags:
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
@@ -6290,6 +6507,7 @@ x-tagGroups:
- Customers
- Addresses
- Credit Cards
+ - Payment Setup Sessions
- Wishlists
- Digitals
components:
@@ -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_method
StorePaymentSource:
type: object
properties:
diff --git a/packages/next/src/actions/payment-setup-sessions.ts b/packages/next/src/actions/payment-setup-sessions.ts
new file mode 100644
index 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.ts
index 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 convenience
export 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.ts
index 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.ts
index 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.ts
index 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.ts
new file mode 100644
index 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.ts
index 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.ts
index 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 types
export interface FilterOption {
id: string;
diff --git a/packages/sdk/tests/mocks/handlers.ts b/packages/sdk/tests/mocks/handlers.ts
index 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' },
+ })
+ ),
+
// Wishlists
http.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.ts
new file mode 100644
index 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');
+ });
+ });
+});