Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
Promote shipping categories to delivery profiles
Damian Legawiec2ba9ea581c7a
diff --git a/CLAUDE.md b/CLAUDE.mdindex b937a71b11..c7edca9c5b 100644--- a/CLAUDE.md+++ b/CLAUDE.md@@ -21,8 +21,8 @@ Active plans (6.0 target, work pending):- `6.0-remove-master-variant.md` — Eliminate is_master, add default_variant_id FK on Product. **Shipped to 6-0-dev (PR #14265):** is_master removed from all models, default_variant_id + `spree:remove_master_variant` data-migration rake landed; only the physical is_master column drop remains (6.1 cleanup).- `6.0-typed-stock-movements.md` — Replace generic StockMovement with typed kinds + concrete FKs- `6.0-normalize-state-to-status.md` — Rename state → status on Payment, Shipment, InventoryUnit, ReturnAuthorization, GiftCard-- `6.0-fulfillment-profiles.md` — **Design finalized 2026-08-09.** `Spree::FulfillmentProfile` = ShippingCategory promoted via table rename (`spree_shipping_categories`→`spree_fulfillment_profiles`, `products.shipping_category_id`→`fulfillment_profile_id`): store-scoped, one default per store, products reference it directly (ProductType stamps a template profile at creation only — restores template doctrine). Profile ↔ stock locations (origins, empty=all) + profile→zones + profile→methods; method `fulfillment_type`→`modality` (`Spree::DeliveryMethod.modalities` class_attribute; `Spree.fulfillment_types` registry DELETED), method binds ≤1 zone (m:n join dropped), optional ships-from narrowing per method (no location-group layer — considered, dropped). Capabilities derive from profile methods (`digital?`, pickupable, address requirement); carts split per profile. `spree:upgrade:migrate_fulfillment_profiles` handles store assignment/default flags/method m:n collapse (`spree_shipping_method_categories` survives to 6.1 as source). ShippingCategory/ShippingMethodCategory classes + associations deleted. Supersedes the string-registry + "named groups 6.1" decisions.-- `6.0-fulfillment-and-delivery.md` — Shipment→Fulfillment, ShippingMethod→DeliveryMethod, drop ShippingCategory, FulfillmentProvider strategy, pickup (merchant StockLocation) + pickup_point (third-party PickupPointProvider). **Shipped to 6-0-dev (Waves 2+4+6):** renames + deprecated twins, providers (Manual/Digital/Pickup/PickupPoint), dual-emit events, store pickup discovery endpoints, admin delivery_methods/delivery_zones CRUD + dashboard settings pages, FulfillmentMailer; Wave 7 shipping→delivery data migration remains. Pickup work beyond shipped code deferred to 6.1 (2026-08-06): contract hardening (`new(delivery_method)` ctor, `find_nearby` zipcode/query) + how-to guide; `PickupPointProvider::Base` stays **undocumented in 6.0** (v6 docs cover only the delivery rate provider interface) — never add pickup-provider docs in 6.0 work. 6.0 built-in fulfillment types: `shipping`/`pickup`/`digital` — `pickup_point` unregistered until 6.1, `local_delivery` cut (= shipping + postal-code zone)+- `6.0-delivery-profiles.md` — **Implemented in PR #14404 (2026-08-09).** `Spree::DeliveryProfile` = ShippingCategory promoted via table rename (`spree_shipping_categories`→`spree_delivery_profiles`, `products.shipping_category_id`→`delivery_profile_id`): store-scoped STI (kinds `DeliveryProfiles::Shipping`/`::Digital` via `Spree.delivery_profile_types`), one default per store, products reference it directly and it's required (auto-assigned: type template else store default; ProductType stamps at creation only — template doctrine). Profile ↔ stock locations (origins, empty=all) + profile→zones + profile→methods; method binds ≤1 zone (m:n join dropped), optional ships-from narrowing per method (no location-group layer — considered, dropped). **Classes only, NO string vocabularies:** method `fulfillment_type` column dropped, `Spree.fulfillment_types` registry + ProductType array deleted; behavior = `FulfillmentProvider` class predicates (`digital?`/`pickup?`/`pickup_point?`/`requires_address?`), rate-provider `requires_address?`, profile kind `digital?`/`requires_shipping_address?` + composition validations. Carts split per profile (`Splitter::DeliveryProfile`); Coordinator allocates only from profile-covered locations. `spree:migrate_delivery_profiles` (5.6→6.0 manifest) does store assignment/kind detection/non-narrowing fold-in/method m:n collapse (`spree_shipping_method_categories` survives to 6.1 as source). ShippingCategory/ShippingMethodCategory classes + associations deleted. Supersedes the string-registry + "named groups 6.1" decisions.+- `6.0-fulfillment-and-delivery.md` — Shipment→Fulfillment, ShippingMethod→DeliveryMethod, drop ShippingCategory, FulfillmentProvider strategy, pickup (merchant StockLocation) + pickup_point (third-party PickupPointProvider). **Shipped to 6-0-dev (Waves 2+4+6):** renames + deprecated twins, providers (Manual/Digital/Pickup/PickupPoint), dual-emit events, store pickup discovery endpoints, admin delivery_methods/delivery_zones CRUD + dashboard settings pages, FulfillmentMailer; Wave 7 shipping→delivery data migration remains. Pickup work beyond shipped code deferred to 6.1 (2026-08-06): contract hardening (`new(delivery_method)` ctor, `find_nearby` zipcode/query) + how-to guide; `PickupPointProvider::Base` stays **undocumented in 6.0** (v6 docs cover only the delivery rate provider interface) — never add pickup-provider docs in 6.0 work. Delivery mechanics live on provider classes (`pickup_point` provider ships but stays unregistered until 6.1; `local_delivery` cut = shipping + postal-code zone); the string fulfillment-type registry was deleted by `6.0-delivery-profiles.md`- `6.0-returns-exchanges-claims.md` — First-class Return, Exchange, Claim models replacing ReturnAuthorization/Reimbursement chain. **COMPLETE (2026-08-05):** all three entities (+ permanent `ReturnLineItem`/`ExchangeLineItem`/`ClaimLineItem` line items), `Spree::HasStatus`, all fifteen workflows (each with a leading `validate` hook), `Refund#originator`, admin + store v3 APIs (transitions as PATCH member actions; no destroy — cancel instead), dashboard pages. Legacy chain **removed**: ReturnAuthorization/CustomerReturn/Reimbursement/ReimbursementType/legacy ReturnItem + eligibility validators + ReturnsCalculator classes all deleted, but their **tables deliberately survive to 6.1** as the data migration's source and rollback path. `spree:upgrade:migrate_returns` (`Spree::ReturnsMigrator`, defined in the rake file like its sibling upgrade tasks; anonymous-AR readers) is in the 5.6→6.0 manifest after the adjustments step; it needs no cursor because the preserved `number` is uniquely indexed on the new tables, so "what's left" is a `where.not(number: ...)` query and an interrupted run resumes for free. `ReturnAuthorizationReason`→`ReturnReason` (alias one release) + new `ClaimReason`; `Metafields` on all three. Capability replacements: `Spree::ReturnMailer#refunded_email` on `return.refunded` (replaces the reimbursement email), `Order#outstanding_balance` drops the reimbursement term (refunds already net out of `payment_total`), `Return#refunded_total` counts store credits too, `StoreCreditCategory.default_refund_category` (alias kept). **Reasons** ship admin-only CRUD (`/api/v3/admin/{return,claim,refund}_reasons`, `settings` scope) + a combined Settings → Reasons dashboard page + reason pickers on the create dialogs; `mutable` is never client-writable and the immutability guard lives on `Spree::NamedType` (`can_be_deleted?` + rename/destroy guards) because secret API keys authorize by scope and never consult CanCanCan. **No state machines (2026-08-02):** plain `status` string + inclusion validation; all fifteen transitions are workflows (`Returns::Receive`, `Exchanges::Fulfill`, `Claims::Resolve`, …) with `validate` hooks for return-eligibility policy and refunds as `external_step`. Nothing happens in a model or transition callback. Statuses live in a `class_attribute` via the core `Spree::HasStatus` concern (`has_status` + additive `add_status(value, after:)`, generating predicates and scopes) — extensible by design, additive only, and no transition graph (that would be a state machine again). **Return eligibility is a hook, not a policy engine (2026-08-03):** no window/restocking-fee/final-sale flag in core — a `validate` handler decides, enforcing for customers while letting staff override (it reads `created_by`), and region-varying policy reads `order.market`. Medusa/Saleor/Vendure ship no policy at all; Shopify's engine has no API. A `ReturnPolicy` model can arrive later behind the same hook.- `6.0-platform-auth.md` — Drop Devise, own auth stack, User→Customer/Staff rename (RefreshToken shipped in 5.4)- `6.0-tax-provider.md` — Per-Market TaxProvider, replaces TaxRate.adjust + Calculator; TaxRate gets direct country/state FKs (tax decoupled from Zone; Zone model dropped in 6.0 via `6.0-delivery-zones.md`); reference provider: Avalara (decisions.md 2026-07-30)@@ -53,8 +53,9 @@ Multi-version plans (some phases shipped, some pending):Pending design work (drafts, no implementation yet):- `6.1-order-change-substrate.md` — `Spree::OrderChange` + `Spree::OrderChangeAction`: one preview-then-apply substrate behind every post-placement mutation (admin order edits, returns, exchanges, claims, draft-order amendments), replacing four per-domain draft models with one `begin → request → confirm → cancel` lifecycle. Actions are typed `kind` + concrete FKs (never polymorphic); **preview is computed in memory and never persisted**; confirm is a workflow with the balance settlement as an `external_step`. Deliberately 6.1 — new schema + new extension API, and 6.0 already carries the Cart/Order split, typed adjustments and the returns rework. 6.0 constraint: don't build a per-domain persisted preview/draft model, and expose post-placement money math through a service returning a value object so it can be re-pointed later.-- `5.7-payment-method-rules.md` — `Spree::PaymentMethodRule` STI on PaymentMethod (Channel / Market / OrderTotal / CustomerGroup rules), mirroring the PromotionRule/PriceRule/OrderRoutingRule pattern. Enforced solely through `Order#collect_frontend_payment_methods` (listing + `Payments::Create` + payment sessions all flow through it); admin/backoffice bypasses; no rules = available everywhere. Dashboard-only management (nested Admin API CRUD + `/payment_method_rules/types` discovery). Supersedes the "no distribution concept" rationale in `5.6-6.0-single-store-promotions-payment-methods.md`; per-channel provider credentials (multiple Stripe accounts, multi-entity setups) explicitly deferred for grooming — see decisions.md 2026-07-23.-- `5.7-channel-markets.md` — Optional Channel→Markets allowlist (`spree_channel_markets` join, empty = all markets). Enforced in market resolution (`set_market_from_country` + channel-aware `Spree::Current.market` fallback), channel-filtered Store API `/store/markets`, and order-level `market must be served by channel` validation. Composes with `MarketRule` from the payment-method-rules plan.+- `6.0-payment-method-rules.md` — `Spree::PaymentMethodRule` STI on PaymentMethod (Channel / Market / OrderTotal / CustomerGroup rules), mirroring the PromotionRule/PriceRule/OrderRoutingRule pattern. Enforced solely through `Order#collect_frontend_payment_methods` (listing + `Payments::Create` + payment sessions all flow through it); admin/backoffice bypasses; no rules = available everywhere. Dashboard-only management (nested Admin API CRUD + `/payment_method_rules/types` discovery). Supersedes the "no distribution concept" rationale in `5.6-6.0-single-store-promotions-payment-methods.md`; per-channel provider credentials (multiple Stripe accounts, multi-entity setups) explicitly deferred for grooming — see decisions.md 2026-07-23.+- `6.0-channel-delivery.md` — **Implemented in PR #14404 (2026-08-09).** Optional Channel→StockLocations allowlist (`spree_channel_stock_locations`, empty = all): constrains which fulfillment origins serve a channel's traffic, enforced origin-side (Coordinator allocation + pickup discovery intersect `Channel#serves_location?`) — never on profiles/groups (channel constraint composes from outside; Medusa-shaped transitive delivery). `preferred_stock_location_id` must be a served location. **Per-channel rates** are a separate axis: `DeliveryMethodRules::ChannelRule` (STI, beside ItemTotal/Weight/ExcludedProducts) gates which methods a channel is *offered* from origins it already reaches — origins decide whether a channel can be served, rules decide what it sees.+- `6.0-channel-markets.md` — Optional Channel→Markets allowlist (`spree_channel_markets` join, empty = all markets). Enforced in market resolution (`set_market_from_country` + channel-aware `Spree::Current.market` fallback), channel-filtered Store API `/store/markets`, and order-level `market must be served by channel` validation. Composes with `MarketRule` from the payment-method-rules plan.- `5.6-admin-spa-csv-import.md` — Universal dashboard CSV import over the existing `Spree::Import` pipeline (implemented). Admin API v3 surface (create via direct-upload signed blob, `complete_mapping`, `retry_failed_rows`, nested failed-rows index, write-scope gating), `client.imports` SDK resource, dashboard-core `ImportButton` (per-context `<Can>` gating, upload Sheet) + full-window wizard dialog driven by an `?import=` search param, with history under `/settings/imports` (new `audit` settings-nav group). Status via API polling — explicitly no ActionCable/Turbo Streams in the SPA; legacy per-row live feed replaced by polled counters + paginated failed-rows table.- `5.5-6.0-resource-translations-api.md` — Admin API v3 translation management + React dashboard for all `Spree.translatable_resources`. Hybrid: embedded `translations` object on resource update + generic dedicated `…/:id/translations` endpoint (one registry-driven controller), self-describing field discovery, advisory server-side staleness. Canonical `{ locale → { field → value } }` shape (consistent with metafield-translations). Cross-record bulk = CSV import/export generalized across the registry (NOT a JSON bulk endpoint — no competitor ships one). Phase 1 (5.5) API; Phase 2 (6.0) coverage read + CSV generalization + staleness + centralized SPA page; Phase 3 folds in metafields.- `5.4-centralized-translations-admin.md` — Centralized Translations admin page under Products, overview grid + bulk CSV import/exportdiff --git a/docs/api-reference/admin.yaml b/docs/api-reference/admin.yamlindex 5049e79d3d..760bf6dee3 100644--- a/docs/api-reference/admin.yaml+++ b/docs/api-reference/admin.yaml@@ -92,16 +92,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjQ3MmEzNDhiLTAxN2YtNGY0OS1hMmY0LWRjMzQzMTEyNmRiMCIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2MjY2ODgyfQ.ZdLG_drYn00UULwbf_sTiZZDQuhL46JwUjfLL_NAvII+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6Ijk0YTBhYWYxLWZjMWUtNGFlNy1hNmRmLTczYjc0YTkxOTY4ZiIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2MzYxNTYxfQ.qVc44rbNx4EQQCdhOEkO9FAPv9Qh9K5TJtZqojnZh3Iuser:id: adm_UkLWZg9DAJemail: [email protected]- first_name: Ceola- last_name: Hahn- full_name: Ceola Hahn+ first_name: Avril+ last_name: Ledner+ full_name: Avril Lednerselected_locale:- created_at: '2026-08-09T09:09:42.085Z'- updated_at: '2026-08-09T09:09:42.085Z'+ created_at: '2026-08-10T11:27:41.826Z'+ updated_at: '2026-08-10T11:27:41.826Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -204,16 +204,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6ImEwNTZkMzE1LTVjOGItNDFjZC05ZDY3LTQ4MTI0NzEyYmMwOSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2MjY2ODgyfQ.7-yKwMyJoNuVHgwEamSIZyDZd1Wc4s-iw57lgpY_ucc+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjIwYTU2ZThmLWE4MmQtNGY4NS04YTdkLWViNDlhYTAzNTIxOCIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2MzYxNTYxfQ.kdarmZXaxqV1R6smMpMZsUjjOSQ169duwEuGi26Q8rguser:id: adm_UkLWZg9DAJemail: [email protected]- first_name: Monica- last_name: Terry- full_name: Monica Terry+ first_name: Adolph+ last_name: Corkery+ full_name: Adolph Corkeryselected_locale:- created_at: '2026-08-09T09:09:42.142Z'- updated_at: '2026-08-09T09:09:42.142Z'+ created_at: '2026-08-10T11:27:41.882Z'+ updated_at: '2026-08-10T11:27:41.882Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -315,13 +315,13 @@ paths:example:user:id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Audie- last_name: Morar- full_name: Audie Morar+ email: [email protected]+ first_name: Evangelina+ last_name: Watsica+ full_name: Evangelina Watsicaselected_locale:- created_at: '2026-08-09T09:09:46.541Z'- updated_at: '2026-08-09T09:09:46.541Z'+ created_at: '2026-08-10T11:27:46.289Z'+ updated_at: '2026-08-10T11:27:46.289Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -432,13 +432,13 @@ paths:example:user:id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Wayne- last_name: Waelchi- full_name: Wayne Waelchi+ email: [email protected]+ first_name: Denice+ last_name: Parker+ full_name: Denice Parkerselected_locale: de- created_at: '2026-08-09T09:09:46.576Z'- updated_at: '2026-08-09T09:09:46.587Z'+ created_at: '2026-08-10T11:27:46.338Z'+ updated_at: '2026-08-10T11:27:46.350Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -626,16 +626,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjhlMzNiOTQ5LTQwOGItNGI4MS1hZmJjLWQ2NmUyNzM2ZjQyMSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2MjcwMTkxfQ.ZdPLMrs0yAS5gDnCTj7EWgCzJQSeTMGMkwbvOETj9Y8+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJhZG1pbiIsImp0aSI6IjIzMDFkYzY5LWYzNTctNDgyMi1hYzM3LWQwOTBjZjhjOWU3NSIsImlzcyI6InNwcmVlIiwiYXVkIjoiYWRtaW5fYXBpIiwiZXhwIjoxNzg2MzY0ODcxfQ.KiuWkHdj7uc-xVFNZ34pGwpHNaI7LiulSkX8Y_64Mhsuser:id: adm_UkLWZg9DAJemail: [email protected]- first_name: Eda- last_name: Schulist- full_name: Eda Schulist+ first_name: Anika+ last_name: Kassulke+ full_name: Anika Kassulkeselected_locale:- created_at: '2026-08-09T09:09:51.982Z'- updated_at: '2026-08-09T09:09:51.995Z'+ created_at: '2026-08-10T11:27:51.598Z'+ updated_at: '2026-08-10T11:27:51.610Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -754,8 +754,8 @@ paths:data:- id: ao_UkLWZg9DAJorigin: https://shop.example.com- created_at: '2026-08-09T09:09:41.717Z'- updated_at: '2026-08-09T09:09:41.717Z'+ created_at: '2026-08-10T11:27:41.404Z'+ updated_at: '2026-08-10T11:27:41.404Z'meta:page: 1limit: 25@@ -839,8 +839,8 @@ paths:example:id: ao_gbHJdmfrXBorigin: https://admin.example.com- created_at: '2026-08-09T09:09:41.770Z'- updated_at: '2026-08-09T09:09:41.770Z'+ created_at: '2026-08-10T11:27:41.464Z'+ updated_at: '2026-08-10T11:27:41.464Z'schema:"$ref": "#/components/schemas/AllowedOrigin"'422':@@ -927,8 +927,8 @@ paths:example:id: ao_UkLWZg9DAJorigin: https://shop.example.com- created_at: '2026-08-09T09:09:41.799Z'- updated_at: '2026-08-09T09:09:41.799Z'+ created_at: '2026-08-10T11:27:41.492Z'+ updated_at: '2026-08-10T11:27:41.492Z'schema:"$ref": "#/components/schemas/AllowedOrigin"'404':@@ -989,8 +989,8 @@ paths:example:id: ao_UkLWZg9DAJorigin: https://www.example.com- created_at: '2026-08-09T09:09:41.840Z'- updated_at: '2026-08-09T09:09:41.854Z'+ created_at: '2026-08-10T11:27:41.582Z'+ updated_at: '2026-08-10T11:27:41.615Z'schema:"$ref": "#/components/schemas/AllowedOrigin"'422':@@ -1110,34 +1110,34 @@ paths:key_type: publishabletoken_prefix:scopes: []- created_at: '2026-08-09T09:09:41.902Z'- updated_at: '2026-08-09T09:09:41.902Z'+ created_at: '2026-08-10T11:27:41.680Z'+ updated_at: '2026-08-10T11:27:41.680Z'revoked_at:last_used_at:channel_id:- plaintext_token: pk_51rMJUrtJEwBr9p8gZHCbgEb+ plaintext_token: pk_maAjkwFUBCKq2eVgsrM86Zvucreated_by_email:- id: key_gbHJdmfrXBname: Backend integrationkey_type: secret- token_prefix: sk_9cxhdhvcL+ token_prefix: sk_9ds1bk6Ciscopes:- write_all- created_at: '2026-08-09T09:09:41.903Z'- updated_at: '2026-08-09T09:09:41.903Z'+ created_at: '2026-08-10T11:27:41.681Z'+ updated_at: '2026-08-10T11:27:41.681Z'revoked_at:last_used_at:channel_id:plaintext_token:created_by_email:- id: key_EfhxLZ9ck8- name: ipsam+ name: voluptatemkey_type: secret- token_prefix: sk_MDadjXBgC+ token_prefix: sk_euWMWQnfEscopes:- write_all- created_at: '2026-08-09T09:09:41.904Z'- updated_at: '2026-08-09T09:09:41.904Z'+ created_at: '2026-08-10T11:27:41.682Z'+ updated_at: '2026-08-10T11:27:41.682Z'revoked_at:last_used_at:channel_id:@@ -1204,16 +1204,16 @@ paths:id: key_VqXmZF31wYname: CI keykey_type: secret- token_prefix: sk_yJCy8bMMo+ token_prefix: sk_oN9F8UsRXscopes:- read_orders- created_at: '2026-08-09T09:09:41.939Z'- updated_at: '2026-08-09T09:09:41.939Z'+ created_at: '2026-08-10T11:27:41.720Z'+ updated_at: '2026-08-10T11:27:41.720Z'revoked_at:last_used_at:channel_id:- plaintext_token: sk_yJCy8bMMoGewuVSihuXMCyZa- created_by_email: [email protected]+ plaintext_token: sk_oN9F8UsRXhPbjMW49BVq66cH+ created_by_email: [email protected]'422':description: validation errorcontent:@@ -1302,12 +1302,12 @@ paths:key_type: publishabletoken_prefix:scopes: []- created_at: '2026-08-09T09:09:41.962Z'- updated_at: '2026-08-09T09:09:41.962Z'+ created_at: '2026-08-10T11:27:41.745Z'+ updated_at: '2026-08-10T11:27:41.745Z'revoked_at:last_used_at:channel_id:- plaintext_token: pk_Ca2nvs432hapLisw3R7gQgXZ+ plaintext_token: pk_Amk4d45FLYwaL9Nc5LCAdtD2created_by_email:patch:summary: Update an API key@@ -1361,11 +1361,11 @@ paths:id: key_gbHJdmfrXBname: Backend integration (renamed)key_type: secret- token_prefix: sk_5ycFz5uDZ+ token_prefix: sk_r5VFbqUbtscopes:- write_all- created_at: '2026-08-09T09:09:41.979Z'- updated_at: '2026-08-09T09:09:41.992Z'+ created_at: '2026-08-10T11:27:41.762Z'+ updated_at: '2026-08-10T11:27:41.776Z'revoked_at:last_used_at:channel_id:@@ -1462,13 +1462,13 @@ paths:application/json:example:id: key_EfhxLZ9ck8- name: vel+ name: laboriosamkey_type: secret- token_prefix: sk_RV1X9rq1f+ token_prefix: sk_dEmqSQKqWscopes:- write_all- created_at: '2026-08-09T09:09:42.046Z'- updated_at: '2026-08-09T09:09:42.046Z'+ created_at: '2026-08-10T11:27:41.800Z'+ updated_at: '2026-08-10T11:27:41.800Z'revoked_at:last_used_at:channel_id:@@ -1526,12 +1526,12 @@ paths:id: key_gbHJdmfrXBname: Backend integrationkey_type: secret- token_prefix: sk_hswwMn59m+ token_prefix: sk_tubL3J2i6scopes:- write_all- created_at: '2026-08-09T09:09:42.062Z'- updated_at: '2026-08-09T09:09:42.078Z'- revoked_at: '2026-08-09T09:09:42.078Z'+ created_at: '2026-08-10T11:27:41.808Z'+ updated_at: '2026-08-10T11:27:41.820Z'+ revoked_at: '2026-08-10T11:27:41.820Z'last_used_at:channel_id:plaintext_token:@@ -1608,8 +1608,8 @@ paths:lft: 1rgt: 2products_count: 0- created_at: '2026-08-09T09:09:42.210Z'- updated_at: '2026-08-09T09:09:42.210Z'+ created_at: '2026-08-10T11:27:41.974Z'+ updated_at: '2026-08-10T11:27:41.974Z'meta:page: 1limit: 25@@ -1683,8 +1683,8 @@ paths:lft: 2rgt: 3products_count: 0- created_at: '2026-08-09T09:09:42.264Z'- updated_at: '2026-08-09T09:09:42.271Z'+ created_at: '2026-08-10T11:27:42.023Z'+ updated_at: '2026-08-10T11:27:42.029Z'schema:"$ref": "#/components/schemas/Category"'422':@@ -1790,8 +1790,8 @@ paths:lft: 1rgt: 2products_count: 0- created_at: '2026-08-09T09:09:42.313Z'- updated_at: '2026-08-09T09:09:42.313Z'+ created_at: '2026-08-10T11:27:42.066Z'+ updated_at: '2026-08-10T11:27:42.066Z'schema:"$ref": "#/components/schemas/Category"'404':@@ -1861,8 +1861,8 @@ paths:lft: 1rgt: 2products_count: 0- created_at: '2026-08-09T09:09:42.365Z'- updated_at: '2026-08-09T09:09:42.388Z'+ created_at: '2026-08-10T11:27:42.115Z'+ updated_at: '2026-08-10T11:27:42.138Z'schema:"$ref": "#/components/schemas/Category"requestBody:@@ -1977,8 +1977,8 @@ paths:lft: 2rgt: 3products_count: 0- created_at: '2026-08-09T09:09:42.437Z'- updated_at: '2026-08-09T09:09:42.482Z'+ created_at: '2026-08-10T11:27:42.221Z'+ updated_at: '2026-08-10T11:27:42.245Z'schema:"$ref": "#/components/schemas/Category"requestBody:@@ -2090,8 +2090,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 1199- slug: product-1199+ name: Product 12674+ slug: product-12674meta_title:meta_description:meta_keywords:@@ -2103,24 +2103,16 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Voluptatibus veniam minus nisi laboriosam eius recusandae- aliquam. Fugiat assumenda molestiae aliquam animi in amet repudiandae.- Delectus aliquam explicabo quae veniam voluptatum. Tenetur aliquam- facere sit architecto veritatis beatae at. Tempora accusamus quisquam- facere iure atque labore eius. Quia architecto deleniti libero assumenda.- Beatae aut hic quis ipsam laudantium officiis. Delectus perspiciatis- veritatis aliquid nobis. Saepe optio occaecati est ratione. Consequatur- ad esse enim incidunt modi accusantium soluta. Ea itaque ad possimus- nulla a illum. Ratione id voluptatum temporibus aliquid. Iure voluptate- eligendi exercitationem recusandae enim praesentium officiis. Reiciendis- aspernatur a doloribus veritatis incidunt. Et iure expedita ratione- quae. Deserunt ab maxime amet a possimus. Iure beatae fugit ad quod- facilis vitae architecto temporibus.- description_html: |-- Voluptatibus veniam minus nisi laboriosam eius recusandae aliquam. Fugiat assumenda molestiae aliquam animi in amet repudiandae. Delectus aliquam explicabo quae veniam voluptatum. Tenetur aliquam facere sit architecto veritatis beatae at. Tempora accusamus quisquam facere iure atque labore eius.- Quia architecto deleniti libero assumenda. Beatae aut hic quis ipsam laudantium officiis. Delectus perspiciatis veritatis aliquid nobis. Saepe optio occaecati est ratione. Consequatur ad esse enim incidunt modi accusantium soluta.- Ea itaque ad possimus nulla a illum. Ratione id voluptatum temporibus aliquid. Iure voluptate eligendi exercitationem recusandae enim praesentium officiis. Reiciendis aspernatur a doloribus veritatis incidunt.- Et iure expedita ratione quae. Deserunt ab maxime amet a possimus. Iure beatae fugit ad quod facilis vitae architecto temporibus.+ description: Rem sint doloribus harum saepe. Quod hic officiis ipsa+ animi iure earum tempora. Non placeat commodi illo quas velit eum+ facilis dolores. Recusandae ratione similique facilis eum velit+ occaecati laudantium praesentium. Reprehenderit esse ut quis natus+ aspernatur.+ description_html: Rem sint doloribus harum saepe. Quod hic officiis+ ipsa animi iure earum tempora. Non placeat commodi illo quas velit+ eum facilis dolores. Recusandae ratione similique facilis eum velit+ occaecati laudantium praesentium. Reprehenderit esse ut quis natus+ aspernatur.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -2135,14 +2127,15 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-09T09:09:42.588Z'- updated_at: '2026-08-09T09:09:42.588Z'+ created_at: '2026-08-10T11:27:42.341Z'+ updated_at: '2026-08-10T11:27:42.341Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-09T09:09:42.566Z'- updated_at: '2026-08-09T09:09:42.598Z'+ created_at: '2026-08-10T11:27:42.320Z'+ updated_at: '2026-08-10T11:27:42.351Z'+ delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJschema:@@ -2312,8 +2305,9 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-09T09:09:41.434Z'- updated_at: '2026-08-09T09:09:41.434Z'+ created_at: '2026-08-10T11:27:41.146Z'+ updated_at: '2026-08-10T11:27:41.146Z'+ stock_location_ids: []- id: ch_gbHJdmfrXBname: Wholesalecode: wholesale@@ -2324,8 +2318,9 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-09T09:09:42.763Z'- updated_at: '2026-08-09T09:09:42.763Z'+ created_at: '2026-08-10T11:27:42.537Z'+ updated_at: '2026-08-10T11:27:42.537Z'+ stock_location_ids: []meta:page: 1limit: 25@@ -2410,8 +2405,9 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-09T09:09:42.815Z'- updated_at: '2026-08-09T09:09:42.815Z'+ created_at: '2026-08-10T11:27:42.591Z'+ updated_at: '2026-08-10T11:27:42.591Z'+ stock_location_ids: []requestBody:content:application/json:@@ -2509,8 +2505,9 @@ paths:preferred_order_routing_strategy:preferred_storefront_access:preferred_guest_checkout:- created_at: '2026-08-09T09:09:42.827Z'- updated_at: '2026-08-09T09:09:42.827Z'+ created_at: '2026-08-10T11:27:42.602Z'+ updated_at: '2026-08-10T11:27:42.602Z'+ stock_location_ids: []patch:summary: Update a channeltags:@@ -2564,8 +2561,9 @@ paths:preferred_order_routing_strategy:preferred_storefront_access: login_requiredpreferred_guest_checkout: false- created_at: '2026-08-09T09:09:42.852Z'- updated_at: '2026-08-09T09:09:42.872Z'+ created_at: '2026-08-10T11:27:42.628Z'+ updated_at: '2026-08-10T11:27:42.652Z'+ stock_location_ids: []requestBody:content:application/json:@@ -2847,8 +2845,8 @@ paths:- id: orule_UkLWZg9DAJposition: 1active: true- created_at: '2026-08-09T09:09:41.439Z'- updated_at: '2026-08-09T09:09:41.439Z'+ created_at: '2026-08-10T11:27:41.151Z'+ updated_at: '2026-08-10T11:27:41.151Z'type: preferred_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -2859,8 +2857,8 @@ paths:- id: orule_gbHJdmfrXBposition: 2active: true- created_at: '2026-08-09T09:09:41.442Z'- updated_at: '2026-08-09T09:09:41.442Z'+ created_at: '2026-08-10T11:27:41.154Z'+ updated_at: '2026-08-10T11:27:41.154Z'type: minimize_splitschannel_id: ch_UkLWZg9DAJpreferences: {}@@ -2871,8 +2869,8 @@ paths:- id: orule_EfhxLZ9ck8position: 3active: true- created_at: '2026-08-09T09:09:41.453Z'- updated_at: '2026-08-09T09:09:41.453Z'+ created_at: '2026-08-10T11:27:41.158Z'+ updated_at: '2026-08-10T11:27:41.158Z'type: default_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -2937,8 +2935,8 @@ paths:id: orule_VqXmZF31wYposition: 3active: true- created_at: '2026-08-09T09:09:47.471Z'- updated_at: '2026-08-09T09:09:47.471Z'+ created_at: '2026-08-10T11:27:47.242Z'+ updated_at: '2026-08-10T11:27:47.242Z'type: default_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -3033,8 +3031,8 @@ paths:id: orule_UkLWZg9DAJposition: 2active: false- created_at: '2026-08-09T09:09:41.439Z'- updated_at: '2026-08-09T09:09:47.527Z'+ created_at: '2026-08-10T11:27:41.151Z'+ updated_at: '2026-08-10T11:27:47.282Z'type: preferred_locationchannel_id: ch_UkLWZg9DAJpreferences: {}@@ -3222,8 +3220,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_fabric- created_at: '2026-08-09T09:09:43.627Z'- updated_at: '2026-08-09T09:09:43.627Z'+ created_at: '2026-08-10T11:27:43.326Z'+ updated_at: '2026-08-10T11:27:43.326Z'- id: cfdef_gbHJdmfrXBnamespace: customkey: order_notes@@ -3234,8 +3232,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_custom_order_notes- created_at: '2026-08-09T09:09:43.628Z'- updated_at: '2026-08-09T09:09:43.628Z'+ created_at: '2026-08-10T11:27:43.327Z'+ updated_at: '2026-08-10T11:27:43.327Z'meta:page: 1limit: 25@@ -3304,8 +3302,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_origin- created_at: '2026-08-09T09:09:43.661Z'- updated_at: '2026-08-09T09:09:43.661Z'+ created_at: '2026-08-10T11:27:43.362Z'+ updated_at: '2026-08-10T11:27:43.362Z'requestBody:content:application/json:@@ -3333,8 +3331,8 @@ paths:description: Owner class, e.g. `Spree::Product`storefront_visible:type: boolean- description: 'When false, definition is admin-only (was `display_on:- back_end`)'+ description: When false, the definition is admin-only and never+ exposed in the Store APIsearchable:type: booleandescription: When true, values are included in storefront product@@ -3413,8 +3411,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_fabric- created_at: '2026-08-09T09:09:43.665Z'- updated_at: '2026-08-09T09:09:43.665Z'+ created_at: '2026-08-10T11:27:43.367Z'+ updated_at: '2026-08-10T11:27:43.367Z'patch:summary: Update a custom field definitiontags:@@ -3474,8 +3472,8 @@ paths:searchable: falsesortable: falsefilter_key: cf_specs_fabric- created_at: '2026-08-09T09:09:43.680Z'- updated_at: '2026-08-09T09:09:43.696Z'+ created_at: '2026-08-10T11:27:43.394Z'+ updated_at: '2026-08-10T11:27:43.413Z'requestBody:content:application/json:@@ -3621,14 +3619,14 @@ paths:name: VIPsdescription: Top spenderscustomers_count: 0- created_at: '2026-08-09T09:09:43.738Z'- updated_at: '2026-08-09T09:09:43.738Z'+ created_at: '2026-08-10T11:27:43.444Z'+ updated_at: '2026-08-10T11:27:43.444Z'- id: cg_gbHJdmfrXBname: Wholesaledescription:customers_count: 0- created_at: '2026-08-09T09:09:43.739Z'- updated_at: '2026-08-09T09:09:43.739Z'+ created_at: '2026-08-10T11:27:43.445Z'+ updated_at: '2026-08-10T11:27:43.445Z'meta:page: 1limit: 25@@ -3717,8 +3715,8 @@ paths:name: Wholesale 2description: B2B accountscustomers_count: 1- created_at: '2026-08-09T09:09:43.808Z'- updated_at: '2026-08-09T09:09:43.808Z'+ created_at: '2026-08-10T11:27:43.512Z'+ updated_at: '2026-08-10T11:27:43.512Z'schema:"$ref": "#/components/schemas/CustomerGroup"'422':@@ -3827,23 +3825,24 @@ paths:name: VIPsdescription: Top spenderscustomers_count: 1- created_at: '2026-08-09T09:09:43.867Z'- updated_at: '2026-08-09T09:09:43.867Z'+ created_at: '2026-08-10T11:27:43.644Z'+ updated_at: '2026-08-10T11:27:43.644Z'customers:- id: cust_UkLWZg9DAJ- email: [email protected]- first_name: Marylee- last_name: Swift+ email: [email protected]+ first_name: Noemi+ last_name: Corkeryphone:accepts_email_marketing: false- full_name: Marylee Swift+ full_name: Noemi Corkeryavailable_store_credit_total: '0'display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-09T09:09:43.871Z'- updated_at: '2026-08-09T09:09:43.871Z'+ created_at: '2026-08-10T11:27:43.648Z'+ updated_at: '2026-08-10T11:27:43.648Z'tags: []+ internal_note:internal_note_html:default_billing_address_id:default_shipping_address_id:@@ -3921,8 +3920,8 @@ paths:name: VIP customers (Q1)description: Top spenderscustomers_count: 0- created_at: '2026-08-09T09:09:43.933Z'- updated_at: '2026-08-09T09:09:43.951Z'+ created_at: '2026-08-10T11:27:43.704Z'+ updated_at: '2026-08-10T11:27:43.722Z'schema:"$ref": "#/components/schemas/CustomerGroup"'422':@@ -4081,8 +4080,8 @@ paths:state_name: New Yorklabel:metadata: {}- created_at: '2026-08-09T09:09:44.012Z'- updated_at: '2026-08-09T09:09:44.012Z'+ created_at: '2026-08-10T11:27:43.777Z'+ updated_at: '2026-08-10T11:27:43.777Z'customer_id: cust_UkLWZg9DAJmeta:page: 1@@ -4175,8 +4174,8 @@ paths:state_name: New Yorklabel: Officemetadata: {}- created_at: '2026-08-09T09:09:44.084Z'- updated_at: '2026-08-09T09:09:44.084Z'+ created_at: '2026-08-10T11:27:43.828Z'+ updated_at: '2026-08-10T11:27:43.828Z'customer_id: cust_UkLWZg9DAJrequestBody:content:@@ -4290,8 +4289,8 @@ paths:state_name: New Yorklabel:metadata: {}- created_at: '2026-08-09T09:09:44.095Z'- updated_at: '2026-08-09T09:09:44.114Z'+ created_at: '2026-08-10T11:27:43.839Z'+ updated_at: '2026-08-10T11:27:43.859Z'customer_id: cust_UkLWZg9DAJrequestBody:content:@@ -4430,8 +4429,8 @@ paths:customer_id: cust_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJmetadata: {}- created_at: '2026-08-09T09:09:44.169Z'- updated_at: '2026-08-09T09:09:44.169Z'+ created_at: '2026-08-10T11:27:43.915Z'+ updated_at: '2026-08-10T11:27:43.915Z'meta:page: 1limit: 25@@ -4521,8 +4520,8 @@ paths:customer_id: cust_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJmetadata: {}- created_at: '2026-08-09T09:09:44.200Z'- updated_at: '2026-08-09T09:09:44.200Z'+ created_at: '2026-08-10T11:27:43.945Z'+ updated_at: '2026-08-10T11:27:43.945Z'delete:summary: Delete a customer credit cardtags:@@ -4647,8 +4646,8 @@ paths:currency: USDmemo:metadata: {}- created_at: '2026-08-09T09:09:44.268Z'- updated_at: '2026-08-09T09:09:44.268Z'+ created_at: '2026-08-10T11:27:44.015Z'+ updated_at: '2026-08-10T11:27:44.015Z'customer_id: cust_UkLWZg9DAJcreated_by_id: adm_UkLWZg9DAJcategory_id: sccat_UkLWZg9DAJ@@ -4727,8 +4726,8 @@ paths:currency: USDmemo: Goodwillmetadata: {}- created_at: '2026-08-09T09:09:44.329Z'- updated_at: '2026-08-09T09:09:44.329Z'+ created_at: '2026-08-10T11:27:44.070Z'+ updated_at: '2026-08-10T11:27:44.070Z'customer_id: cust_UkLWZg9DAJcreated_by_id: adm_gbHJdmfrXBcategory_id: sccat_UkLWZg9DAJ@@ -4823,8 +4822,8 @@ paths:currency: USDmemo: Updatedmetadata: {}- created_at: '2026-08-09T09:09:44.349Z'- updated_at: '2026-08-09T09:09:44.366Z'+ created_at: '2026-08-10T11:27:44.088Z'+ updated_at: '2026-08-10T11:27:44.104Z'customer_id: cust_UkLWZg9DAJcreated_by_id: adm_UkLWZg9DAJcategory_id: sccat_UkLWZg9DAJ@@ -4983,9 +4982,10 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-09T09:09:44.409Z'- updated_at: '2026-08-09T09:09:44.409Z'+ created_at: '2026-08-10T11:27:44.145Z'+ updated_at: '2026-08-10T11:27:44.145Z'tags: []+ internal_note:internal_note_html:default_billing_address_id:default_shipping_address_id:@@ -5066,9 +5066,10 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-09T09:09:44.462Z'- updated_at: '2026-08-09T09:09:44.462Z'+ created_at: '2026-08-10T11:27:44.190Z'+ updated_at: '2026-08-10T11:27:44.190Z'tags: []+ internal_note:internal_note_html:default_billing_address_id:default_shipping_address_id:@@ -5181,9 +5182,10 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-09T09:09:44.476Z'- updated_at: '2026-08-09T09:09:44.476Z'+ created_at: '2026-08-10T11:27:44.201Z'+ updated_at: '2026-08-10T11:27:44.201Z'tags: []+ internal_note:internal_note_html:default_billing_address_id:default_shipping_address_id:@@ -5254,9 +5256,10 @@ paths:display_available_store_credit_total: "$0.00"failed_attempts: 0metadata: {}- created_at: '2026-08-09T09:09:44.505Z'- updated_at: '2026-08-09T09:09:44.524Z'+ created_at: '2026-08-10T11:27:44.225Z'+ updated_at: '2026-08-10T11:27:44.241Z'tags: []+ internal_note:internal_note_html:default_billing_address_id:default_shipping_address_id:@@ -5700,10 +5703,10 @@ paths:example:data:- id: exp_UkLWZg9DAJ- number: EF541569883+ number: EF401648345format: csv- created_at: '2026-08-09T09:09:44.946Z'- updated_at: '2026-08-09T09:09:44.946Z'+ created_at: '2026-08-10T11:27:44.738Z'+ updated_at: '2026-08-10T11:27:44.738Z'type: productsuser_id: adm_UkLWZg9DAJdone: false@@ -5774,10 +5777,10 @@ paths:application/json:example:id: exp_gbHJdmfrXB- number: EF704014156+ number: EF171348674format: csv- created_at: '2026-08-09T09:09:44.978Z'- updated_at: '2026-08-09T09:09:44.978Z'+ created_at: '2026-08-10T11:27:44.766Z'+ updated_at: '2026-08-10T11:27:44.766Z'type: productsuser_id: adm_UkLWZg9DAJdone: false@@ -5874,10 +5877,10 @@ paths:application/json:example:id: exp_UkLWZg9DAJ- number: EF099279530+ number: EF700480557format: csv- created_at: '2026-08-09T09:09:44.989Z'- updated_at: '2026-08-09T09:09:44.989Z'+ created_at: '2026-08-10T11:27:44.775Z'+ updated_at: '2026-08-10T11:27:44.775Z'type: productsuser_id: adm_UkLWZg9DAJdone: false@@ -6060,7 +6063,7 @@ paths:example:data:- id: ful_UkLWZg9DAJ- number: F48561886288+ number: F92903260945tracking: U10000tracking_url:pickup_point_data:@@ -6087,8 +6090,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-09T09:09:47.621Z'- updated_at: '2026-08-09T09:09:47.659Z'+ created_at: '2026-08-10T11:27:47.372Z'+ updated_at: '2026-08-10T11:27:47.413Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJmeta:@@ -6158,7 +6161,7 @@ paths:application/json:example:id: ful_gbHJdmfrXB- number: F03309260985+ number: F83114410439tracking: INPOST-12345tracking_url:pickup_point_data:@@ -6177,7 +6180,7 @@ paths:display_tax_total: "$0.00"status: fulfilledfulfillment_type: shipping- fulfilled_at: '2026-08-09T09:09:47Z'+ fulfilled_at: '2026-08-10T11:27:47Z'items:- item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ@@ -6185,8 +6188,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '0.0'- created_at: '2026-08-09T09:09:47.803Z'- updated_at: '2026-08-09T09:09:47.821Z'+ created_at: '2026-08-10T11:27:47.568Z'+ updated_at: '2026-08-10T11:27:47.588Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJ'422':@@ -6326,7 +6329,7 @@ paths:application/json:example:id: ful_UkLWZg9DAJ- number: F72045601519+ number: F10820342219tracking: U10000tracking_url:pickup_point_data:@@ -6353,8 +6356,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-09T09:09:48.040Z'- updated_at: '2026-08-09T09:09:48.072Z'+ created_at: '2026-08-10T11:27:47.814Z'+ updated_at: '2026-08-10T11:27:47.844Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJpatch:@@ -6416,7 +6419,7 @@ paths:application/json:example:id: ful_UkLWZg9DAJ- number: F16244311599+ number: F29922084352tracking: 1Z999AA10123456784tracking_url: https://wwwapps.ups.com/WebTracking/track?track=yes&trackNums=1Z999AA10123456784pickup_point_data:@@ -6443,8 +6446,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-09T09:09:48.143Z'- updated_at: '2026-08-09T09:09:48.204Z'+ created_at: '2026-08-10T11:27:47.917Z'+ updated_at: '2026-08-10T11:27:47.976Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJrequestBody:@@ -6520,7 +6523,7 @@ paths:application/json:example:id: ful_UkLWZg9DAJ- number: F91842243844+ number: F34957339768tracking: U10000tracking_url:pickup_point_data:@@ -6539,7 +6542,7 @@ paths:display_tax_total: "$0.00"status: fulfilledfulfillment_type: shipping- fulfilled_at: '2026-08-09T09:09:48Z'+ fulfilled_at: '2026-08-10T11:27:48Z'items:- item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJ@@ -6547,8 +6550,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-09T09:09:48.260Z'- updated_at: '2026-08-09T09:09:48.329Z'+ created_at: '2026-08-10T11:27:48.034Z'+ updated_at: '2026-08-10T11:27:48.088Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJ"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":@@ -6610,7 +6613,7 @@ paths:application/json:example:id: ful_UkLWZg9DAJ- number: F52805200511+ number: F77175682291tracking: U10000tracking_url:pickup_point_data:@@ -6637,8 +6640,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-09T09:09:48.382Z'- updated_at: '2026-08-09T09:09:48.447Z'+ created_at: '2026-08-10T11:27:48.144Z'+ updated_at: '2026-08-10T11:27:48.198Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJ"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":@@ -6700,7 +6703,7 @@ paths:application/json:example:id: ful_UkLWZg9DAJ- number: F56212114885+ number: F57306565390tracking: U10000tracking_url:pickup_point_data:@@ -6727,8 +6730,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '100.0'- created_at: '2026-08-09T09:09:48.519Z'- updated_at: '2026-08-09T09:09:48.583Z'+ created_at: '2026-08-10T11:27:48.268Z'+ updated_at: '2026-08-10T11:27:48.327Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_UkLWZg9DAJ"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":@@ -6792,7 +6795,7 @@ paths:example:data:- id: ful_gbHJdmfrXB- number: F85877867532+ number: F16291057535tracking:tracking_url:pickup_point_data:@@ -6819,8 +6822,8 @@ paths:metadata: {}adjustment_total: '0.0'pre_tax_amount: '0.0'- created_at: '2026-08-09T09:09:48.712Z'- updated_at: '2026-08-09T09:09:48.747Z'+ created_at: '2026-08-10T11:27:48.452Z'+ updated_at: '2026-08-10T11:27:48.491Z'order_id: or_UkLWZg9DAJstock_location_id: sloc_gbHJdmfrXBrequestBody:@@ -6919,8 +6922,8 @@ paths:codes_count: 2currency: USDprefix: WELCOME- created_at: '2026-08-09T09:09:45.062Z'- updated_at: '2026-08-09T09:09:45.062Z'+ created_at: '2026-08-10T11:27:44.843Z'+ updated_at: '2026-08-10T11:27:44.843Z'amount: '50.0'expires_at:created_by_id:@@ -7004,8 +7007,8 @@ paths:codes_count: 5currency: USDprefix: NEWCAMP- created_at: '2026-08-09T09:09:45.103Z'- updated_at: '2026-08-09T09:09:45.103Z'+ created_at: '2026-08-10T11:27:44.898Z'+ updated_at: '2026-08-10T11:27:44.898Z'amount: '25.0'expires_at: '2030-12-31'created_by_id: adm_UkLWZg9DAJ@@ -7109,8 +7112,8 @@ paths:codes_count: 2currency: USDprefix: WELCOME- created_at: '2026-08-09T09:09:45.142Z'- updated_at: '2026-08-09T09:09:45.142Z'+ created_at: '2026-08-10T11:27:44.939Z'+ updated_at: '2026-08-10T11:27:44.939Z'amount: '50.0'expires_at:created_by_id:@@ -7216,7 +7219,7 @@ paths:example:data:- id: gc_UkLWZg9DAJ- code: 5DBDB06BD535943F+ code: 79D50AE3D78A0EC5status: activecurrency: USDamount: '50.0'@@ -7230,12 +7233,12 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-09T09:09:45.199Z'- updated_at: '2026-08-09T09:09:45.199Z'+ created_at: '2026-08-10T11:27:44.989Z'+ updated_at: '2026-08-10T11:27:44.989Z'customer_id:created_by_id:- id: gc_gbHJdmfrXB- code: 634AE1FDD0EB0343+ code: 9BB43CFB8FF7782Cstatus: activecurrency: USDamount: '25.0'@@ -7249,8 +7252,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-09T09:09:45.201Z'- updated_at: '2026-08-09T09:09:45.201Z'+ created_at: '2026-08-10T11:27:44.990Z'+ updated_at: '2026-08-10T11:27:44.990Z'customer_id:created_by_id:meta:@@ -7338,7 +7341,7 @@ paths:application/json:example:id: gc_EfhxLZ9ck8- code: 8E7AAF2B9A4EE876+ code: 34FBF6A328982A32status: activecurrency: USDamount: '25.0'@@ -7352,8 +7355,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-09T09:09:45.257Z'- updated_at: '2026-08-09T09:09:45.257Z'+ created_at: '2026-08-10T11:27:45.044Z'+ updated_at: '2026-08-10T11:27:45.044Z'customer_id:created_by_id: adm_UkLWZg9DAJschema:@@ -7462,7 +7465,7 @@ paths:application/json:example:id: gc_UkLWZg9DAJ- code: 14EDE4FF0652D7BC+ code: 6A8D006E84C1DAE8status: activecurrency: USDamount: '50.0'@@ -7476,8 +7479,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-09T09:09:45.295Z'- updated_at: '2026-08-09T09:09:45.295Z'+ created_at: '2026-08-10T11:27:45.074Z'+ updated_at: '2026-08-10T11:27:45.074Z'customer_id:created_by_id:schema:@@ -7540,7 +7543,7 @@ paths:application/json:example:id: gc_UkLWZg9DAJ- code: 15D99F163BB53E90+ code: 847C51A23F119BE5status: activecurrency: USDamount: '75.0'@@ -7554,8 +7557,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-09T09:09:45.340Z'- updated_at: '2026-08-09T09:09:45.356Z'+ created_at: '2026-08-10T11:27:45.113Z'+ updated_at: '2026-08-10T11:27:45.130Z'customer_id:created_by_id:schema:@@ -7658,10 +7661,10 @@ paths:example:data:- id: imp_UkLWZg9DAJ- number: IM127885518+ number: IM528432521rows_count: 0- created_at: '2026-08-09T09:09:45.438Z'- updated_at: '2026-08-09T09:09:45.445Z'+ created_at: '2026-08-10T11:27:45.197Z'+ updated_at: '2026-08-10T11:27:45.203Z'type: productsstatus: pendingowner_type: store@@ -7670,7 +7673,7 @@ paths:processing_errors:preferred_delimiter: ","original_filename: products_import.csv- original_byte_size: 3612+ original_byte_size: 3627original_file_url: "/api/v3/admin/imports/imp_UkLWZg9DAJ/download"completed_rows_count: 0failed_rows_count: 0@@ -7837,10 +7840,10 @@ paths:application/json:example:id: imp_gbHJdmfrXB- number: IM538228867+ number: IM041119571rows_count: 0- created_at: '2026-08-09T09:09:45.493Z'- updated_at: '2026-08-09T09:09:45.532Z'+ created_at: '2026-08-10T11:27:45.251Z'+ updated_at: '2026-08-10T11:27:45.289Z'type: productsstatus: mappingowner_type: store@@ -8275,10 +8278,10 @@ paths:application/json:example:id: imp_UkLWZg9DAJ- number: IM753551409+ number: IM774332755rows_count: 0- created_at: '2026-08-09T09:09:45.642Z'- updated_at: '2026-08-09T09:09:45.648Z'+ created_at: '2026-08-10T11:27:45.413Z'+ updated_at: '2026-08-10T11:27:45.419Z'type: productsstatus: pendingowner_type: store@@ -8287,7 +8290,7 @@ paths:processing_errors:preferred_delimiter: ","original_filename: products_import.csv- original_byte_size: 3612+ original_byte_size: 3627original_file_url: "/api/v3/admin/imports/imp_UkLWZg9DAJ/download"completed_rows_count: 0failed_rows_count: 0@@ -8512,10 +8515,10 @@ paths:application/json:example:id: imp_gbHJdmfrXB- number: IM458702794+ number: IM453541421rows_count: 0- created_at: '2026-08-09T09:09:45.743Z'- updated_at: '2026-08-09T09:09:45.803Z'+ created_at: '2026-08-10T11:27:45.507Z'+ updated_at: '2026-08-10T11:27:45.566Z'type: productsstatus: completed_mappingowner_type: store@@ -8524,7 +8527,7 @@ paths:processing_errors:preferred_delimiter: ","original_filename: products_import.csv- original_byte_size: 3612+ original_byte_size: 3627original_file_url: "/api/v3/admin/imports/imp_gbHJdmfrXB/download"completed_rows_count: 0failed_rows_count: 0@@ -8848,10 +8851,10 @@ paths:application/json:example:id: imp_gbHJdmfrXB- number: IM749925374+ number: IM890337634rows_count: 1- created_at: '2026-08-09T09:09:45.841Z'- updated_at: '2026-08-09T09:09:45.863Z'+ created_at: '2026-08-10T11:27:45.600Z'+ updated_at: '2026-08-10T11:27:45.633Z'type: productsstatus: processingowner_type: store@@ -8860,7 +8863,7 @@ paths:processing_errors:preferred_delimiter: ","original_filename: products_import.csv- original_byte_size: 3612+ original_byte_size: 3627original_file_url: "/api/v3/admin/imports/imp_gbHJdmfrXB/download"completed_rows_count: 0failed_rows_count: 1@@ -9024,8 +9027,8 @@ paths:row_number: 2status: failedvalidation_errors: boom- created_at: '2026-08-09T09:09:45.884Z'- updated_at: '2026-08-09T09:09:45.884Z'+ created_at: '2026-08-10T11:27:45.673Z'+ updated_at: '2026-08-10T11:27:45.673Z'import_id: imp_UkLWZg9DAJitem_type:item_id:@@ -9127,8 +9130,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'- id: mkt_gbHJdmfrXBname: EUcurrency: USD@@ -9139,8 +9142,8 @@ paths:- DEsupported_locales:- en- created_at: '2026-08-09T09:09:46.213Z'- updated_at: '2026-08-09T09:09:46.213Z'+ created_at: '2026-08-10T11:27:45.985Z'+ updated_at: '2026-08-10T11:27:45.985Z'meta:page: 1limit: 25@@ -9233,8 +9236,8 @@ paths:supported_locales:- en- fr- created_at: '2026-08-09T09:09:46.269Z'- updated_at: '2026-08-09T09:09:46.269Z'+ created_at: '2026-08-10T11:27:46.039Z'+ updated_at: '2026-08-10T11:27:46.039Z'schema:"$ref": "#/components/schemas/Market"'422':@@ -9370,8 +9373,8 @@ paths:- DEsupported_locales:- en- created_at: '2026-08-09T09:09:46.327Z'- updated_at: '2026-08-09T09:09:46.327Z'+ created_at: '2026-08-10T11:27:46.093Z'+ updated_at: '2026-08-10T11:27:46.093Z'schema:"$ref": "#/components/schemas/Market"'404':@@ -9450,8 +9453,8 @@ paths:- DEsupported_locales:- en- created_at: '2026-08-09T09:09:46.393Z'- updated_at: '2026-08-09T09:09:46.421Z'+ created_at: '2026-08-10T11:27:46.157Z'+ updated_at: '2026-08-10T11:27:46.175Z'schema:"$ref": "#/components/schemas/Market"'422':@@ -9631,8 +9634,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-09T09:09:46.603Z'- updated_at: '2026-08-09T09:09:46.603Z'+ created_at: '2026-08-10T11:27:46.369Z'+ updated_at: '2026-08-10T11:27:46.369Z'meta:page: 1limit: 25@@ -9726,8 +9729,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-09T09:09:46.656Z'- updated_at: '2026-08-09T09:09:46.656Z'+ created_at: '2026-08-10T11:27:46.425Z'+ updated_at: '2026-08-10T11:27:46.425Z'schema:"$ref": "#/components/schemas/OptionType"'422':@@ -9851,8 +9854,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-09T09:09:46.695Z'- updated_at: '2026-08-09T09:09:46.695Z'+ created_at: '2026-08-10T11:27:46.456Z'+ updated_at: '2026-08-10T11:27:46.456Z'schema:"$ref": "#/components/schemas/OptionType"'404':@@ -9925,8 +9928,8 @@ paths:kind: dropdownmetadata: {}filterable: true- created_at: '2026-08-09T09:09:46.739Z'- updated_at: '2026-08-09T09:09:46.754Z'+ created_at: '2026-08-10T11:27:46.499Z'+ updated_at: '2026-08-10T11:27:46.514Z'schema:"$ref": "#/components/schemas/OptionType"'422':@@ -10086,8 +10089,8 @@ paths:display_amount: "$1.50"provider_id: internalmetadata: {}- created_at: '2026-08-09T09:09:46.926Z'- updated_at: '2026-08-09T09:09:46.926Z'+ created_at: '2026-08-10T11:27:46.679Z'+ updated_at: '2026-08-10T11:27:46.679Z'meta:page: 1limit: 25@@ -10161,8 +10164,8 @@ paths:amount: "-2.0"display_amount: "-$2.00"metadata: {}- created_at: '2026-08-09T09:09:47.031Z'- updated_at: '2026-08-09T09:09:47.031Z'+ created_at: '2026-08-10T11:27:46.788Z'+ updated_at: '2026-08-10T11:27:46.788Z'meta:page: 1limit: 25@@ -10242,8 +10245,8 @@ paths:amount: "-3.0"display_amount: "-$3.00"metadata: {}- created_at: '2026-08-09T09:09:47.139Z'- updated_at: '2026-08-09T09:09:47.139Z'+ created_at: '2026-08-10T11:27:46.901Z'+ updated_at: '2026-08-10T11:27:46.901Z''422':description: invalid discountcontent:@@ -10340,8 +10343,8 @@ paths:amount: '4.0'display_amount: "$4.00"metadata: {}- created_at: '2026-08-09T09:09:47.335Z'- updated_at: '2026-08-09T09:09:47.335Z'+ created_at: '2026-08-10T11:27:47.098Z'+ updated_at: '2026-08-10T11:27:47.098Z''422':description: invalid feecontent:@@ -10438,7 +10441,7 @@ paths:application/json:example:id: gc_UkLWZg9DAJ- code: EFE45A065B844D0B+ code: CCA3386D8305D517status: activecurrency: USDamount: '10.0'@@ -10452,8 +10455,8 @@ paths:redeemed_at:expired: falseactive: true- created_at: '2026-08-09T09:09:48.819Z'- updated_at: '2026-08-09T09:09:48.853Z'+ created_at: '2026-08-10T11:27:48.570Z'+ updated_at: '2026-08-10T11:27:48.599Z'customer_id:created_by_id:requestBody:@@ -10594,8 +10597,8 @@ paths:preorder_ships_at:quantity: 2currency: USD- name: Product 276367- slug: product-276367+ name: Product 274756+ slug: product-274756options_text: 'Size: S'price: '10.0'display_price: "$10.00"@@ -10627,12 +10630,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:49.003Z'- updated_at: '2026-08-09T09:09:49.003Z'+ created_at: '2026-08-10T11:27:48.759Z'+ updated_at: '2026-08-10T11:27:48.759Z'digital_links: []metadata: {}- created_at: '2026-08-09T09:09:49.025Z'- updated_at: '2026-08-09T09:09:49.025Z'+ created_at: '2026-08-10T11:27:48.785Z'+ updated_at: '2026-08-10T11:27:48.785Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJmeta:@@ -10704,8 +10707,8 @@ paths:preorder_ships_at:quantity: 3currency: USD- name: Product 297971- slug: product-297971+ name: Product 291359+ slug: product-291359options_text: 'Size: S'price: '19.99'display_price: "$19.99"@@ -10737,12 +10740,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:49.155Z'- updated_at: '2026-08-09T09:09:49.155Z'+ created_at: '2026-08-10T11:27:48.920Z'+ updated_at: '2026-08-10T11:27:48.920Z'digital_links: []metadata: {}- created_at: '2026-08-09T09:09:49.177Z'- updated_at: '2026-08-09T09:09:49.177Z'+ created_at: '2026-08-10T11:27:48.945Z'+ updated_at: '2026-08-10T11:27:48.945Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJrequestBody:@@ -10836,8 +10839,8 @@ paths:preorder_ships_at:quantity: 2currency: USD- name: Product 30232- slug: product-30232+ name: Product 30156+ slug: product-30156options_text: 'Size: S'price: '10.0'display_price: "$10.00"@@ -10869,12 +10872,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:49.250Z'- updated_at: '2026-08-09T09:09:49.250Z'+ created_at: '2026-08-10T11:27:49.016Z'+ updated_at: '2026-08-10T11:27:49.016Z'digital_links: []metadata: {}- created_at: '2026-08-09T09:09:49.271Z'- updated_at: '2026-08-09T09:09:49.271Z'+ created_at: '2026-08-10T11:27:49.037Z'+ updated_at: '2026-08-10T11:27:49.037Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJpatch:@@ -10941,8 +10944,8 @@ paths:preorder_ships_at:quantity: 5currency: USD- name: Product 316085- slug: product-316085+ name: Product 311252+ slug: product-311252options_text: 'Size: S'price: '19.99'display_price: "$19.99"@@ -10974,12 +10977,12 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:49.345Z'- updated_at: '2026-08-09T09:09:49.345Z'+ created_at: '2026-08-10T11:27:49.096Z'+ updated_at: '2026-08-10T11:27:49.096Z'digital_links: []metadata: {}- created_at: '2026-08-09T09:09:49.367Z'- updated_at: '2026-08-09T09:09:49.401Z'+ created_at: '2026-08-10T11:27:49.115Z'+ updated_at: '2026-08-10T11:27:49.151Z'cost_price: '17.0'tax_category_id: taxcat_UkLWZg9DAJrequestBody:@@ -11100,8 +11103,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R086475794- email: [email protected]+ number: R080573327+ email: [email protected]customer_note:currency: USDlocale: en@@ -11145,8 +11148,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: draftlast_ip_address:considered_risky: false@@ -11157,11 +11160,12 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-09T09:09:50.649Z'- updated_at: '2026-08-09T09:09:50.695Z'+ created_at: '2026-08-10T11:27:50.276Z'+ updated_at: '2026-08-10T11:27:50.323Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id:created_by_id:@@ -11336,8 +11340,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R067819856- email: [email protected]+ number: R865350387+ email: [email protected]customer_note:currency: USDlocale: en@@ -11381,8 +11385,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: draftlast_ip_address:considered_risky: false@@ -11393,11 +11397,12 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-09T09:09:50.872Z'- updated_at: '2026-08-09T09:09:50.872Z'+ created_at: '2026-08-10T11:27:50.501Z'+ updated_at: '2026-08-10T11:27:50.501Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id:created_by_id:@@ -11445,12 +11450,12 @@ paths:// except `email` is optional.const order = await client.orders.create({email: '[email protected]',- customer_id: 'cus_UkLWZg9DAJ', // Existing customer; omit for guest orders- use_customer_default_address: false, // true to copy the customer's saved addresses+ customer_id: 'cus_UkLWZg9DAJ', // Existing customer; omit for guest orders+ use_customer_default_address: false, // true to copy the customer's saved addressescurrency: 'USD',market_id: 'mkt_UkLWZg9DAJ',- channel_id: 'ch_UkLWZg9DAJ', // Optional — defaults to the store's primary channel+ channel_id: 'ch_UkLWZg9DAJ', // Optional — defaults to the store's primary channellocale: 'en-US',// Pin the order's preferred fulfillment location. Order Routing's@@ -11460,7 +11465,9 @@ paths:preferred_stock_location_id: 'sloc_UkLWZg9DAJ',customer_note: 'Please leave at the front desk.',- internal_note: 'VIP customer — handle with care.',+ // Rich text: send HTML. Reads return this as plain text, plus+ // `internal_note_html` with the markup.+ internal_note: '<p>VIP customer — handle with care.</p>',metadata: {external_reference: 'subscription_invoice_2026_04',source: 'recurring-engine',@@ -11505,7 +11512,8 @@ paths:- lang: bashlabel: Spree CLIsource: spree api post /orders -d '{"email":"[email protected]","customer_id":"cus_UkLWZg9DAJ","use_customer_default_address":false,"currency":"USD","market_id":"mkt_UkLWZg9DAJ","channel_id":"ch_UkLWZg9DAJ","locale":"en-US","preferred_stock_location_id":"sloc_UkLWZg9DAJ","customer_note":"Please- leave at the front desk.","internal_note":"VIP customer — handle with care.","metadata":{"external_reference":"subscription_invoice_2026_04","source":"recurring-engine"},"items":[{"variant_id":"variant_k5nR8xLq","quantity":2},{"variant_id":"variant_QXyZ12abCD","quantity":1,"metadata":{"gift":true}}],"shipping_address":{"first_name":"Jane","last_name":"Doe","address1":"350+ leave at the front desk.","internal_note":"<p>VIP customer — handle with+ care.</p>","metadata":{"external_reference":"subscription_invoice_2026_04","source":"recurring-engine"},"items":[{"variant_id":"variant_k5nR8xLq","quantity":2},{"variant_id":"variant_QXyZ12abCD","quantity":1,"metadata":{"gift":true}}],"shipping_address":{"first_name":"Jane","last_name":"Doe","address1":"350Fifth Avenue","address2":"Floor 42","city":"New York","postal_code":"10118","country_iso":"US","state_abbr":"NY","phone":"+1212 555 1234","company":"Acme Inc."},"billing_address":{"first_name":"Jane","last_name":"Doe","address1":"350Fifth Avenue","city":"New York","postal_code":"10118","country_iso":"US","state_abbr":"NY","phone":"+1@@ -11546,7 +11554,7 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R538808865+ number: R222587133email: [email protected]customer_note:currency: USD@@ -11591,8 +11599,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: draftlast_ip_address:considered_risky: false@@ -11603,11 +11611,12 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-09T09:09:50.994Z'- updated_at: '2026-08-09T09:09:50.997Z'+ created_at: '2026-08-10T11:27:50.617Z'+ updated_at: '2026-08-10T11:27:50.621Z'preferred_stock_location_id: sloc_UkLWZg9DAJtags: []internal_note:+ internal_note_html:approver_id:canceler_id:created_by_id:@@ -11792,8 +11801,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R618487880- email: [email protected]+ number: R498989786+ email: [email protected]customer_note:currency: USDlocale: en@@ -11837,8 +11846,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: draftlast_ip_address:considered_risky: false@@ -11849,11 +11858,12 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-09T09:09:51.017Z'- updated_at: '2026-08-09T09:09:51.017Z'+ created_at: '2026-08-10T11:27:50.638Z'+ updated_at: '2026-08-10T11:27:50.638Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id:created_by_id:@@ -11892,12 +11902,12 @@ paths:const order = await client.orders.update('or_UkLWZg9DAJ', {email: '[email protected]',- internal_note: 'VIP — gift wrap on next order',+ internal_note: '<p>VIP — gift wrap on next order</p>',})- lang: bashlabel: Spree CLI- source: spree api patch /orders/{id} -d '{"email":"[email protected]","internal_note":"VIP- — gift wrap on next order"}'+ source: spree api patch /orders/{id} -d '{"email":"[email protected]","internal_note":"<p>VIP+ — gift wrap on next order</p>"}'parameters:- name: x-spree-api-keyin: header@@ -11926,7 +11936,7 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R812776402+ number: R211239086email: [email protected]customer_note:currency: USD@@ -11971,8 +11981,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: draftlast_ip_address:considered_risky: false@@ -11983,11 +11993,12 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-09T09:09:51.078Z'- updated_at: '2026-08-09T09:09:51.104Z'+ created_at: '2026-08-10T11:27:50.709Z'+ updated_at: '2026-08-10T11:27:50.734Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id:created_by_id:@@ -12172,8 +12183,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R461375679- email: [email protected]+ number: R594694432+ email: [email protected]customer_note:currency: USDlocale: en@@ -12181,7 +12192,7 @@ paths:coupon_code:fulfillment_status: readypayment_status: paid- completed_at: '2026-08-09T09:09:51.236Z'+ completed_at: '2026-08-10T11:27:50.856Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -12217,8 +12228,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: placedlast_ip_address:considered_risky: false@@ -12229,11 +12240,12 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-09T09:09:51.183Z'- updated_at: '2026-08-09T09:09:51.256Z'+ created_at: '2026-08-10T11:27:50.801Z'+ updated_at: '2026-08-10T11:27:50.875Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id:created_by_id:@@ -12315,8 +12327,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R968104076- email: [email protected]+ number: R550377090+ email: [email protected]customer_note:currency: USDlocale: en@@ -12324,7 +12336,7 @@ paths:coupon_code:fulfillment_status: canceledpayment_status: none- completed_at: '2026-08-09T09:09:51.547Z'+ completed_at: '2026-08-10T11:27:51.106Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -12360,8 +12372,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: canceledlast_ip_address:considered_risky: false@@ -12370,13 +12382,14 @@ paths:payment_total: '0.0'display_payment_total: "$0.00"metadata: {}- canceled_at: '2026-08-09T09:09:51.575Z'+ canceled_at: '2026-08-10T11:27:51.158Z'approved_at:- created_at: '2026-08-09T09:09:51.495Z'- updated_at: '2026-08-09T09:09:51.592Z'+ created_at: '2026-08-10T11:27:51.018Z'+ updated_at: '2026-08-10T11:27:51.213Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id: adm_UkLWZg9DAJcreated_by_id:@@ -12436,8 +12449,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R319108276- email: [email protected]+ number: R438232532+ email: [email protected]customer_note:currency: USDlocale: en@@ -12445,7 +12458,7 @@ paths:coupon_code:fulfillment_status:payment_status:- completed_at: '2026-08-09T09:09:51.677Z'+ completed_at: '2026-08-10T11:27:51.308Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -12481,8 +12494,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: placedlast_ip_address:considered_risky: false@@ -12492,12 +12505,13 @@ paths:display_payment_total: "$0.00"metadata: {}canceled_at:- approved_at: '2026-08-09T09:09:51.702Z'- created_at: '2026-08-09T09:09:51.630Z'- updated_at: '2026-08-09T09:09:51.677Z'+ approved_at: '2026-08-10T11:27:51.335Z'+ created_at: '2026-08-10T11:27:51.260Z'+ updated_at: '2026-08-10T11:27:51.308Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id: adm_UkLWZg9DAJcanceler_id:created_by_id:@@ -12557,8 +12571,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R237442109- email: [email protected]+ number: R314422340+ email: [email protected]customer_note:currency: USDlocale: en@@ -12566,7 +12580,7 @@ paths:coupon_code:fulfillment_status: pendingpayment_status: none- completed_at: '2026-08-09T09:09:51.795Z'+ completed_at: '2026-08-10T11:27:51.407Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -12602,8 +12616,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: placedlast_ip_address:considered_risky: false@@ -12612,13 +12626,14 @@ paths:payment_total: '0.0'display_payment_total: "$0.00"metadata: {}- canceled_at: '2026-08-09T09:09:51.811Z'+ canceled_at: '2026-08-10T11:27:51.425Z'approved_at:- created_at: '2026-08-09T09:09:51.725Z'- updated_at: '2026-08-09T09:09:51.856Z'+ created_at: '2026-08-10T11:27:51.360Z'+ updated_at: '2026-08-10T11:27:51.468Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id: adm_UkLWZg9DAJcreated_by_id:@@ -12678,8 +12693,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R092084655- email: [email protected]+ number: R403032002+ email: [email protected]customer_note:currency: USDlocale: en@@ -12687,7 +12702,7 @@ paths:coupon_code:fulfillment_status:payment_status:- completed_at: '2026-08-09T09:09:51.928Z'+ completed_at: '2026-08-10T11:27:51.543Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -12723,8 +12738,8 @@ paths:- USsupported_locales:- en- created_at: '2026-08-09T09:09:41.429Z'- updated_at: '2026-08-09T09:09:41.429Z'+ created_at: '2026-08-10T11:27:41.141Z'+ updated_at: '2026-08-10T11:27:41.141Z'status: placedlast_ip_address:considered_risky: false@@ -12735,11 +12750,12 @@ paths:metadata: {}canceled_at:approved_at:- created_at: '2026-08-09T09:09:51.881Z'- updated_at: '2026-08-09T09:09:51.927Z'+ created_at: '2026-08-10T11:27:51.493Z'+ updated_at: '2026-08-10T11:27:51.542Z'preferred_stock_location_id:tags: []internal_note:+ internal_note_html:approver_id:canceler_id:created_by_id:@@ -12814,8 +12830,8 @@ paths:auto_capture:storefront_visible: trueposition: 1- created_at: '2026-08-09T09:09:52.029Z'- updated_at: '2026-08-09T09:09:52.029Z'+ created_at: '2026-08-10T11:27:51.642Z'+ updated_at: '2026-08-10T11:27:51.642Z'preferences: {}preference_schema: []meta:@@ -12877,12 +12893,12 @@ paths:label: Bogusdescription:preference_schema:- - key: dummy_key- type: string- default: PUBLICKEY123- key: dummy_secret_keytype: passworddefault:+ - key: dummy_key+ type: string+ default: PUBLICKEY123- type: custom_payment_source_methodlabel: Custom Payment Source Methoddescription:@@ -12961,8 +12977,8 @@ paths:auto_capture:storefront_visible: trueposition: 1- created_at: '2026-08-09T09:09:52.077Z'- updated_at: '2026-08-09T09:09:52.077Z'+ created_at: '2026-08-10T11:27:51.697Z'+ updated_at: '2026-08-10T11:27:51.697Z'preferences: {}preference_schema: []"/api/v3/admin/orders/{order_id}/payments":@@ -13033,8 +13049,8 @@ paths:data:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: BGS-c65bd4f40ebb- number: PD9XM67M+ response_code: BGS-56ef6696697f+ number: P31OCG7Gamount: '110.0'display_amount: "$110.00"status: completed@@ -13052,14 +13068,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-09T09:09:49.629Z'- updated_at: '2026-08-09T09:09:49.637Z'+ created_at: '2026-08-10T11:27:49.345Z'+ updated_at: '2026-08-10T11:27:49.348Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-09T09:09:49.634Z'- updated_at: '2026-08-09T09:09:49.634Z'+ created_at: '2026-08-10T11:27:49.347Z'+ updated_at: '2026-08-10T11:27:49.347Z'captured_amount: '0.0'order_id: or_UkLWZg9DAJmeta:@@ -13129,7 +13145,7 @@ paths:id: py_gbHJdmfrXBpayment_method_id: pm_EfhxLZ9ck8response_code:- number: PD3V9Z67+ number: PG7DKFEVamount: '110.0'display_amount: "$110.00"status: checkout@@ -13140,8 +13156,8 @@ paths:avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-09T09:09:49.915Z'- updated_at: '2026-08-09T09:09:49.915Z'+ created_at: '2026-08-10T11:27:49.556Z'+ updated_at: '2026-08-10T11:27:49.556Z'captured_amount: '0.0'order_id: or_gbHJdmfrXBrequestBody:@@ -13234,8 +13250,8 @@ paths:example:id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: BGS-4134892b65b1- number: PWKWN8D1+ response_code: BGS-198724a14747+ number: P2GTXPJ3amount: '110.0'display_amount: "$110.00"status: completed@@ -13253,14 +13269,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-09T09:09:50.003Z'- updated_at: '2026-08-09T09:09:50.005Z'+ created_at: '2026-08-10T11:27:49.633Z'+ updated_at: '2026-08-10T11:27:49.635Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-09T09:09:50.004Z'- updated_at: '2026-08-09T09:09:50.004Z'+ created_at: '2026-08-10T11:27:49.634Z'+ updated_at: '2026-08-10T11:27:49.634Z'captured_amount: '0.0'order_id: or_UkLWZg9DAJ"/api/v3/admin/orders/{order_id}/payments/{id}/capture":@@ -13323,8 +13339,8 @@ paths:example:id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: BGS-87f5f531a188- number: PI0LH7AW+ response_code: BGS-6ed37b69e225+ number: PMOLEPPGamount: '110.0'display_amount: "$110.00"status: completed@@ -13342,14 +13358,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-09T09:09:50.112Z'- updated_at: '2026-08-09T09:09:50.115Z'+ created_at: '2026-08-10T11:27:49.746Z'+ updated_at: '2026-08-10T11:27:49.749Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-09T09:09:50.114Z'- updated_at: '2026-08-09T09:09:50.146Z'+ created_at: '2026-08-10T11:27:49.748Z'+ updated_at: '2026-08-10T11:27:49.781Z'captured_amount: '110.0'order_id: or_UkLWZg9DAJ'422':@@ -13421,8 +13437,8 @@ paths:example:id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: void-BGS-f976e6e54ee1- number: PF4XA0LX+ response_code: void-BGS-feb91a857231+ number: P6OTLG19amount: '110.0'display_amount: "$110.00"status: void@@ -13440,14 +13456,14 @@ paths:customer_id:payment_method_id: pm_gbHJdmfrXBmetadata: {}- created_at: '2026-08-09T09:09:50.362Z'- updated_at: '2026-08-09T09:09:50.365Z'+ created_at: '2026-08-10T11:27:50.011Z'+ updated_at: '2026-08-10T11:27:50.013Z'metadata: {}avs_response:cvv_response_code:cvv_response_message:- created_at: '2026-08-09T09:09:50.364Z'- updated_at: '2026-08-09T09:09:50.388Z'+ created_at: '2026-08-10T11:27:50.012Z'+ updated_at: '2026-08-10T11:27:50.035Z'captured_amount: '0.0'order_id: or_UkLWZg9DAJ"/api/v3/admin/price_lists":@@ -13535,8 +13551,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-09T09:09:52.122Z'- updated_at: '2026-08-09T09:09:52.122Z'+ created_at: '2026-08-10T11:27:51.740Z'+ updated_at: '2026-08-10T11:27:51.740Z'currently_active: falseproducts_count: 0prices_count: 0@@ -13550,8 +13566,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-09T09:09:52.123Z'- updated_at: '2026-08-09T09:09:52.123Z'+ created_at: '2026-08-10T11:27:51.741Z'+ updated_at: '2026-08-10T11:27:51.741Z'currently_active: falseproducts_count: 0prices_count: 0@@ -13665,8 +13681,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-09T09:09:52.330Z'- updated_at: '2026-08-09T09:09:52.332Z'+ created_at: '2026-08-10T11:27:51.916Z'+ updated_at: '2026-08-10T11:27:51.918Z'currently_active: falseproducts_count: 1prices_count: 2@@ -13829,8 +13845,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-09T09:09:52.371Z'- updated_at: '2026-08-09T09:09:52.371Z'+ created_at: '2026-08-10T11:27:51.961Z'+ updated_at: '2026-08-10T11:27:51.961Z'currently_active: falseproducts_count: 0prices_count: 0@@ -13905,8 +13921,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-09T09:09:52.607Z'- updated_at: '2026-08-09T09:09:52.622Z'+ created_at: '2026-08-10T11:27:52.212Z'+ updated_at: '2026-08-10T11:27:52.227Z'currently_active: falseproducts_count: 0prices_count: 0@@ -14094,8 +14110,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-09T09:09:52.653Z'- updated_at: '2026-08-09T09:09:52.669Z'+ created_at: '2026-08-10T11:27:52.258Z'+ updated_at: '2026-08-10T11:27:52.273Z'currently_active: trueproducts_count: 0prices_count: 0@@ -14158,8 +14174,8 @@ paths:starts_at:ends_at:deleted_at:- created_at: '2026-08-09T09:09:52.678Z'- updated_at: '2026-08-09T09:09:52.694Z'+ created_at: '2026-08-10T11:27:52.282Z'+ updated_at: '2026-08-10T11:27:52.297Z'currently_active: falseproducts_count: 0prices_count: 0@@ -14273,8 +14289,8 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-09T09:09:52.722Z'- updated_at: '2026-08-09T09:09:52.722Z'+ created_at: '2026-08-10T11:27:52.325Z'+ updated_at: '2026-08-10T11:27:52.325Z'- id: price_gbHJdmfrXBamount: '19.99'amount_in_cents: 1999@@ -14285,8 +14301,8 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_gbHJdmfrXB- created_at: '2026-08-09T09:09:52.740Z'- updated_at: '2026-08-09T09:09:52.740Z'+ created_at: '2026-08-10T11:27:52.353Z'+ updated_at: '2026-08-10T11:27:52.353Z'- id: price_EfhxLZ9ck8amount: '5.0'amount_in_cents: 500@@ -14297,8 +14313,8 @@ paths:display_compare_at_amount:price_list_id: pl_UkLWZg9DAJvariant_id: variant_gbHJdmfrXB- created_at: '2026-08-09T09:09:52.743Z'- updated_at: '2026-08-09T09:09:52.743Z'+ created_at: '2026-08-10T11:27:52.357Z'+ updated_at: '2026-08-10T11:27:52.357Z'meta:page: 1limit: 25@@ -14380,8 +14396,8 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_EfhxLZ9ck8- created_at: '2026-08-09T09:09:52.863Z'- updated_at: '2026-08-09T09:09:52.863Z'+ created_at: '2026-08-10T11:27:52.475Z'+ updated_at: '2026-08-10T11:27:52.475Z'schema:"$ref": "#/components/schemas/Price"requestBody:@@ -14468,8 +14484,8 @@ paths:display_compare_at_amount:price_list_id: pl_UkLWZg9DAJvariant_id: variant_gbHJdmfrXB- created_at: '2026-08-09T09:09:52.922Z'- updated_at: '2026-08-09T09:09:52.922Z'+ created_at: '2026-08-10T11:27:52.534Z'+ updated_at: '2026-08-10T11:27:52.534Z'schema:"$ref": "#/components/schemas/Price"'404':@@ -14534,8 +14550,8 @@ paths:display_compare_at_amount:price_list_id: pl_UkLWZg9DAJvariant_id: variant_gbHJdmfrXB- created_at: '2026-08-09T09:09:53.063Z'- updated_at: '2026-08-09T09:09:53.078Z'+ created_at: '2026-08-10T11:27:52.668Z'+ updated_at: '2026-08-10T11:27:52.684Z'schema:"$ref": "#/components/schemas/Price"requestBody:@@ -14843,12 +14859,12 @@ paths:data:- id: cf_UkLWZg9DAJlabel: Title- type: Spree::Metafields::ShortText+ type: Spree::CustomFields::ShortTextfield_type: short_textkey: custom.titlevalue: wool- created_at: '2026-08-09T09:09:53.641Z'- updated_at: '2026-08-09T09:09:53.641Z'+ created_at: '2026-08-10T11:27:53.267Z'+ updated_at: '2026-08-10T11:27:53.267Z'storefront_visible: truecustom_field_definition_id: cfdef_UkLWZg9DAJmeta:@@ -14914,12 +14930,12 @@ paths:example:id: cf_gbHJdmfrXBlabel: Description- type: Spree::Metafields::LongText+ type: Spree::CustomFields::LongTextfield_type: long_textkey: custom.descriptionvalue: A longer description- created_at: '2026-08-09T09:09:53.714Z'- updated_at: '2026-08-09T09:09:53.714Z'+ created_at: '2026-08-10T11:27:53.338Z'+ updated_at: '2026-08-10T11:27:53.338Z'storefront_visible: truecustom_field_definition_id: cfdef_gbHJdmfrXB'422':@@ -14929,9 +14945,9 @@ paths:example:error:code: validation_error- message: Metafield definition has already been taken+ message: Custom field definition has already been takendetails:- metafield_definition_id:+ custom_field_definition_id:- has already been takenrequestBody:content:@@ -15014,12 +15030,12 @@ paths:example:id: cf_UkLWZg9DAJlabel: Title- type: Spree::Metafields::ShortText+ type: Spree::CustomFields::ShortTextfield_type: short_textkey: custom.titlevalue: wool- created_at: '2026-08-09T09:09:53.794Z'- updated_at: '2026-08-09T09:09:53.794Z'+ created_at: '2026-08-10T11:27:53.424Z'+ updated_at: '2026-08-10T11:27:53.424Z'storefront_visible: truecustom_field_definition_id: cfdef_UkLWZg9DAJpatch:@@ -15079,12 +15095,12 @@ paths:example:id: cf_UkLWZg9DAJlabel: Title- type: Spree::Metafields::ShortText+ type: Spree::CustomFields::ShortTextfield_type: short_textkey: custom.titlevalue: cotton- created_at: '2026-08-09T09:09:53.848Z'- updated_at: '2026-08-09T09:09:53.874Z'+ created_at: '2026-08-10T11:27:53.469Z'+ updated_at: '2026-08-10T11:27:53.495Z'storefront_visible: truecustom_field_definition_id: cfdef_UkLWZg9DAJrequestBody:@@ -15202,9 +15218,9 @@ paths:source: Espresso Machine- key: descriptiontype: html- source: Enim sequi vel facilis harum est. Labore dolorem minus- odio harum iusto tempora. Dignissimos neque doloremque magnam- alias corrupti reiciendis nostrum. Ab nam natus eum ad aliquam.+ source: |-+ Doloremque ea beatae minima veritatis fuga. Eveniet iure non numquam vel ab voluptate maxime. Sapiente mollitia cupiditate repudiandae qui blanditiis voluptatem illum.+ Velit dolorem quaerat voluptatibus nobis adipisci cumque quis. Veniam doloribus perspiciatis debitis sit. Exercitationem quo porro doloremque unde sapiente animi dolore.- key: slugtype: stringsource: espresso-machine@@ -15315,8 +15331,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 725700- slug: product-725700+ name: Product 722624+ slug: product-722624meta_title:meta_description:meta_keywords:@@ -15328,27 +15344,18 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Voluptas atque quibusdam tempora aperiam rem magni- corrupti in. Et numquam dolore repellendus qui. Dolores minima- blanditiis ut eius enim. Quidem itaque neque reprehenderit nulla- doloribus. Saepe fugiat laboriosam atque et sit ut autem aut.- Ipsum amet blanditiis quidem soluta. Laboriosam enim suscipit- maiores doloremque tempora possimus ipsum. Libero quas debitis- cupiditate quasi. Omnis dolorum libero alias expedita a eius eligendi- illo. Placeat culpa saepe dolores repellat aut cupiditate ad.- Ratione quod impedit aperiam odio. At necessitatibus porro doloribus- totam explicabo quo vel provident. Cum quia iusto consectetur- sint quis. Earum fugiat ab recusandae quaerat pariatur totam.- Laboriosam fuga nihil ipsa tempora veniam nam aperiam laudantium.- Aliquid dolore labore qui vitae quasi saepe architecto fugiat.- Exercitationem iure impedit possimus cumque dolor suscipit. Ipsum- harum animi doloribus fuga quisquam iusto exercitationem alias.- Quia iusto suscipit numquam debitis.+ description: Sapiente numquam recusandae quaerat harum ipsum laborum+ ducimus ipsa. Vero expedita accusamus repudiandae inventore iste+ doloremque. Cupiditate temporibus exercitationem iusto voluptatibus+ nemo est quidem veniam. Tempora repellendus modi autem sequi ab+ cupiditate iste accusamus. Consequuntur quam numquam quasi voluptatibus+ quaerat reiciendis. Quisquam modi animi expedita tempora earum+ facilis placeat ut. Voluptate harum atque dolor minus. Explicabo+ rem blanditiis architecto quo rerum. Excepturi corporis velit+ consequatur accusamus voluptate reprehenderit.description_html: |-- Voluptas atque quibusdam tempora aperiam rem magni corrupti in. Et numquam dolore repellendus qui. Dolores minima blanditiis ut eius enim. Quidem itaque neque reprehenderit nulla doloribus. Saepe fugiat laboriosam atque et sit ut autem aut.- Ipsum amet blanditiis quidem soluta. Laboriosam enim suscipit maiores doloremque tempora possimus ipsum. Libero quas debitis cupiditate quasi. Omnis dolorum libero alias expedita a eius eligendi illo. Placeat culpa saepe dolores repellat aut cupiditate ad.- Ratione quod impedit aperiam odio. At necessitatibus porro doloribus totam explicabo quo vel provident. Cum quia iusto consectetur sint quis. Earum fugiat ab recusandae quaerat pariatur totam. Laboriosam fuga nihil ipsa tempora veniam nam aperiam laudantium.- Aliquid dolore labore qui vitae quasi saepe architecto fugiat. Exercitationem iure impedit possimus cumque dolor suscipit. Ipsum harum animi doloribus fuga quisquam iusto exercitationem alias. Quia iusto suscipit numquam debitis.+ Sapiente numquam recusandae quaerat harum ipsum laborum ducimus ipsa. Vero expedita accusamus repudiandae inventore iste doloremque. Cupiditate temporibus exercitationem iusto voluptatibus nemo est quidem veniam. Tempora repellendus modi autem sequi ab cupiditate iste accusamus. Consequuntur quam numquam quasi voluptatibus quaerat reiciendis.+ Quisquam modi animi expedita tempora earum facilis placeat ut. Voluptate harum atque dolor minus. Explicabo rem blanditiis architecto quo rerum. Excepturi corporis velit consequatur accusamus voluptate reprehenderit.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -15363,14 +15370,15 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-09T09:09:54.109Z'- updated_at: '2026-08-09T09:09:54.109Z'+ created_at: '2026-08-10T11:27:53.638Z'+ updated_at: '2026-08-10T11:27:53.638Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-09T09:09:54.092Z'- updated_at: '2026-08-09T09:09:54.122Z'+ created_at: '2026-08-10T11:27:53.628Z'+ updated_at: '2026-08-10T11:27:53.643Z'+ delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJmeta:@@ -15433,7 +15441,9 @@ paths:const product = await client.products.create({name: 'Premium T-Shirt',- description: 'Soft, organic cotton.',+ // Rich text: send HTML. Reads return this as plain text, plus+ // `description_html` with the markup.+ description: '<p>Soft, organic cotton.</p>',status: 'active',variants: [{@@ -15461,8 +15471,8 @@ paths:})- lang: bashlabel: Spree CLI- source: spree api post /products -d '{"name":"Premium T-Shirt","description":"Soft,- organic cotton.","status":"active","variants":[{"sku":"TSHIRT-S-NAVY","options":[{"name":"size","value":"Small"},{"name":"color","value":"navy"}],"prices":[{"currency":"USD","amount":"29.99"},{"currency":"EUR","amount":"27.99"}],"stock_items":[{"stock_location_id":"sloc_UkLWZg9DAJ","count_on_hand":50}]},{"sku":"TSHIRT-M-NAVY","options":[{"name":"size","value":"Medium"},{"name":"color","value":"navy"}],"prices":[{"currency":"USD","amount":"29.99"}],"stock_items":[{"stock_location_id":"sloc_UkLWZg9DAJ","count_on_hand":30}]}]}'+ source: spree api post /products -d '{"name":"Premium T-Shirt","description":"<p>Soft,+ organic cotton.</p>","status":"active","variants":[{"sku":"TSHIRT-S-NAVY","options":[{"name":"size","value":"Small"},{"name":"color","value":"navy"}],"prices":[{"currency":"USD","amount":"29.99"},{"currency":"EUR","amount":"27.99"}],"stock_items":[{"stock_location_id":"sloc_UkLWZg9DAJ","count_on_hand":50}]},{"sku":"TSHIRT-M-NAVY","options":[{"name":"size","value":"Medium"},{"name":"color","value":"navy"}],"prices":[{"currency":"USD","amount":"29.99"}],"stock_items":[{"stock_location_id":"sloc_UkLWZg9DAJ","count_on_hand":30}]}]}'parameters:- name: x-spree-api-keyin: header@@ -15505,8 +15515,9 @@ paths:status: draftmetadata: {}deleted_at:- created_at: '2026-08-09T09:09:54.265Z'- updated_at: '2026-08-09T09:09:54.270Z'+ created_at: '2026-08-10T11:27:53.776Z'+ updated_at: '2026-08-10T11:27:53.780Z'+ delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id:schema:@@ -15712,8 +15723,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 769662- slug: product-769662+ name: Product 766984+ slug: product-766984meta_title:meta_description:meta_keywords:@@ -15725,15 +15736,20 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Officia laudantium necessitatibus eius culpa. Iste id- unde laborum qui tempora a. Omnis quo corrupti voluptatibus tenetur- labore aliquam exercitationem. Nihil placeat excepturi dolore atque- itaque aperiam. Labore dolore assumenda ratione similique voluptates- blanditiis. Labore similique impedit facere sapiente iusto praesentium- atque. Dolor ipsam quos doloremque hic praesentium fuga in.+ description: Eaque recusandae porro nam vitae. Exercitationem neque+ itaque in ea doloribus excepturi. Esse ipsum repudiandae sequi quod+ sapiente repellendus id aliquid. Et molestiae odit repellendus libero+ eos corporis dolorum officia. Ullam consequatur aspernatur dolor+ soluta architecto expedita ad error. Expedita vel a incidunt enim+ optio. Nisi quos aspernatur maxime aut ipsa recusandae minus. Eveniet+ omnis nisi deleniti minima consequuntur. Totam nesciunt neque voluptates+ et iste numquam. Quasi soluta beatae quibusdam ad sunt. Sed sunt+ ab suscipit aperiam eos labore. Magni praesentium tempora est officia+ optio excepturi vel doloribus.description_html: |-- Officia laudantium necessitatibus eius culpa. Iste id unde laborum qui tempora a. Omnis quo corrupti voluptatibus tenetur labore aliquam exercitationem.- Nihil placeat excepturi dolore atque itaque aperiam. Labore dolore assumenda ratione similique voluptates blanditiis. Labore similique impedit facere sapiente iusto praesentium atque. Dolor ipsam quos doloremque hic praesentium fuga in.+ Eaque recusandae porro nam vitae. Exercitationem neque itaque in ea doloribus excepturi. Esse ipsum repudiandae sequi quod sapiente repellendus id aliquid. Et molestiae odit repellendus libero eos corporis dolorum officia. Ullam consequatur aspernatur dolor soluta architecto expedita ad error.+ Expedita vel a incidunt enim optio. Nisi quos aspernatur maxime aut ipsa recusandae minus. Eveniet omnis nisi deleniti minima consequuntur. Totam nesciunt neque voluptates et iste numquam.+ Quasi soluta beatae quibusdam ad sunt. Sed sunt ab suscipit aperiam eos labore. Magni praesentium tempora est officia optio excepturi vel doloribus.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -15748,14 +15764,15 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-09T09:09:54.662Z'- updated_at: '2026-08-09T09:09:54.662Z'+ created_at: '2026-08-10T11:27:53.894Z'+ updated_at: '2026-08-10T11:27:53.894Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-09T09:09:54.648Z'- updated_at: '2026-08-09T09:09:54.669Z'+ created_at: '2026-08-10T11:27:53.882Z'+ updated_at: '2026-08-10T11:27:53.901Z'+ delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJschema:@@ -15826,7 +15843,7 @@ paths:example:id: prod_UkLWZg9DAJname: Updated Name- slug: product-783355+ slug: product-785714meta_title:meta_description:meta_keywords:@@ -15838,25 +15855,21 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Fugit fugiat cum in placeat deserunt accusamus laboriosam.- Ducimus sed maxime explicabo omnis sint odio. Possimus tenetur iusto- aliquid a commodi quaerat fugiat. Voluptatem magnam commodi molestias- atque dignissimos aperiam fugiat occaecati. A voluptatum officiis- eaque doloribus. Id dolor laudantium numquam veritatis incidunt- quam recusandae at. Occaecati animi perferendis harum eligendi ab- veniam voluptatem incidunt. Mollitia maiores tenetur quisquam occaecati- molestias deleniti. Pariatur dolores sed incidunt optio. Non laboriosam- velit accusantium voluptas rem excepturi laborum. Reiciendis harum- minus ipsam magnam consequatur debitis. Voluptas rerum quae libero- dolorem illo. Magni deserunt voluptas numquam corporis exercitationem- consequuntur. Nemo fugit adipisci voluptate impedit magni dignissimos- delectus temporibus. Voluptatem assumenda magni deleniti inventore- cum dolor omnis.+ description: Nihil rerum sit natus voluptate quam sint asperiores+ in. Perspiciatis animi deleniti cupiditate vel nulla saepe quas+ corporis. Cumque quasi aliquid ipsam voluptates dicta iusto. Nostrum+ ex deserunt cumque odit. Rem culpa explicabo deleniti eos. Libero+ quis neque ipsa laborum non. Debitis dolores atque voluptas facere+ ullam laudantium ex. Soluta veritatis earum quidem blanditiis dolorum+ eius. Assumenda ipsum deserunt atque incidunt eius molestias cum+ sed. Pariatur accusantium architecto maiores sequi. Autem rem nostrum+ blanditiis atque ipsum. Delectus omnis nesciunt reiciendis officia+ minus quisquam. Nemo placeat vitae ad voluptate ducimus voluptatibus+ earum.description_html: |-- Fugit fugiat cum in placeat deserunt accusamus laboriosam. Ducimus sed maxime explicabo omnis sint odio. Possimus tenetur iusto aliquid a commodi quaerat fugiat. Voluptatem magnam commodi molestias atque dignissimos aperiam fugiat occaecati.- A voluptatum officiis eaque doloribus. Id dolor laudantium numquam veritatis incidunt quam recusandae at. Occaecati animi perferendis harum eligendi ab veniam voluptatem incidunt.- Mollitia maiores tenetur quisquam occaecati molestias deleniti. Pariatur dolores sed incidunt optio. Non laboriosam velit accusantium voluptas rem excepturi laborum. Reiciendis harum minus ipsam magnam consequatur debitis.- Voluptas rerum quae libero dolorem illo. Magni deserunt voluptas numquam corporis exercitationem consequuntur. Nemo fugit adipisci voluptate impedit magni dignissimos delectus temporibus. Voluptatem assumenda magni deleniti inventore cum dolor omnis.+ Nihil rerum sit natus voluptate quam sint asperiores in. Perspiciatis animi deleniti cupiditate vel nulla saepe quas corporis. Cumque quasi aliquid ipsam voluptates dicta iusto. Nostrum ex deserunt cumque odit. Rem culpa explicabo deleniti eos.+ Libero quis neque ipsa laborum non. Debitis dolores atque voluptas facere ullam laudantium ex. Soluta veritatis earum quidem blanditiis dolorum eius.+ Assumenda ipsum deserunt atque incidunt eius molestias cum sed. Pariatur accusantium architecto maiores sequi. Autem rem nostrum blanditiis atque ipsum. Delectus omnis nesciunt reiciendis officia minus quisquam. Nemo placeat vitae ad voluptate ducimus voluptatibus earum.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -15871,14 +15884,15 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-09T09:09:54.783Z'- updated_at: '2026-08-09T09:09:54.783Z'+ created_at: '2026-08-10T11:27:54.020Z'+ updated_at: '2026-08-10T11:27:54.020Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-09T09:09:54.773Z'- updated_at: '2026-08-09T09:09:54.808Z'+ created_at: '2026-08-10T11:27:54.010Z'+ updated_at: '2026-08-10T11:27:54.047Z'+ delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJschema:@@ -16809,15 +16823,15 @@ paths:- id: coupon_UkLWZg9DAJcode: AAA111state: unused- created_at: '2026-08-09T09:09:43.599Z'- updated_at: '2026-08-09T09:09:43.599Z'+ created_at: '2026-08-10T11:27:43.298Z'+ updated_at: '2026-08-10T11:27:43.298Z'promotion_id: promo_UkLWZg9DAJorder_id:- id: coupon_gbHJdmfrXBcode: BBB222state: unused- created_at: '2026-08-09T09:09:43.600Z'- updated_at: '2026-08-09T09:09:43.600Z'+ created_at: '2026-08-10T11:27:43.299Z'+ updated_at: '2026-08-10T11:27:43.299Z'promotion_id: promo_UkLWZg9DAJorder_id:meta:@@ -16879,8 +16893,8 @@ paths:example:data:- id: pact_UkLWZg9DAJ- created_at: '2026-08-09T09:09:55.737Z'- updated_at: '2026-08-09T09:09:55.737Z'+ created_at: '2026-08-10T11:27:54.958Z'+ updated_at: '2026-08-10T11:27:54.958Z'type: free_shippingpromotion_id: promo_UkLWZg9DAJpreferences: {}@@ -16944,8 +16958,8 @@ paths:application/json:example:id: pact_UkLWZg9DAJ- created_at: '2026-08-09T09:09:55.777Z'- updated_at: '2026-08-09T09:09:55.777Z'+ created_at: '2026-08-10T11:27:54.996Z'+ updated_at: '2026-08-10T11:27:54.996Z'type: free_shippingpromotion_id: promo_UkLWZg9DAJpreferences: {}@@ -17073,8 +17087,8 @@ paths:example:data:- id: prorule_UkLWZg9DAJ- created_at: '2026-08-09T09:09:55.828Z'- updated_at: '2026-08-09T09:09:55.828Z'+ created_at: '2026-08-10T11:27:55.063Z'+ updated_at: '2026-08-10T11:27:55.063Z'type: currencypromotion_id: promo_UkLWZg9DAJpreferences:@@ -17144,8 +17158,8 @@ paths:application/json:example:id: prorule_UkLWZg9DAJ- created_at: '2026-08-09T09:09:55.865Z'- updated_at: '2026-08-09T09:09:55.865Z'+ created_at: '2026-08-10T11:27:55.139Z'+ updated_at: '2026-08-10T11:27:55.139Z'type: currencypromotion_id: promo_UkLWZg9DAJpreferences:@@ -17236,8 +17250,8 @@ paths:application/json:example:id: prorule_UkLWZg9DAJ- created_at: '2026-08-09T09:09:55.888Z'- updated_at: '2026-08-09T09:09:55.905Z'+ created_at: '2026-08-10T11:27:55.196Z'+ updated_at: '2026-08-10T11:27:55.234Z'type: currencypromotion_id: promo_UkLWZg9DAJpreferences:@@ -17345,7 +17359,7 @@ paths:name: Summer Saledescription:code: summer- starts_at: '2026-08-09T09:09:55.935Z'+ starts_at: '2026-08-10T11:27:55.276Z'expires_at:usage_limit:match_policy: all@@ -17356,8 +17370,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-09T09:09:55.935Z'- updated_at: '2026-08-09T09:09:55.935Z'+ created_at: '2026-08-10T11:27:55.276Z'+ updated_at: '2026-08-10T11:27:55.276Z'action_ids: []rule_ids: []meta:@@ -17464,7 +17478,7 @@ paths:name: Black Fridaydescription:code: blackfriday-os- starts_at: '2026-08-09T09:09:56.042Z'+ starts_at: '2026-08-10T11:27:55.386Z'expires_at:usage_limit:match_policy: all@@ -17475,8 +17489,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-09T09:09:56.042Z'- updated_at: '2026-08-09T09:09:56.061Z'+ created_at: '2026-08-10T11:27:55.386Z'+ updated_at: '2026-08-10T11:27:55.404Z'action_ids:- pact_UkLWZg9DAJ- pact_gbHJdmfrXB@@ -17642,7 +17656,7 @@ paths:name: Summer Saledescription:code: summer- starts_at: '2026-08-09T09:09:56.092Z'+ starts_at: '2026-08-10T11:27:55.434Z'expires_at:usage_limit:match_policy: all@@ -17653,8 +17667,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-09T09:09:56.092Z'- updated_at: '2026-08-09T09:09:56.092Z'+ created_at: '2026-08-10T11:27:55.434Z'+ updated_at: '2026-08-10T11:27:55.434Z'action_ids: []rule_ids: []patch:@@ -17751,7 +17765,7 @@ paths:name: Summer Saledescription:code: summer- starts_at: '2026-08-09T09:09:56.175Z'+ starts_at: '2026-08-10T11:27:55.517Z'expires_at:usage_limit:match_policy: all@@ -17762,8 +17776,8 @@ paths:code_prefix:promotion_category_id:metadata: {}- created_at: '2026-08-09T09:09:56.176Z'- updated_at: '2026-08-09T09:09:56.200Z'+ created_at: '2026-08-10T11:27:55.517Z'+ updated_at: '2026-08-10T11:27:55.535Z'action_ids: []rule_ids: []requestBody:@@ -18025,15 +18039,15 @@ paths:label: Countrydescription:preference_schema:- - key: country_isos- type: array- default: []- key: country_idtype: integerdefault:- key: country_isotype: stringdefault:+ - key: country_isos+ type: array+ default: []- type: currencylabel: Currencydescription:@@ -18235,15 +18249,15 @@ paths:application/json:example:id: re_UkLWZg9DAJ- transaction_id: BGS-e847d80abf8a+ transaction_id: BGS-82b0c9d35420amount: '5.0'payment_id: py_UkLWZg9DAJrefund_reason_id: rr_UkLWZg9DAJoriginator_id:originator_type:metadata: {}- created_at: '2026-08-09T09:09:50.623Z'- updated_at: '2026-08-09T09:09:50.623Z'+ created_at: '2026-08-10T11:27:50.254Z'+ updated_at: '2026-08-10T11:27:50.254Z'requestBody:content:application/json:@@ -18387,8 +18401,8 @@ paths:data:- id: sccat_UkLWZg9DAJname: Goodwill- created_at: '2026-08-09T09:09:56.643Z'- updated_at: '2026-08-09T09:09:56.643Z'+ created_at: '2026-08-10T11:27:55.955Z'+ updated_at: '2026-08-10T11:27:55.955Z'non_expiring: falsemeta:page: 1@@ -18482,8 +18496,8 @@ paths:example:id: sccat_UkLWZg9DAJname: Goodwill- created_at: '2026-08-09T09:09:56.676Z'- updated_at: '2026-08-09T09:09:56.676Z'+ created_at: '2026-08-10T11:27:55.988Z'+ updated_at: '2026-08-10T11:27:55.988Z'non_expiring: falseschema:"$ref": "#/components/schemas/StoreCreditCategory"@@ -18564,8 +18578,8 @@ paths:preferred_storefront_access: publicpreferred_guest_checkout: truepreferred_order_routing_strategy: Spree::OrderRouting::Strategy::Rules- created_at: '2026-08-09T09:09:41.407Z'- updated_at: '2026-08-09T09:09:56.745Z'+ created_at: '2026-08-10T11:27:41.113Z'+ updated_at: '2026-08-10T11:27:56.043Z'url: http://www.example.com:3000api_url: http://www.example.com:3000setup_tasks:@@ -18866,8 +18880,8 @@ paths:preferred_storefront_access: publicpreferred_guest_checkout: truepreferred_order_routing_strategy: Spree::OrderRouting::Strategy::Rules- created_at: '2026-08-09T09:09:41.407Z'- updated_at: '2026-08-09T09:09:56.830Z'+ created_at: '2026-08-10T11:27:41.113Z'+ updated_at: '2026-08-10T11:27:56.133Z'url: http://www.example.com:3000api_url: http://www.example.com:3000setup_tasks:@@ -19256,7 +19270,7 @@ paths:- key: nametype: string- key: description- type: string+ type: html- key: permalinktype: stringreadable: false@@ -19440,13 +19454,13 @@ paths:example:data:- id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Clare- last_name: Johnston- full_name: Clare Johnston+ email: [email protected]+ first_name: Natalie+ last_name: Bechtelar+ full_name: Natalie Bechtelarselected_locale:- created_at: '2026-08-09T09:09:41.568Z'- updated_at: '2026-08-09T09:09:41.568Z'+ created_at: '2026-08-10T11:27:41.215Z'+ updated_at: '2026-08-10T11:27:41.215Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -19512,13 +19526,13 @@ paths:application/json:example:id: adm_UkLWZg9DAJ- email: [email protected]- first_name: Ambrose- last_name: Dooley- full_name: Ambrose Dooley+ email: [email protected]+ first_name: Jeremiah+ last_name: Greenfelder+ full_name: Jeremiah Greenfelderselected_locale:- created_at: '2026-08-09T09:09:41.649Z'- updated_at: '2026-08-09T09:09:41.649Z'+ created_at: '2026-08-10T11:27:41.330Z'+ updated_at: '2026-08-10T11:27:41.330Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -19579,13 +19593,13 @@ paths:application/json:example:id: adm_UkLWZg9DAJ- email: [email protected]+ email: [email protected]first_name: Renamed- last_name: Wyman- full_name: Renamed Wyman+ last_name: Douglas+ full_name: Renamed Douglasselected_locale:- created_at: '2026-08-09T09:09:41.669Z'- updated_at: '2026-08-09T09:09:41.683Z'+ created_at: '2026-08-10T11:27:41.356Z'+ updated_at: '2026-08-10T11:27:41.371Z'avatar_url:roles:- id: role_UkLWZg9DAJ@@ -19701,15 +19715,15 @@ paths:example:data:- id: inv_UkLWZg9DAJ- email: [email protected]+ email: [email protected]status: pending- created_at: '2026-08-09T09:09:45.994Z'- updated_at: '2026-08-09T09:09:45.994Z'- expires_at: '2026-08-23T09:09:45.992Z'+ created_at: '2026-08-10T11:27:45.856Z'+ updated_at: '2026-08-10T11:27:45.856Z'+ expires_at: '2026-08-24T11:27:45.853Z'role_id: role_UkLWZg9DAJrole_name: admin- inviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=vnpiQHWVB8EVwnZTm1L3FUh1"+ inviter_email: [email protected]+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=gyUtD5PjgMox4QJbzgihfuQD"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -19773,13 +19787,13 @@ paths:id: inv_gbHJdmfrXBemail: [email protected]status: pending- created_at: '2026-08-09T09:09:46.069Z'- updated_at: '2026-08-09T09:09:46.069Z'- expires_at: '2026-08-23T09:09:46.064Z'+ created_at: '2026-08-10T11:27:45.896Z'+ updated_at: '2026-08-10T11:27:45.896Z'+ expires_at: '2026-08-24T11:27:45.894Z'role_id: role_UkLWZg9DAJrole_name: admin- inviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_gbHJdmfrXB?token=gEi1NRV9MpVo1FQuoh1LDWct"+ inviter_email: [email protected]+ acceptance_url: "/accept-invitation/inv_gbHJdmfrXB?token=kvAceSun2K6zaQbQeo7onqBy"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -19892,15 +19906,15 @@ paths:application/json:example:id: inv_UkLWZg9DAJ- email: [email protected]+ email: [email protected]status: pending- created_at: '2026-08-09T09:09:46.133Z'- updated_at: '2026-08-09T09:09:46.133Z'- expires_at: '2026-08-23T09:09:46.129Z'+ created_at: '2026-08-10T11:27:45.935Z'+ updated_at: '2026-08-10T11:27:45.935Z'+ expires_at: '2026-08-24T11:27:45.933Z'role_id: role_UkLWZg9DAJrole_name: admin- inviter_email: [email protected]- acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=U5kkoLcc95AEHhaStNtFQPCE"+ inviter_email: [email protected]+ acceptance_url: "/accept-invitation/inv_UkLWZg9DAJ?token=APVfGMP8z83ydZKuJ6Rrpv9k"invitee_exists: falsestore:id: store_UkLWZg9DAJ@@ -20245,8 +20259,8 @@ paths:- id: role_UkLWZg9DAJname: admindescription:- created_at: '2026-08-09T09:09:56.303Z'- updated_at: '2026-08-09T09:09:56.303Z'+ created_at: '2026-08-10T11:27:55.614Z'+ updated_at: '2026-08-10T11:27:55.614Z'permissions:- read_orders- write_orders@@ -20346,8 +20360,8 @@ paths:id: role_gbHJdmfrXBname: order_managerdescription: Handles daily orders- created_at: '2026-08-09T09:09:56.340Z'- updated_at: '2026-08-09T09:09:56.340Z'+ created_at: '2026-08-10T11:27:55.646Z'+ updated_at: '2026-08-10T11:27:55.646Z'permissions:- write_orders- read_customers@@ -20441,8 +20455,8 @@ paths:id: role_gbHJdmfrXBname: supportdescription:- created_at: '2026-08-09T09:09:56.365Z'- updated_at: '2026-08-09T09:09:56.380Z'+ created_at: '2026-08-10T11:27:55.669Z'+ updated_at: '2026-08-10T11:27:55.685Z'permissions:- read_orders- read_customers@@ -20616,14 +20630,16 @@ paths:example:data:- id: sloc_UkLWZg9DAJ- state_abbr: STATE_ABBR_56+ state_abbr: STATE_ABBR_58name: Brooklyn warehouseaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of America- state_text: STATE_ABBR_56+ state_text: STATE_ABBR_58+ pickup_ready_in_minutes:+ pickup_instructions:admin_name:address2:state_name:@@ -20636,10 +20652,8 @@ paths:kind: warehousepickup_enabled: falsepickup_stock_policy: local- pickup_ready_in_minutes:- pickup_instructions:- created_at: '2026-08-09T09:09:56.425Z'- updated_at: '2026-08-09T09:09:56.425Z'+ created_at: '2026-08-10T11:27:55.730Z'+ updated_at: '2026-08-10T11:27:55.730Z'meta:page: 1limit: 25@@ -20739,6 +20753,8 @@ paths:country_iso:country_name:state_text:+ pickup_ready_in_minutes: 30+ pickup_instructions:admin_name:address2:state_name:@@ -20751,10 +20767,8 @@ paths:kind: storepickup_enabled: truepickup_stock_policy: local- pickup_ready_in_minutes: 30- pickup_instructions:- created_at: '2026-08-09T09:09:56.484Z'- updated_at: '2026-08-09T09:09:56.484Z'+ created_at: '2026-08-10T11:27:55.800Z'+ updated_at: '2026-08-10T11:27:55.800Z'schema:"$ref": "#/components/schemas/StockLocation"'422':@@ -20909,14 +20923,16 @@ paths:application/json:example:id: sloc_UkLWZg9DAJ- state_abbr: STATE_ABBR_60+ state_abbr: STATE_ABBR_62name: Brooklyn warehouseaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of America- state_text: STATE_ABBR_60+ state_text: STATE_ABBR_62+ pickup_ready_in_minutes:+ pickup_instructions:admin_name:address2:state_name:@@ -20929,10 +20945,8 @@ paths:kind: warehousepickup_enabled: falsepickup_stock_policy: local- pickup_ready_in_minutes:- pickup_instructions:- created_at: '2026-08-09T09:09:56.521Z'- updated_at: '2026-08-09T09:09:56.521Z'+ created_at: '2026-08-10T11:27:55.834Z'+ updated_at: '2026-08-10T11:27:55.834Z'schema:"$ref": "#/components/schemas/StockLocation"'404':@@ -20999,14 +21013,16 @@ paths:application/json:example:id: sloc_UkLWZg9DAJ- state_abbr: STATE_ABBR_62+ state_abbr: STATE_ABBR_64name: Renamed warehouseaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of America- state_text: STATE_ABBR_62+ state_text: STATE_ABBR_64+ pickup_ready_in_minutes: 45+ pickup_instructions:admin_name:address2:state_name:@@ -21019,10 +21035,8 @@ paths:kind: warehousepickup_enabled: truepickup_stock_policy: local- pickup_ready_in_minutes: 45- pickup_instructions:- created_at: '2026-08-09T09:09:56.571Z'- updated_at: '2026-08-09T09:09:56.587Z'+ created_at: '2026-08-10T11:27:55.881Z'+ updated_at: '2026-08-10T11:27:55.898Z'schema:"$ref": "#/components/schemas/StockLocation"'422':@@ -21265,14 +21279,14 @@ paths:dimensions_unit:backorder_limit:deleted_at:- created_at: '2026-08-09T09:09:57.021Z'- updated_at: '2026-08-09T09:09:57.033Z'+ created_at: '2026-08-10T11:27:56.324Z'+ updated_at: '2026-08-10T11:27:56.334Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 968094+ product_name: Product 962527- id: variant_gbHJdmfrXBproduct_id: prod_UkLWZg9DAJsku: SKU-116@@ -21285,10 +21299,10 @@ paths:in_stock: falsebackorderable: truepreorder: false- weight: 125.78- height: 105.57- width: 18.45- depth: 37.79+ weight: 174.18+ height: 37.66+ width: 156.56+ depth: 135.8price:id: price_gbHJdmfrXBamount: '19.99'@@ -21311,8 +21325,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:57.047Z'- updated_at: '2026-08-09T09:09:57.047Z'+ created_at: '2026-08-10T11:27:56.345Z'+ updated_at: '2026-08-10T11:27:56.345Z'metadata: {}position: 2cost_price: '17.0'@@ -21322,14 +21336,14 @@ paths:dimensions_unit:backorder_limit:deleted_at:- created_at: '2026-08-09T09:09:57.045Z'- updated_at: '2026-08-09T09:09:57.053Z'+ created_at: '2026-08-10T11:27:56.343Z'+ updated_at: '2026-08-10T11:27:56.351Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 968094+ product_name: Product 962527meta:page: 1limit: 25@@ -21443,8 +21457,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:57.159Z'- updated_at: '2026-08-09T09:09:57.159Z'+ created_at: '2026-08-10T11:27:56.455Z'+ updated_at: '2026-08-10T11:27:56.455Z'metadata: {}position: 3cost_price:@@ -21454,14 +21468,14 @@ paths:dimensions_unit:backorder_limit:deleted_at:- created_at: '2026-08-09T09:09:57.163Z'- updated_at: '2026-08-09T09:09:57.164Z'+ created_at: '2026-08-10T11:27:56.458Z'+ updated_at: '2026-08-10T11:27:56.460Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 971931+ product_name: Product 97604'422':description: validation errorcontent:@@ -21648,10 +21662,10 @@ paths:in_stock: falsebackorderable: truepreorder: false- weight: 31.24- height: 118.63- width: 44.5- depth: 65.72+ weight: 29.2+ height: 116.81+ width: 165.15+ depth: 190.66price:id: price_gbHJdmfrXBamount: '19.99'@@ -21674,8 +21688,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:57.323Z'- updated_at: '2026-08-09T09:09:57.323Z'+ created_at: '2026-08-10T11:27:56.606Z'+ updated_at: '2026-08-10T11:27:56.606Z'metadata: {}position: 2cost_price: '17.0'@@ -21685,14 +21699,14 @@ paths:dimensions_unit:backorder_limit:deleted_at:- created_at: '2026-08-09T09:09:57.321Z'- updated_at: '2026-08-09T09:09:57.330Z'+ created_at: '2026-08-10T11:27:56.604Z'+ updated_at: '2026-08-10T11:27:56.612Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 992490+ product_name: Product 993664'404':description: variant not foundcontent:@@ -21776,10 +21790,10 @@ paths:in_stock: falsebackorderable: truepreorder: false- weight: 167.93- height: 128.82- width: 13.74- depth: 68.8+ weight: 143.39+ height: 73.48+ width: 121.81+ depth: 66.12price:id: price_gbHJdmfrXBamount: '19.99'@@ -21802,8 +21816,8 @@ paths:option_type_label: Sizeimage_url:metadata: {}- created_at: '2026-08-09T09:09:57.473Z'- updated_at: '2026-08-09T09:09:57.473Z'+ created_at: '2026-08-10T11:27:56.757Z'+ updated_at: '2026-08-10T11:27:56.757Z'metadata: {}position: 2cost_price: '17.0'@@ -21813,14 +21827,14 @@ paths:dimensions_unit:backorder_limit:deleted_at:- created_at: '2026-08-09T09:09:57.470Z'- updated_at: '2026-08-09T09:09:57.498Z'+ created_at: '2026-08-10T11:27:56.755Z'+ updated_at: '2026-08-10T11:27:56.782Z'preorderable: falsetax_category_id: taxcat_UkLWZg9DAJavailable_stock: 0reserved_quantity: 0total_on_hand: 0- product_name: Product 1012243+ product_name: Product 1017870requestBody:content:application/json:@@ -22065,9 +22079,9 @@ paths:request_errors:response_body:success: false- created_at: '2026-08-09T09:09:57.652Z'- updated_at: '2026-08-09T09:09:57.652Z'- delivered_at: '2026-08-09T09:09:57.652Z'+ created_at: '2026-08-10T11:27:56.899Z'+ updated_at: '2026-08-10T11:27:56.899Z'+ delivered_at: '2026-08-10T11:27:56.899Z'payload:event: order.createddata:@@ -22083,9 +22097,9 @@ paths:request_errors:response_body:success: true- created_at: '2026-08-09T09:09:57.651Z'- updated_at: '2026-08-09T09:09:57.651Z'- delivered_at: '2026-08-09T09:09:57.651Z'+ created_at: '2026-08-10T11:27:56.898Z'+ updated_at: '2026-08-10T11:27:56.898Z'+ delivered_at: '2026-08-10T11:27:56.898Z'payload:event: order.createddata:@@ -22188,9 +22202,9 @@ paths:request_errors:response_body:success: false- created_at: '2026-08-09T09:09:57.734Z'- updated_at: '2026-08-09T09:09:57.734Z'- delivered_at: '2026-08-09T09:09:57.734Z'+ created_at: '2026-08-10T11:27:56.961Z'+ updated_at: '2026-08-10T11:27:56.961Z'+ delivered_at: '2026-08-10T11:27:56.961Z'payload:event: order.createddata:@@ -22279,8 +22293,8 @@ paths:request_errors:response_body:success:- created_at: '2026-08-09T09:09:57.850Z'- updated_at: '2026-08-09T09:09:57.850Z'+ created_at: '2026-08-10T11:27:57.034Z'+ updated_at: '2026-08-10T11:27:57.034Z'delivered_at:payload:event: order.created@@ -22383,8 +22397,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-09T09:09:57.895Z'- updated_at: '2026-08-09T09:09:57.895Z'+ created_at: '2026-08-10T11:27:57.048Z'+ updated_at: '2026-08-10T11:27:57.048Z'disabled_at:secret_key:last_delivery_at:@@ -22479,10 +22493,10 @@ paths:subscriptions:- order.placeddisabled_reason:- created_at: '2026-08-09T09:09:58.019Z'- updated_at: '2026-08-09T09:09:58.019Z'+ created_at: '2026-08-10T11:27:57.110Z'+ updated_at: '2026-08-10T11:27:57.110Z'disabled_at:- secret_key: f6d6549496d4015a62d691d8a5517fed359fafe4b800b33a91c1e6046e9b6f48+ secret_key: 54921d8fd2353db1c5b06cdf8388b95393a901166bea0ec47f3a2469db639830last_delivery_at:recent_delivery_count: 0recent_failure_count: 0@@ -22605,8 +22619,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-09T09:09:58.168Z'- updated_at: '2026-08-09T09:09:58.168Z'+ created_at: '2026-08-10T11:27:57.150Z'+ updated_at: '2026-08-10T11:27:57.150Z'disabled_at:secret_key:last_delivery_at:@@ -22685,8 +22699,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-09T09:09:58.257Z'- updated_at: '2026-08-09T09:09:58.273Z'+ created_at: '2026-08-10T11:27:57.287Z'+ updated_at: '2026-08-10T11:27:57.305Z'disabled_at:secret_key:last_delivery_at:@@ -22843,13 +22857,13 @@ paths:request_errors:response_body:success:- created_at: '2026-08-09T09:09:58.419Z'- updated_at: '2026-08-09T09:09:58.419Z'+ created_at: '2026-08-10T11:27:57.391Z'+ updated_at: '2026-08-10T11:27:57.391Z'delivered_at:payload:- id: be2c0457-76ce-47ce-8a7c-be34c8e55f89+ id: c064dd52-0f48-432e-8224-de5553f80660name: webhook.test- created_at: '2026-08-09T09:09:58Z'+ created_at: '2026-08-10T11:27:57Z'data:message: This is a test webhook from Spree.metadata:@@ -22918,8 +22932,8 @@ paths:- order.completed- product.createddisabled_reason:- created_at: '2026-08-09T09:09:58.447Z'- updated_at: '2026-08-09T09:09:58.465Z'+ created_at: '2026-08-10T11:27:57.406Z'+ updated_at: '2026-08-10T11:27:57.424Z'disabled_at:secret_key:last_delivery_at:@@ -22996,9 +23010,9 @@ paths:- order.completed- product.createddisabled_reason: Investigating- created_at: '2026-08-09T09:09:58.544Z'- updated_at: '2026-08-09T09:09:58.560Z'- disabled_at: '2026-08-09T09:09:58.560Z'+ created_at: '2026-08-10T11:27:57.437Z'+ updated_at: '2026-08-10T11:27:57.457Z'+ disabled_at: '2026-08-10T11:27:57.457Z'secret_key:last_delivery_at:recent_delivery_count: 0@@ -23081,8 +23095,8 @@ paths:automatic: falserules_match_policy: allmetadata: {}- created_at: '2026-08-09T09:09:43.066Z'- updated_at: '2026-08-09T09:09:43.066Z'+ created_at: '2026-08-10T11:27:42.846Z'+ updated_at: '2026-08-10T11:27:42.846Z'meta:page: 1limit: 25@@ -23150,8 +23164,8 @@ paths:automatic: truerules_match_policy: anymetadata: {}- created_at: '2026-08-09T09:09:43.115Z'- updated_at: '2026-08-09T09:09:43.116Z'+ created_at: '2026-08-10T11:27:42.895Z'+ updated_at: '2026-08-10T11:27:42.896Z'schema:"$ref": "#/components/schemas/Collection"'422':@@ -23278,8 +23292,8 @@ paths:automatic: falserules_match_policy: allmetadata: {}- created_at: '2026-08-09T09:09:43.156Z'- updated_at: '2026-08-09T09:09:43.156Z'+ created_at: '2026-08-10T11:27:42.935Z'+ updated_at: '2026-08-10T11:27:42.935Z'schema:"$ref": "#/components/schemas/Collection"'404':@@ -23343,8 +23357,8 @@ paths:automatic: falserules_match_policy: allmetadata: {}- created_at: '2026-08-09T09:09:43.250Z'- updated_at: '2026-08-09T09:09:43.289Z'+ created_at: '2026-08-10T11:27:42.995Z'+ updated_at: '2026-08-10T11:27:43.014Z'schema:"$ref": "#/components/schemas/Collection"requestBody:@@ -23519,8 +23533,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 64612- slug: product-64612+ name: Product 61653+ slug: product-61653meta_title:meta_description:meta_keywords:@@ -23532,28 +23546,16 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Ipsam numquam modi ullam doloremque rerum odit dolores- odio. Odit fugit laborum accusantium voluptate. Corporis molestiae- nihil ut maiores sunt. Consectetur rem minus est cupiditate voluptates- dicta repudiandae mollitia. Quos laboriosam facilis ut nihil quibusdam.- Praesentium pariatur earum veniam accusamus. Fuga laborum repudiandae- vel at quis. Quos a nisi delectus atque minus ipsam ducimus. Iste- sed architecto ut explicabo. Veniam quo distinctio inventore culpa- ea. Minima dicta laudantium soluta culpa possimus ea quasi. Dolorum- eligendi amet corporis ratione molestias nemo eius. Autem tempora- assumenda deleniti consequatur quo. Eaque veniam perspiciatis animi- ipsam cumque minus. Quos officia dolorem corrupti placeat aspernatur.- Velit ipsa corrupti itaque inventore dolor facilis voluptatum. Sunt- libero voluptate ratione labore doloribus veniam. Aspernatur officiis- voluptatem quos sed facilis sunt quae. Nesciunt voluptatum cum dolorem- minima molestiae illo quibusdam. Et aliquid modi aperiam a non.- Qui voluptates quae ipsam repudiandae facilis id.+ description: Officiis facilis illo nobis cum rem nulla non. Maiores+ recusandae iusto possimus molestiae fugit magnam voluptatibus sed.+ Quod quia consectetur reiciendis vitae quam soluta aperiam provident.+ Cupiditate quis labore iusto officia recusandae nam similique minima.+ Saepe nesciunt totam harum eos sed repellat. Similique delectus+ ipsam consequatur enim consectetur vel. Beatae et aliquam quos delectus+ amet ducimus.description_html: |-- Ipsam numquam modi ullam doloremque rerum odit dolores odio. Odit fugit laborum accusantium voluptate. Corporis molestiae nihil ut maiores sunt. Consectetur rem minus est cupiditate voluptates dicta repudiandae mollitia. Quos laboriosam facilis ut nihil quibusdam.- Praesentium pariatur earum veniam accusamus. Fuga laborum repudiandae vel at quis. Quos a nisi delectus atque minus ipsam ducimus. Iste sed architecto ut explicabo.- Veniam quo distinctio inventore culpa ea. Minima dicta laudantium soluta culpa possimus ea quasi. Dolorum eligendi amet corporis ratione molestias nemo eius.- Autem tempora assumenda deleniti consequatur quo. Eaque veniam perspiciatis animi ipsam cumque minus. Quos officia dolorem corrupti placeat aspernatur. Velit ipsa corrupti itaque inventore dolor facilis voluptatum.- Sunt libero voluptate ratione labore doloribus veniam. Aspernatur officiis voluptatem quos sed facilis sunt quae. Nesciunt voluptatum cum dolorem minima molestiae illo quibusdam. Et aliquid modi aperiam a non. Qui voluptates quae ipsam repudiandae facilis id.+ Officiis facilis illo nobis cum rem nulla non. Maiores recusandae iusto possimus molestiae fugit magnam voluptatibus sed. Quod quia consectetur reiciendis vitae quam soluta aperiam provident. Cupiditate quis labore iusto officia recusandae nam similique minima.+ Saepe nesciunt totam harum eos sed repellat. Similique delectus ipsam consequatur enim consectetur vel. Beatae et aliquam quos delectus amet ducimus.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -23568,14 +23570,15 @@ paths:display_compare_at_amount:price_list_id:variant_id: variant_UkLWZg9DAJ- created_at: '2026-08-09T09:09:43.412Z'- updated_at: '2026-08-09T09:09:43.412Z'+ created_at: '2026-08-10T11:27:43.093Z'+ updated_at: '2026-08-10T11:27:43.093Z'original_price:status: activemetadata: {}deleted_at:- created_at: '2026-08-09T09:09:43.402Z'- updated_at: '2026-08-09T09:09:43.417Z'+ created_at: '2026-08-10T11:27:43.084Z'+ updated_at: '2026-08-10T11:27:43.098Z'+ delivery_profile_id: fp_UkLWZg9DAJproduct_type_id:tax_category_id: taxcat_UkLWZg9DAJschema:@@ -23723,6 +23726,385 @@ paths:label: Tagdescription: Products carrying a matching tagpreference_schema: []+ "/api/v3/admin/delivery_profiles":+ get:+ summary: List delivery profiles+ tags:+ - Delivery+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Fulfillment profiles group products with the stock locations, delivery zones and delivery methods that fulfill them. Every store has exactly one default profile.++ **Required scope:** `read_settings` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ const profiles = await client.deliveryProfiles.list()+ - lang: bash+ label: Spree CLI+ source: spree api get /delivery_profiles+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: delivery profiles found+ content:+ application/json:+ example:+ data:+ - id: fp_UkLWZg9DAJ+ name: General+ default: true+ position: 1+ created_at: '2026-08-10T11:27:41.186Z'+ updated_at: '2026-08-10T11:27:41.186Z'+ kind: shipping+ digital: false+ offers_pickup: false+ offers_shipping: false+ stock_location_ids: []+ origin_groups:+ - id: og_UkLWZg9DAJ+ name:+ position: 1+ stock_location_ids: []+ products_count: 0+ delivery_methods_count: 0+ delivery_zones_count: 0+ meta:+ page: 1+ limit: 25+ count: 1+ pages: 1+ from: 1+ to: 1+ in: 1+ previous:+ next:+ post:+ summary: Create a delivery profile+ tags:+ - Delivery+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Creates a delivery profile. `kind` selects the registered profile kind (shipping, digital, extension kinds); `stock_location_ids` limits fulfillment to those locations — empty means every store location.++ **Required scope:** `write_settings` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ const profile = await client.deliveryProfiles.create({+ name: 'Oversized',+ stock_location_ids: ['sloc_86Rf07xd4z'],+ })+ - lang: bash+ label: Spree CLI+ source: spree api post /delivery_profiles -d '{"name":"Oversized","stock_location_ids":["sloc_86Rf07xd4z"]}'+ 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: delivery profile created+ content:+ application/json:+ example:+ id: fp_gbHJdmfrXB+ name: Oversized 1786361264.479885+ default: false+ position: 2+ created_at: '2026-08-10T11:27:44.487Z'+ updated_at: '2026-08-10T11:27:44.487Z'+ kind: shipping+ digital: false+ offers_pickup: false+ offers_shipping: false+ stock_location_ids: []+ origin_groups:+ - id: og_gbHJdmfrXB+ name:+ position: 1+ stock_location_ids: []+ products_count: 0+ delivery_methods_count: 0+ delivery_zones_count: 0+ '422':+ description: validation error+ content:+ application/json:+ example:+ error:+ code: validation_error+ message: Name can't be blank+ details:+ name:+ - can't be blank+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ name:+ type: string+ example: Oversized+ kind:+ type: string+ example: shipping+ description: Registered profile kind; defaults to shipping.+ default:+ type: boolean+ stock_location_ids:+ type: array+ items:+ type: string+ description: Empty means every store location.+ required:+ - name+ "/api/v3/admin/delivery_profiles/{delivery_profile_id}/origin_groups":+ parameters:+ - name: delivery_profile_id+ in: path+ required: true+ schema:+ type: string+ post:+ summary: Create an origin group+ tags:+ - Delivery+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ Origin groups partition a profile's fulfillment origins: zones and methods belong to a group, so the same products can quote different rate tables per warehouse. `stock_location_ids` replaces the full membership; empty means every store location.++ **Required scope:** `write_settings` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ const originGroup = await client.deliveryProfiles.originGroups.create('fp_86Rf07xd4z', {+ name: 'EU warehouse',+ stock_location_ids: ['sloc_86Rf07xd4z'],+ })+ - lang: bash+ label: Spree CLI+ source: spree api post /delivery_profiles/{delivery_profile_id}/origin_groups+ -d '{"name":"EU warehouse","stock_location_ids":["sloc_86Rf07xd4z"]}'+ 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: origin group created+ content:+ application/json:+ example:+ id: og_EfhxLZ9ck8+ name: EU warehouse+ position: 2+ created_at: '2026-08-10T11:27:44.538Z'+ updated_at: '2026-08-10T11:27:44.538Z'+ delivery_profile_id: fp_gbHJdmfrXB+ stock_location_ids:+ - sloc_UkLWZg9DAJ+ delivery_zones_count: 0+ delivery_methods_count: 0+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ name:+ type: string+ nullable: true+ example: EU warehouse+ position:+ type: integer+ nullable: true+ stock_location_ids:+ type: array+ items:+ type: string+ description: Empty means every store location.+ "/api/v3/admin/delivery_profiles/{id}":+ parameters:+ - name: id+ in: path+ required: true+ schema:+ type: string+ patch:+ summary: Update a delivery profile+ tags:+ - Delivery+ security:+ - api_key: []+ bearer_auth: []+ description: "**Required scope:** `write_settings` (for API-key authentication)."+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ const profile = await client.deliveryProfiles.update('fp_86Rf07xd4z', {+ name: 'Oversized freight',+ stock_location_ids: [],+ })+ - lang: bash+ label: Spree CLI+ source: spree api patch /delivery_profiles/{id} -d '{"name":"Oversized freight","stock_location_ids":[]}'+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '200':+ description: delivery profile updated+ content:+ application/json:+ example:+ id: fp_gbHJdmfrXB+ name: Bulky 1786361264.54373+ default: false+ position: 2+ created_at: '2026-08-10T11:27:44.544Z'+ updated_at: '2026-08-10T11:27:44.544Z'+ kind: shipping+ digital: false+ offers_pickup: false+ offers_shipping: false+ stock_location_ids:+ - sloc_UkLWZg9DAJ+ origin_groups:+ - id: og_gbHJdmfrXB+ name:+ position: 1+ stock_location_ids:+ - sloc_UkLWZg9DAJ+ products_count: 0+ delivery_methods_count: 0+ delivery_zones_count: 0+ requestBody:+ content:+ application/json:+ schema:+ type: object+ properties:+ name:+ type: string+ default:+ type: boolean+ stock_location_ids:+ type: array+ items:+ type: string+ delete:+ summary: Delete a delivery profile+ tags:+ - Delivery+ security:+ - api_key: []+ bearer_auth: []+ description: |-+ The default profile and profiles still referenced by products cannot be deleted.++ **Required scope:** `write_settings` (for API-key authentication).+ x-codeSamples:+ - lang: javascript+ label: Spree Admin SDK+ source: |-+ import { createAdminClient } from '@spree/admin-sdk'++ const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+ })++ await client.deliveryProfiles.delete('fp_86Rf07xd4z')+ - lang: bash+ label: Spree CLI+ source: spree api delete /delivery_profiles/{id}+ parameters:+ - name: x-spree-api-key+ in: header+ required: true+ schema:+ type: string+ - name: Authorization+ in: header+ required: true+ schema:+ type: string+ responses:+ '204':+ description: delivery profile deleted"/api/v3/admin/delivery_methods":get:summary: List delivery methods@@ -23771,9 +24153,11 @@ paths:- id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falseadmin_name:fulfillment_provider: Spree::FulfillmentProvider::Manualpickup_point_provider:@@ -23782,15 +24166,19 @@ paths:tracking_url:markup_flat: '0.0'markup_percent: '0.0'- created_at: '2026-08-09T09:09:44.787Z'- updated_at: '2026-08-09T09:09:44.789Z'+ created_at: '2026-08-10T11:27:44.602Z'+ updated_at: '2026-08-10T11:27:44.603Z'deleted_at:services: []+ rules: []tax_category_id:- delivery_zone_ids: []+ delivery_profile_id: fp_UkLWZg9DAJ+ delivery_origin_group_id: og_UkLWZg9DAJ+ delivery_zone_id:stock_location_ids: []calculator_type: Spree::Calculator::Shipping::FlatRatecalculator_preferences:+ amounts: {}amount: '10.0'currency: USDmeta:@@ -23811,7 +24199,7 @@ paths:- api_key: []bearer_auth: []description: |-- Creates a delivery method. fulfillment_type is one of shipping, digital, pickup.+ Creates a delivery method inside a delivery profile (defaults to the store default profile). Delivery behavior comes from the fulfillment provider.**Required scope:** `write_settings` (for API-key authentication).x-codeSamples:@@ -23827,14 +24215,13 @@ paths:const deliveryMethod = await client.deliveryMethods.create({name: 'Express',- fulfillment_type: 'shipping',storefront_visible: true,calculator_type: 'Spree::Calculator::Shipping::FlatRate',calculator_preferences: { amount: 12.5 },})- lang: bashlabel: Spree CLI- source: spree api post /delivery_methods -d '{"name":"Express","fulfillment_type":"shipping","storefront_visible":true,"calculator_type":"Spree::Calculator::Shipping::FlatRate","calculator_preferences":{"amount":12.5}}'+ source: spree api post /delivery_methods -d '{"name":"Express","storefront_visible":true,"calculator_type":"Spree::Calculator::Shipping::FlatRate","calculator_preferences":{"amount":12.5}}'parameters:- name: x-spree-api-keyin: header@@ -23855,9 +24242,11 @@ paths:id: dm_UkLWZg9DAJname: Expresscode:- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falseadmin_name:fulfillment_provider: Spree::FulfillmentProvider::Manualpickup_point_provider:@@ -23866,15 +24255,19 @@ paths:tracking_url:markup_flat: '0.0'markup_percent: '0.0'- created_at: '2026-08-09T09:09:44.863Z'- updated_at: '2026-08-09T09:09:44.864Z'+ created_at: '2026-08-10T11:27:44.652Z'+ updated_at: '2026-08-10T11:27:44.653Z'deleted_at:services: []+ rules: []tax_category_id:- delivery_zone_ids: []+ delivery_profile_id: fp_UkLWZg9DAJ+ delivery_origin_group_id: og_UkLWZg9DAJ+ delivery_zone_id:stock_location_ids: []calculator_type: Spree::Calculator::Shipping::FlatRatecalculator_preferences:+ amounts: {}amount: '12.5'currency: USDrequestBody:@@ -23892,13 +24285,14 @@ paths:code:type: stringnullable: true- fulfillment_type:+ fulfillment_provider:type: string- enum:- - shipping- - digital- - pickup- example: shipping+ nullable: true+ example: Spree::FulfillmentProvider::Manual+ delivery_profile_id:+ type: string+ nullable: true+ example: fp_86Rf07xd4zstorefront_visible:type: booleanexample: true@@ -23921,10 +24315,9 @@ paths:type: objectexample:amount: 12.5- delivery_zone_ids:- type: array- items:- type: string+ delivery_zone_id:+ type: string+ nullable: truerequired:- name"/api/v3/admin/delivery_methods/calculators":@@ -23981,6 +24374,9 @@ paths:- type: Spree::Calculator::Shipping::FlatRatename: Flat ratepreference_schema:+ - key: amounts+ type: hash+ default: {}- key: amounttype: decimaldefault: 0@@ -23990,6 +24386,9 @@ paths:- type: Spree::Calculator::Shipping::FlexiRatename: Flexible Rate per package itempreference_schema:+ - key: currency+ type: string+ default: USD- key: first_itemtype: decimaldefault: 0.0@@ -23999,12 +24398,12 @@ paths:- key: max_itemstype: integerdefault: 0- - key: currency- type: string- default: USD- type: Spree::Calculator::Shipping::PerItemname: Flat rate per package itempreference_schema:+ - key: amounts+ type: hash+ default: {}- key: amounttype: decimaldefault: 0@@ -24014,21 +24413,24 @@ paths:- type: Spree::Calculator::Shipping::PriceSackname: Price sackpreference_schema:- - key: discount_amount- type: decimal- default: 0- key: minimal_amounttype: decimaldefault: 0- key: normal_amounttype: decimaldefault: 0+ - key: discount_amount+ type: decimal+ default: 0- key: currencytype: stringdefault: USD- type: Spree::Calculator::Shipping::DigitalDeliveryname: Digital Deliverypreference_schema:+ - key: amounts+ type: hash+ default: {}- key: amounttype: decimaldefault: 0@@ -24101,22 +24503,26 @@ paths:postal_code_from:postal_code_to:country_iso: US+ country_name: United States of Americastate_abbr:state_name:- created_at: '2026-08-09T09:09:44.928Z'- updated_at: '2026-08-09T09:09:44.928Z'+ created_at: '2026-08-10T11:27:44.720Z'+ updated_at: '2026-08-10T11:27:44.720Z'- id: dzm_gbHJdmfrXBmember_type: postal_codepostal_code_prefix: '10'postal_code_from:postal_code_to:country_iso: US+ country_name: United States of Americastate_abbr:state_name:- created_at: '2026-08-09T09:09:44.928Z'- updated_at: '2026-08-09T09:09:44.928Z'- created_at: '2026-08-09T09:09:44.927Z'- updated_at: '2026-08-09T09:09:44.927Z'+ created_at: '2026-08-10T11:27:44.721Z'+ updated_at: '2026-08-10T11:27:44.721Z'+ created_at: '2026-08-10T11:27:44.720Z'+ updated_at: '2026-08-10T11:27:44.720Z'+ delivery_profile_id: fp_UkLWZg9DAJ+ delivery_origin_group_id: og_UkLWZg9DAJdelivery_method_ids: []requestBody:content:@@ -24209,8 +24615,8 @@ paths:- id: int_UkLWZg9DAJname: Carrieractive: false- created_at: '2026-08-09T09:09:45.903Z'- updated_at: '2026-08-09T09:09:45.903Z'+ created_at: '2026-08-10T11:27:45.715Z'+ updated_at: '2026-08-10T11:27:45.715Z'type: carriergroup: shippingpreferences:@@ -24282,8 +24688,8 @@ paths:id: int_UkLWZg9DAJname: Carrieractive: false- created_at: '2026-08-09T09:09:45.942Z'- updated_at: '2026-08-09T09:09:45.942Z'+ created_at: '2026-08-10T11:27:45.771Z'+ updated_at: '2026-08-10T11:27:45.771Z'type: carriergroup: shippingpreferences:@@ -24474,11 +24880,10 @@ paths:data:- id: pt_UkLWZg9DAJname: T-Shirt- fulfillment_types:- - shippingproducts_count: 0- created_at: '2026-08-09T09:09:53.384Z'- updated_at: '2026-08-09T09:09:53.384Z'+ created_at: '2026-08-10T11:27:53.014Z'+ updated_at: '2026-08-10T11:27:53.014Z'+ delivery_profile_id:option_type_ids: []category_ids: []custom_field_definitions: []@@ -24551,11 +24956,10 @@ paths:example:id: pt_gbHJdmfrXBname: Hoodie- fulfillment_types:- - shippingproducts_count: 0- created_at: '2026-08-09T09:09:53.451Z'- updated_at: '2026-08-09T09:09:53.451Z'+ created_at: '2026-08-10T11:27:53.066Z'+ updated_at: '2026-08-10T11:27:53.066Z'+ delivery_profile_id:option_type_ids: []category_ids: []custom_field_definitions: []@@ -24583,13 +24987,12 @@ paths:name:type: stringexample: Hoodie- fulfillment_types:- type: array- items:- type: string- example:- - shipping- description: How products of this type can be delivered.+ delivery_profile_id:+ type: string+ nullable: true+ example: fp_86Rf07xd4z+ description: Fulfillment profile stamped onto products created with+ this type. Null leaves new products on the store default profile.option_type_ids:type: arrayitems:@@ -24654,11 +25057,10 @@ paths:example:id: pt_UkLWZg9DAJname: T-Shirt- fulfillment_types:- - shippingproducts_count: 0- created_at: '2026-08-09T09:09:53.491Z'- updated_at: '2026-08-09T09:09:53.491Z'+ created_at: '2026-08-10T11:27:53.094Z'+ updated_at: '2026-08-10T11:27:53.094Z'+ delivery_profile_id:option_type_ids: []category_ids: []custom_field_definitions: []@@ -24709,11 +25111,10 @@ paths:example:id: pt_UkLWZg9DAJname: Premium T-Shirt- fulfillment_types:- - shippingproducts_count: 0- created_at: '2026-08-09T09:09:53.538Z'- updated_at: '2026-08-09T09:09:53.555Z'+ created_at: '2026-08-10T11:27:53.153Z'+ updated_at: '2026-08-10T11:27:53.172Z'+ delivery_profile_id:option_type_ids: []category_ids: []custom_field_definitions: []@@ -24728,10 +25129,9 @@ paths:name:type: stringexample: Premium T-Shirt- fulfillment_types:- type: array- items:- type: string+ delivery_profile_id:+ type: string+ nullable: trueoption_type_ids:type: arrayitems:@@ -25777,6 +26177,10 @@ components:type: stringupdated_at:type: string+ stock_location_ids:+ type: array+ items:+ type: stringrequired:- id- name@@ -25790,6 +26194,7 @@ components:- preferred_guest_checkout- created_at- updated_at+ - stock_location_idsx-typelizer: trueClaimLineItem:type: object@@ -26317,6 +26722,9 @@ components:type: arrayitems:type: string+ internal_note:+ type: string+ nullable: trueinternal_note_html:type: stringnullable: true@@ -26362,6 +26770,7 @@ components:- created_at- updated_at- tags+ - internal_note- internal_note_html- default_billing_address_id- default_shipping_address_id@@ -26418,14 +26827,18 @@ components:code:type: stringnullable: true- fulfillment_type:- type: stringestimated_transit_business_days_min:type: numbernullable: trueestimated_transit_business_days_max:type: numbernullable: true+ digital:+ type: boolean+ pickup:+ type: boolean+ pickup_point:+ type: booleanadmin_name:type: stringnullable: true@@ -26458,13 +26871,21 @@ components:type: arrayitems:"$ref": "#/components/schemas/DeliveryMethodService"+ rules:+ type: array+ items:+ "$ref": "#/components/schemas/DeliveryMethodRule"tax_category_id:type: stringnullable: true- delivery_zone_ids:- type: array- items:- type: string+ delivery_profile_id:+ type: string+ delivery_origin_group_id:+ type: string+ nullable: true+ delivery_zone_id:+ type: string+ nullable: truestock_location_ids:type: arrayitems:@@ -26479,9 +26900,11 @@ components:- id- name- code- - fulfillment_type- estimated_transit_business_days_min- estimated_transit_business_days_max+ - digital+ - pickup+ - pickup_point- admin_name- fulfillment_provider- pickup_point_provider@@ -26494,8 +26917,11 @@ components:- updated_at- deleted_at- services+ - rules- tax_category_id- - delivery_zone_ids+ - delivery_profile_id+ - delivery_origin_group_id+ - delivery_zone_id- stock_location_ids- calculator_type- calculator_preferences@@ -26529,6 +26955,95 @@ components:- markup_percent- positionx-typelizer: true+ DeliveryOriginGroup:+ type: object+ properties:+ id:+ type: string+ name:+ type: string+ nullable: true+ position:+ type: number+ nullable: true+ created_at:+ type: string+ updated_at:+ type: string+ delivery_profile_id:+ type: string+ stock_location_ids:+ type: array+ items:+ type: string+ delivery_zones_count:+ type: number+ delivery_methods_count:+ type: number+ required:+ - id+ - name+ - position+ - created_at+ - updated_at+ - delivery_profile_id+ - stock_location_ids+ - delivery_zones_count+ - delivery_methods_count+ x-typelizer: true+ DeliveryProfile:+ type: object+ properties:+ id:+ type: string+ name:+ type: string+ default:+ type: boolean+ position:+ type: number+ nullable: true+ created_at:+ type: string+ updated_at:+ type: string+ kind:+ type: string+ digital:+ type: boolean+ offers_pickup:+ type: boolean+ offers_shipping:+ type: boolean+ stock_location_ids:+ type: array+ items:+ type: string+ origin_groups:+ type: object+ products_count:+ type: number+ delivery_methods_count:+ type: number+ delivery_zones_count:+ type: number+ required:+ - id+ - name+ - default+ - position+ - created_at+ - updated_at+ - kind+ - digital+ - offers_pickup+ - offers_shipping+ - stock_location_ids+ - origin_groups+ - products_count+ - delivery_methods_count+ - delivery_zones_count+ x-typelizer: trueDeliveryRate:type: objectproperties:@@ -26619,6 +27134,9 @@ components:country_iso:type: stringnullable: true+ country_name:+ type: string+ nullable: truestate_abbr:type: stringnullable: true@@ -26636,6 +27154,7 @@ components:- postal_code_from- postal_code_to- country_iso+ - country_name- state_abbr- state_name- created_at@@ -26659,6 +27178,11 @@ components:type: stringupdated_at:type: string+ delivery_profile_id:+ type: string+ delivery_origin_group_id:+ type: string+ nullable: truedelivery_method_ids:type: arrayitems:@@ -26669,6 +27193,8 @@ components:- description- created_at- updated_at+ - delivery_profile_id+ - delivery_origin_group_id- delivery_method_idsx-typelizer: trueDigitalLink:@@ -27997,6 +28523,9 @@ components:internal_note:type: stringnullable: true+ internal_note_html:+ type: string+ nullable: trueapprover_id:type: stringnullable: true@@ -28098,6 +28627,7 @@ components:- preferred_stock_location_id- tags- internal_note+ - internal_note_html- approver_id- canceler_id- created_by_id@@ -28615,6 +29145,9 @@ components:type: stringupdated_at:type: string+ delivery_profile_id:+ type: string+ nullable: trueproduct_type_id:type: stringnullable: true@@ -28662,6 +29195,7 @@ components:- deleted_at- created_at- updated_at+ - delivery_profile_id- product_type_id- tax_category_idx-typelizer: true@@ -28707,16 +29241,15 @@ components:type: stringtranslations:type: object- fulfillment_types:- type: array- items:- type: stringproducts_count:type: numbercreated_at:type: stringupdated_at:type: string+ delivery_profile_id:+ type: string+ nullable: trueoption_type_ids:type: arrayitems:@@ -28732,10 +29265,10 @@ components:required:- id- name- - fulfillment_types- products_count- created_at- updated_at+ - delivery_profile_id- option_type_ids- category_ids- custom_field_definitions@@ -29288,6 +29821,12 @@ components:state_text:type: stringnullable: true+ pickup_ready_in_minutes:+ type: number+ nullable: true+ pickup_instructions:+ type: string+ nullable: trueadmin_name:type: stringnullable: true@@ -29317,12 +29856,6 @@ components:type: booleanpickup_stock_policy:type: string- pickup_ready_in_minutes:- type: number- nullable: true- pickup_instructions:- type: string- nullable: truecreated_at:type: stringupdated_at:@@ -29337,6 +29870,8 @@ components:- country_iso- country_name- state_text+ - pickup_ready_in_minutes+ - pickup_instructions- admin_name- address2- state_name@@ -29349,8 +29884,6 @@ components:- kind- pickup_enabled- pickup_stock_policy- - pickup_ready_in_minutes- - pickup_instructions- created_at- updated_atx-typelizer: truediff --git a/docs/api-reference/store.yaml b/docs/api-reference/store.yamlindex f97176e063..34c4299f28 100644--- a/docs/api-reference/store.yaml+++ b/docs/api-reference/store.yaml@@ -87,16 +87,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjU3NDk5M2VlLWQ2NjgtNGQwZi05YzRjLWEyOGI2ZmFjOWE1OSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MjcwMTk4fQ.i9QFOqkVoH5-8quSU4ndHEFEan0QO_qj9mwQwTyvvo4- refresh_token: N8wqmiiGJA4tatXxxQ8gHq9q+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjczMTdlOGFkLTg2NWEtNDIzYS04YTg3LWJhZTMxZDliNzNlYyIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MzY0ODc3fQ.xP2IHJleyl6x-0a-pZu0OyZQEs_zig5Qds10xSZuH1Y+ refresh_token: 3PYnif7qa4bc18sEfLKCPeLWuser:id: cust_UkLWZg9DAJemail: [email protected]- first_name: Dominic- last_name: Treutel+ first_name: Kyong+ last_name: Lowephone:accepts_email_marketing: false- full_name: Dominic Treutel+ full_name: Kyong Loweavailable_store_credit_total: '0'display_available_store_credit_total: "$0.00"addresses: []@@ -194,16 +194,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjAwY2I4MzE0LTNlYzYtNGY1OC1iYmY4LTJkNWM0YzEyY2VlMSIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MjcwMTk4fQ.QTqDJSeUoKh55EoO_JLRMvBMTE9uj8_1l0Ry7ljz1RU- refresh_token: v4bYdfiJ9qDfM7aX5CYNGQ5C+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6ImMxMTk0MTJiLTM4OTgtNDI4Ni04OWYyLTgzYTlmZDYyNWYzYiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MzY0ODc3fQ.54bnm0CLF2FY1qPi-TDb0SS23b94yHQ78akc0f1vK4o+ refresh_token: WY98LKde1aVQMkCrzkEUTndkuser:id: cust_UkLWZg9DAJemail: [email protected]- first_name: Lien- last_name: Conroy+ first_name: Lavonna+ last_name: Baumbachphone:accepts_email_marketing: false- full_name: Lien Conroy+ full_name: Lavonna Baumbachavailable_store_credit_total: '0'display_available_store_credit_total: "$0.00"addresses: []@@ -393,16 +393,16 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjkxNjNlZWJkLTEwODAtNDhhNC1iZDc4LTMxZjJmYWM4Nzc2ZiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MjcwMjAxfQ.Z5MeSEAB_NOTGCgKXnRKDkf3UETtfAVzxytdpU7ui6o- refresh_token: xHiorSHBULjavACQCgS33vik+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjY4NjY2MzAzLWI5ZGQtNDRhYi1iODcwLWQ3MzA4YTQ1ZDA5MiIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MzY0ODgwfQ.aJSfzeXR10C_qMU6N5br-jbXsf3XuSNtnBeiSiCgGqQ+ refresh_token: hjq3AmArXYnbAzziqFXWjUtBuser:id: cust_UkLWZg9DAJemail: [email protected]- first_name: Jetta- last_name: Borer+ first_name: Kathern+ last_name: Kassulkephone:accepts_email_marketing: false- full_name: Jetta Borer+ full_name: Kathern Kassulkeavailable_store_credit_total: '0'display_available_store_credit_total: "$0.00"addresses: []@@ -879,8 +879,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 1295572- slug: product-1295572+ name: Product 1296805+ slug: product-1296805meta_title:meta_description:meta_keywords:@@ -892,12 +892,25 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Accusantium magni in corporis doloremque. Modi ducimus- illum debitis quasi sint. Aut corporis sapiente in at doloremque- magnam. Veritatis iusto dolore voluptatum magnam sequi.- description_html: Accusantium magni in corporis doloremque. Modi- ducimus illum debitis quasi sint. Aut corporis sapiente in at- doloremque magnam. Veritatis iusto dolore voluptatum magnam sequi.+ description: Veritatis ex atque tempora repudiandae quasi voluptatem.+ Sunt necessitatibus occaecati repellendus dolorum optio sapiente+ expedita ullam. Asperiores quo ratione repudiandae magnam. Modi+ neque aut iste illum accusantium rem exercitationem. Cumque aut+ quibusdam porro inventore fugit praesentium deleniti earum. Dicta+ at ratione non minus fugiat explicabo. In hic mollitia pariatur+ reiciendis. Doloribus quisquam ipsa voluptatibus impedit. Quibusdam+ eos beatae quos aperiam. Delectus nam veritatis aperiam perferendis+ pariatur rerum consequatur fuga. Illo iure odit doloribus atque+ modi facere eveniet maxime. Commodi numquam ea cum recusandae+ fuga. Quidem nam incidunt dolorum placeat. Facere sequi placeat+ blanditiis eligendi optio magnam ratione. Quia sunt recusandae+ architecto qui repellendus eaque saepe. Natus vel illum eveniet+ molestiae vero.+ description_html: |-+ Veritatis ex atque tempora repudiandae quasi voluptatem. Sunt necessitatibus occaecati repellendus dolorum optio sapiente expedita ullam. Asperiores quo ratione repudiandae magnam. Modi neque aut iste illum accusantium rem exercitationem. Cumque aut quibusdam porro inventore fugit praesentium deleniti earum.+ Dicta at ratione non minus fugiat explicabo. In hic mollitia pariatur reiciendis. Doloribus quisquam ipsa voluptatibus impedit.+ Quibusdam eos beatae quos aperiam. Delectus nam veritatis aperiam perferendis pariatur rerum consequatur fuga. Illo iure odit doloribus atque modi facere eveniet maxime. Commodi numquam ea cum recusandae fuga.+ Quidem nam incidunt dolorum placeat. Facere sequi placeat blanditiis eligendi optio magnam ratione. Quia sunt recusandae architecto qui repellendus eaque saepe. Natus vel illum eveniet molestiae vero.default_variant_id: variant_UkLWZg9DAJthumbnail_url:tags: []@@ -1052,8 +1065,8 @@ paths:example:data:- id: prod_UkLWZg9DAJ- name: Product 1718939- slug: product-1718939+ name: Product 1711772+ slug: product-1711772meta_title:meta_description:meta_keywords:@@ -1082,8 +1095,8 @@ paths:price_list_id:original_price:- id: prod_gbHJdmfrXB- name: Product 1726567- slug: product-1726567+ name: Product 1727964+ slug: product-1727964meta_title:meta_description:meta_keywords:@@ -1095,25 +1108,14 @@ paths:in_stock: falsebackorderable: trueavailable: true- description: Inventore saepe quaerat et dolorum. Dolor tempore maxime- exercitationem labore eveniet iste odit maiores. Mollitia voluptatum- quod placeat culpa itaque alias fugiat at. Dignissimos pariatur- amet nostrum neque libero. Dolor veritatis nulla alias quis laudantium.- Ut asperiores excepturi libero vel laudantium praesentium. Libero- consequatur quaerat vitae a voluptatibus blanditiis. Saepe quibusdam- odio illum perspiciatis modi impedit. Eum laborum voluptate eos- omnis debitis nihil voluptates. Eligendi nihil tempora dolore- aliquid. Aperiam libero quam aliquid sint dolorum. Labore maiores- inventore aliquid nemo ullam. Tempora ducimus porro eum neque.- Corrupti alias exercitationem rerum quaerat quas earum. Nostrum- possimus impedit perferendis voluptate commodi culpa ab. Tempore- in quo officia vitae fugiat. Sapiente perferendis beatae eveniet- enim illum possimus rem cumque.- description_html: |-- Inventore saepe quaerat et dolorum. Dolor tempore maxime exercitationem labore eveniet iste odit maiores. Mollitia voluptatum quod placeat culpa itaque alias fugiat at.- Dignissimos pariatur amet nostrum neque libero. Dolor veritatis nulla alias quis laudantium. Ut asperiores excepturi libero vel laudantium praesentium. Libero consequatur quaerat vitae a voluptatibus blanditiis. Saepe quibusdam odio illum perspiciatis modi impedit.- Eum laborum voluptate eos omnis debitis nihil voluptates. Eligendi nihil tempora dolore aliquid. Aperiam libero quam aliquid sint dolorum. Labore maiores inventore aliquid nemo ullam. Tempora ducimus porro eum neque.- Corrupti alias exercitationem rerum quaerat quas earum. Nostrum possimus impedit perferendis voluptate commodi culpa ab. Tempore in quo officia vitae fugiat. Sapiente perferendis beatae eveniet enim illum possimus rem cumque.+ description: Veniam ducimus assumenda facilis autem. Nesciunt atque+ iste hic ex nostrum non. Vel odit incidunt soluta iure facere.+ Vitae dicta quo ad quas repudiandae natus. Placeat unde deserunt+ consequuntur ducimus.+ description_html: Veniam ducimus assumenda facilis autem. Nesciunt+ atque iste hic ex nostrum non. Vel odit incidunt soluta iure facere.+ Vitae dicta quo ad quas repudiandae natus. Placeat unde deserunt+ consequuntur ducimus.default_variant_id: variant_EfhxLZ9ck8thumbnail_url:tags: []@@ -1215,8 +1217,8 @@ paths:application/json:example:id: prod_UkLWZg9DAJ- name: Product 199157- slug: product-199157+ name: Product 1995676+ slug: product-1995676meta_title:meta_description:meta_keywords:@@ -1250,7 +1252,7 @@ paths:amount_in_cents: 999currency: USDdisplay_amount: "$9.99"- recorded_at: '2026-07-25T09:10:07Z'+ recorded_at: '2026-07-26T11:28:07Z'schema:"$ref": "#/components/schemas/Product"'404':@@ -1500,7 +1502,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_gbHJdmfrXB- token: GjCfd6kBi6uRsRqtSof1ADdo+ token: BUU6Xt4cxAhTgWr7MjRmebq6email:customer_note:currency: USD@@ -1559,8 +1561,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1049577- slug: product-1049577+ name: Product 104263+ slug: product-104263options_text: ''price: '10.0'display_price: "$10.00"@@ -1605,7 +1607,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: tTabf1P9g8LSV92ZzXQPQRCj+ token: N58bHYc3SHa886wP5piBdQQgemail:customer_note:currency: USD@@ -1664,8 +1666,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1038896- slug: product-1038896+ name: Product 1037279+ slug: product-1037279options_text: ''price: '10.0'display_price: "$10.00"@@ -1783,7 +1785,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: FdfXCtx5cA2LmdyPBdCRGcyq+ token: Ts5tuGfmLCtSaaQDfisuQTYyemail:customer_note:currency: USD@@ -1948,7 +1950,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: xDbNX4QtvRaLQNjzLz1aZ7of+ token: mEQQ3D6uPbQeyizmvcnEQ6D7email:customer_note:currency: USD@@ -1956,7 +1958,7 @@ paths:total_quantity: 0warnings:- code: line_item_removed- message: Product 1082436 was removed because it was sold out+ message: Product 10855 was removed because it was sold outline_item_id: li_UkLWZg9DAJvariant_id: variant_UkLWZg9DAJcoupon_code:@@ -2098,7 +2100,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: 65WdtUsia89SVgJefNi2iExn+ token: 2XD1HviHtAR5xuYwCV4Kdd3qemail:customer_note: Leave at doorcurrency: USD@@ -2153,8 +2155,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1094220- slug: product-1094220+ name: Product 1091047+ slug: product-1091047options_text: ''price: '10.0'display_price: "$10.00"@@ -2373,8 +2375,8 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: jKWK533KjXuCsnxN9uEJeovH- email: [email protected]+ token: zKs28XkmdZ4fiHe2sp3XiLD6+ email: [email protected]customer_note:currency: USDlocale: en@@ -2425,8 +2427,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 111264- slug: product-111264+ name: Product 1119865+ slug: product-1119865options_text: ''price: '10.0'display_price: "$10.00"@@ -2580,8 +2582,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id: cart_UkLWZg9DAJchannel_id: ch_UkLWZg9DAJ- number: R778084798- email: [email protected]+ number: R130676804+ email: [email protected]customer_note:currency: USDlocale: en@@ -2589,7 +2591,7 @@ paths:coupon_code:fulfillment_status: backorderpayment_status: paid- completed_at: '2026-08-09T09:09:59.841Z'+ completed_at: '2026-08-10T11:27:58.734Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -2621,8 +2623,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1145144- slug: product-1145144+ name: Product 1147526+ slug: product-1147526options_text: ''price: '10.0'display_price: "$10.00"@@ -2647,7 +2649,7 @@ paths:digital_links: []fulfillments:- id: ful_gbHJdmfrXB- number: F41829764279+ number: F93815749430tracking:tracking_url:pickup_point_data:@@ -2675,19 +2677,23 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsestock_location:id: sloc_UkLWZg9DAJstate_abbr: NY- name: Augusta Schaden+ name: Lennie Litteladdress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of Americastate_text: NY+ pickup_ready_in_minutes:+ pickup_instructions:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ@@ -2710,14 +2716,16 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsepayments:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: BGS-28a85ef6dc0a- number: P4OB559Y+ response_code: BGS-62bc022d7770+ number: PYNMWMUCamount: '20.0'display_amount: "$20.00"status: completed@@ -2873,7 +2881,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: f1dsF1cuWPLDtSqqs65FU9k7+ token: jSXBL8ojJSUj42hpmmrX6ueeemail:customer_note:currency: USD@@ -2931,8 +2939,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1405682- slug: product-1405682+ name: Product 1409521+ slug: product-1409521options_text: ''price: '10.0'display_price: "$10.00"@@ -3061,7 +3069,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: F7bkzaTPiEQ1mDp51iPM4EGw+ token: Zf8oHX7N7gKp9HhcP3x7p3oZemail:customer_note:currency: USD@@ -3116,8 +3124,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1421609- slug: product-1421609+ name: Product 1424357+ slug: product-1424357options_text: ''price: '10.0'display_price: "$10.00"@@ -3235,8 +3243,8 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: uCwWgKvM9R1VLva8F9Kx94UQ- email: [email protected]+ token: mDFhnEvgXPg8xskdqgrPpPYw+ email: [email protected]customer_note:currency: USDlocale: en@@ -3284,8 +3292,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1447296- slug: product-1447296+ name: Product 144459+ slug: product-144459options_text: ''price: '10.0'display_price: "$10.00"@@ -3310,7 +3318,7 @@ paths:digital_links: []fulfillments:- id: ful_UkLWZg9DAJ- number: F44237087538+ number: F10833750426tracking:tracking_url:pickup_point_data:@@ -3338,19 +3346,23 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsestock_location:id: sloc_UkLWZg9DAJstate_abbr: NY- name: Altha Witting+ name: Jacklyn Leffleraddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of Americastate_text: NY+ pickup_ready_in_minutes:+ pickup_instructions:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ@@ -3373,9 +3385,11 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsepayments: []billing_address:shipping_address:@@ -3502,7 +3516,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: qcRdUkmU6h615wvaY1q9xgwU+ token: G3Zn1Xiuo1BNRnKzprLXANpZemail:customer_note:currency: USD@@ -3553,8 +3567,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1461694- slug: product-1461694+ name: Product 1464203+ slug: product-1464203options_text: ''price: '10.0'display_price: "$10.00"@@ -3581,8 +3595,8 @@ paths:payments:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: 1-SC-20260809091003366027- number: PKWZPTB2+ response_code: 1-SC-20260810112802523091+ number: PXWEDYTDamount: '10.0'display_amount: "$10.00"status: checkout@@ -3738,7 +3752,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: kvxra5SpJm13tB3JWiYuXNQ8+ token: X9e8jJrLmZ3A7XEEg4eaxKSiemail:customer_note:currency: USD@@ -3793,8 +3807,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1508437- slug: product-1508437+ name: Product 150354+ slug: product-150354options_text: ''price: '10.0'display_price: "$10.00"@@ -3821,8 +3835,8 @@ paths:payments:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: 1-SC-20260809091003635201- number: P4L5XAVK+ response_code: 1-SC-20260810112802822007+ number: PES7Q238amount: '10.0'display_amount: "$10.00"status: invalid@@ -3929,7 +3943,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: X5HgWR6Tvv3DMgnW7cfNUsHC+ token: XUmEink4R8nNawAyajqD8iwYemail:customer_note:currency: USD@@ -3937,10 +3951,10 @@ paths:total_quantity: 2warnings:- code: delivery_unavailable- message: Product 1533709 cannot be delivered to the selected address+ message: Product 1538487 cannot be delivered to the selected addressline_item_id: li_UkLWZg9DAJ- code: delivery_unavailable- message: Product 1543646 cannot be delivered to the selected address+ message: Product 1541144 cannot be delivered to the selected addressline_item_id: li_gbHJdmfrXBcoupon_code:item_total: '29.99'@@ -3990,8 +4004,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1533709- slug: product-1533709+ name: Product 1538487+ slug: product-1538487options_text: ''price: '10.0'display_price: "$10.00"@@ -4020,8 +4034,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1543646- slug: product-1543646+ name: Product 1541144+ slug: product-1541144options_text: ''price: '19.99'display_price: "$19.99"@@ -4159,7 +4173,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: 5GwCpHFd8bJudofsKw6kTMuU+ token: WXjLqpsK3qLFSahouShKP7qKemail:customer_note:currency: USD@@ -4210,8 +4224,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1573849- slug: product-1573849+ name: Product 1576754+ slug: product-1576754options_text: ''price: '10.0'display_price: "$10.00"@@ -4329,7 +4343,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: 2NwdodwrXcckWhwFbieuFYYJ+ token: L9ajU78YYg1sT4mViAd7T9ZCemail:customer_note:currency: USD@@ -4469,9 +4483,9 @@ paths:id: ps_gbHJdmfrXBstatus: pendingcurrency: USD- external_id: bogus_fd7f2f664b226686d771de3a+ external_id: bogus_f6a56731acd49a48f6595774external_data:- client_secret: bogus_secret_1730863682b5bf70+ client_secret: bogus_secret_24a6f4b3b25a8636customer_external_id:expires_at:amount: '10.0'@@ -4570,7 +4584,7 @@ paths:id: ps_UkLWZg9DAJstatus: pendingcurrency: USD- external_id: bogus_d13d8ce74671712d594a56fd+ external_id: bogus_e6469be23f3ee8284e7666f1external_data:client_secret: secret_123customer_external_id:@@ -4633,7 +4647,7 @@ paths:id: ps_UkLWZg9DAJstatus: pendingcurrency: USD- external_id: bogus_7204517a75b766698b5d5aba+ external_id: bogus_5cc928271c6cf9fa2782e72dexternal_data:client_secret: secret_123customer_external_id:@@ -4736,7 +4750,7 @@ paths:id: ps_UkLWZg9DAJstatus: completedcurrency: USD- external_id: bogus_61e50c32a8eb70d42e7974c0+ external_id: bogus_d274e70e9a2f47fcb2619443external_data:client_secret: secret_123customer_external_id:@@ -4835,7 +4849,7 @@ paths:id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJresponse_code:- number: PPBWRQEE+ number: PBIEXBJDamount: '10.0'display_amount: "$10.00"status: checkout@@ -4944,7 +4958,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: EFZ7MqhNYa8LrsBzAhQJ4uWB+ token: UrmDDiTJkuzskiHv8DfcvuTFemail:customer_note:currency: USD@@ -4995,8 +5009,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2193838- slug: product-2193838+ name: Product 2192014+ slug: product-2192014options_text: ''price: '10.0'display_price: "$10.00"@@ -5023,8 +5037,8 @@ paths:payments:- id: py_UkLWZg9DAJpayment_method_id: pm_UkLWZg9DAJ- response_code: 1-SC-20260809091008635689- number: PMXNQM1P+ response_code: 1-SC-20260810112808601774+ number: PWO4ZYXYamount: '10.0'display_amount: "$10.00"status: checkout@@ -5144,7 +5158,7 @@ paths:channel_id: ch_UkLWZg9DAJpreferred_stock_location_id:number: cart_UkLWZg9DAJ- token: oNff3Mz76KpUyRjyYb8a1aYU+ token: vut4asBja2w3M6P6bJmgpz29email:customer_note:currency: USD@@ -5199,8 +5213,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 2212457- slug: product-2212457+ name: Product 221337+ slug: product-221337options_text: ''price: '10.0'display_price: "$10.00"@@ -5315,7 +5329,7 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R538621506+ number: R087531624email: [email protected]customer_note:currency: USD@@ -5324,7 +5338,7 @@ paths:coupon_code:fulfillment_status:payment_status:- completed_at: '2026-08-09T09:10:05.256Z'+ completed_at: '2026-08-10T11:28:04.710Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -5356,8 +5370,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1615935- slug: product-1615935+ name: Product 1618550+ slug: product-1618550options_text: ''price: '10.0'display_price: "$10.00"@@ -5382,7 +5396,7 @@ paths:digital_links: []fulfillments:- id: ful_UkLWZg9DAJ- number: F26008334213+ number: F67732987095tracking: U10000tracking_url:pickup_point_data:@@ -5410,19 +5424,23 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsestock_location:id: sloc_UkLWZg9DAJstate_abbr: NY- name: Jan Bradtke+ name: Monty Hudsonaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of Americastate_text: NY+ pickup_ready_in_minutes:+ pickup_instructions:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ@@ -5445,9 +5463,11 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsepayments: []billing_address:id: addr_UkLWZg9DAJ@@ -6371,8 +6391,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R990584210- email: [email protected]+ number: R022967021+ email: [email protected]customer_note:currency: USDlocale: en@@ -6380,7 +6400,7 @@ paths:coupon_code:fulfillment_status:payment_status:- completed_at: '2026-08-09T09:10:01.811Z'+ completed_at: '2026-08-10T11:28:00.922Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -6412,8 +6432,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1304554- slug: product-1304554+ name: Product 1302824+ slug: product-1302824options_text: ''price: '10.0'display_price: "$10.00"@@ -6438,7 +6458,7 @@ paths:digital_links: []fulfillments:- id: ful_UkLWZg9DAJ- number: F51295829107+ number: F45944270908tracking: U10000tracking_url:pickup_point_data:@@ -6466,19 +6486,23 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsestock_location:id: sloc_UkLWZg9DAJstate_abbr: NY- name: Sharilyn Medhurst+ name: Kelly O'Reillyaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of Americastate_text: NY+ pickup_ready_in_minutes:+ pickup_instructions:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ@@ -6501,9 +6525,11 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsepayments: []billing_address:id: addr_EfhxLZ9ck8@@ -6652,8 +6678,8 @@ paths:market_id: mkt_UkLWZg9DAJcart_id:channel_id: ch_UkLWZg9DAJ- number: R026824535- email: [email protected]+ number: R863383059+ email: [email protected]customer_note:currency: USDlocale: en@@ -6661,7 +6687,7 @@ paths:coupon_code:fulfillment_status:payment_status:- completed_at: '2026-08-09T09:10:02.049Z'+ completed_at: '2026-08-10T11:28:01.101Z'item_total: '10.0'display_item_total: "$10.00"adjustment_total: '0.0'@@ -6693,8 +6719,8 @@ paths:preorder_ships_at:quantity: 1currency: USD- name: Product 1326538- slug: product-1326538+ name: Product 1322352+ slug: product-1322352options_text: ''price: '10.0'display_price: "$10.00"@@ -6719,7 +6745,7 @@ paths:digital_links: []fulfillments:- id: ful_UkLWZg9DAJ- number: F64871710492+ number: F44447919647tracking: U10000tracking_url:pickup_point_data:@@ -6747,19 +6773,23 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsestock_location:id: sloc_UkLWZg9DAJstate_abbr: NY- name: Zenobia Brakus+ name: Stella Marvinaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of Americastate_text: NY+ pickup_ready_in_minutes:+ pickup_instructions:delivery_rates:- id: dr_gbHJdmfrXBdelivery_method_id: dm_UkLWZg9DAJ@@ -6782,9 +6812,11 @@ paths:id: dm_UkLWZg9DAJname: UPS Groundcode: UPS_GROUND- fulfillment_type: shippingestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: false+ pickup_point: falsepayments: []billing_address:id: addr_EfhxLZ9ck8@@ -6889,8 +6921,8 @@ paths:content:application/json:example:- token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6IjgzNGVlYTg1LTZkMWUtNDdjYS04OThhLTg5NTZkNzUyNDI4OCIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MjcwMjAyfQ.UneNvHzyAfrEckd5V_z--gPqI3bDCT2Vh_fp1EO1Vmk- refresh_token: HoqYgbss6RHRUsdJNL8psiES+ token: eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoxLCJ1c2VyX3R5cGUiOiJjdXN0b21lciIsImp0aSI6ImY3Y2E3ZWRiLTIwMjYtNGE3Mi05Y2UxLWZlZmEyNWMxZDAxZCIsImlzcyI6InNwcmVlIiwiYXVkIjoic3RvcmVfYXBpIiwiZXhwIjoxNzg2MzY0ODgxfQ.qRM1NbaSUjpJuxKL6BjHxJvwte0bB4nyYB1kBzgiZ_M+ refresh_token: mJRWRf1EZnqmG8PfnGhaHqTauser:id: cust_UkLWZg9DAJemail: [email protected]@@ -6907,10 +6939,10 @@ paths:newsletter_subscriber:id: sub_UkLWZg9DAJemail: [email protected]- created_at: '2026-08-09T09:10:02.210Z'- updated_at: '2026-08-09T09:10:02.212Z'+ created_at: '2026-08-10T11:28:01.252Z'+ updated_at: '2026-08-10T11:28:01.254Z'verified: true- verified_at: '2026-08-09T09:10:02Z'+ verified_at: '2026-08-10T11:28:01Z'customer_id: cust_UkLWZg9DAJcustomer_groups: []schema:@@ -7013,12 +7045,12 @@ paths:application/json:example:id: cust_UkLWZg9DAJ- email: [email protected]- first_name: Fredric- last_name: Blick+ email: [email protected]+ first_name: Gregg+ last_name: Abbottphone: 555-555-0199accepts_email_marketing: false- full_name: Fredric Blick+ full_name: Gregg Abbottavailable_store_credit_total: '0'display_available_store_credit_total: "$0.00"addresses:@@ -7154,7 +7186,7 @@ paths:application/json:example:id: cust_UkLWZg9DAJ- email: [email protected]+ email: [email protected]first_name: Updatedlast_name: Namephone: 555-555-0199@@ -7345,7 +7377,7 @@ paths:example:data:- id: gc_UkLWZg9DAJ- code: 8FD2C4D0040CB7F9+ code: F91DD5F5213A9433status: activecurrency: USDamount: '10.0'@@ -7441,7 +7473,7 @@ paths:application/json:example:id: gc_UkLWZg9DAJ- code: 0AE2AF1139F3F32B+ code: 2B9848F22389648Bstatus: activecurrency: USDamount: '10.0'@@ -7513,8 +7545,8 @@ paths:example:id: pss_gbHJdmfrXBstatus: pending- external_id: bogus_seti_8401ee4431c98857c5e449e5- external_client_secret: bogus_seti_secret_c9f08400cc60d46d+ external_id: bogus_seti_94d4b26f6df18ac118d568a0+ external_client_secret: bogus_seti_secret_36490c4da3eceb5eexternal_data: {}payment_method_id: pm_UkLWZg9DAJpayment_source_id:@@ -7613,8 +7645,8 @@ paths:example:id: pss_UkLWZg9DAJstatus: pending- external_id: seti_test_167d9562f20b1142ef29281f- external_client_secret: seti_secret_e1d76d4a7578139fef14af51+ external_id: seti_test_e854fa25b8124aa8c20b4de3+ external_client_secret: seti_secret_70305ae66ff9cefdeef67002external_data:client_secret: secret_123payment_method_id: pm_UkLWZg9DAJ@@ -7690,8 +7722,8 @@ paths:example:id: pss_UkLWZg9DAJstatus: completed- external_id: seti_test_c1254d775c1e286ea327f45b- external_client_secret: seti_secret_f1520a39fd80e93af43b9fec+ external_id: seti_test_59bdb8ed379c9bffcd9ed0b6+ external_client_secret: seti_secret_c43e3c6bd4cf37171a9c9eddexternal_data:client_secret: secret_123payment_method_id: pm_UkLWZg9DAJ@@ -8635,7 +8667,7 @@ paths:data:- id: wl_UkLWZg9DAJname: My Wishlist- token: apSZTfajbuyhefzXCeL6DeaB+ token: 8qebn9WnSpj7eZzktNBg8yEKis_default: falseis_private: truemeta:@@ -8711,7 +8743,7 @@ paths:example:id: wl_gbHJdmfrXBname: Birthday Ideas- token: DMUxnb1quvJNCAxMcWfoMUTm+ token: isGZv52Ux1jzpCwJ3LA4rw7qis_default: falseis_private: trueschema:@@ -8812,7 +8844,7 @@ paths:example:id: wl_UkLWZg9DAJname: My Wishlist- token: yPSybdt1Z9KekJzYC3WN29WS+ token: HqsFX1qSJewQLRtDY1i9Bf9Vis_default: falseis_private: trueschema:@@ -8874,7 +8906,7 @@ paths:example:id: wl_UkLWZg9DAJname: Updated Name- token: FKUxbqsuwH5hWqNHtsJyEDGp+ token: pim3D7zUr2tALBcquXQaBHsUis_default: falseis_private: trueschema:@@ -9156,11 +9188,11 @@ paths:application/json:example:id: sub_UkLWZg9DAJ- email: [email protected]- created_at: '2026-08-09T09:10:04.715Z'- updated_at: '2026-08-09T09:10:04.715Z'+ email: [email protected]+ created_at: '2026-08-10T11:28:04.061Z'+ updated_at: '2026-08-10T11:28:04.061Z'verified: true- verified_at: '2026-08-09T09:10:04Z'+ verified_at: '2026-08-10T11:28:04Z'customer_id: cust_UkLWZg9DAJschema:"$ref": "#/components/schemas/NewsletterSubscriber"@@ -9239,10 +9271,10 @@ paths:example:id: sub_UkLWZg9DAJemail: [email protected]- created_at: '2026-08-09T09:10:04.732Z'- updated_at: '2026-08-09T09:10:04.737Z'+ created_at: '2026-08-10T11:28:04.083Z'+ updated_at: '2026-08-10T11:28:04.088Z'verified: true- verified_at: '2026-08-09T09:10:04Z'+ verified_at: '2026-08-10T11:28:04Z'customer_id:schema:"$ref": "#/components/schemas/NewsletterSubscriber"@@ -9412,20 +9444,14 @@ paths:body_html: ''- id: pol_OIJLhNcSbfname: Privacy Policy- slug: privacy-policy-dc897639-9888-49d1-835d-41971da57d2f+ slug: privacy-policy-93876f02-1688-401b-9f98-83403c654854body: We respect your privacy.- body_html: |- <div class="trix-content">- We respect your privacy.- </div>+ body_html: We respect your privacy.- id: pol_uw2YK1rnl0name: Return Policyslug: return-policybody: You can return items within 30 days.- body_html: |- <div class="trix-content">- You can return items within 30 days.- </div>+ body_html: You can return items within 30 days.- id: pol_EfhxLZ9ck8name: Returns Policyslug: returns-policy@@ -9519,10 +9545,7 @@ paths:name: Return Policyslug: return-policybody: You can return items within 30 days.- body_html: |- <div class="trix-content">- You can return items within 30 days.- </div>+ body_html: You can return items within 30 days.schema:"$ref": "#/components/schemas/Policy"'404':@@ -9691,10 +9714,12 @@ paths:data:- id: dm_gbHJdmfrXBname: Store pickup- code: UPS_GROUND- fulfillment_type: pickup+ code: PICKUPestimated_transit_business_days_min:estimated_transit_business_days_max:+ digital: false+ pickup: true+ pickup_point: falsemeta:page: 1limit: 25@@ -9755,14 +9780,16 @@ paths:example:data:- id: sloc_UkLWZg9DAJ- state_abbr: STATE_ABBR_91+ state_abbr: STATE_ABBR_93name: Downtownaddress1: 1600 Pennsylvania Ave NWcity: Washingtonzipcode: '20500'country_iso: UScountry_name: United States of America- state_text: STATE_ABBR_91+ state_text: STATE_ABBR_93+ pickup_ready_in_minutes:+ pickup_instructions:servers:- url: http://{defaultHost}variables:@@ -10880,21 +10907,27 @@ components:code:type: stringnullable: true- fulfillment_type:- type: stringestimated_transit_business_days_min:type: numbernullable: trueestimated_transit_business_days_max:type: numbernullable: true+ digital:+ type: boolean+ pickup:+ type: boolean+ pickup_point:+ type: booleanrequired:- id- name- code- - fulfillment_type- estimated_transit_business_days_min- estimated_transit_business_days_max+ - digital+ - pickup+ - pickup_pointx-typelizer: trueDeliveryRate:type: object@@ -10977,6 +11010,9 @@ components:country_iso:type: stringnullable: true+ country_name:+ type: string+ nullable: truestate_abbr:type: stringnullable: true@@ -10990,6 +11026,7 @@ components:- postal_code_from- postal_code_to- country_iso+ - country_name- state_abbr- state_namex-typelizer: true@@ -12671,6 +12708,12 @@ components:state_text:type: stringnullable: true+ pickup_ready_in_minutes:+ type: number+ nullable: true+ pickup_instructions:+ type: string+ nullable: truerequired:- id- state_abbr@@ -12681,6 +12724,8 @@ components:- country_iso- country_name- state_text+ - pickup_ready_in_minutes+ - pickup_instructionsx-typelizer: trueStockReservation:type: objectdiff --git a/docs/plans/5.6-6.0-single-store-promotions-payment-methods.md b/docs/plans/5.6-6.0-single-store-promotions-payment-methods.mdindex b4da19a1e0..40f8b469ff 100644--- a/docs/plans/5.6-6.0-single-store-promotions-payment-methods.md+++ b/docs/plans/5.6-6.0-single-store-promotions-payment-methods.md@@ -22,7 +22,7 @@ This plan removes the need for that branch.## Key Decisions (do not deviate without discussion)- **Single owner via FK.** Both models gain a `store_id` column and `belongs_to :store`. No new join model is introduced (unlike Product, which needed `ProductPublication` for channel distribution — promotions and payment methods have no equivalent distribution concept, so the FK is the whole story).-- **No `Channel`/`Publication` layer.** Products needed publications because a catalog item is *distributed* to multiple channels. A promotion or payment method belongs to exactly one store; there is nothing to publish. Keep it simple — just the FK. **Amended 2026-07-23:** the single-owner FK stands, but "no distribution concept" is superseded for payment methods — per-channel/market/total/customer-group *eligibility* is layered on via `Spree::PaymentMethodRule` (see `5.7-payment-method-rules.md`), not via scoping columns or join tables.+- **No `Channel`/`Publication` layer.** Products needed publications because a catalog item is *distributed* to multiple channels. A promotion or payment method belongs to exactly one store; there is nothing to publish. Keep it simple — just the FK. **Amended 2026-07-23:** the single-owner FK stands, but "no distribution concept" is superseded for payment methods — per-channel/market/total/customer-group *eligibility* is layered on via `Spree::PaymentMethodRule` (see `6.0-payment-method-rules.md`), not via scoping columns or join tables.- **Multi-store behaviour moves to `spree_multi_store`.** The `has_many :stores` / `store_ids` accessors are preserved as **deprecation bridges** in core (returning `Array(store)`), and the real multi-store association is restored by the `spree_multi_store` extension on top of the untouched join tables. Same split as Product.- **Join tables survive 5.6, drop in 6.0.** `spree_promotions_stores` and `spree_payment_methods_stores` are left intact in the 5.6 migration so the extension can overlay the old relationship and so the backfill is re-runnable. The 6.0 cleanup migration drops them.- **`store_id` stays nullable in 5.6, `null: false` in 6.0.** Matching the Product migration (which left `store_id` nullable in 5.5), the 5.6 columns are nullable so installs that haven't run the backfill don't fail validations. The 6.0 cleanup migration enforces `null: false` once the data is known-clean.diff --git a/docs/plans/6.0-channel-delivery.md b/docs/plans/6.0-channel-delivery.mdnew file mode 100644index 0000000000..f0ed0928ba--- /dev/null+++ b/docs/plans/6.0-channel-delivery.md@@ -0,0 +1,67 @@+# Channel-Scoped Delivery (Channel → Stock Locations)++**Status:** Design Finalized (implemented in PR #14404)+**Target:** Spree 6.0+**Depends on:** `6.0-delivery-profiles.md` (profiles + origin groups, shipped in PR #14404), `6.0-order-routing.md` (Channel, `preferred_stock_location_id` on Order), `6.0-channel-markets.md` (sibling axis, composes)+**Author:** Damian Legawiec + Claude (design session 2026-08-09)+**Last updated:** 2026-08-09++## Summary++Let a Channel be limited to a subset of the store's stock locations, constraining which fulfillment origins serve its traffic — and therefore which delivery options its carts are quoted. Today Channel and the delivery model are fully orthogonal: a wholesale channel's cart is quoted from every origin group of the product's profile, and nothing can express "the B2B channel ships only from the wholesale warehouse" or "the POS channel fulfills only from its own store". The link is an optional allowlist join (`spree_channel_stock_locations`, empty = all locations — today's behavior), enforced on the *origin* axis the delivery model already filters on: allocation and quoting simply intersect an origin group's effective locations with the channel's served set.++This is the industry's shape for the problem. The delivery-profiles work deliberately keeps profiles channel-free (a profile answers "how do these products ship", not "who is buying"); the platform that models both — Medusa — links sales channels to **stock locations**, never to shipping profiles, and lets channel-appropriate delivery options fall out transitively through the origin. Without this plan, the only way to express channel-specific delivery in Spree is a separate profile per channel with products duplicated across them — exactly the duplication origin groups were built to kill.++## Key Decisions (do not deviate without discussion)++- **The channel links to stock locations, not to profiles and not to origin groups (2026-08-09).** Profiles group products; groups partition origins; the channel constrains which origins serve its traffic. Linking channel→profile would fork the catalog per channel; linking channel→group would make groups do double duty and duplicate a relationship the channel already needs for inventory. Origin is the one axis where the concern actually lives — and it is the axis the Coordinator and Estimator already filter on, so enforcement is an intersection, not a new mechanism.+- **Empty allowlist = every location** — the established "no rows means no restriction" convention (`6.0-channel-markets.md`, origin-group members, method service rows). Existing stores upgrade with zero behavior change.+- **Origin scoping is origin-side filtering, never method-side rules.** Using a rule to decide which *warehouses* serve a channel was considered and rejected: a method could be visible while its origins cannot serve the channel, quoting rates that allocation then contradicts. The stock-location allowlist keeps quoting and allocation consistent by construction.+- **Rate visibility IS a method-side rule (2026-08-10).** The separate question — which delivery *options and prices* a channel is offered from origins it already reaches — is `Spree::DeliveryMethodRules::ChannelRule`, an STI rule beside ItemTotal/Weight/ExcludedProducts, enforced in the Estimator's method filter. This is what makes "wholesale pays €5, retail pays €10, same warehouse, same goods" expressible without duplicating products or profiles; a differing price is a second method carrying the rule, exactly as zones already work. The two mechanisms answer different questions and compose: origins decide *whether* a channel can be served, rules decide *what it is offered*.+- **Pickup follows the same rule:** a channel's carts only see pickup counters among the channel's served locations. No special casing — `available_pickup_locations` intersects like everything else.+- **Order routing is unchanged.** `preferred_stock_location_id` lives on the Order (customer pickup selection / routing outcome), and its resolution path already scopes by `pickup_enabled` — the channel intersection lands in that same resolution. The allowlist constrains the candidate set; routing strategies order within it.++## Design Details++### Model++```+spree_channel_stock_locations (join; unique [channel_id, stock_location_id])+Channel has_many :channel_stock_locations, :stock_locations (through)+Channel#serves_location?(stock_location) # empty allowlist → true+Channel#served_stock_locations # empty → store.stock_locations+```++### Enforcement points (all one predicate)++1. **Allocation** — `Stock::Coordinator` already asks `profile.covers_location?`; it additionally asks `channel.serves_location?` when the cart has a channel. Items allocate only from origins both the profile's groups and the channel serve.+2. **Quoting** — `Stock::Estimator`'s method filter already consults `serves_location?(package.stock_location)`; a package sourced from a non-served location never exists (filtered at allocation), so quoting needs no extra check — documented as invariant, covered by spec.+3. **Pickup discovery** — the store `pickup_locations` endpoint and `Carts::Update`'s `preferred_stock_location_id` resolution intersect with the cart's channel.+4. **Pickup selection** — `Carts::Update` resolves the customer's `preferred_stock_location_id` through `pickup_enabled` AND the cart channel's served set, so a non-served counter 404s exactly like a non-pickup one.++### API / Dashboard++- Admin API: `stock_location_ids` on the channel serializer + params (replace-set, empty = all) — same shape as origin groups.+- Dashboard: a "Fulfillment locations" card on the channel form (`all` / `selected` radio + checkbox list, the exact pattern shipped for origin groups and profiles).+- Store API: no new surface — the constraint manifests as which delivery options and pickup counters a channel-bound cart sees.++## Migration Path++Additive only: one `create_table` migration for the join. No backfill (empty = all preserves behavior). No deprecations.++## Constraints on Current Work++- New code resolving fulfillment origins for a cart must flow through the profile/group coverage path (`covers_location?` / `fulfillable_stock_locations`) so the channel intersection lands in one place — never enumerate `store.stock_locations` directly in delivery code.+- Don't add channel awareness to DeliveryProfile, DeliveryOriginGroup, or DeliveryMethod — the channel constraint composes from outside.++## Open Questions++- ~~In-PR vs follow-up~~ — resolved 2026-08-09 (Damian): implemented inside PR #14404, same pattern as origin groups.+- Whether `Order#channel_id` is reliably present on carts at quoting time in all storefront paths (key-bound channel vs. explicit header) — a nil channel means unrestricted, which is safe; audited during implementation for the primary paths.++## References++- `6.0-delivery-profiles.md` (origin groups — the axis this composes with)+- `6.0-channel-markets.md` (sibling allowlist: markets axis; together: "wholesale channel → EU markets, wholesale warehouse")+- `6.0-order-routing.md` (Channel model, `preferred_stock_location_id`)+- Medusa's sales-channel ↔ stock-location link (the transitive-delivery precedent; competitor names in plans only)diff --git a/docs/plans/5.7-channel-markets.md b/docs/plans/6.0-channel-markets.mdsimilarity index 97%rename from docs/plans/5.7-channel-markets.mdrename to docs/plans/6.0-channel-markets.mdindex ea0cfd489b..52f174e3da 100644--- a/docs/plans/5.7-channel-markets.md+++ b/docs/plans/6.0-channel-markets.md@@ -1,14 +1,14 @@# Channel → Markets Allowlist**Status:** Draft-**Target:** Spree 5.7+**Target:** Spree 6.0 (retargeted from 5.7 — the 5.7 release was cut, 5.6 → 6.0; 2026-08-09)**Depends on:** `6.0-channels-catalogs-b2b.md` (Channel, shipped 5.5), `5.6-store-channel-context-and-key-binding.md` (channel binding + `/store/channel`), Markets (existing)**Author:** Damian + Claude**Last updated:** 2026-07-23## Summary-Let a Channel be limited to a subset of the store's Markets. Today Channel (where you sell) and Market (where your customers are) are fully orthogonal request axes — `Spree::Current.channel` comes from key binding / `X-Spree-Channel`, `Spree::Current.market` from `x-spree-country` — and nothing can express "the wholesale channel only serves EU markets" or "the POS channel is domestic-only". This plan adds an optional allowlist: a join table between Channel and Market, empty meaning "all markets" (today's behavior). The industry validates the link from both directions: Vendure and Saleor merge channel and market into one primitive (per-channel currencies/zones), Shopify bridges its separate primitives with *channel markets* (a market conditioned on a sales channel) and since May 2026 routes per-market Shopify Payments entities through it; Medusa alone leaves the axes unlinked. Spree keeps its two first-class models and adds the constraint — which also composes with `5.7-payment-method-rules.md` (`MarketRule` on a channel-restricted market set) into "wholesale channel → EU markets → invoice payment".+Let a Channel be limited to a subset of the store's Markets. Today Channel (where you sell) and Market (where your customers are) are fully orthogonal request axes — `Spree::Current.channel` comes from key binding / `X-Spree-Channel`, `Spree::Current.market` from `x-spree-country` — and nothing can express "the wholesale channel only serves EU markets" or "the POS channel is domestic-only". This plan adds an optional allowlist: a join table between Channel and Market, empty meaning "all markets" (today's behavior). The industry validates the link from both directions: Vendure and Saleor merge channel and market into one primitive (per-channel currencies/zones), Shopify bridges its separate primitives with *channel markets* (a market conditioned on a sales channel) and since May 2026 routes per-market Shopify Payments entities through it; Medusa alone leaves the axes unlinked. Spree keeps its two first-class models and adds the constraint — which also composes with `6.0-payment-method-rules.md` (`MarketRule` on a channel-restricted market set) into "wholesale channel → EU markets → invoice payment".## Key Decisions (do not deviate without discussion)@@ -110,7 +110,7 @@ Additive only:2. Models + resolution changes ship together (behavior only diverges once an admin restricts a channel).3. Admin API + dashboard UI.-The 5.6 wholesale seed channel stays unrestricted by default; the sample-data story ("wholesale serves EU markets only") is optional polish once `5.7-payment-method-rules.md` lands its seed changes.+The 5.6 wholesale seed channel stays unrestricted by default; the sample-data story ("wholesale serves EU markets only") is optional polish once `6.0-payment-method-rules.md` lands its seed changes.## Constraints on Current Work@@ -125,7 +125,7 @@ The 5.6 wholesale seed channel stays unrestricted by default; the sample-data st## References-- Sibling plan: `docs/plans/5.7-payment-method-rules.md` (`MarketRule` composes with the allowlist)+- Sibling plan: `docs/plans/6.0-payment-method-rules.md` (`MarketRule` composes with the allowlist)- Channel infrastructure: `docs/plans/6.0-channels-catalogs-b2b.md`, `docs/plans/5.6-store-channel-context-and-key-binding.md`- Market model: `spree/core/app/models/spree/market.rb`; resolution: `spree/api/app/controllers/concerns/spree/api/v3/locale_and_currency.rb` (`set_market_from_country`), `spree/core/app/models/spree/current.rb`- Order market wiring: `spree/core/app/models/spree/order.rb` (`ensure_market_presence`, `resolve_market_from_currency`)diff --git a/docs/plans/6.0-delivery-method-rules.md b/docs/plans/6.0-delivery-method-rules.mdindex ba79be9698..d506d17add 100644--- a/docs/plans/6.0-delivery-method-rules.md+++ b/docs/plans/6.0-delivery-method-rules.md@@ -2,7 +2,7 @@**Status:** Phase 1 shipped (ItemTotal/Weight + Estimator seam + admin CRUD + Conditions card); ExcludedProductsRule (decision 2026-08-06) in review as PR #14399**Target:** Spree 6.0-**Depends on:** `6.0-fulfillment-and-delivery.md` (DeliveryMethod), `6.0-delivery-rate-provider.md` (shared Estimator seam), `5.7-payment-method-rules.md` (pattern sibling — expected to retarget 6.0 per 2026-07-29 direction to skip 5.7 for a faster 6.0 launch)+**Depends on:** `6.0-fulfillment-and-delivery.md` (DeliveryMethod), `6.0-delivery-rate-provider.md` (shared Estimator seam), `6.0-payment-method-rules.md` (pattern sibling — expected to retarget 6.0 per 2026-07-29 direction to skip 5.7 for a faster 6.0 launch)**Author:** Damian + Claude (design review 2026-07-29)**Last updated:** 2026-08-06@@ -53,7 +53,7 @@ buries eligibility in the pricing object.`Spree::DeliveryMethodRule` on `spree_delivery_method_rules`, subclassesunder `app/models/spree/delivery_method_rules/`, preference-schema-drivenconfig, registry-validated `type`. Where this plan and- `5.7-payment-method-rules.md` overlap (base-class shape, AND semantics,+ `6.0-payment-method-rules.md` overlap (base-class shape, AND semantics,empty-preference fail-open, registry, dashboard-only management), thepayment plan's wording is authoritative — keep the two symmetric.- **Rules over method columns.** Saleor-style columns would cover Phase 1 but@@ -325,7 +325,7 @@ None currently.## References-- `5.7-payment-method-rules.md` — authoritative pattern wording+- `6.0-payment-method-rules.md` — authoritative pattern wording- `6.0-delivery-rate-provider.md` — the provider bypass this plan closes- decisions.md 2026-07-29 (geo modeling; regional method rows), 2026-08-06(ExcludedProductsRule replaces the product-side column)diff --git a/docs/plans/6.0-delivery-profiles.md b/docs/plans/6.0-delivery-profiles.mdnew file mode 100644index 0000000000..f6c05d8d98--- /dev/null+++ b/docs/plans/6.0-delivery-profiles.md@@ -0,0 +1,102 @@+# Delivery Profiles++**Status:** Design Finalized+**Target:** Spree 6.0+**Depends on:** `6.0-fulfillment-and-delivery.md` (shipped waves), `6.0-delivery-rate-provider.md` (dynamic carrier rates), `6.0-delivery-zones.md`, `6.0-product-types.md`+**Author:** Damian Legawiec + Claude (design sessions 2026-08-09)+**Last updated:** 2026-08-09++## Summary++`Spree::DeliveryProfile` is the store-scoped grouping that decides how a set of products ships: which origins can fulfill them, which destination zones apply, and which delivery methods are offered. Products reference a profile directly (nil falls back to the store's default profile); carts split per profile; a package's candidate methods are exactly its profile's methods filtered by origin and destination. The model is **ShippingCategory promoted, not replaced**: the 5.x table and the product foreign key are renamed in place, so historical data migrates by rename rather than by copy.++This supersedes three earlier decisions: "fulfillment types are NOT a model", "named delivery groups are 6.1-if-needed", and live-by-reference `fulfillment_types` on ProductType. Rationale for reversing inside the 6.0 window: there is no rewrite window in 6.1; custom string types were second-class (providers declare handled types, so a custom type could not use any carrier rate provider); the origin axis (stock locations ↔ methods) did not exist for shipping methods at all; and the array-on-ProductType was the sole live-by-reference exception to the product-type template doctrine.++## The model++```+Spree::Store ─────────────────────────────── has many; exactly ONE default per store+ ▼+Spree::DeliveryProfile spree_delivery_profiles (STI, prefix fp_)+ │ store_id · name · type · default · position (renamed spree_shipping_categories)+ │ kinds: DeliveryProfiles::Shipping (default kind, physical goods)+ │ DeliveryProfiles::Digital (digital? true, no shipping address,+ │ accepts only digital-provider methods)+ │ extension kinds via registers_subclasses_via+ │+ ├──< Spree::Product spree_products.delivery_profile_id+ │ (renamed shipping_category_id; REQUIRED — auto-assigned on create:+ │ type template, else the store's default profile)+ │ ProductType.delivery_profile_id = creation-time template+ │+ ├──< Spree::DeliveryOriginGroup spree_delivery_origin_groups (prefix og_)+ │ partitions the profile's fulfillment origins; every zone and method+ │ belongs to one group, so per-warehouse rate tables need no second+ │ profile. Auto-created nameless default with no members = every store+ │ location — single-group profiles never see the layer.+ │ group ↔ StockLocation join (spree_delivery_origin_group_locations;+ │ no rows ⇒ every store location)+ │+ ├──< Spree::DeliveryZone gains delivery_profile_id ++ │ delivery_origin_group_id+ │+ └──< Spree::DeliveryMethod+ delivery_profile_id (required)+ delivery_origin_group_id (defaults: zone's group, else the profile's+ default group; zone and method must share it)+ delivery_zone_id (nullable; same profile; nil = no destination+ restriction)+ NO modality column — behavior comes from classes:+ · FulfillmentProvider subclasses answer requires_address?,+ digital?, pickup? (Manual/Digital/Pickup/PickupPoint)+ · the profile kind validates composition (Digital profiles accept+ only digital-provider methods)+ · rate providers declare requires_address? (a carrier can only+ price methods that ship somewhere) instead of type lists+ ships-from narrowing · providers · calculator · markup · services ·+ rules — unchanged+```++**No string vocabularies anywhere**: the `Spree.fulfillment_types` registry, the ProductType array, AND the method `fulfillment_type`/modality column are all deleted. Every behavior question routes to a class: `profile.digital?`, `profile.requires_shipping_address?`, `provider.requires_address?`. The method form loses its type select — provider + profile say everything.++## Runtime flow++1. **Split** — `Stock::Splitter::DeliveryProfile` (replaces `Splitter::FulfillmentType`) partitions cart contents by each item's resolved profile.+2. **Allocate** — the Coordinator allocates a profile's items only from stock locations the profile covers (its join; empty = all).+3. **Quote** — for a package (profile, origin): candidates are the profile's methods whose ships-from set covers the origin, whose zone is nil or includes the ship address, passing the existing rule/calculator/audience filters; rate providers then fan out (multi-rate carriers untouched).+4. **Derive, never declare twice** — `Product#digital?` ⇐ its profile kind (`DeliveryProfiles::Digital`); pickupable ⇐ the profile contains a pickup-provider method; the order requires an address ⇐ any item's profile answers `requires_shipping_address?` (kind-declared for Digital, derived from the methods' providers for physical kinds).++## Key Decisions (do not deviate without discussion)++- **`delivery_profile_id` is required on Product (2026-08-09)** — a product without one cannot be fulfilled, and nullable-with-fallback smears `OR IS NULL` across every profile join. Auto-assigned on create (type template, else store default), mirroring the 5.x category's presence+auto-assign behavior.+- **Profile on the Product, template on the ProductType (2026-08-09).** `delivery_profile_id` lives on `spree_products`; ProductType's own `delivery_profile_id` is stamped onto products at creation only. This restores the uniform "creation-time template" doctrine that the `fulfillment_types` array violated, and makes a product's shipping behavior inspectable on the product itself.+- **Migration by rename, not by copy (2026-08-09).** `spree_shipping_categories` → `spree_delivery_profiles`; `spree_products.shipping_category_id` → `delivery_profile_id`. 5.x products arrive assigned; the 5.x "Digital" category becomes the Digital profile. What the rename cannot express is handled by `spree:migrate_delivery_profiles` (in the 5.6→6.0 manifest): store assignment (5.x categories were global; products are single-owner since 5.5, so each profile goes to the store whose products use it, duplicated + remapped when shared — loudly logged); categories that do not narrow the store's method set fold into the store default profile (the schema migration creates "General" as each store's default); digital-only categories become Digital-kind profiles; and `spree_shipping_method_categories` (m:n) collapses into the method's single `delivery_profile_id` (solely-linked methods move in; multi-category methods stay in the default profile with a LOUD warning). The m:n table survives to 6.1 solely as that task's source.+- **No modality column, classes only (2026-08-09, supersedes the interim modality rename).** The method's `fulfillment_type` column is dropped, not renamed; the `Spree.fulfillment_types` registry (engine config + accessors) is deleted outright — unreleased 6.0-dev surface. Delivery mechanics live on `FulfillmentProvider` class predicates (`digital?`, `pickup?`, `pickup_point?`, instance `requires_address?`); rate providers declare `requires_address?` instead of type lists; profile kinds are STI classes registered via `Spree.delivery_profile_types`. Wire formats may derive kind strings for display/filtering, but nothing stores or validates them.+- **`ProductType#fulfillment_types` array is removed** (column + validation) in favor of the template profile reference. Capabilities derive from the profile's methods rather than being declared on the product side.+- **Zones belong to the profile; a method belongs to at most one zone.** The `spree_delivery_method_zones` m:n join is dropped (backfilled to the first zone with a warning on multiples). A method with no zone has no destination restriction.+- **One default profile per store**, enforced like `StockLocation#default` (`ensure_one_default`); undeletable; created by a `Store` `after_create` hook and by seeds/upgrade for existing stores. Non-default profiles are deletable only when no products reference them (model-level guard, per the RBAC axis-B convention).+- **Competitor names never appear in code or comments** — grounding stays in plan documents.++## Migration Path++1. Structural migration (6.0, `[8.1]`): renames + new columns/joins as diagrammed; adds `store_id`/`default`/`position` to the renamed profiles table (nullable until the upgrade task assigns them; `null: false` tightening lands in 6.1); drops `spree_delivery_method_zones` after backfill.+2. `Spree::ShippingCategory` + `Spree::ShippingMethodCategory` classes, deprecated associations (`Product#shipping_category*`, `Variant#shipping_category*`, `DeliveryMethod#shipping_categories*`), factories, permission-catalog subject, and typelizer entry are deleted. The permission catalog gains `Spree::DeliveryProfile`.+3. `spree:upgrade:migrate_delivery_profiles` in the 5.6→6.0 manifest (resumable, anonymous-AR readers for the m:n) performs the judgement work listed above.+4. 6.1: drop `spree_shipping_method_categories`, tighten profile `store_id` constraints.++## Constraints on Current Work++- New delivery features must resolve eligibility through the profile chain — never reintroduce parallel product-side capability arrays.+- Behavior questions route through classes (`provider_class.digital?`, `profile.requires_shipping_address?`) — never reintroduce a stored type/modality string on methods, products, or profiles. Fulfillment.fulfillment_type (the historical column on fulfillments) remains as recorded data only.+- The Store API surface for profiles is read-only derivation (product serializers may expose digital/pickupable); profile management is Admin API only.++## Open Questions++- ~~Whether ships-from narrowing needs promotion to named origin groups~~ — pulled into 6.0 (2026-08-09, Damian): `Spree::DeliveryOriginGroup` ships now; per-method ships-from narrowing retires for shipping methods (the group is the origin axis) and `DeliveryMethodStockLocation` remains pickup-only (collection counters).+- Multi-currency/multi-market interplay: profiles are store-scoped; market-aware profiles deferred to the channels/markets work.++## References++- Supersedes sections of `6.0-fulfillment-and-delivery.md` ("Fulfillment types are a strict registered set", "Named delivery groups"), `6.0-product-types.md` (fulfillment_types array), `6.0-delivery-zones.md` (store-level zone ownership).+- decisions.md 2026-08-09 entries (dynamic carrier rates; delivery profiles).+- PR #14404.diff --git a/docs/plans/6.0-delivery-rate-provider.md b/docs/plans/6.0-delivery-rate-provider.mdindex e0e3afbaf9..ec9d86819d 100644--- a/docs/plans/6.0-delivery-rate-provider.md+++ b/docs/plans/6.0-delivery-rate-provider.md@@ -250,7 +250,7 @@ endTwo constraints to design around:-- **One integration per (store, type)** — `validates :store, presence: true, uniqueness: { scope: :type }` (`integration.rb:16`). A store cannot hold two EasyPost credential sets. Multi-account support is a separate change; see the grooming note in `5.7-payment-method-rules.md`.+- **One integration per (store, type)** — `validates :store, presence: true, uniqueness: { scope: :type }` (`integration.rb:16`). A store cannot hold two EasyPost credential sets. Multi-account support is a separate change; see the grooming note in `6.0-payment-method-rules.md`.- **Core ships no `Spree::Integrations::` namespace** — there is no `core/app/models/spree/integrations/` directory, so `integration_group`, `icon_path`, `integration_name`, and `integration_key` (`:33-47`) are currently unexercised. The EasyPost provider gem would be the first real consumer.Internal providers need no Integration.diff --git a/docs/plans/6.0-delivery-zones.md b/docs/plans/6.0-delivery-zones.mdindex d530c25785..44ab172ece 100644--- a/docs/plans/6.0-delivery-zones.md+++ b/docs/plans/6.0-delivery-zones.md@@ -1,6 +1,6 @@# Delivery Zones (Zone → DeliveryZone)-> **Amendment 2026-08-09 (`6.0-fulfillment-profiles.md`):** delivery zones become owned by a fulfillment profile (`fulfillment_profile_id`), and a delivery method binds to at most ONE zone (`delivery_zone_id`; the method↔zone m:n join is dropped). Zone membership mechanics (country/state/postal ranges) are unchanged.+> **Amendment 2026-08-09 (`6.0-delivery-profiles.md`):** delivery zones become owned by a delivery profile (`delivery_profile_id`), and a delivery method binds to at most ONE zone (`delivery_zone_id`; the method↔zone m:n join is dropped). Zone membership mechanics (country/state/postal ranges) are unchanged.**Status:** Phases A and B shipped, C mostly shipped; `Spree::Zone` removal (Phase D) blocked on the tax provider — see "Implementation status"diff --git a/docs/plans/6.0-fulfillment-and-delivery.md b/docs/plans/6.0-fulfillment-and-delivery.mdindex dfe244f0f6..4cfbcdbf61 100644--- a/docs/plans/6.0-fulfillment-and-delivery.md+++ b/docs/plans/6.0-fulfillment-and-delivery.md@@ -102,9 +102,9 @@ Replacement semantics:`ShippingMethod#digital?`, `#requires_zone_check?`, and the `.digital` scope currently test `calculator.is_a?(DigitalDelivery)` (`shipping_method.rb:42, 57, 128`; memoized via `MEMOIZED_METHODS :17`), and `Product#digital?` derives through a four-hop chain (product → category → methods → calculator class). All of these move to columns: `DeliveryMethod#fulfillment_type == 'digital'` and `ProductType#digital?`. The `DigitalDelivery` calculator stays (calculators are kept) but becomes a plain zero-cost calculator — its `available?` gating is superseded by fulfillment-type eligibility. `Seeds::DigitalDelivery` updates to set `fulfillment_type: 'digital'`.-### SUPERSEDED (2026-08-09): fulfillment types are replaced by Fulfillment Profiles+### SUPERSEDED (2026-08-09): fulfillment types are replaced by Delivery Profiles-The registered-string design below, the "NOT a model" doctrine, and the "Named delivery groups (6.1-if-needed)" section further down are superseded by `6.0-fulfillment-profiles.md`: ShippingCategory is promoted (table renamed) into store-scoped `Spree::FulfillmentProfile`, products reference profiles directly, method `fulfillment_type` becomes `modality`, and the `Spree.fulfillment_types` registry is deleted. Kept below for history.+The registered-string design below, the "NOT a model" doctrine, and the "Named delivery groups (6.1-if-needed)" section further down are superseded by `6.0-delivery-profiles.md`: ShippingCategory is promoted (table renamed) into store-scoped `Spree::DeliveryProfile`, products reference profiles directly, method `fulfillment_type` becomes `modality`, and the `Spree.fulfillment_types` registry is deleted. Kept below for history.### Historical — Fulfillment types are a strict registered set (revised 2026-08-02; supersedes "open strings, no inclusion validation")@@ -112,7 +112,7 @@ The registered-string design below, the "NOT a model" doctrine, and the "Named d**Modality vs segment.** New fulfillment types are for genuinely new delivery *modalities* (need provider code anyway — the initializer is the smallest part of the work). Product *segments* ("oversized", "fragile") should NOT become custom types: model them with `DeliveryMethodRule` (weight/item-total/excluded-products — merchant-manageable in the dashboard, registry `Spree.delivery_method_rules` for custom rules; the former `Product#excluded_delivery_method_ids` column is gone per the 2026-08-06 decision — one-off subtractions are `ExcludedProductsRule`). The Wave 7 shipping→delivery data migration MAY mint custom tokens for 5.x shipping categories whose method bindings actually narrow (a category not served by all methods) — flattening those to `'shipping'` would silently widen eligibility — but that token-minting is a compatibility measure, not recommended modeling; the migration task must print the `Spree.fulfillment_types += [...]` initializer line for every token it mints.-**Historical (superseded 2026-08-09 by `6.0-fulfillment-profiles.md` — profiles shipped in 6.0). Named delivery groups — the if-needed 6.1 successor to profiles (2026-08-06).** ShippingCategory stays removed even though the removal is unreleased. Competitor context, stated honestly: Medusa's ShippingProfile and Shopify's shipping profiles are the same design as ShippingCategory (product-level FK to a named group, options scoped to the group, carts split per group) — so per-product delivery grouping entities are common; what the 6.0 stack replaces them with covers all three of the category's jobs (eligibility via `fulfillment_types` matching, splitting via `Splitter::FulfillmentType`, per-product restrictions via `DeliveryMethodRules::ExcludedProductsRule`). The one genuine loss is the *named grouping as a management surface*: tagging 1,000 products "Oversized" once beats listing them individually on an exclusion rule (worse ergonomics at scale). If real merchant demand materializes, the comeback is NOT the old category (mandatory column, join table to methods, digital-via-calculator hack) but an additive construct in existing machinery — a named eligibility/exclusion set that products reference, or a `DeliveryMethodRule` kind matching a product group. 6.1-if-needed, evidence first. Also clarified 2026-08-06: dropping the category loses nothing at the variant level — Spree never had a variant-level shipping category (`spree_variants` has no such column back through the consolidated 4.3 schema; `Variant#shipping_category` was pure product delegation; Solidus is the fork that added one). Mixed physical/digital within one product is a pre-existing gap, with the reserved relief valve recorded in `6.0-product-types.md` (per-product/per-variant `fulfillment_types` override, 6.1-if-needed).+**Historical (superseded 2026-08-09 by `6.0-delivery-profiles.md` — profiles shipped in 6.0). Named delivery groups — the if-needed 6.1 successor to profiles (2026-08-06).** ShippingCategory stays removed even though the removal is unreleased. Competitor context, stated honestly: Medusa's ShippingProfile and Shopify's shipping profiles are the same design as ShippingCategory (product-level FK to a named group, options scoped to the group, carts split per group) — so per-product delivery grouping entities are common; what the 6.0 stack replaces them with covers all three of the category's jobs (eligibility via `fulfillment_types` matching, splitting via `Splitter::FulfillmentType`, per-product restrictions via `DeliveryMethodRules::ExcludedProductsRule`). The one genuine loss is the *named grouping as a management surface*: tagging 1,000 products "Oversized" once beats listing them individually on an exclusion rule (worse ergonomics at scale). If real merchant demand materializes, the comeback is NOT the old category (mandatory column, join table to methods, digital-via-calculator hack) but an additive construct in existing machinery — a named eligibility/exclusion set that products reference, or a `DeliveryMethodRule` kind matching a product group. 6.1-if-needed, evidence first. Also clarified 2026-08-06: dropping the category loses nothing at the variant level — Spree never had a variant-level shipping category (`spree_variants` has no such column back through the consolidated 4.3 schema; `Variant#shipping_category` was pure product delegation; Solidus is the fork that added one). Mixed physical/digital within one product is a pre-existing gap, with the reserved relief valve recorded in `6.0-product-types.md` (per-product/per-variant `fulfillment_types` override, 6.1-if-needed).### FulfillmentProvider is a strategy (not a DB model)diff --git a/docs/plans/6.0-fulfillment-profiles.md b/docs/plans/6.0-fulfillment-profiles.mddeleted file mode 100644index 1c12915757..0000000000--- a/docs/plans/6.0-fulfillment-profiles.md+++ /dev/null@@ -1,92 +0,0 @@-# Fulfillment Profiles--**Status:** Design Finalized-**Target:** Spree 6.0-**Depends on:** `6.0-fulfillment-and-delivery.md` (shipped waves), `6.0-delivery-rate-provider.md` (dynamic carrier rates), `6.0-delivery-zones.md`, `6.0-product-types.md`-**Author:** Damian Legawiec + Claude (design sessions 2026-08-09)-**Last updated:** 2026-08-09--## Summary--`Spree::FulfillmentProfile` is the store-scoped grouping that decides how a set of products ships: which origins can fulfill them, which destination zones apply, and which delivery methods are offered. Products reference a profile directly (nil falls back to the store's default profile); carts split per profile; a package's candidate methods are exactly its profile's methods filtered by origin and destination. The model is **ShippingCategory promoted, not replaced**: the 5.x table and the product foreign key are renamed in place, so historical data migrates by rename rather than by copy.--This supersedes three earlier decisions: "fulfillment types are NOT a model", "named delivery groups are 6.1-if-needed", and live-by-reference `fulfillment_types` on ProductType. Rationale for reversing inside the 6.0 window: there is no rewrite window in 6.1; custom string types were second-class (providers declare handled types, so a custom type could not use any carrier rate provider); the origin axis (stock locations ↔ methods) did not exist for shipping methods at all; and the array-on-ProductType was the sole live-by-reference exception to the product-type template doctrine.--## The model--```-Spree::Store ─────────────────────────────── has many; exactly ONE default per store- ▼-Spree::FulfillmentProfile spree_fulfillment_profiles (prefix fp_)- │ store_id · name · default · position (renamed spree_shipping_categories)- │ "General" (default) · "Oversized" · "Digital"- │- ├──< Spree::Product spree_products.fulfillment_profile_id- │ (renamed shipping_category_id; nullable → default profile fallback)- │ ProductType.fulfillment_profile_id = creation-time template:- │ stamps the product at creation, never manages it afterwards- │- ├──< profile ↔ StockLocation join spree_fulfillment_profile_locations- │ which origins can fulfill this profile; no rows ⇒ every store location- │- ├──< Spree::DeliveryZone gains fulfillment_profile_id- │ country/state/postal members unchanged- │- └──< Spree::DeliveryMethod- fulfillment_profile_id (required)- delivery_zone_id (nullable; must belong to the same profile;- nil = no destination restriction — digital,- pickup, or genuinely worldwide shipping)- modality (renamed fulfillment_type: shipping | pickup |- digital; validated against- Spree::DeliveryMethod.modalities, a- class_attribute extensions append to)- ships-from narrowing (existing DeliveryMethodStockLocation join,- optional subset of the profile's locations;- empty = all; Pickup keeps its policy override)- rate/fulfillment providers · calculator · markup · carrier services ·- rules — unchanged from the dynamic-carrier-rates work-```--No location-group layer: named origin bundles were considered (2026-08-09) and dropped — per-method ships-from narrowing expresses the multi-origin case ("UPS from the US warehouse, DPD from the EU one") without a third entity, and a group layer can be added additively in 6.1 if merchants outgrow that.--## Runtime flow--1. **Split** — `Stock::Splitter::FulfillmentProfile` (replaces `Splitter::FulfillmentType`) partitions cart contents by each item's resolved profile.-2. **Allocate** — the Coordinator allocates a profile's items only from stock locations the profile covers (its join; empty = all).-3. **Quote** — for a package (profile, origin): candidates are the profile's methods whose ships-from set covers the origin, whose zone is nil or includes the ship address, passing the existing rule/calculator/audience filters; rate providers then fan out (multi-rate carriers untouched).-4. **Derive, never declare twice** — `Product#digital?` ⇐ its profile's methods are all digital-modality; pickupable ⇐ the profile contains a pickup method; the order requires an address ⇐ any item's profile has a method whose provider `requires_address?`.--## Key Decisions (do not deviate without discussion)--- **Profile on the Product, template on the ProductType (2026-08-09).** `fulfillment_profile_id` lives on `spree_products`; ProductType's own `fulfillment_profile_id` is stamped onto products at creation only. This restores the uniform "creation-time template" doctrine that the `fulfillment_types` array violated, and makes a product's shipping behavior inspectable on the product itself.-- **Migration by rename, not by copy (2026-08-09).** `spree_shipping_categories` → `spree_fulfillment_profiles`; `spree_products.shipping_category_id` → `fulfillment_profile_id`. 5.x products arrive assigned; the 5.x "Digital" category becomes the Digital profile. What the rename cannot express is handled by `spree:upgrade:migrate_fulfillment_profiles`: store assignment (5.x categories were global; products are single-owner since 5.5, so each profile goes to the store whose products use it, duplicated + remapped when shared — loudly logged), default-profile flagging ("Default"-named else most-used, else a created "General"), and collapsing `spree_shipping_method_categories` (m:n) into the method's single `fulfillment_profile_id` (unambiguous for one binding; default profile + LOUD warning for several). The m:n table survives to 6.1 solely as that task's source.-- **Modality is a method concern.** `fulfillment_type` on the method is renamed `modality` and means the delivery mechanics (shipping/pickup/digital). The `Spree.fulfillment_types` registry (engine config + `Spree.fulfillment_types` accessors) is deleted outright — unreleased 6.0-dev surface. The vocabulary is `Spree::DeliveryMethod.modalities` (class_attribute, default `%w[shipping pickup digital]`); provider `fulfillment_types` declarations keep their name and mean modalities.-- **`ProductType#fulfillment_types` array is removed** (column + validation) in favor of the template profile reference. Capabilities derive from the profile's methods rather than being declared on the product side.-- **Zones belong to the profile; a method belongs to at most one zone.** The `spree_delivery_method_zones` m:n join is dropped (backfilled to the first zone with a warning on multiples). A method with no zone has no destination restriction.-- **One default profile per store**, enforced like `StockLocation#default` (`ensure_one_default`); undeletable; created by a `Store` `after_create` hook and by seeds/upgrade for existing stores. Non-default profiles are deletable only when no products reference them (model-level guard, per the RBAC axis-B convention).-- **Competitor names never appear in code or comments** — grounding stays in plan documents.--## Migration Path--1. Structural migration (6.0, `[8.1]`): renames + new columns/joins as diagrammed; adds `store_id`/`default`/`position` to the renamed profiles table (nullable until the upgrade task assigns them; `null: false` tightening lands in 6.1); drops `spree_delivery_method_zones` after backfill.-2. `Spree::ShippingCategory` + `Spree::ShippingMethodCategory` classes, deprecated associations (`Product#shipping_category*`, `Variant#shipping_category*`, `DeliveryMethod#shipping_categories*`), factories, permission-catalog subject, and typelizer entry are deleted. The permission catalog gains `Spree::FulfillmentProfile`.-3. `spree:upgrade:migrate_fulfillment_profiles` in the 5.6→6.0 manifest (resumable, anonymous-AR readers for the m:n) performs the judgement work listed above.-4. 6.1: drop `spree_shipping_method_categories`, tighten profile `store_id` constraints.--## Constraints on Current Work--- New delivery features must resolve eligibility through the profile chain — never reintroduce parallel product-side capability arrays.-- Anything reading `fulfillment_type` on methods means modality now; do not overload modality for product segmentation (that is what profiles are for).-- The Store API surface for profiles is read-only derivation (product serializers may expose digital/pickupable); profile management is Admin API only.--## Open Questions--- Whether ships-from narrowing needs promotion to named origin groups (6.1, evidence-first — additive).-- Multi-currency/multi-market interplay: profiles are store-scoped; market-aware profiles deferred to the channels/markets work.--## References--- Supersedes sections of `6.0-fulfillment-and-delivery.md` ("Fulfillment types are a strict registered set", "Named delivery groups"), `6.0-product-types.md` (fulfillment_types array), `6.0-delivery-zones.md` (store-level zone ownership).-- decisions.md 2026-08-09 entries (dynamic carrier rates; fulfillment profiles).-- PR #14404.diff --git a/docs/plans/6.0-integrations-admin.md b/docs/plans/6.0-integrations-admin.mdindex 681cd1213b..c6ecaea3ca 100644--- a/docs/plans/6.0-integrations-admin.md+++ b/docs/plans/6.0-integrations-admin.md@@ -21,7 +21,7 @@ Make `Spree::Integration` the single credential surface for every provider seam- **One credential home.** Provider gems ship an `Spree::Integration` subclass holding credentials in model preferences, plus one or more stateless provider classes that resolve it via `store.integrations.active.find_by(type: ...)`. Providers never store credentials, and no new provider seam may invent its own credential storage (no env-var contracts, no preferences on the provider's host model). Existing exception: the Meilisearch search provider stays on `MEILISEARCH_URL` env config for 6.0 — it is infrastructure shared across stores, not a per-store commerce credential; migrating it is out of scope.- **Explicit registry: `Spree.integrations`.** Engine-defaulted array of class-name strings; gems append in an initializer (`Spree.integrations << 'SpreeEasyPost::Integration'`). Same shape as `Spree.fulfillment_providers` / `Spree.delivery_method_rules`. No descendants-scanning — eager-loading-dependent magic hides intent. `Spree::Integration` validates `type` inclusion against the registry on attribute change.- **Preference schema drives the UI.** `Spree::Integration` includes the existing `Spree::PreferenceSchema` concern. The types-discovery endpoint serves `serialized_preference_schema`; the dashboard renders forms with the existing `PreferencesForm` component. Secrets use `:password`-typed preferences and flow through the existing `Spree::Preferences::Masking` machinery — masked on read (`••••` + last 4), masked-round-trip-guarded on write, exactly as payment method credentials work today.-- **One integration per (store, type)** stays (model validation shipped; this plan adds the backing unique DB index per house rule). Multi-account support is explicitly out of scope — same deferral as `5.7-payment-method-rules.md`'s per-channel credentials grooming note.+- **One integration per (store, type)** stays (model validation shipped; this plan adds the backing unique DB index per house rule). Multi-account support is explicitly out of scope — same deferral as `6.0-payment-method-rules.md`'s per-channel credentials grooming note.- **Admin-only surface.** No store serializer, no storefront exposure, ever. Secret-key access is gated by new `read_integrations` / `write_integrations` scopes; JWT access by CanCanCan on `Spree::Integration`.- **Verify before activate** (resolved 2026-08-06). Saving credentials never runs a network call — partial setups save fine, inactive. Flipping `active: true` runs `can_connect?` and rejects with 422 (`connection_error_message` in the error) on failure. Accepted trade-off: a vendor outage temporarily blocks *going live* (not editing); the explicit `POST /:id/test` endpoint remains for diagnostics at any time.- **Gallery branding is `logo_url` + server-localized `description`** (resolved 2026-08-06). Integration gems declare a class-level `logo_url` — an absolute URL to hosted brand assets, or a `data:` URI for self-contained gems — and a `description` (with `spree.integrations.<api_type>.description` Rails translations winning, so gems localize server-side; dashboard locale files are not extendable by Ruby gems). **Deliberately not asset-pipeline paths**: in the 6.0 split the Rails side is a data API — integration gems shipping browser images would force Propshaft onto headless hosts plus precompile hints and host-URL resolution. Accepted trade-off: hosted logos are a courtesy, not a guarantee (vendor CDNs rot, air-gapped admins) — the dashboard always falls back to a letter avatar, and self-contained gems use data URIs.@@ -95,4 +95,4 @@ No data migration — the table is empty in practice (zero core subclasses exist- Model: `spree/core/app/models/spree/integration.rb`; table: `20250407085228_create_spree_integrations.rb`- Schema/masking machinery: `spree/core/app/models/concerns/spree/preference_schema.rb`, `spree/core/lib/spree/core/preferences/masking.rb`- Types-endpoint precedent: `spree/api/app/controllers/spree/api/v3/admin/payment_methods_controller.rb`-- Related plans: `6.0-delivery-rate-provider.md`, `6.0-fulfillment-and-delivery.md`, `6.0-tax-provider.md`, `5.7-payment-method-rules.md` (multi-account deferral), decisions.md 2026-07-30 (reference providers), 2026-08-06 (EasyPost)+- Related plans: `6.0-delivery-rate-provider.md`, `6.0-fulfillment-and-delivery.md`, `6.0-tax-provider.md`, `6.0-payment-method-rules.md` (multi-account deferral), decisions.md 2026-07-30 (reference providers), 2026-08-06 (EasyPost)diff --git a/docs/plans/5.7-payment-method-rules.md b/docs/plans/6.0-payment-method-rules.mdsimilarity index 98%rename from docs/plans/5.7-payment-method-rules.mdrename to docs/plans/6.0-payment-method-rules.mdindex 83bbcb4a78..be0280bdfb 100644--- a/docs/plans/5.7-payment-method-rules.md+++ b/docs/plans/6.0-payment-method-rules.md@@ -1,8 +1,8 @@# Payment Method Rules**Status:** Draft-**Target:** Spree 5.7-**Depends on:** `6.0-channels-catalogs-b2b.md` (Channel, shipped 5.5), `5.6-6.0-single-store-promotions-payment-methods.md` (single-store PaymentMethod, 5.6), Markets (existing), `5.7-channel-markets.md` (composes, not required)+**Target:** Spree 6.0 (retargeted from 5.7 — the 5.7 release was cut, 5.6 → 6.0; 2026-08-09)+**Depends on:** `6.0-channels-catalogs-b2b.md` (Channel, shipped 5.5), `5.6-6.0-single-store-promotions-payment-methods.md` (single-store PaymentMethod, 5.6), Markets (existing), `6.0-channel-markets.md` (composes, not required)**Author:** Damian + Claude**Last updated:** 2026-07-23@@ -205,7 +205,7 @@ Additive only:## References-- Sibling plan: `docs/plans/5.7-channel-markets.md` (Channel→Markets allowlist; `MarketRule` + a restricted channel compose into "this channel's markets pay this way")+- Sibling plan: `docs/plans/6.0-channel-markets.md` (Channel→Markets allowlist; `MarketRule` + a restricted channel compose into "this channel's markets pay this way")- Superseded rationale: `docs/plans/5.6-6.0-single-store-promotions-payment-methods.md` (Key Decisions — "No Channel/Publication layer")- Pattern references: `spree/core/app/models/spree/promotion_rule.rb`, `spree/core/app/models/spree/promotion/rules/channel.rb`, `spree/core/app/models/spree/price_rules/channel_rule.rb`, `spree/core/app/models/spree/order_routing_rule.rb`- Enforcement seam: `spree/core/app/models/spree/order.rb` (`collect_frontend_payment_methods`), `spree/core/app/services/spree/payments/create.rb`diff --git a/docs/plans/6.0-product-types.md b/docs/plans/6.0-product-types.mdindex 932e7c7ed6..eb9e80ac62 100644--- a/docs/plans/6.0-product-types.md+++ b/docs/plans/6.0-product-types.md@@ -1,6 +1,6 @@# ProductType (Prototype → ProductType)-> **Amendment 2026-08-09 (`6.0-fulfillment-profiles.md`):** `fulfillment_types` on ProductType is removed. The type now carries a `fulfillment_profile_id` **template** stamped onto products at creation — restoring the creation-time-template doctrine this plan established; the array was its only live-by-reference exception. Products reference their profile directly.+> **Amendment 2026-08-09 (`6.0-delivery-profiles.md`):** `fulfillment_types` on ProductType is removed. The type now carries a `delivery_profile_id` **template** stamped onto products at creation — restoring the creation-time-template doctrine this plan established; the array was its only live-by-reference exception. Products reference their profile directly.**Status:** All phases shipped (Phase 2 rescoped and completed 2026-08-06) — see "Implementation status"diff --git a/docs/plans/decisions.md b/docs/plans/decisions.mdindex f425293dff..cc601d0fb2 100644--- a/docs/plans/decisions.md+++ b/docs/plans/decisions.md@@ -59,26 +59,73 @@ never in metadata.Plan: `docs/plans/6.0-consolidate-metadata-columns.md`.+## 2026-08-09: Origin groups and per-currency delivery pricing in 6.0++Two same-day additions to the delivery-profiles model, both Damian-approved+mid-review of PR #14404.++**`Spree::DeliveryOriginGroup` (pulled forward from the 6.1 open+question).** Zones are per-profile (the profile-based platforms' shape;+sharing across profiles was considered and rejected — editing a shared zone+would silently change other profiles' coverage). Within a profile, origin+groups partition the fulfillment origins: every zone and method belongs to+one group, so "same products, different warehouse, different rates" is one+profile with two groups instead of hand-narrowed method duplicates. The+auto-created nameless default group (no members = all locations) keeps the+layer invisible for single-origin stores. The profile ↔ stock-location join+is replaced by group membership (profile coverage = union of its groups);+per-method ships-from narrowing retires for shipping methods, and+`DeliveryMethodStockLocation` stays pickup-only (collection counters).+Admin API: nested origin_groups CRUD under delivery_profiles; the+profile-level `stock_location_ids` shorthand reads/writes the default+group.++**Per-currency delivery pricing (kills method-per-currency).** Amount-based+shipping calculators (FlatRate, PerItem, DigitalDelivery) gain an `amounts`+hash — one explicit amount per currency, no FX, mirroring product prices;+a currency without an amount hides the method for those carts. The legacy+single `amount`+`currency` pair stays as the fallback for its own currency,+so upgraded 5.x stores quote unchanged. Percent calculators are+currency-agnostic and drop the currency gate; PriceSack/FlexiRate keep+strict single-currency matching. The Estimator consults+`calculator.supports_currency?` instead of exact-matching the currency+preference. Carrier quotes: `DeliveryRateProvider::Estimate` gains+`currency`, EasyPost passes the carrier's `rate.currency` through, and the+Estimator drops estimates quoted in another currency than the cart's — a+number in the wrong currency must never reach checkout (EasyPost has no+quote-currency parameter; multi-currency carrier setups use+per-currency carrier accounts). The pricing card renders one amount per+supported store currency; the default currency maps to the legacy amount+preference.+## 2026-08-09: Fulfillment profiles — ShippingCategory promoted, not removedReverses three recorded decisions inside the 6.0 window: "fulfillment typesare NOT a model", "named delivery groups are the 6.1-if-needed successor toprofiles" (both `6.0-fulfillment-and-delivery.md`), and live-by-reference`fulfillment_types` on ProductType (`6.0-product-types.md`). Full design in-`6.0-fulfillment-profiles.md`.--**The model.** `Spree::FulfillmentProfile` — store-scoped, one default per-store — groups products for delivery: profile ↔ stock locations (origins,-empty = all), profile → delivery zones (destinations), profile → delivery-methods (each with a `modality` — the renamed `fulfillment_type` column —-an optional single zone, and optional ships-from narrowing via the-generalized method↔location join). Products carry `fulfillment_profile_id`-directly; ProductType stamps its template profile at creation and never-manages it afterwards. Carts split per profile; capabilities derive-(`digital?`, pickupable, address requirement) from the profile's methods-instead of being declared product-side. A location-group layer was-considered and dropped — per-method narrowing covers multi-origin stores,-and groups can arrive additively later.+`6.0-delivery-profiles.md`.++**The model.** `Spree::DeliveryProfile` — store-scoped STI, one default+per store, kinds registered via `Spree.delivery_profile_types`+(`DeliveryProfiles::Shipping` default, `::Digital`) — groups products+for delivery: profile ↔ stock locations (origins, empty = all), profile →+delivery zones (destinations), profile → delivery methods (each with an+optional single zone and optional ships-from narrowing via the generalized+method↔location join). Products carry `delivery_profile_id` directly;+ProductType stamps its template profile at creation and never manages it+afterwards. Carts split per profile. **Classes only, no string+vocabularies (refined same day):** the method's `fulfillment_type` column+is dropped (not renamed to modality), `Spree.fulfillment_types` and the+ProductType array are deleted; behavior routes through class predicates —+`FulfillmentProvider` subclasses answer `digital?`/`pickup?`/+`pickup_point?`/`requires_address?`, rate providers declare+`requires_address?` instead of type lists, and the profile kind declares+`digital?`/`requires_shipping_address?` and validates composition (a+Digital profile accepts only digital-provider methods; a carrier rate+provider only prices methods that ship to an address). A location-group+layer was considered and dropped — per-method narrowing covers+multi-origin stores, and groups can arrive additively later.**Why reverse now.** No rewrite window after 6.0; custom string types weresecond-class (provider declarations could never include them, so a custom@@ -87,16 +134,15 @@ exist for shipping methods; and the fulfillment_types array was the solelive-by-reference exception to the product-type template doctrine.**Migration by rename.** `spree_shipping_categories` →-`spree_fulfillment_profiles` and `spree_products.shipping_category_id` →-`fulfillment_profile_id`: 5.x products arrive assigned, the 5.x Digital-category becomes the Digital profile. `spree:upgrade:migrate_fulfillment_profiles`-handles what a rename cannot: store assignment for the formerly-global-categories (duplicate + remap when shared), default flagging, and-collapsing the method m:n (`spree_shipping_method_categories`, kept to 6.1-as source) into the single method FK — loud warnings wherever flattening-loses information. The `Spree.fulfillment_types` registry and the-ProductType array are deleted outright; modality vocabulary lives on-`Spree::DeliveryMethod.modalities`.+`spree_delivery_profiles` and `spree_products.shipping_category_id` →+`delivery_profile_id`: 5.x products arrive assigned, the 5.x Digital+category becomes the Digital profile. `spree:migrate_delivery_profiles`+(5.6→6.0 manifest) handles what a rename cannot: store assignment for the+formerly-global categories (duplicate + remap when shared), folding+non-narrowing categories into the store default profile, digital-kind+detection, and collapsing the method m:n+(`spree_shipping_method_categories`, kept to 6.1 as source) into the+single method FK — loud warnings wherever flattening loses information.## 2026-08-09: Dynamic carrier rates — one delivery method, many named rates@@ -894,7 +940,7 @@ certain markets) plus a four-platform review (OSS platform C channel-scopedPaymentMethods + `PaymentMethodEligibilityChecker`, OSS platform A region-scopedpayment providers, OSS platform B per-channel payment apps, the hosted leader's Payment Customization Functions + the May-2026 per-market multi-entity payments product) settled three things:-1. **`5.7-payment-method-rules.md`** — `Spree::PaymentMethodRule` STI+1. **`6.0-payment-method-rules.md`** — `Spree::PaymentMethodRule` STI(Channel / Market / OrderTotal / CustomerGroup rules), mirroring thePromotionRule/PriceRule/OrderRoutingRule house pattern; enforced throughthe single `Order#collect_frontend_payment_methods` seam; storefront-only@@ -902,7 +948,7 @@ payment providers, OSS platform B per-channel payment apps, the hosted leader'sdistribution concept" rationale in`5.6-6.0-single-store-promotions-payment-methods.md` — the single-store FKstands, eligibility is layered on via rules.-2. **`5.7-channel-markets.md`** — optional Channel→Markets allowlist+2. **`6.0-channel-markets.md`** — optional Channel→Markets allowlist(`spree_channel_markets`, empty = all markets), enforced in marketresolution, the Store API markets reference endpoints, and ordervalidation. Composes with `MarketRule` above.@@ -1506,7 +1552,7 @@ maps naturally onto several delivery zones — standard / remote / oversized).Spree already carries a stronger coordination guardrail than the disjointcamp: `MarketCountry#country_covered_by_shipping_zone` refuses marketcountries the store cannot deliver to. The channel axis heads the Saleor-direction separately via `5.7-channel-markets.md`. If more convenience is+direction separately via `6.0-channel-markets.md`. If more convenience isever wanted, it is a dashboard affordance ("create delivery zone from thismarket's countries"), never a schema link.@@ -1548,7 +1594,7 @@ ShippingMethod an eligibility-checker strategy parallel to its calculator.**Decision:** `Spree::DeliveryMethodRule` STI on DeliveryMethod — the fifthinstance of the house rule pattern and the symmetric sibling of-`5.7-payment-method-rules.md` (ItemTotal + Weight first; Channel/Market/+`6.0-payment-method-rules.md` (ItemTotal + Weight first; Channel/Market/CustomerGroup later, in lockstep with the payment set). One enforcementseam: the Estimator's method filter, so calculator- and provider-pricedmethods obey the same eligibility; no admin-bypass concept (the Estimator is@@ -1679,7 +1725,7 @@ domains are deliberately opposite:store.** Two Stripe accounts are two merchants of record (separatesettlement and liability), selected per market at checkout — exactlywhat PaymentMethod rows model, gated by MarketRule once- `5.7-payment-method-rules.md` lands. Credentials stay on the method+ `6.0-payment-method-rules.md` lands. Credentials stay on the methodrow; converging them onto Integration would fight its store+typeuniqueness and is explicitly NOT planned.@@ -1760,7 +1806,7 @@ registered subclasses by matching two hardcoded class namesreturning `[]`. Four families had each worked around that with a privateper-class override in three different idioms (`PriceRule`,`OrderRoutingRule`, `CollectionRule`, `DeliveryMethodRule`), and-`5.7-payment-method-rules.md` specced a fifth. The empty-list fallback+`6.0-payment-method-rules.md` specced a fifth. The empty-list fallbackfailed **silently**: `find_by_api_type` returned nil, so`TypedAssociations` dropped typed rows from a payload with no error and`subclasses_with_preference_schema` rendered empty admin pickers — the@@ -1778,7 +1824,7 @@ PromotionRule, PromotionAction, PriceRule, OrderRoutingRule,CollectionRule, DeliveryMethodRule, and **PaymentMethod** — gatewaysdeclare `registers_subclasses_via { providers }` rather than being aspecial case in the resolver, so there is exactly one resolution rule.-`5.7-payment-method-rules.md` updated to the new form.+`6.0-payment-method-rules.md` updated to the new form.Known debt: the registry is a lodger inside `PreferenceSchema` (which`Spree::Base` includes, so ~200 models carry class methods only six use),diff --git a/docs/v6/developer/how-to/custom-delivery-rate-provider.mdx b/docs/v6/developer/how-to/custom-delivery-rate-provider.mdxindex 8764e3af27..40412563df 100644--- a/docs/v6/developer/how-to/custom-delivery-rate-provider.mdx+++ b/docs/v6/developer/how-to/custom-delivery-rate-provider.mdx@@ -68,6 +68,10 @@ module SpreeAcmeCarrierquotes_for(package).map do |quote|Spree::DeliveryRateProvider::Estimate.new(cost: quote.amount,+ # ISO code of the currency the carrier quoted in. Estimates in a+ # different currency than the cart's are dropped — never convert+ # silently; nil means the store's own currency.+ currency: quote.currency,carrier: quote.carrier_name,service_level: quote.service_name,estimated_delivery_date: quote.delivery_date,diff --git a/packages/admin-sdk/examples/delivery-methods/create.ts b/packages/admin-sdk/examples/delivery-methods/create.tsindex 49e0a8aee0..7921552713 100644--- a/packages/admin-sdk/examples/delivery-methods/create.ts+++ b/packages/admin-sdk/examples/delivery-methods/create.ts@@ -8,7 +8,6 @@ const client = createAdminClient({// region:exampleconst deliveryMethod = await client.deliveryMethods.create({name: 'Express',- fulfillment_type: 'shipping',storefront_visible: true,calculator_type: 'Spree::Calculator::Shipping::FlatRate',calculator_preferences: { amount: 12.5 },diff --git a/packages/admin-sdk/examples/delivery-profiles/create.ts b/packages/admin-sdk/examples/delivery-profiles/create.tsnew file mode 100644index 0000000000..87593210e6--- /dev/null+++ b/packages/admin-sdk/examples/delivery-profiles/create.ts@@ -0,0 +1,16 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+const profile = await client.deliveryProfiles.create({+ name: 'Oversized',+ stock_location_ids: ['sloc_86Rf07xd4z'],+})++// endregion:example++export { profile }diff --git a/packages/admin-sdk/examples/delivery-profiles/delete.ts b/packages/admin-sdk/examples/delivery-profiles/delete.tsnew file mode 100644index 0000000000..5b6325f818--- /dev/null+++ b/packages/admin-sdk/examples/delivery-profiles/delete.ts@@ -0,0 +1,11 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+await client.deliveryProfiles.delete('fp_86Rf07xd4z')++// endregion:examplediff --git a/packages/admin-sdk/examples/delivery-profiles/list.ts b/packages/admin-sdk/examples/delivery-profiles/list.tsnew file mode 100644index 0000000000..f3e836288b--- /dev/null+++ b/packages/admin-sdk/examples/delivery-profiles/list.ts@@ -0,0 +1,13 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+const profiles = await client.deliveryProfiles.list()++// endregion:example++export { profiles }diff --git a/packages/admin-sdk/examples/delivery-profiles/origin-groups-create.ts b/packages/admin-sdk/examples/delivery-profiles/origin-groups-create.tsnew file mode 100644index 0000000000..564609d2e7--- /dev/null+++ b/packages/admin-sdk/examples/delivery-profiles/origin-groups-create.ts@@ -0,0 +1,16 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+const originGroup = await client.deliveryProfiles.originGroups.create('fp_86Rf07xd4z', {+ name: 'EU warehouse',+ stock_location_ids: ['sloc_86Rf07xd4z'],+})++// endregion:example++export { originGroup }diff --git a/packages/admin-sdk/examples/delivery-profiles/update.ts b/packages/admin-sdk/examples/delivery-profiles/update.tsnew file mode 100644index 0000000000..c3c7598574--- /dev/null+++ b/packages/admin-sdk/examples/delivery-profiles/update.ts@@ -0,0 +1,16 @@+import { createAdminClient } from '@spree/admin-sdk'++const client = createAdminClient({+ baseUrl: 'https://your-store.com',+ secretKey: 'sk_xxx',+})++// region:example+const profile = await client.deliveryProfiles.update('fp_86Rf07xd4z', {+ name: 'Oversized freight',+ stock_location_ids: [],+})++// endregion:example++export { profile }diff --git a/packages/admin-sdk/src/admin-client.ts b/packages/admin-sdk/src/admin-client.tsindex e3c0b92954..5500bda57d 100644--- a/packages/admin-sdk/src/admin-client.ts+++ b/packages/admin-sdk/src/admin-client.ts@@ -127,6 +127,8 @@ import type {CustomFieldOwnerType,CustomFieldUpdateParams,DeliveryMethodParams,+ DeliveryOriginGroupParams,+ DeliveryProfileParams,DeliveryZoneParams,DirectUploadCreateParams,ExchangeCreateParams,@@ -229,6 +231,8 @@ import type {CustomFieldDefinition,DeliveryMethod,DeliveryMethodRule,+ DeliveryOriginGroup,+ DeliveryProfile,DeliveryRateProviderOption,DeliveryZone,Discount,@@ -1602,8 +1606,8 @@ export class AdminClient {*/fulfillmentProviders: (options?: RequestOptions,- ): Promise<{ data: FulfillmentProviderOption[]; fulfillment_types: string[] }> =>- this.request<{ data: FulfillmentProviderOption[]; fulfillment_types: string[] }>(+ ): Promise<{ data: FulfillmentProviderOption[] }> =>+ this.request<{ data: FulfillmentProviderOption[] }>('GET','/delivery_methods/fulfillment_providers',options,@@ -1692,6 +1696,96 @@ export class AdminClient {}>('GET', '/delivery_method_rules/types', options),}+ readonly deliveryProfiles = {+ list: (+ params?: ListParams & Record<string, unknown>,+ options?: RequestOptions,+ ): Promise<PaginatedResponse<DeliveryProfile>> =>+ this.request<PaginatedResponse<DeliveryProfile>>('GET', '/delivery_profiles', {+ ...options,+ params: params ? transformListParams(params) : undefined,+ }),++ get: (id: string, options?: RequestOptions): Promise<DeliveryProfile> =>+ this.request<DeliveryProfile>('GET', `/delivery_profiles/${id}`, options),++ create: (+ params: DeliveryProfileParams & { name: string },+ options?: RequestOptions,+ ): Promise<DeliveryProfile> =>+ this.request<DeliveryProfile>('POST', '/delivery_profiles', {+ ...options,+ body: params,+ }),++ /** `stock_location_ids` replaces the profile's full location set. */+ update: (+ id: string,+ params: DeliveryProfileParams,+ options?: RequestOptions,+ ): Promise<DeliveryProfile> =>+ this.request<DeliveryProfile>('PATCH', `/delivery_profiles/${id}`, {+ ...options,+ body: params,+ }),++ /** The default profile and profiles still referenced by products cannot be deleted. */+ delete: (id: string, options?: RequestOptions): Promise<void> =>+ this.request<void>('DELETE', `/delivery_profiles/${id}`, options),++ /** Registered profile kinds (shipping, digital, extension kinds). */+ kinds: (options?: RequestOptions): Promise<{ data: Array<{ type: string; kind: string }> }> =>+ this.request<{ data: Array<{ type: string; kind: string }> }>(+ 'GET',+ '/delivery_profiles/kinds',+ options,+ ),++ /** Origin groups partition a profile's fulfillment origins; its zones and methods each belong to one. */+ originGroups: {+ list: (+ deliveryProfileId: string,+ options?: RequestOptions,+ ): Promise<PaginatedResponse<DeliveryOriginGroup>> =>+ this.request<PaginatedResponse<DeliveryOriginGroup>>(+ 'GET',+ `/delivery_profiles/${deliveryProfileId}/origin_groups`,+ options,+ ),++ create: (+ deliveryProfileId: string,+ params: DeliveryOriginGroupParams,+ options?: RequestOptions,+ ): Promise<DeliveryOriginGroup> =>+ this.request<DeliveryOriginGroup>(+ 'POST',+ `/delivery_profiles/${deliveryProfileId}/origin_groups`,+ { ...options, body: params },+ ),++ update: (+ deliveryProfileId: string,+ id: string,+ params: DeliveryOriginGroupParams,+ options?: RequestOptions,+ ): Promise<DeliveryOriginGroup> =>+ this.request<DeliveryOriginGroup>(+ 'PATCH',+ `/delivery_profiles/${deliveryProfileId}/origin_groups/${id}`,+ { ...options, body: params },+ ),++ /** The last group, or one still holding zones or methods, cannot be deleted. */+ delete: (deliveryProfileId: string, id: string, options?: RequestOptions): Promise<void> =>+ this.request<void>(+ 'DELETE',+ `/delivery_profiles/${deliveryProfileId}/origin_groups/${id}`,+ options,+ ),+ },+ }+readonly deliveryZones = {list: (params?: ListParams & Record<string, unknown>,@@ -1702,8 +1796,16 @@ export class AdminClient {params: params ? transformListParams(params) : undefined,}),- get: (id: string, options?: RequestOptions): Promise<DeliveryZone> =>- this.request<DeliveryZone>('GET', `/delivery_zones/${id}`, options),+ /** Members are expand-gated; pass `{ expand: ['members'] }` to edit a zone. */+ get: (+ id: string,+ params?: { expand?: string[] },+ options?: RequestOptions,+ ): Promise<DeliveryZone> =>+ this.request<DeliveryZone>('GET', `/delivery_zones/${id}`, {+ ...options,+ params: getParams(params),+ }),create: (params: DeliveryZoneParams, options?: RequestOptions): Promise<DeliveryZone> =>this.request<DeliveryZone>('POST', '/delivery_zones', { ...options, body: params }),diff --git a/packages/admin-sdk/src/params.ts b/packages/admin-sdk/src/params.tsindex 109acb4913..c36d2957ab 100644--- a/packages/admin-sdk/src/params.ts+++ b/packages/admin-sdk/src/params.ts@@ -472,6 +472,8 @@ export interface ProductCreateParams {slug?: stringstatus?: 'draft' | 'active' | 'archived'tax_category_id?: string+ /** Fulfillment profile deciding how this product ships (fp_...); null falls back to the store default. */+ delivery_profile_id?: string | nullcategory_ids?: Array<string>/*** Collections this product belongs to. Assigning an automatic collection@@ -498,6 +500,8 @@ export interface ProductUpdateParams {slug?: stringstatus?: 'draft' | 'active' | 'archived'tax_category_id?: string+ /** See `ProductCreateParams.delivery_profile_id`. */+ delivery_profile_id?: string | nullcategory_ids?: Array<string>/** See `ProductCreateParams.collection_ids`. */collection_ids?: Array<string>@@ -1031,8 +1035,8 @@ export interface ProductTypeCustomFieldDefinitionParams {*/export interface ProductTypeCreateParams {name: string- /** Fulfillment types products of this type support (e.g. ['shipping', 'pickup']). */- fulfillment_types?: string[]+ /** Fulfillment profile stamped onto products created with this type (fp_...); null leaves them on the store default. */+ delivery_profile_id?: string | null/*** Option types seeded onto products that get this type. Editing them never* changes existing products — use `applyToProducts` for that.@@ -1052,7 +1056,7 @@ export interface ProductTypeCreateParams {*/export interface ProductTypeUpdateParams {name?: string- fulfillment_types?: string[]+ delivery_profile_id?: string | nulloption_type_ids?: string[]category_ids?: string[]custom_field_definitions?: ProductTypeCustomFieldDefinitionParams[]@@ -1151,6 +1155,8 @@ export interface ChannelCreateParams {* store-level preference.*/preferred_guest_checkout?: boolean | null+ /** Fulfillment-origin allowlist (sloc_...); replaces the full set. Empty means every store location serves this channel. */+ stock_location_ids?: string[]}export interface ChannelUpdateParams {@@ -1169,6 +1175,8 @@ export interface ChannelUpdateParams {* store-level preference.*/preferred_guest_checkout?: boolean | null+ /** Fulfillment-origin allowlist (sloc_...); replaces the full set. Empty means every store location serves this channel. */+ stock_location_ids?: string[]}export interface CustomerGroupUpdateParams {@@ -1711,13 +1719,43 @@ export interface PromotionRuleUpdateParams {customer_ids?: string[]}+/**+ * Creates or updates a delivery profile — the grouping that decides how a+ * set of products ships (origins, zones, methods). `stock_location_ids` is a+ * replace-set; empty means every store location.+ */+export interface DeliveryProfileParams {+ name?: string+ /** Registered profile kind (`shipping`, `digital`, extension kinds); create-only, defaults to shipping. */+ kind?: string+ /** Promotes this profile to the store default; the previous default is demoted. */+ default?: boolean+ position?: number+ /** Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location. */+ stock_location_ids?: string[]+}++/**+ * Creates or updates an origin group — the partition of a profile's+ * fulfillment origins that its zones and methods hang off. `stock_location_ids`+ * is a replace-set; empty means every store location.+ */+export interface DeliveryOriginGroupParams {+ name?: string | null+ position?: number+ /** Prefixed stock location IDs (`sloc_...`); replaces the full set. Empty means every store location. */+ stock_location_ids?: string[]+}+export interface DeliveryMethodParams {name?: stringadmin_name?: string | nullcode?: string | null- /** One of `shipping`, `digital`, `pickup` (see `deliveryMethods.fulfillmentProviders()`). */- fulfillment_type?: stringfulfillment_provider?: string+ /** Delivery profile this method belongs to (fp_...); defaults to the store default profile. */+ delivery_profile_id?: string+ /** Origin group offering this method (og_...); defaults to the zone's group, else the profile's default group. */+ delivery_origin_group_id?: stringpickup_point_provider?: string | null/*** Quoting strategy class name (see `deliveryMethods.rateProviders()`).@@ -1731,13 +1769,11 @@ export interface DeliveryMethodParams {estimated_transit_business_days_max?: number | null/** Prefixed tax category ID (`taxcat_...`), or null to clear. */tax_category_id?: string | null- /** Product type prefixed ID (pt_...); drives fulfillment eligibility. */- product_type_id?: string | null/** Delivery calculator class name (see `deliveryMethods.calculators()`). */calculator_type?: stringcalculator_preferences?: Record<string, unknown>- /** Prefixed delivery zone IDs (`dz_...`); replaces the full set. */- delivery_zone_ids?: string[]+ /** Prefixed delivery zone ID (`dz_...`) narrowing destinations, or null for no restriction. Must belong to the method's profile. */+ delivery_zone_id?: string | null/*** Method-level percentage handling fee added on top of provider-quoted* rates. Ignored for calculator-priced methods.@@ -1783,6 +1819,8 @@ export interface DeliveryZoneMemberParams {export interface DeliveryZoneParams {name?: stringdescription?: string | null+ /** Fulfillment profile this zone belongs to (fp_...); create-only, defaults to the store default profile. */+ delivery_profile_id?: string/** Replaces the zone's full member set atomically. */members?: DeliveryZoneMemberParams[]}diff --git a/packages/admin-sdk/src/types/fulfillment-providers.ts b/packages/admin-sdk/src/types/fulfillment-providers.tsindex 4d6aa32c08..d3ca1b6dd8 100644--- a/packages/admin-sdk/src/types/fulfillment-providers.ts+++ b/packages/admin-sdk/src/types/fulfillment-providers.ts@@ -2,9 +2,9 @@* A registered `Spree::FulfillmentProvider` strategy, as returned by* `GET /delivery_methods/fulfillment_providers`. Providers perform the* mechanics of a fulfillment (dispatch, tracking, cancellation) — which is a- * separate choice from the delivery method's `fulfillment_type`, since one- * type can be handled by several providers (a shipping method might be- * fulfilled manually, or through a carrier integration).+ * separate choice from the method's delivery profile — one profile can+ * hold methods fulfilled manually, by a carrier integration, or over the+ * counter.*/export interface FulfillmentProviderOption {/** Ruby class name, e.g. `Spree::FulfillmentProvider::Pickup`. */@@ -17,8 +17,12 @@ export interface FulfillmentProviderOption {integration_type: string | null/** False when the provider's integration isn't connected for this store — connect it to enable the provider. */available: boolean- /** Fulfillment types this provider handles; empty means any type. */- fulfillment_types: string[]+ /** Whether this provider delivers digitally. */+ digital: boolean+ /** Whether this provider hands goods over at a merchant counter. */+ pickup: boolean+ /** Whether this provider delivers to third-party pickup points. */+ pickup_point: boolean/** Whether fulfillments handled by this provider ship to a customer address. */requires_address: boolean}@@ -42,8 +46,8 @@ export interface DeliveryRateProviderOption {integration_type: string | null/** False when the provider's integration isn't connected for this store — connect it to enable the provider. */available: boolean- /** Fulfillment types this provider can quote; empty means any type. */- fulfillment_types: string[]+ /** Whether this provider quotes real shipments — it can only price methods that ship to an address. */+ requires_address: boolean/** Whether the method's calculator sets the price. False for carrier providers, which quote live rates. */uses_calculator: boolean/**diff --git a/packages/admin-sdk/src/types/generated/Channel.ts b/packages/admin-sdk/src/types/generated/Channel.tsindex 1df2788ca5..76bad0ad9f 100644--- a/packages/admin-sdk/src/types/generated/Channel.ts+++ b/packages/admin-sdk/src/types/generated/Channel.ts@@ -1,4 +1,4 @@-// Typelizer digest 6ff58038e7d89d893e1f1f5c8e0b3792+// Typelizer digest 21d71b45666f721799435a0a933febf4//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -15,6 +15,7 @@ interface Channel {preferred_guest_checkout: boolean | null;created_at: string;updated_at: string;+ stock_location_ids: Array<string>;}export default Channel;diff --git a/packages/admin-sdk/src/types/generated/DeliveryMethod.ts b/packages/admin-sdk/src/types/generated/DeliveryMethod.tsindex 842475f0b2..8e78e0b9cb 100644--- a/packages/admin-sdk/src/types/generated/DeliveryMethod.ts+++ b/packages/admin-sdk/src/types/generated/DeliveryMethod.ts@@ -1,15 +1,17 @@-// Typelizer digest 77ab0e60ed57bdca576bc0d6a3bfa150+// Typelizer digest 9ef69439b55fb8e6c30917c0f1967d4e//// DO NOT MODIFY: This file was automatically generated by Typelizer.-import type {DeliveryMethodService} from '@/types'+import type {DeliveryMethodService, DeliveryMethodRule} from '@/types'interface DeliveryMethod {id: string;name: string;code: string | null;- fulfillment_type: string;estimated_transit_business_days_min: number | null;estimated_transit_business_days_max: number | null;+ digital: boolean;+ pickup: boolean;+ pickup_point: boolean;admin_name: string | null;fulfillment_provider: string;pickup_point_provider: string | null;@@ -22,8 +24,11 @@ interface DeliveryMethod {updated_at: string;deleted_at: string;services: Array<DeliveryMethodService>;+ rules: Array<DeliveryMethodRule>;tax_category_id: string | null;- delivery_zone_ids: Array<string>;+ delivery_profile_id: string;+ delivery_origin_group_id: string | null;+ delivery_zone_id: string | null;stock_location_ids: Array<string>;calculator_type: string | null;calculator_preferences: Record<string, unknown> | null;diff --git a/packages/admin-sdk/src/types/generated/DeliveryOriginGroup.ts b/packages/admin-sdk/src/types/generated/DeliveryOriginGroup.tsnew file mode 100644index 0000000000..31fd5afaa2--- /dev/null+++ b/packages/admin-sdk/src/types/generated/DeliveryOriginGroup.ts@@ -0,0 +1,17 @@+// Typelizer digest 262afc9938a4b818106d39615b3a7546+//+// DO NOT MODIFY: This file was automatically generated by Typelizer.++interface DeliveryOriginGroup {+ id: string;+ name: string | null;+ position: number | null;+ created_at: string;+ updated_at: string;+ delivery_profile_id: string;+ stock_location_ids: Array<string>;+ delivery_zones_count: number;+ delivery_methods_count: number;+}++export default DeliveryOriginGroup;diff --git a/packages/admin-sdk/src/types/generated/DeliveryProfile.ts b/packages/admin-sdk/src/types/generated/DeliveryProfile.tsnew file mode 100644index 0000000000..27e6467c2c--- /dev/null+++ b/packages/admin-sdk/src/types/generated/DeliveryProfile.ts@@ -0,0 +1,23 @@+// Typelizer digest 0fc170e48ff0a4628ddde9fd292d552b+//+// DO NOT MODIFY: This file was automatically generated by Typelizer.++interface DeliveryProfile {+ id: string;+ name: string;+ default: boolean;+ position: number | null;+ created_at: string;+ updated_at: string;+ kind: string;+ digital: boolean;+ offers_pickup: boolean;+ offers_shipping: boolean;+ stock_location_ids: Array<string>;+ origin_groups: Array<{ id: string; name: string | null; position: number | null; stock_location_ids: Array<string> }>;+ products_count: number;+ delivery_methods_count: number;+ delivery_zones_count: number;+}++export default DeliveryProfile;diff --git a/packages/admin-sdk/src/types/generated/DeliveryZone.ts b/packages/admin-sdk/src/types/generated/DeliveryZone.tsindex 6559d40aa4..174bb0fa06 100644--- a/packages/admin-sdk/src/types/generated/DeliveryZone.ts+++ b/packages/admin-sdk/src/types/generated/DeliveryZone.ts@@ -1,4 +1,4 @@-// Typelizer digest 997bd949ef866abcb2dfc0291477a061+// Typelizer digest c562808b8e7f90a0a93e3048aea6463a//// DO NOT MODIFY: This file was automatically generated by Typelizer.import type {DeliveryZoneMember} from '@/types'@@ -10,6 +10,8 @@ interface DeliveryZone {members?: Array<DeliveryZoneMember>;created_at: string;updated_at: string;+ delivery_profile_id: string;+ delivery_origin_group_id: string | null;delivery_method_ids: Array<string>;}diff --git a/packages/admin-sdk/src/types/generated/DeliveryZoneMember.ts b/packages/admin-sdk/src/types/generated/DeliveryZoneMember.tsindex a7f6084505..56e13931ea 100644--- a/packages/admin-sdk/src/types/generated/DeliveryZoneMember.ts+++ b/packages/admin-sdk/src/types/generated/DeliveryZoneMember.ts@@ -1,4 +1,4 @@-// Typelizer digest 8357d6c4cee5abf78c125edd4e951d48+// Typelizer digest a927799f3f86eecbaf3d6e666ce8c2f4//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -9,6 +9,7 @@ interface DeliveryZoneMember {postal_code_from: string | null;postal_code_to: string | null;country_iso: string | null;+ country_name: string | null;state_abbr: string | null;state_name: string | null;created_at: string;diff --git a/packages/admin-sdk/src/types/generated/Product.ts b/packages/admin-sdk/src/types/generated/Product.tsindex 7b4625da28..5d5ac4a092 100644--- a/packages/admin-sdk/src/types/generated/Product.ts+++ b/packages/admin-sdk/src/types/generated/Product.ts@@ -1,4 +1,4 @@-// Typelizer digest 3853e4b436716a36144fad3ea8ed46f0+// Typelizer digest 7d300f0a1e6d9e398126c1a28689880e//// DO NOT MODIFY: This file was automatically generated by Typelizer.import type {Price, PriceHistory, Media, Variant, OptionType, OptionValue, Category, CustomField, Collection, ProductPublication, Channel, ProductType} from '@/types'@@ -40,6 +40,7 @@ interface Product {deleted_at: string | null;created_at: string;updated_at: string;+ delivery_profile_id: string | null;product_type_id: string | null;tax_category_id: string | null;collections?: Array<Collection>;diff --git a/packages/admin-sdk/src/types/generated/ProductType.ts b/packages/admin-sdk/src/types/generated/ProductType.tsindex 67c109506d..aea8250a4e 100644--- a/packages/admin-sdk/src/types/generated/ProductType.ts+++ b/packages/admin-sdk/src/types/generated/ProductType.ts@@ -1,4 +1,4 @@-// Typelizer digest 6967b30120ed76d125c3bf5770b61fae+// Typelizer digest eca9829bc69f9f39b2690f6632e6b73e//// DO NOT MODIFY: This file was automatically generated by Typelizer.import type {ProductTypeCustomFieldDefinition} from '@/types'@@ -7,10 +7,10 @@ interface ProductType {id: string;name: string;translations?: Record<string, Record<string, string | number | null>>;- fulfillment_types: Array<string>;products_count: number;created_at: string;updated_at: string;+ delivery_profile_id: string | null;option_type_ids: Array<string>;category_ids: Array<string>;custom_field_definitions: Array<ProductTypeCustomFieldDefinition>;diff --git a/packages/admin-sdk/src/types/generated/StockLocation.ts b/packages/admin-sdk/src/types/generated/StockLocation.tsindex c7dd5b476a..1f0a3d3a6b 100644--- a/packages/admin-sdk/src/types/generated/StockLocation.ts+++ b/packages/admin-sdk/src/types/generated/StockLocation.ts@@ -1,4 +1,4 @@-// Typelizer digest e8dcf00c900cd785112284de5d9faaa6+// Typelizer digest 5f83b8b40c6ccdfcc5d0941d6fe5f0a2//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -12,6 +12,8 @@ interface StockLocation {country_iso: string | null;country_name: string | null;state_text: string | null;+ pickup_ready_in_minutes: number | null;+ pickup_instructions: string | null;admin_name: string | null;address2: string | null;state_name: string | null;@@ -24,8 +26,6 @@ interface StockLocation {kind: string;pickup_enabled: boolean;pickup_stock_policy: string;- pickup_ready_in_minutes: number | null;- pickup_instructions: string | null;created_at: string;updated_at: string;}diff --git a/packages/admin-sdk/src/types/generated/index.ts b/packages/admin-sdk/src/types/generated/index.tsindex 16f092e1a0..7d680b4b32 100644--- a/packages/admin-sdk/src/types/generated/index.ts+++ b/packages/admin-sdk/src/types/generated/index.ts@@ -1,4 +1,4 @@-// Typelizer digest e56632bcb2e25797d7af9cb4b7e84e9d+// Typelizer digest d30e852b2d7ac8dea87d7faae6c043fb//// DO NOT MODIFY: This file was automatically generated by Typelizer.export type { default as Address } from './Address'@@ -24,6 +24,8 @@ export type { default as Customer } from './Customer'export type { default as DeliveryMethodRule } from './DeliveryMethodRule'export type { default as DeliveryMethod } from './DeliveryMethod'export type { default as DeliveryMethodService } from './DeliveryMethodService'+export type { default as DeliveryOriginGroup } from './DeliveryOriginGroup'+export type { default as DeliveryProfile } from './DeliveryProfile'export type { default as DeliveryRate } from './DeliveryRate'export type { default as DeliveryZoneMember } from './DeliveryZoneMember'export type { default as DeliveryZone } from './DeliveryZone'diff --git a/packages/admin-sdk/src/types/index.ts b/packages/admin-sdk/src/types/index.tsindex 303ac992dc..9caedd7f64 100644--- a/packages/admin-sdk/src/types/index.ts+++ b/packages/admin-sdk/src/types/index.ts@@ -36,6 +36,8 @@ export type { default as CustomField } from './generated/CustomField'export type { default as CustomFieldDefinition } from './generated/CustomFieldDefinition'export type { default as DeliveryMethod } from './generated/DeliveryMethod'export type { default as DeliveryMethodRule } from './generated/DeliveryMethodRule'+export type { default as DeliveryOriginGroup } from './generated/DeliveryOriginGroup'+export type { default as DeliveryProfile } from './generated/DeliveryProfile'export type { default as DeliveryRate } from './generated/DeliveryRate'export type { default as DeliveryZone } from './generated/DeliveryZone'export type { default as DeliveryZoneMember } from './generated/DeliveryZoneMember'diff --git a/packages/cli/src/generated/admin-spec.json b/packages/cli/src/generated/admin-spec.jsonindex 8bace24467..51c1060a22 100644--- a/packages/cli/src/generated/admin-spec.json+++ b/packages/cli/src/generated/admin-spec.json@@ -1 +1 @@-{"info":{"title":"Admin API","contact":{"name":"Spree Commerce","url":"https://spreecommerce.org","email":"[email protected]"},"description":"Spree Admin API v3 - Administrative API for managing products, orders, and store settings.\n\n## Authentication\n\nThe Admin API requires a secret API key passed in the `x-spree-api-key` header.\nSecret API keys can be generated in the Spree admin dashboard.\n\n## Response Format\n\nAll responses are JSON. List endpoints return paginated responses with `data` and `meta` keys.\nSingle resource endpoints return a flat JSON object.\n\n## Resource IDs\n\nEvery resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,\n`variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,\nrequest bodies, and Ransack filters all accept them directly.\n\n## Error Handling\n\nErrors return a consistent format:\n```json\n{\n \"error\": {\n \"code\": \"validation_error\",\n \"message\": \"Validation failed\",\n \"details\": { \"name\": [\"can't be blank\"] }\n }\n}\n```\n","version":"v3"},"paths":{"/api/v3/admin/auth/login":{"post":{"summary":"Login","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Authenticates an admin user and returns a short-lived JWT access token.\nThe rotatable refresh token is set in an HttpOnly cookie — it is not\nincluded in the response body.\n\nThe `provider` field selects the authentication method. When omitted it\ndefaults to `email`, the built-in email/password login.\n\nTo authenticate against a third-party identity provider (Okta, Azure AD,\nGoogle Workspace SSO, a custom JWT issuer, SAML, etc.), send\n`{ \"provider\": \"<your_key>\", ... }` with the fields that provider\nrequires. The endpoint returns the same JWT regardless of which provider\nauthenticated the request. See\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication)\nfor the list of configured providers and their required fields.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"title":"EmailPasswordLogin","description":"Built-in email/password authentication (default when `provider` is omitted).","type":"object","properties":{"provider":{"type":"string","enum":["email"],"default":"email"},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email","password"]},{"title":"ProviderLogin","description":"Provider-dispatched login. The `provider` key selects a configured\nauthentication provider; the remaining fields are forwarded to it.\nRequired fields depend on the provider — see\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication).\n","type":"object","properties":{"provider":{"type":"string","description":"Registered provider key (anything other than `email`).","not":{"enum":["email"]}}},"required":["provider"],"additionalProperties":true}]}}}}}},"/api/v3/admin/auth/refresh":{"post":{"summary":"Refresh token","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Exchanges the HttpOnly refresh-token cookie for a new access JWT and a\nrotated refresh token cookie. No request body or Authorization header\nis required — the cookie alone authenticates the call.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"refresh successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"missing or invalid refresh-token cookie","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/auth/logout":{"post":{"summary":"Logout","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Revokes the refresh-token cookie, effectively logging the admin out.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"logout successful"}}}},"/api/v3/admin/me":{"get":{"summary":"Get current admin user and permissions","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current admin user profile and a serialized list of permissions (CanCanCan rules). The SPA uses these to drive UI permission checks.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current admin user and permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current admin profile","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Self-service update of the signed-in admin's own profile, such as their admin UI display language (`selected_locale`).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"profile updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"selected_locale":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}}},"/api/v3/admin/auth/password_resets":{"post":{"summary":"Request password reset","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Requests a password reset email for an admin user. Always returns `202`\nwhether or not the email matches an account, to prevent enumeration.\n\n`redirect_url` is where the emailed link should point (the reset token\nis appended as a `token` query param). It must match one of the store's\nallowed origins — otherwise it is silently ignored and the server-side\ndefault is used. The email is delivered by Spree itself via the\n`admin_user.password_reset_requested` event; this event is never\nforwarded to webhook endpoints.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"reset requested","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"redirect_url":{"type":"string","description":"Must match an allowed origin of the store; ignored otherwise."}},"required":["email"]}}}}}},"/api/v3/admin/auth/password_resets/{id}":{"patch":{"summary":"Reset password","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Consumes a password reset token (the `token` query param from the\nemailed link), sets the new password, and signs the admin in: the\nresponse carries a JWT access token and the rotatable refresh token is\nset in an HttpOnly cookie. The token is single-use — it invalidates as\nsoon as the password changes.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The reset token from the emailed link","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"password reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"invalid or expired token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"password_confirmation":{"type":"string"}},"required":["password","password_confirmation"]}}}}}},"/api/v3/admin/allowed_origins":{"get":{"summary":"List allowed origins","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the CORS allowlist for the current store. Each entry is a\nbare `scheme://host[:port]` permitted to call the admin API from a\nbrowser. Backs the `Rack::Cors` allowlist and the CSRF boundary of\nthe admin cookie session (see\n`docs/plans/5.5-admin-auth-cookie-refresh.md`).\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[origin_cont]","in":"query","required":false,"description":"Filter by origin (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origins found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AllowedOrigin"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds an origin to the admin CORS allowlist. The value must be a bare\n`scheme://host[:port]` (no path, query, or fragment) and use `http` or\n`https`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"allowed origin created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}},"required":["origin"]}}}}}},"/api/v3/admin/allowed_origins/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Allowed origin ID","schema":{"type":"string"}}],"get":{"summary":"Get an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single allowed origin by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"404":{"description":"allowed origin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing allowed origin.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}}}}}}},"delete":{"summary":"Delete an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an origin from the admin CORS allowlist. After deletion the\nadmin SPA running at that origin will no longer be able to call the\nadmin API from a browser.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"allowed origin deleted"}}}},"/api/v3/admin/api_keys":{"get":{"summary":"List API keys","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns publishable and secret API keys for the current store. Secret keys are listed by `token_prefix` only — the plaintext token is delivered exactly once on create.\n\n**Required scope:** `read_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API keys found","content":{"application/json":{}}}}},"post":{"summary":"Create an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a publishable or secret API key. The plaintext token is included in the response **once** for secret keys; publishable keys expose their token on every read since they are intended for client-side use.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","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":"secret key created — plaintext token returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","key_type"],"properties":{"name":{"type":"string"},"key_type":{"type":"string","enum":["publishable","secret"]},"scopes":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/api_keys/{id}":{"get":{"summary":"Show an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key found","content":{"application/json":{}}}}},"patch":{"summary":"Update an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a key. `key_type` and `scopes` are fixed at creation — to change a key's authority, create a new key and revoke the old one.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key renamed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}}},"delete":{"summary":"Delete an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"API key deleted"}}}},"/api/v3/admin/api_keys/current":{"get":{"summary":"Describe the current API key","tags":["API Keys"],"security":[{"api_key":[]}],"description":"Returns the secret key that authenticated this request, including its live scopes. Useful to confirm a key's real, current authority. Only secret-key principals have a single key to describe.\n\n**Required scope:** none — any key can describe itself (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"current API key","content":{"application/json":{}}}}}},"/api/v3/admin/api_keys/{id}/revoke":{"patch":{"summary":"Revoke an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks the key revoked. Future requests using its token will fail; the row is preserved for audit.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key revoked","content":{"application/json":{}}}}}},"/api/v3/admin/categories":{"get":{"summary":"List categories","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's categories (manual hierarchical taxons; rule-based collections are excluded).\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a category. Nests under the parent when parent_id is given, otherwise creates a top-level category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"category created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}},"required":["name"]}}}}}},"/api/v3/admin/categories/{id}":{"get":{"summary":"Get a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single category by ID.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"404":{"description":"category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}}}}}}},"delete":{"summary":"Delete a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a category and its descendants.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"204":{"description":"category deleted"}}}},"/api/v3/admin/categories/{id}/reposition":{"patch":{"summary":"Reposition a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a category to a new parent and/or index within the tree.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category repositioned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_parent_id":{"type":"string","description":"Prefixed ID of the new parent (omit for top level)"},"new_position":{"type":"integer","description":"0-based index among the new parent's children"}},"required":["new_position"]}}}}}},"/api/v3/admin/categories/{category_id}/products":{"get":{"summary":"List category products","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products classified under the category, ordered by their classification position.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Classifies a product under the category (appended to the end).\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/categories/{category_id}/products/{id}":{"delete":{"summary":"Remove a product from a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the category's manual classification.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/categories/{category_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a category product","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the category's products.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the category's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/channels":{"get":{"summary":"List channels","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channels configured for the current store.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"channels found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new channel on the current store. `code` is normalized to a\nURL-safe slug (`Point of Sale` → `point-of-sale`); when omitted it's\nderived from `name`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"channel created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"code":{"type":"string","description":"Slug — auto-derived from `name` when blank."},"active":{"type":"boolean","default":true},"default":{"type":"boolean","default":false},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}}},"/api/v3/admin/channels/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel found","content":{"application/json":{}}}}},"patch":{"summary":"Update a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}},"delete":{"summary":"Delete a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"channel deleted"}}}},"/api/v3/admin/channels/{id}/add_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Publish products on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the listed products on this channel. Idempotent — re-publishing\nan already-published product updates its publication window. Products from\nsibling stores are silently dropped.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}},"published_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications go live. `null` means immediately."},"unpublished_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications come down. `null` means never."}}}}}}}},"/api/v3/admin/channels/{id}/remove_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Unpublish products from a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes the listed products from this channel.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List order routing rules for a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channel's routing rules in priority order. The rules engine walks them top-down; see the Order Routing guide.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create an order routing rule on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a rule to the channel's routing list. The `type` is the wire shorthand from `GET /order_routing_rules/types` (e.g. `preferred_location`). Omitting `position` appends the rule at the end of the list. Each rule kind can appear at most once per channel — a duplicate `type` is rejected with a validation error.\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"rule created","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules/{id}":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a rule's `active` flag, `position` (the list reorders around it), or `preferences`. The rule kind cannot be changed — delete and re-create instead.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/order_routing_rules/types":{"get":{"summary":"List available order routing rule types","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels, descriptions and preference schemas — drives the \"Add rule\" picker in the admin dashboard. Plugins extend the list by registering `Spree::OrderRoutingRule` subclasses via `Spree.order_routing.rules`.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/custom_field_definitions":{"get":{"summary":"List custom field definitions","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all defined custom fields. Filter by `?q[resource_type_eq]=Spree::Product` to narrow to one parent type.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definitions returned","content":{"application/json":{}}}}},"post":{"summary":"Create a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","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":"definition created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["key","field_type","resource_type"],"properties":{"namespace":{"type":"string","description":"Defaults to `custom`"},"key":{"type":"string"},"label":{"type":"string","description":"Human-readable name; defaults to titleized `key`"},"field_type":{"type":"string","description":"Custom field type identifier (one of the registered field-type class names)."},"resource_type":{"type":"string","description":"Owner class, e.g. `Spree::Product`"},"storefront_visible":{"type":"boolean","description":"When false, definition is admin-only (was `display_on: back_end`)"},"searchable":{"type":"boolean","description":"When true, values are included in storefront product text search"},"sortable":{"type":"boolean","description":"When true, storefront product listings can sort by this field"}}}}}}}},"/api/v3/admin/custom_field_definitions/{id}":{"get":{"summary":"Show a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","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,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definition found","content":{"application/json":{}}}}},"patch":{"summary":"Update a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"definition updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the definition and cascades to all custom field values referencing it.\n\n**Required scope:** `write_settings` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"definition deleted"}}}},"/api/v3/admin/customer_groups":{"get":{"summary":"List customer groups","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer groups configured for the current store. Groups\nsegment customers for targeted promotions (see the `customer_group`\npromotion rule) and reporting. The list endpoint never embeds the\nmember list — fetch a single group with `?expand=customers` if you\nneed them inline, or query `/admin/customers?customer_group_id_in=…`\nfor paginated membership.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer group in the current store. `customer_ids` is\noptional; when present, customers are attached at create time.\nPass prefixed IDs (e.g. `cus_…`) — the server decodes them\nautomatically.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","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":"customer group created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customer_groups/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Customer group prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single customer group. Pass `?expand=customers` to embed\nthe full member list inline (recommended only for single-record\nreads — embed cost scales with membership size).\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `customers`.","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer group with embedded customers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"404":{"description":"customer group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, description, or membership. `customer_ids` is a\nfull-set replacement — the server reconciles the membership to\nmatch the array, adding new IDs and removing ones not present.\nSend `customer_ids: []` to clear all members.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer group updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the group. Member users are not deleted; their `customer_group_users` rows are dropped.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer group deleted"}}}},"/api/v3/admin/customers/{customer_id}/addresses":{"get":{"summary":"List customer addresses","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved addresses.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., country, state). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., first_name,last_name,address1,city). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"addresses found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new address to the customer's address book. Pass `is_default_billing: true` or `is_default_shipping: true` to set as the default — the previous default loses its flag in the same transaction.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"address created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_iso":{"type":"string","description":"ISO-2 country code (e.g. US)"},"state_abbr":{"type":"string","description":"State/province abbreviation (e.g. NY)"},"phone":{"type":"string"},"company":{"type":"string"},"label":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}}},"/api/v3/admin/customers/{customer_id}/addresses/{id}":{"patch":{"summary":"Update a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a customer address.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"address updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"city":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the address. If it was a default, the customer loses that default (no auto-promotion).\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"address deleted"}}}},"/api/v3/admin/customers/{customer_id}/credit_cards":{"get":{"summary":"List customer credit cards","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved credit cards. Useful for off-session admin charges via `POST /admin/orders/:id/payments { source_id }`.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit cards found","content":{"application/json":{}}}}}},"/api/v3/admin/customers/{customer_id}/credit_cards/{id}":{"get":{"summary":"Show a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a saved credit card by ID.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit card found","content":{"application/json":{}}}}},"delete":{"summary":"Delete a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a saved credit card.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"credit card deleted"}}}},"/api/v3/admin/customers/{customer_id}/store_credits":{"get":{"summary":"List customer store credits","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns store credits issued to the customer.\n\n**Required scope:** `read_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., category, store, created_by). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,amount_used,memo,currency). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credits found","content":{"application/json":{}}}}},"post":{"summary":"Issue a store credit to a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"`created_by` is set automatically from the authenticated admin.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"store credit created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount","currency","category_id"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"},"category_id":{"type":"string","description":"StoreCreditCategory ID"},"memo":{"type":"string"}}}}}}}},"/api/v3/admin/customers/{customer_id}/store_credits/{id}":{"patch":{"summary":"Update a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Update memo / category / amount. The amount can only be changed if `amount_used == 0`.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"store credit updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"category_id":{"type":"string"},"memo":{"type":"string"}}}}}}},"delete":{"summary":"Delete a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused store credit (amount_used == 0). Returns 422 otherwise.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"store credit deleted"}}}},"/api/v3/admin/customers":{"get":{"summary":"List customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of customers. Supports Ransack search/filters.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[search]","in":"query","required":false,"description":"Email + name full-text-ish search","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., addresses, store_credits). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customers found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer. No welcome email is sent automatically.\n\n**Required scope:** `write_customers` (for API-key authentication).","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":"customer created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}}},"/api/v3/admin/customers/{id}":{"get":{"summary":"Show a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full customer details including computed order stats (orders_count, total_spent, last_order_completed_at).\n\n**Required scope:** `read_customers` (for API-key authentication).","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":"Customer ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations: addresses, orders, store_credits, default_billing_address, default_shipping_address","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer found","content":{"application/json":{}}}}},"patch":{"summary":"Update a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates customer attributes. `tags` replaces the full set.\n\n**Required scope:** `write_customers` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}},"delete":{"summary":"Delete a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a customer. Returns 422 if the customer has any orders.\n\n**Required scope:** `write_customers` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer deleted"}}}},"/api/v3/admin/customers/bulk_add_to_groups":{"post":{"summary":"Bulk-add customers to groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each customer in `ids` to every group in `customer_group_ids`.\nIdempotent — customers already in a group are skipped server-side.\nGroups from sibling stores are silently ignored. Returns counts of\ncustomers and groups that were processed (post store-scoping).\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers added to groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_from_groups":{"post":{"summary":"Bulk-remove customers from groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each customer in `ids` from every group in `customer_group_ids`.\nNo-op for non-members. Groups from sibling stores are silently ignored.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers removed from groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_add_tags":{"post":{"summary":"Bulk-add tags to customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every customer in `ids`. Tags are\nupserted by name; re-adding an existing tag is a no-op.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag name in `tags` from every customer in `ids`. No-op\nfor customers that don't carry the tag.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/exports":{"get":{"summary":"List exports","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV exports queued or completed for the current store. Polled by the admin SPA to detect when an export finishes (`done: true`).\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"exports found","content":{"application/json":{}}}}},"post":{"summary":"Create an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV export. The `type` selects the dataset; `search_params` is an\noptional Ransack query (same shape used by the `q[...]` params on list endpoints)\nthat filters which records are exported. Pass `record_selection: \"all\"` to\nclear the filter server-side and export everything in scope.\n\nGeneration is asynchronous. Poll `GET /admin/exports/{id}` until `done` is `true`,\nthen redirect the browser to `download_url` to fetch the file.\n\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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":"export queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["products","orders","customers","product_translations","gift_cards","coupon_codes","newsletter_subscribers"]},"record_selection":{"type":"string","enum":["filtered","all"],"description":"Set to \"all\" to ignore search_params and export everything in scope."},"search_params":{"type":"object","description":"Ransack query hash. Same predicates accepted by the list endpoint.","additionalProperties":true},"results_url":{"type":"string","description":"Absolute URL of your admin exports view; the export-done email uses it as the download button target. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/exports/{id}":{"get":{"summary":"Show an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns export status. While `done` is `false`, the SPA continues polling.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"export found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the export and purges its attachment.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"export deleted"}}}},"/api/v3/admin/exports/{id}/download":{"get":{"summary":"Download an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the exported CSV with `Content-Disposition: attachment`. Returns 422 with `code: export_not_ready` while `done` is still `false`. The endpoint is JWT/API-key protected, so SPA clients must fetch it (with `Authorization` header) and trigger the browser download via a Blob URL — a top-level navigation cannot carry the JWT.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments":{"get":{"summary":"List fulfillments","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all shipments for an order.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillments found","content":{"application/json":{}}}}},"post":{"summary":"Create a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually creates a fulfillment on a completed order, bypassing order routing — for example to mirror a shipment handled by an external carrier or 3PL. Moves the requested line item quantities out of their current fulfillments; when `items` is omitted, every not-yet-shipped unit is moved. Pass `status: 'shipped'` to register an already-shipped fulfillment (fires shipped webhooks and freezes cost/carrier). When `delivery_method_id` is omitted, the fulfillment inherits the delivery method and cost of the source fulfillment(s) it fully drains — keeping the order total unchanged; partially drained splits get no carrier when shipped, and pending fulfillments are otherwise (re)priced by the standard rate engine, which selects the lowest-cost available rate. Pass `cost` to set an explicit shipping cost instead (e.g. the 3PL price) — note this changes the order total and payment state, and is guaranteed to persist only with `status: 'shipped'` (pending fulfillments are re-priced by the rate engine).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fulfillment created","content":{"application/json":{}}},"422":{"description":"order not completed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stock_location_id"],"properties":{"stock_location_id":{"type":"string","description":"Stock location the fulfillment ships from"},"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link — a full URL is served back as tracking_url unchanged instead of being templated into the delivery method tracking URL"},"delivery_method_id":{"type":"string","description":"Delivery method (carrier) to attach as the selected rate. Defaults to the delivery method of the fully drained source fulfillment(s)"},"cost":{"type":"string","description":"Explicit shipping cost. Defaults to the summed cost of the fully drained source fulfillment(s), which keeps the order total unchanged; an explicit cost changes the order total and payment state. Guaranteed to persist only with status: 'shipped' — pending fulfillments are re-priced by the rate engine"},"status":{"type":"string","enum":["shipped"],"description":"Pass 'shipped' to register the fulfillment as already shipped"},"items":{"type":"array","description":"Line item quantities to fulfill. Omit to fulfill every not-yet-shipped unit.","items":{"type":"object","required":["item_id","quantity"],"properties":{"item_id":{"type":"string","description":"Line item ID"},"quantity":{"type":"integer"}}}},"metadata":{"type":"object","additionalProperties":true}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}":{"get":{"summary":"Show a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific shipment.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment found","content":{"application/json":{}}}}},"patch":{"summary":"Update a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a fulfillment (tracking, delivery rate).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link served back as tracking_url unchanged"},"selected_delivery_rate_id":{"type":"string","description":"Delivery rate ID (dr_...) to select"}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill":{"patch":{"summary":"Fulfill a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks a fulfillment as fulfilled.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment fulfilled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":{"patch":{"summary":"Cancel a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment canceled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":{"patch":{"summary":"Resume a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a canceled fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":{"patch":{"summary":"Split a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Transfers items from this shipment to a new shipment at a different stock location.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment split","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"stock_location_id":{"type":"string","description":"Target stock location ID"}}}}}}}},"/api/v3/admin/gift_card_batches":{"get":{"summary":"List gift card batches","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift card batches issued by the current store. Each batch\ngroups the cards generated together for a campaign or bulk-issuance\n— the cards themselves live under `/admin/gift_cards` and reference\nthe batch via `gift_card_batch_id`.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page","schema":{"type":"integer"}},{"name":"q[prefix_cont]","in":"query","required":false,"description":"Filter by prefix (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batches found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardBatch"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a batch of gift cards in a single call. The server generates\n`codes_count` cards inline for small batches (configurable via\n`Spree.config.gift_card_batch_web_limit`, default 500) or enqueues\na background job for larger ones. Each card's code is the batch\n`prefix` followed by random hex.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","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":"gift card batch created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prefix","amount","codes_count"],"properties":{"prefix":{"type":"string","description":"Lowercased and prepended to every generated code."},"amount":{"type":"string","description":"Decimal amount per card, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"codes_count":{"type":"integer","description":"Number of cards to generate. Capped at `gift_card_batch_limit`."},"expires_at":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/gift_card_batches/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card batch prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single batch.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batch found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"404":{"description":"gift card batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/gift_cards":{"get":{"summary":"List gift cards","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift cards issued by the current store. Filter by\n`q[code_cont]` for code search, `q[user_id_eq]` for cards issued\nto a specific customer, or `q[state_eq]` for status filtering.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[code_cont]","in":"query","required":false,"description":"Filter by gift card code (contains)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by status (active, redeemed, partially_redeemed, canceled)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift cards found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a gift card scoped to the current store. The code is\nauto-generated when omitted. `currency` defaults to the store's\nconfigured currency. Pass `user_id` (prefixed ID) to attach the\ncard to a specific customer.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","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":"gift card created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"string","description":"Decimal amount, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"code":{"type":"string","description":"Optional caller-supplied code. Auto-generated when omitted."},"expires_at":{"type":"string","description":"ISO 8601 date.","nullable":true},"user_id":{"type":"string","description":"Optional customer prefixed ID.","nullable":true}}}}}}}},"/api/v3/admin/gift_cards/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single gift card.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"404":{"description":"gift card not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an active gift card's editable attributes. Redeemed or\npartially-redeemed cards cannot be edited.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"expires_at":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused gift card. Cards that have been redeemed or\npartially redeemed cannot be deleted and return 422.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"gift card deleted"},"422":{"description":"redeemed gift card cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/imports":{"get":{"summary":"List imports","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV imports queued or completed for the current store.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"imports found","content":{"application/json":{}}}}},"post":{"summary":"Create an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV import. Upload the file first via `POST /api/v3/admin/direct_uploads`\nand pass the returned `signed_id` as `attachment`. On success the import is in the\n`mapping` state and the response carries the mapping payload: `schema_fields`\n(the canonical columns for the type), `csv_headers`, a `sample_row`, and the\nauto-assigned `mappings`.\n\nAdjust mappings if needed, then call `PATCH /admin/imports/{id}/complete_mapping`\nto start processing. Poll `GET /admin/imports/{id}` while `status` is\n`completed_mapping`/`processing`; terminal statuses are `completed` and `failed`.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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":"import created in mapping state","content":{"application/json":{}}},"422":{"description":"unknown import type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type","attachment"],"properties":{"type":{"type":"string","enum":["products","customers","product_translations"]},"attachment":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."},"preferred_delimiter":{"type":"string","enum":[",",";","|","\t"],"description":"CSV column separator. Defaults to a comma."},"results_url":{"type":"string","description":"Absolute URL of your admin imports view; the import-done email links back to it with `?import=<id>` appended. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/imports/template":{"get":{"summary":"Download an import template","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a CSV header row for the given import type, including the custom field columns available for the model.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"200":{"description":"CSV template","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/example":{"get":{"summary":"Download an example import file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Redirects to a populated example CSV for the given import type — the same sample data `rake spree:load_sample_data` uses, pinned to the installed Spree version. Returns 404 for a type that ships no example file.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to the example CSV"}}}},"/api/v3/admin/imports/{id}":{"get":{"summary":"Show an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns import status and row counters. The admin dashboard polls this endpoint while `status` is `completed_mapping` or `processing`; `rows_count`, `completed_rows_count` and `failed_rows_count` drive the progress bar. The mapping payload (`csv_headers`, `sample_row`) is only present while `status` is `mapping`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"import found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the import, its rows and the uploaded file. Returns 422 while the import is being processed.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"import deleted"}}}},"/api/v3/admin/imports/{id}/download":{"get":{"summary":"Download the originally uploaded file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the CSV exactly as it was uploaded — the audit trail for what was imported. JWT/API-key protected; SPA clients fetch it with the Authorization header and trigger the browser download via a Blob URL.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/{id}/complete_mapping":{"patch":{"summary":"Complete mapping and start processing","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the submitted column mappings, then starts row processing. Omit `mappings`\nto accept the auto-assigned ones from the create response. Returns 422 when a\nrequired schema field is left unmapped (`details.missing_required_fields`) or a\nfile column is assigned twice.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"mapping completed, processing queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mappings":{"type":"array","description":"Column assignments to apply before starting. `file_column: null` unmaps a field.","items":{"type":"object","required":["schema_field"],"properties":{"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/imports/{id}/retry_failed_rows":{"patch":{"summary":"Retry failed rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-processes the rows that failed. The import re-enters `processing`; poll `GET /admin/imports/{id}` until it completes again. Returns 422 when the import is not `completed` or has no failed rows.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"retry queued","content":{"application/json":{}}}}}},"/api/v3/admin/imports/{import_id}/rows":{"get":{"summary":"List import rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Paginated rows of an import — the failure report. Filter with `q[status_eq]=failed` to list only rows that could not be imported; each row carries the raw CSV `data` and its `validation_errors`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter rows by status: pending, processing, completed, failed.","schema":{"type":"string"}}],"responses":{"200":{"description":"rows found","content":{"application/json":{}}}}}},"/api/v3/admin/markets":{"get":{"summary":"List markets","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the markets configured for the current store. Markets are\nstore-scoped and ordered by `position` (an `acts_as_list` column —\nupdate the order via `PATCH /markets/{id}` with `position`).\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `countries`.","schema":{"type":"string"}}],"responses":{"200":{"description":"markets found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new market for the current store.\n\n- `country_isos` accepts 2-letter ISO country codes (e.g. `[\"DE\", \"FR\"]`);\n the market must contain at least one country. Unknown codes are\n silently dropped.\n- `supported_locales` accepts an array of locale codes; the\n `default_locale` is always implicitly included.\n- Setting `default: true` automatically demotes the previous default\n market in the store.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"market created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code."},"default_locale":{"type":"string","description":"IETF locale tag used as the market default."},"supported_locales":{"type":"array","items":{"type":"string"},"description":"Locale codes available in this market. The default is always implicitly included."},"tax_inclusive":{"type":"boolean","default":false,"description":"Display prices with tax included."},"default":{"type":"boolean","default":false,"description":"Setting to true demotes the previous default."},"position":{"type":"integer","description":"Sort order within the store; lower = first."},"country_isos":{"type":"array","items":{"type":"string"},"description":"2-letter ISO country codes assigned to this market. At least one is required."}},"required":["name","currency","default_locale","country_isos"]}}}}}},"/api/v3/admin/markets/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"market found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"404":{"description":"market not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing market. Pass `country_isos` to replace the\nmarket's country list (full-set update), `supported_locales` to\nreplace the supported locales, or `position` to reorder the market\nwithin the store.\n\nSetting `default: true` automatically demotes the previous default.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"market updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"supported_locales":{"type":"array","items":{"type":"string"}},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer"},"country_isos":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the market (sets `deleted_at`). The default market and\nthe last remaining market in a store cannot be deleted — both return\n422 with a `validation_error`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"market deleted"},"422":{"description":"cannot delete default or last market","content":{"application/json":{}}}}}},"/api/v3/admin/option_types":{"get":{"summary":"List option types","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of option types.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new option type. Supports nested option values.\n\nOption values can be provided inline and will be created or updated by name.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"option type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}},"required":["name","label"]}}}}}},"/api/v3/admin/option_types/{id}":{"get":{"summary":"Get an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single option type by ID, including its option values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"404":{"description":"option type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an option type. Supports updating nested option values.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"200":{"description":"option type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Existing option value ID to update"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an option type.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"204":{"description":"option type deleted"}}}},"/api/v3/admin/orders/{order_id}/tax_lines":{"get":{"summary":"List tax lines","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed tax rows on the order. Read-only — written exclusively by the tax provider.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"tax lines found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/discounts":{"get":{"summary":"List discounts","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed discount rows (promotion-sourced and manual) on the order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"discounts found","content":{"application/json":{}}}}},"post":{"summary":"Create manual discount","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual discount. With line_item_id a single row is created; without it the amount is distributed across line items (largest remainder). This is the sanctioned post-placement discount path and works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"discount created","content":{"application/json":{}}},"422":{"description":"invalid discount","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"},"value_type":{"type":"string","enum":["flat","percent"]},"line_item_id":{"type":"string","nullable":true,"description":"Target line item; omit to distribute order-level"}},"required":["label","value"]}}}}}},"/api/v3/admin/orders/{order_id}/fees":{"post":{"summary":"Create fee","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a fee (surcharge, handling, gift wrap, COD, payment fee). Order-level when no target is given. Works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fee created","content":{"application/json":{}}},"422":{"description":"invalid fee","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number"},"kind":{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment"],"description":"Defaults to 'surcharge'"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true}},"required":["label","amount"]}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards":{"post":{"summary":"Apply a gift card to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies a gift card by code to the order. Returns the gift card.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"gift card applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Gift card code"}}}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards/{id}":{"delete":{"summary":"Remove a gift card from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the gift card from the order.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Gift card ID","schema":{"type":"string"}}],"responses":{"204":{"description":"gift card removed"}}}},"/api/v3/admin/orders/{order_id}/items":{"get":{"summary":"List order items","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all line items for an order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"items found","content":{"application/json":{}}}}},"post":{"summary":"Add an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new line item to the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"item added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Prefixed variant ID"},"quantity":{"type":"integer","default":1}}}}}}}},"/api/v3/admin/orders/{order_id}/items/{id}":{"get":{"summary":"Show an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific line item.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"item found","content":{"application/json":{}}}}},"patch":{"summary":"Update an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order item quantity or metadata.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"200":{"description":"item updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer"}}}}}}},"delete":{"summary":"Remove an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an item from the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"204":{"description":"line item removed"}}}},"/api/v3/admin/orders/{order_id}/store_credits":{"post":{"summary":"Apply customer's store credit to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the order customer's available store credit. When `amount` is omitted, applies up to the order outstanding balance.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"store credit applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","description":"Optional explicit amount; defaults to order outstanding balance"}}}}}}},"delete":{"summary":"Remove store credit from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes any applied store credit from the order.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"store credit removed"}}}},"/api/v3/admin/orders":{"get":{"summary":"List orders","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of orders for the current store.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., created_at, -created_at, completed_at)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by state (cart, address, delivery, payment, confirm, complete, canceled)","schema":{"type":"string"}},{"name":"q[email_cont]","in":"query","required":false,"description":"Filter by email (contains)","schema":{"type":"string"}},{"name":"q[number_eq]","in":"query","required":false,"description":"Filter by order number","schema":{"type":"string"}},{"name":"q[completed_at_gt]","in":"query","required":false,"description":"Filter by completed after date","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"orders found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft order in one shot. Customer, items, addresses, currency,\nmarket, channel, locale, notes, metadata, and a coupon code can all be\nprovided inline.\n\nSetting `preferred_stock_location_id` pins the order's preferred fulfillment\nlocation — Order Routing's built-in `PreferredLocation` rule consumes it\nwhen picking which stock location ships each shipment.\n\nInvalid coupon codes are non-fatal — the order is created and the failure\nis reported on the service result (not in the API response body for now).\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"order created with preferred_stock_location_id","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_id":{"type":"string","description":"Customer ID. Alias: user_id (legacy)."},"use_customer_default_address":{"type":"boolean","description":"When true with customer_id, copies the customer's saved billing/shipping addresses onto the order."},"currency":{"type":"string"},"market_id":{"type":"string","description":"Market ID"},"channel_id":{"type":"string","description":"Channel ID. Defaults to the store primary channel when omitted."},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Order Routing's built-in PreferredLocation rule reads this and ranks the location first; routing falls back to the next rule when the preferred location can't cover the cart."},"locale":{"type":"string"},"customer_note":{"type":"string","description":"Public, customer-visible note"},"internal_note":{"type":"string","description":"Staff-only note"},"metadata":{"type":"object","description":"Arbitrary key/value metadata"},"shipping_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"shipping_address_id":{"type":"string","description":"Existing customer address ID"},"billing_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"billing_address_id":{"type":"string","description":"Existing customer address ID"},"items":{"type":"array","items":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}},"coupon_code":{"type":"string","description":"Optional. Applied non-fatally; invalid codes do not block creation."}}}}}}}},"/api/v3/admin/orders/{id}":{"get":{"summary":"Show an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full order details including admin-only fields.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID (e.g., or_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"order found","content":{"application/json":{}}},"404":{"description":"order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order. Supports updating email, addresses, special instructions, and line items.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_note":{"type":"string"},"internal_note":{"type":"string"},"channel_id":{"type":"string","description":"Channel ID"},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Re-runs Order Routing's PreferredLocation rule on subsequent shipment rebuilds."},"ship_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"bill_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}}}}}}}},"delete":{"summary":"Delete a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a draft order. Completed orders cannot be deleted.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"order deleted"}}}},"/api/v3/admin/orders/{id}/complete":{"patch":{"summary":"Complete an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Completes an order in the `confirm` state, marking it as placed.\n\nSet `notify_customer: true` to send the order confirmation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order completed","content":{"application/json":{}}},"422":{"description":"order cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order confirmation email after completion."}}}}}}}},"/api/v3/admin/orders/{id}/cancel":{"patch":{"summary":"Cancel an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a completed order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order canceled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/approve":{"patch":{"summary":"Approve an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Approves an order (e.g., for fraud review).\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order approved","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resume":{"patch":{"summary":"Resume a canceled order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a previously canceled order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resend_confirmation":{"post":{"summary":"Resend confirmation email","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the order.completed event to trigger confirmation email delivery.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"confirmation resent","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods":{"get":{"summary":"List payment methods","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's configured payment methods. Use `source_required: true` to know which methods need a saved source.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment methods found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/types":{"get":{"summary":"List available payment provider types","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a \"Provider\" dropdown in admin UIs.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"provider types found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/{id}":{"get":{"summary":"Show a payment method","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a payment method by ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","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,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment method found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments":{"get":{"summary":"List payments","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all payments for an order.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payments found","content":{"application/json":{}}}}},"post":{"summary":"Create a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new payment for the order.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"payment created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_method_id"],"properties":{"payment_method_id":{"type":"string","description":"Payment method ID"},"amount":{"type":"string"},"source_id":{"type":"string","description":"Payment source ID"}}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}":{"get":{"summary":"Show a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific payment.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/capture":{"patch":{"summary":"Capture a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Captures a pending payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment captured","content":{"application/json":{}}},"422":{"description":"capture failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/void":{"patch":{"summary":"Void a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Voids a payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment voided","content":{"application/json":{}}}}}},"/api/v3/admin/price_lists":{"get":{"summary":"List price lists","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the price lists configured for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `price_rules`.","schema":{"type":"string"}}],"responses":{"200":{"description":"price lists found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceList"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft price list.\n\n**Required scope:** `write_products` (for API-key authentication).","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":"price list created (server-to-server — rules + prices, no product_ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids to seed the list with."},"rules":{"type":"array","description":"STI-typed price rules to attach on create. Existing rules on the same payload via PATCH reconcile by id.","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Server-to-server alternative to `product_ids`: ship the exact per-variant prices the list should contain. Each row upserts on the unique key `(variant_id, currency, price_list_id)`. Mix-and-match with `product_ids` is supported but typically unnecessary — `prices` alone tells the server which variants belong to the list and what the override amount is.","items":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/price_lists/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"404":{"description":"price list not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a price list. The optional `rules:` array reconciles nested\nSTI-typed price rules in a single round-trip — existing rules update\nby `id`, new rules build, missing rules destroy. Mirrors the\npromotion editor's \"save the whole thing on Save\" pattern.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list updated with nested rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids — reconciles list membership (adds + removes)."},"rules":{"type":"array","items":{"type":"object","required":["type"],"properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Individual price overrides (the spreadsheet payload). Each row updates by `id` if shipped, otherwise upserts on the unique key `(variant_id, currency, price_list_id)`.","items":{"type":"object","oneOf":[{"required":["id"]},{"required":["variant_id","currency"]}],"properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}},"delete":{"summary":"Delete a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price list. Associated prices are removed asynchronously.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price list deleted"}}}},"/api/v3/admin/price_lists/{id}/activate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Activate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Transitions a draft / inactive list to `active`. If `starts_at` is\nin the future the list is marked `scheduled` instead, matching the\nlegacy admin behaviour.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/price_lists/{id}/deactivate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Deactivate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/prices":{"get":{"summary":"List prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Generic prices endpoint covering both base prices and price-list\noverrides. Filter with Ransack: `q[price_list_id_eq]=…`,\n`q[currency_eq]=USD`, `q[price_list_id_null]=true` (base prices only).\n\nThe admin spreadsheet uses this with server-side pagination so it\nscales past the metadata-PATCH path on `/price_lists/:id`.\n\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[price_list_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[price_list_id_null]","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q[currency_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[variant_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Comma-separated sort keys. Supports e.g. `variant_product_name,variant_id`.","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `variant`.","schema":{"type":"string"}}],"responses":{"200":{"description":"prices found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a single price. Omit `price_list_id` to create a base price.\nFor more than a handful of rows, prefer `POST /admin/prices/bulk_upsert`.\n\n\n**Required scope:** `write_products` (for API-key authentication).","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":"price created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/prices/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"404":{"description":"price not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price (acts_as_paranoid).\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price deleted"}}}},"/api/v3/admin/prices/bulk_upsert":{"post":{"summary":"Bulk-upsert prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Upserts a batch of prices in a single SQL round trip.\n\nEach row either:\n* targets an existing price by `id`, OR\n* matches on the unique key `(variant_id, currency, price_list_id)` —\n updating the existing row if one exists, creating one otherwise.\n\nModel callbacks (e.g. PriceHistory) are bypassed; this is a\nbulk-write fast path for the admin spreadsheet. The response\ncarries `price_count` — the number of rows touched.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices upserted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}},"422":{"description":"missing prices key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prices"],"properties":{"prices":{"type":"array","items":{"type":"object","required":["variant_id","currency"],"properties":{"id":{"type":"string","nullable":true},"variant_id":{"type":"string"},"currency":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/prices/bulk_destroy":{"delete":{"summary":"Bulk-delete prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each price in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices deleted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields":{"get":{"summary":"List product custom fields","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the product's custom field values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom fields found","content":{"application/json":{}}}}},"post":{"summary":"Create a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets a custom field value on the product. Requires an existing CustomFieldDefinition; pass its prefixed `cfdef_…` id.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"custom field created","content":{"application/json":{}}},"422":{"description":"duplicate definition for the same product","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["custom_field_definition_id","value"],"properties":{"custom_field_definition_id":{"type":"string","description":"Prefixed `cfdef_…` id"},"value":{"description":"Value matching the definition's `field_type`"}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields/{id}":{"get":{"summary":"Show a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom field found","content":{"application/json":{}}}}},"patch":{"summary":"Update a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the custom field's `value`. The linked definition cannot be changed — delete and recreate to switch.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"custom field updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"New value"}}}}}}},"delete":{"summary":"Delete a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"custom field deleted"}}}},"/api/v3/admin/products/{product_id}/translations":{"get":{"summary":"List product translations","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the full translation matrix for the product: the source value and content type per translatable field, plus the translated value for every supported locale.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations found","content":{"application/json":{}}}}}},"/api/v3/admin/products":{"get":{"summary":"List products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of products for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., name, -name, price, -price, best_selling)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new product. Supports nested variants with prices and option types.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}},"required":["name"]}}}}}},"/api/v3/admin/products/{id}":{"get":{"summary":"Get a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID (e.g., prod_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"product found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"404":{"description":"product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"200":{"description":"product updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}}}},"delete":{"summary":"Delete a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a product.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product deleted"}}}},"/api/v3/admin/products/bulk_status_update":{"post":{"summary":"Bulk-update product status","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets `status` on each product in `ids`. Reindexes the affected products\nfor search. Cross-store IDs are silently dropped. Returns counts.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"cross-store products silently dropped","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"status":{"type":"string"}}}}}},"422":{"description":"invalid status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","status"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["draft","active","archived"]}}}}}}}},"/api/v3/admin/products/bulk_add_to_categories":{"post":{"summary":"Bulk-add products to categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every category (category) in `category_ids`.\nCategories from sibling stores are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to categories","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"category_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_categories":{"post":{"summary":"Bulk-remove products from categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every category in `category_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from categories","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_collections":{"post":{"summary":"Bulk-add products to collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every manual collection in `collection_ids`.\nAutomatic (rule-based) and sibling-store collections are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to collections","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"collection_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_collections":{"post":{"summary":"Bulk-remove products from collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every collection in `collection_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from collections","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_channels":{"post":{"summary":"Bulk-add products to channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes each product in `ids` on every channel in `channel_ids`. Idempotent —\nre-publishing on an existing channel is a no-op. Channels from sibling stores\nare silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published on channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_channels":{"post":{"summary":"Bulk-remove products from channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes each product in `ids` from every channel in `channel_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished from channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"},"removed":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_tags":{"post":{"summary":"Bulk-add tags to products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag in `tags` from every product in `ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_destroy":{"delete":{"summary":"Bulk-delete products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each product in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products deleted","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/promotions/{promotion_id}/coupon_codes":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List coupon codes for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the auto-generated coupon codes for a multi-code promotion. Single-code promotions store the code on the promotion itself; this endpoint returns an empty list for them.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"coupon codes found","content":{"application/json":{}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List actions for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"actions found","content":{"application/json":{}}}}},"post":{"summary":"Create an action on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new action to a promotion. The `type` is the wire shorthand from `GET /promotion_actions/types` (e.g. `free_shipping`, `create_item_adjustments`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).","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":"action created","content":{"application/json":{}}},"422":{"description":"unknown action type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Delete an action from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"action deleted"}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List rules for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create a rule on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new rule to a promotion. The `type` is the wire shorthand from `GET /promotion_rules/types` (e.g. `currency`, `item_total`, `product`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).","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":"rule created with preferences","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a rule's preferences","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete a rule from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/promotions":{"get":{"summary":"List promotions","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's promotions, including manual coupon and automatic promotions.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotions found","content":{"application/json":{}}}}},"post":{"summary":"Create a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new promotion. `code` is required for single-code coupon promotions;\npass `multi_codes: true` with `number_of_codes` to auto-generate a batch.\n\nRules and actions can be created in the same request by passing arrays of\n`{ type, preferences, ... }` rows. The server reconciles to the desired set:\nnew rows are built, existing rows (by `id`) are updated, omitted rows are removed.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).","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":"promotion created with rules and actions","content":{"application/json":{}}},"422":{"description":"invalid params","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"integer","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}},"required":["name"]}}}}}},"/api/v3/admin/promotions/{id}":{"get":{"summary":"Show a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotion found","content":{"application/json":{}}}}},"patch":{"summary":"Update a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a promotion. The `rules` and `actions` arrays are treated as\na *desired set* — rows with `id` update in place, rows without `id` are\nbuilt fresh, and any existing row not present in the array is destroyed.\nPass `rules: []` or `actions: []` to clear them.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules and actions cleared with empty arrays","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"Pass to update an existing rule; omit to build a new one"},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}}}}}}},"delete":{"summary":"Delete a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"promotion deleted"}}}},"/api/v3/admin/promotion_actions/types":{"get":{"summary":"List available promotion action types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PromotionAction subclasses with their preference schemas. Used by admin UIs to populate the \"Add action\" picker and render generic preference forms.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"action types found","content":{"application/json":{}}}}}},"/api/v3/admin/promotion_rules/types":{"get":{"summary":"List available promotion rule types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PromotionRule subclasses with their preference schemas.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule types found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/refunds":{"get":{"summary":"List refunds","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all refunds for an order.\n\n**Required scope:** `read_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment, refund_reason). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,reason,transaction_id). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"refunds found","content":{"application/json":{}}}}},"post":{"summary":"Create a refund","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.\n\n**Required scope:** `write_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"refund created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_id","amount"],"properties":{"payment_id":{"type":"string","description":"Payment ID"},"amount":{"type":"string"},"refund_reason_id":{"type":"string","description":"Refund reason ID"}}}}}}}},"/api/v3/admin/locales":{"get":{"summary":"List supported locales","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the locales a merchant can translate content into for the current store, with the default and right-to-left flags.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"locales found","content":{"application/json":{}}}}}},"/api/v3/admin/store_credit_categories":{"get":{"summary":"List store credit categories","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured store credit categories. Categories classify\nstore credits (e.g., \"Goodwill\", \"Gift Card\", \"Refund\") and surface\nin the admin UI as a dropdown when issuing or editing a store\ncredit. Category names matching `Spree::Config[:non_expiring_credit_types]`\nare flagged via `non_expiring: true`.\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCreditCategory"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credit_categories/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Store credit category ID","schema":{"type":"string"}}],"get":{"summary":"Get a store credit category","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single store credit category by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCreditCategory"}}}},"404":{"description":"store credit category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store":{"get":{"summary":"Get the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current store configuration. The store is resolved from the request context (host or admin selection); there is no `id` parameter.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the current store configuration.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"store updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"preferred_admin_locale":{"type":"string"},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_unit_system":{"type":"string"}}}}}}}},"/api/v3/admin/tags":{"get":{"summary":"List tags","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns tag names for a given taggable type. Used for autocomplete in tag inputs on products, orders, and customers.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"taggable_type","in":"query","required":true,"description":"Taggable type (`Spree::Product`, `Spree::Order`, or `Spree::User`)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Optional case-insensitive substring filter","schema":{"type":"string"}}],"responses":{"200":{"description":"tags found","content":{"application/json":{}}},"422":{"description":"invalid taggable type","content":{"application/json":{}}}}}},"/api/v3/admin/translatable_resources":{"get":{"summary":"List translatable resources","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every translatable resource type and its translatable fields (key + content type), so clients can render translation editors generically.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translatable resources found","content":{"application/json":{}}}}}},"/api/v3/admin/translations/batch":{"post":{"summary":"Batch upsert translations","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Atomically upserts translations across many records of (possibly) different translatable resource types in one request — e.g. an option type and all its option values in one save. A flat list of independent registry writes; all entries succeed or none do.\n\n**Required scope:** `write_<resource>` for every resource type in the batch (for API-key authentication) (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations upserted","content":{"application/json":{}}},"422":{"description":"unsupported locale rolls back the whole batch","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["translations"],"properties":{"translations":{"type":"array","items":{"type":"object","required":["resource_type","resource_id","values"],"properties":{"resource_type":{"type":"string","description":"Translatable resource type token, e.g. `option_type`"},"resource_id":{"type":"string","description":"Prefixed id of the record"},"values":{"type":"object","description":"Map of locale code to { field: value }","additionalProperties":{"type":"object","additionalProperties":true}}}}}}}}}}}},"/api/v3/admin/admin_users":{"get":{"summary":"List staff","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns admin users with at least one role assignment on the current store.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff found","content":{"application/json":{}}}}}},"/api/v3/admin/admin_users/{id}":{"get":{"summary":"Show a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member found","content":{"application/json":{}}}}},"patch":{"summary":"Update a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name fields and reassigns roles for the current store. `role_ids` is a complete replacement — roles not in the array are removed for this store.\n\n**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"role_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Remove a staff member from this store","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the user's role assignments on the current store. The account is preserved — the user keeps access to any other stores.\n\n**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"staff removed from store"}}}},"/api/v3/admin/invitations":{"get":{"summary":"List invitations","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns invitations for the current store, including pending and accepted.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitations found","content":{"application/json":{}}}}},"post":{"summary":"Create an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Invites a teammate by email. The invitation is scoped to the current store and carries the chosen role; on accept, a `RoleUser` is created via the invitation's `after_accept` callback.\n\n**Required scope:** `write_staff` (for API-key authentication).","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":"invitation created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","role_id"],"properties":{"email":{"type":"string"},"role_id":{"type":"string"}}}}}}}},"/api/v3/admin/invitations/{id}":{"delete":{"summary":"Revoke an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"invitation revoked"}}}},"/api/v3/admin/invitations/{id}/resend":{"patch":{"summary":"Resend an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a fresh token and dispatches the invitation email again.\n\n**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitation resent","content":{"application/json":{}}}}}},"/api/v3/admin/permissions":{"get":{"summary":"List the permission catalog","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the permission catalog — the grant vocabulary shared by staff role permissions and secret API key scopes. Entries are grouped for permission pickers; labels and descriptions are localized. Readable by any authenticated admin credential.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"catalog returned","content":{"application/json":{}}}}}},"/api/v3/admin/roles":{"get":{"summary":"List roles","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns staff roles with their catalog permissions. Roles are global, not per-store; `mutable: false` marks the protected admin role and host-locked rows.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"roles found","content":{"application/json":{}}}}},"post":{"summary":"Create a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a staff role. `permissions` holds catalog keys (see GET /admin/permissions); a caller may only grant keys they effectively hold.\n\n**Required scope:** `write_staff` (for API-key authentication).","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":"role created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}}}},"/api/v3/admin/roles/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a role name, description or permissions. The admin role and host-locked roles (`mutable: false`) reject changes.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"role updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a role. Fails with 422 while the role is protected or still referenced by staff members or pending invitations.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"role deleted"},"422":{"description":"role cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/stock_locations":{"get":{"summary":"List stock locations","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured stock locations. Stock locations are global\n(shared across stores). Filter with Ransack predicates such as\n`q[active_eq]`, `q[kind_eq]`, `q[pickup_enabled_eq]`, or\n`q[name_cont]`.\n\nPickup-related attributes (`kind`, `pickup_enabled`,\n`pickup_stock_policy`, `pickup_ready_in_minutes`,\n`pickup_instructions`) drive merchant pickup support at checkout —\ncustomers can collect orders from any active location with\n`pickup_enabled: true`.\n\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[active_eq]","in":"query","required":false,"description":"Filter by active status","schema":{"type":"boolean"}},{"name":"q[kind_eq]","in":"query","required":false,"description":"Filter by kind (built-in: 'warehouse', 'store', 'fulfillment_center')","schema":{"type":"string"}},{"name":"q[pickup_enabled_eq]","in":"query","required":false,"description":"Filter by pickup-enabled flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock locations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockLocation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new stock location.\n\nSetting `default: true` automatically demotes the previous default\nlocation.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"stock location created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true,"description":"Internal name shown only in the admin"},"active":{"type":"boolean"},"default":{"type":"boolean","description":"Setting to true demotes the previous default."},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"],"description":"Categorizes the location."},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true,"description":"ISO-3166 alpha-2 country code (e.g. \"US\")."},"state_abbr":{"type":"string","nullable":true,"description":"State / province abbreviation (e.g. \"NY\"). Resolved against the selected country."},"state_name":{"type":"string","nullable":true,"description":"Free-text state for countries without a states list."},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"],"description":"'local' = items at this location only; 'any' = transfer-eligible (ship-to-store)."},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}},"required":["name"]}}}}}},"/api/v3/admin/stock_locations/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock location ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single stock location by prefixed ID.\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"404":{"description":"stock location not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing stock location. Same address-field conventions as\nthe create endpoint.\n\nSetting `default: true` automatically demotes the previous default.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"]},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"]},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the stock location (sets `deleted_at`). Existing\nfulfillments that referenced it keep the historical record via\n`Spree::StockLocation.with_deleted`.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"stock location deleted"}}}},"/api/v3/admin/products/{product_id}/variants":{"get":{"summary":"List product variants","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of variants for a product, including the default variant.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variants found","content":{"application/json":{}}}}},"post":{"summary":"Create a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new variant for a product. Supports nested prices and stock items.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"201":{"description":"variant created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"A variant on a product with option types should declare its option pairs (e.g. size + color) — one per option type it participates in. Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}},"/api/v3/admin/products/{product_id}/variants/{id}":{"get":{"summary":"Get a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single variant by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variant found","content":{"application/json":{}}},"404":{"description":"variant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a variant. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"200":{"description":"variant updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}},"delete":{"summary":"Delete a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a variant.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"204":{"description":"variant deleted"}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"List webhook deliveries","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns delivery attempts for the given endpoint, most recent first.\nEach row carries the original request payload, the response code\n(when the receiver replied), the execution time, and any transport\nerror — everything needed to audit failures and decide whether to\nredeliver.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[event_name_eq]","in":"query","required":false,"description":"Filter by event name (exact)","schema":{"type":"string"}},{"name":"q[success_eq]","in":"query","required":false,"description":"Filter by success flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-delivered_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}},"404":{"description":"parent webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single delivery attempt with the full request payload and\nthe response body the receiver returned. Use this for ad-hoc debug\nof failed deliveries.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery found","content":{"application/json":{}}},"404":{"description":"delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}/redeliver":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID to redeliver","schema":{"type":"string"}}],"post":{"summary":"Redeliver a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new delivery row with the same payload + event_name and\nqueues it. The original row is preserved for audit history.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"redelivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints":{"get":{"summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns outbound webhook subscriptions for the current store. Each\nendpoint receives a signed POST when any subscribed event fires.\n`secret_key` is `null` on list reads — the plaintext is delivered\nexactly once on create.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[url_cont]","in":"query","required":false,"description":"Filter by URL (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoints found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new outbound webhook subscription. The plaintext\n`secret_key` is returned **once** in this response — persist it\nimmediately to verify incoming webhook signatures. Subsequent reads\nreturn `null` for the secret. Pass an empty `subscriptions` array or\nomit it to receive every event.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"webhook endpoint created — secret_key returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/webhook_endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single webhook endpoint by prefixed ID.\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint found","content":{"application/json":{}}},"404":{"description":"webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, URL, active flag, or the event subscription list.\nToggling `active` here is equivalent to calling `disable`/`enable`\nwithout an audit reason.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint updated","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the endpoint and stops future deliveries.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"webhook endpoint deleted"}}}},"/api/v3/admin/webhook_endpoints/{id}/send_test":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"post":{"summary":"Send a test delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a `webhook.test` delivery record and queues it. Use this to\nverify the endpoint is reachable and your signature verification\naccepts Spree's payloads.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"test delivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/enable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Re-enable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-enables an endpoint that was manually or automatically disabled.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint enabled","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/disable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Disable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually pauses an endpoint. Unlike auto-disable (triggered after\nrepeated delivery failures), no notification email is sent.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint disabled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/collections":{"get":{"summary":"List collections","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's collections.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collections found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual or automatic (rule-based) collection. For automatic collections, send the full desired rule set under `rules`.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"collection created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"sort_order":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"rules":{"type":"array","description":"Full desired rule set. Entries with an id update, id-less entries create, omitted rules are removed.","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}},"required":["name"]}}}}}},"/api/v3/admin/collections/{id}":{"get":{"summary":"Get a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single collection by ID, including its rules.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collection found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"404":{"description":"collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a collection. Send `position` to reorder it within the flat list; send the full `rules` set to sync automatic rules.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"collection updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"sort_order":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer","description":"Reorders the collection within the flat list (acts_as_list)"},"rules":{"type":"array","description":"Full desired rule set (see create).","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}}}}}}},"delete":{"summary":"Delete a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a collection.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"204":{"description":"collection deleted"}}}},"/api/v3/admin/collections/{collection_id}/products":{"get":{"summary":"List collection products","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products curated in the collection, ordered by their membership position.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Curates a product into the collection (appended to the end).\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/collections/{collection_id}/products/{id}":{"delete":{"summary":"Remove a product from a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the collection's manual curation.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/collections/{collection_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a collection product","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the collection's products.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the collection's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/collection_rules/types":{"get":{"summary":"List available collection rule types","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels and descriptions — drives the rule picker on an automatic collection. Plugins extend the list by registering `Spree::CollectionRule` subclasses via `config.spree.collection_rules`. The `type` returned here is the wire shorthand accepted when writing a collection's `rules`.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/delivery_methods":{"get":{"summary":"List delivery methods","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all delivery methods with calculator and zone configuration.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery methods found","content":{"application/json":{}}}}},"post":{"summary":"Create delivery method","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery method. fulfillment_type is one of shipping, digital, pickup.\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"delivery method created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"fulfillment_type":{"type":"string","enum":["shipping","digital","pickup"]},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"estimated_transit_business_days_min":{"type":"integer","nullable":true},"estimated_transit_business_days_max":{"type":"integer","nullable":true},"tax_category_id":{"type":"string","nullable":true},"calculator_type":{"type":"string"},"calculator_preferences":{"type":"object"},"delivery_zone_ids":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}}}},"/api/v3/admin/delivery_methods/calculators":{"get":{"summary":"List delivery calculators","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registered delivery calculator classes with preference schemas for building configuration forms.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"calculators found","content":{"application/json":{}}}}}},"/api/v3/admin/delivery_zones":{"post":{"summary":"Create delivery zone","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery zone with typed members: country, state, or postal_code (prefix or from/to range).\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed, e.g. `members`","schema":{"type":"string"}}],"responses":{"201":{"description":"delivery zone created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"type":"object","properties":{"member_type":{"type":"string","enum":["country","state","postal_code"]},"country_iso":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true}},"required":["member_type"]}}},"required":["name"]}}}}}},"/api/v3/admin/integrations":{"get":{"summary":"List integrations","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the integrations connected to the current store. Secret preference values are masked.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integrations found","content":{"application/json":{}}}}},"post":{"summary":"Connect integration","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Connects an integration type to the current store. Setting active: true verifies the connection and fails with 422 when it cannot connect. Submitting a masked secret value back keeps the stored secret.\n\n**Required scope:** `write_integrations` (for API-key authentication).","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":"integration connected","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Wire shorthand from GET /integrations/types"},"active":{"type":"boolean"},"preferences":{"type":"object"}},"required":["type"]}}}}}},"/api/v3/admin/integrations/types":{"get":{"summary":"List integration types","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every registered integration type with its gallery metadata and configuration schema. Pure registry discovery — read live connection state from GET /integrations.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integration types found","content":{"application/json":{}}}}}},"/api/v3/admin/integrations/{id}/test":{"post":{"summary":"Test integration connection","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Runs a live connection check against the provider. Nothing is persisted; a failed check reports the vendor error message.\n\n**Required scope:** `write_integrations` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"connection checked","content":{"application/json":{}}}}}},"/api/v3/admin/product_types":{"get":{"summary":"List product types","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of product types.\n\nA product type is a back-office template: it seeds option types and\ncategories onto products created with it, and defines which custom\nfields those products' forms show. It is not exposed on the Store API.\n\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}}],"responses":{"200":{"description":"product types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a product type.\n\n`option_type_ids` and `category_ids` seed products created with this\ntype. `custom_field_definitions` is a replace-set of the definitions the\nproduct form renders, in `sort_order`. `required` is advisory — the\ndashboard marks the field, but a blank value is never rejected.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"422":{"description":"unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"fulfillment_types":{"type":"array","items":{"type":"string"},"description":"How products of this type can be delivered."},"option_type_ids":{"type":"array","items":{"type":"string"},"description":"Option types seeded onto products created with this type."},"category_ids":{"type":"array","items":{"type":"string"},"description":"Categories seeded onto products created with this type."},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Prefixed custom field definition id."},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}},"required":["name"]}}}}}},"/api/v3/admin/product_types/{id}":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Retrieve a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product type with its option types, categories and custom fields.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"404":{"description":"product type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product type.\n\nChanges never modify products that already carry the type — use\n`apply_to_products` to backfill those.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"fulfillment_types":{"type":"array","items":{"type":"string"}},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a product type. Types still used by products cannot be deleted.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"product type deleted"}}}},"/api/v3/admin/product_types/{id}/apply_to_products":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"post":{"summary":"Apply a product type to its existing products","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Backfills the type's option types and categories onto the products that\nalready carry it. Additive and idempotent — nothing is removed, and\nre-running is safe.\n\nRuns in the background; the response reports how many products the type\ncurrently has.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"202":{"description":"backfill accepted","content":{"application/json":{"schema":{"type":"object","properties":{"products_count":{"type":"integer"}}}}}}}}}},"components":{"schemas":{"PaginationMeta":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"count":{"type":"integer","description":"Total number of records"},"pages":{"type":"integer","description":"Total number of pages"},"from":{"type":"integer","description":"Index of first record on this page"},"to":{"type":"integer","description":"Index of last record on this page"},"in":{"type":"integer","description":"Number of records on this page"},"previous":{"type":"integer","nullable":true,"description":"Previous page number"},"next":{"type":"integer","nullable":true,"description":"Next page number"}},"required":["page","limit","count","pages","from","to","in"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","description":"Field-specific validation errors","nullable":true}},"required":["code","message"]}},"required":["error"]},"AuthResponse":{"type":"object","properties":{"token":{"type":"string","description":"JWT access token"},"user":{"$ref":"#/components/schemas/AdminUser"}},"required":["token","user"]},"PermissionRule":{"type":"object","description":"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.","properties":{"allow":{"type":"boolean","description":"true for `can`, false for `cannot`"},"actions":{"type":"array","items":{"type":"string"},"description":"Action names, e.g. [\"read\", \"update\"] or [\"manage\"]"},"subjects":{"type":"array","items":{"type":"string"},"description":"Subject class names, e.g. [\"Spree::Product\"] or [\"all\"]"},"has_conditions":{"type":"boolean","description":"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},"required":["allow","actions","subjects","has_conditions"]},"MeResponse":{"type":"object","description":"Current admin user profile and serialized permissions","properties":{"user":{"$ref":"#/components/schemas/AdminUser"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionRule"}}},"required":["user","permissions"]},"ImportSchemaField":{"type":"object","description":"A canonical column of an import type, including per-store custom field columns","properties":{"name":{"type":"string","description":"Canonical field name used in mappings"},"label":{"type":"string","description":"Human-readable label"},"required":{"type":"boolean","description":"Whether the field must be mapped before processing"}},"required":["name","label","required"]},"CheckoutRequirement":{"type":"object","properties":{"step":{"type":"string","description":"Checkout step this requirement belongs to"},"field":{"type":"string","description":"Field that needs to be satisfied"},"message":{"type":"string","description":"Human-readable requirement message"}},"required":["step","field","message"]},"CartWarning":{"type":"object","description":"A warning about a cart issue (e.g., item removed due to stock change)","properties":{"code":{"type":"string","description":"Machine-readable warning code"},"message":{"type":"string","description":"Human-readable warning message"},"line_item_id":{"type":"string","nullable":true,"description":"Prefixed line item ID (when applicable)"},"variant_id":{"type":"string","nullable":true,"description":"Prefixed variant ID (when applicable)"}},"required":["code","message"]},"FulfillmentManifestItem":{"type":"object","description":"An item within a fulfillment — which line item and how many units are in this fulfillment","properties":{"item_id":{"type":"string","description":"Line item ID"},"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer","description":"Quantity in this fulfillment"}},"required":["item_id","variant_id","quantity"]},"AdminUserRoleAssignment":{"type":"object","description":"A role assignment for the current store on a staff member","properties":{"id":{"type":"string","description":"Prefixed role ID"},"name":{"type":"string","description":"Role name"}},"required":["id","name"]},"AdminUserStore":{"type":"object","description":"A store the staff member can access through a role assignment","properties":{"id":{"type":"string","description":"Prefixed store ID"},"name":{"type":"string","description":"Store name"},"code":{"type":"string","description":"Store code"}},"required":["id","name","code"]},"PreferenceField":{"type":"object","description":"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.","properties":{"key":{"type":"string"},"type":{"type":"string","description":"string | text | password | integer | decimal | boolean | array | hash"},"default":{"description":"Default value (any JSON type), null when there is no default","nullable":true}},"required":["key","type"]},"PromotionActionCalculator":{"type":"object","description":"The action's nested calculator (when the action carries one — null for actions like `free_shipping`)","properties":{"type":{"type":"string","description":"Wire shorthand for the calculator subclass"},"label":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}}},"required":["type","label","preferences","preference_schema"]},"PromotionActionLineItem":{"type":"object","description":"One row in a `create_line_items` action — the variant added to the order and how many","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["variant_id","quantity"]},"Address":{"type":"object","properties":{"id":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_name":{"type":"string"},"country_iso":{"type":"string"},"state_text":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"quick_checkout":{"type":"boolean"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"},"state_name":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true}},"required":["id","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_iso","state_text","state_abbr","quick_checkout","is_default_billing","is_default_shipping","state_name","label","metadata","created_at","updated_at","customer_id"],"x-typelizer":true},"AdminUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string","nullable":true},"selected_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"avatar_url":{"type":"string","nullable":true},"roles":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserRoleAssignment"}},"stores":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserStore"}}},"required":["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":true},"AllowedOrigin":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","origin","created_at","updated_at"],"x-typelizer":true},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key_type":{"type":"string"},"token_prefix":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"revoked_at":{"type":"string","nullable":true},"last_used_at":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"plaintext_token":{"type":"string","nullable":true},"created_by_email":{"type":"string","nullable":true}},"required":["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email"],"x-typelizer":true},"AppliedPromotion":{"type":"object","properties":{"id":{"type":"string"},"promotion_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":true},"Cart":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"preferred_stock_location_id":{"type":"string","nullable":true},"number":{"type":"string"},"token":{"type":"string"},"email":{"type":"string","nullable":true},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/CartWarning"}},"coupon_code":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"display_item_total":{"type":"string","nullable":true},"adjustment_total":{"type":"string","nullable":true},"display_adjustment_total":{"type":"string","nullable":true},"discount_total":{"type":"string","nullable":true},"display_discount_total":{"type":"string","nullable":true},"tax_total":{"type":"string","nullable":true},"display_tax_total":{"type":"string","nullable":true},"included_tax_total":{"type":"string","nullable":true},"display_included_tax_total":{"type":"string","nullable":true},"additional_tax_total":{"type":"string","nullable":true},"display_additional_tax_total":{"type":"string","nullable":true},"total":{"type":"string","nullable":true},"display_total":{"type":"string","nullable":true},"gift_card_total":{"type":"string","nullable":true},"display_gift_card_total":{"type":"string","nullable":true},"amount_due":{"type":"string","nullable":true},"display_amount_due":{"type":"string","nullable":true},"delivery_total":{"type":"string","nullable":true},"display_delivery_total":{"type":"string","nullable":true},"store_credit_total":{"type":"string","nullable":true},"display_store_credit_total":{"type":"string","nullable":true},"covered_by_store_credit":{"type":"boolean"},"current_step":{"type":"string"},"completed_steps":{"type":"array","items":{"type":"string"}},"requirements":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutRequirement"}},"shipping_eq_billing_address":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"completed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}}},"required":["id","market_id","channel_id","preferred_stock_location_id","number","token","email","customer_note","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":true},"Category":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"depth":{"type":"number"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"children_count":{"type":"number"},"parent_id":{"type":"string","nullable":true},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"is_root":{"type":"boolean"},"is_child":{"type":"boolean"},"is_leaf":{"type":"boolean"},"parent":{"$ref":"#/components/schemas/Category"},"children":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"ancestors":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"metadata":{"type":"object"},"pretty_name":{"type":"string"},"lft":{"type":"number"},"rgt":{"type":"number"},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":true},"Channel":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"storefront_access":{"type":"string"},"guest_checkout":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true},"preferred_storefront_access":{"type":"string","nullable":true},"preferred_guest_checkout":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","code","active","default","storefront_access","guest_checkout","preferred_order_routing_strategy","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at"],"x-typelizer":true},"ClaimLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"send_replacement":{"type":"boolean"},"description":{"type":"string","nullable":true},"refund_amount":{"type":"string"},"paid_amount":{"type":"string"},"display_refund_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"replacement_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"replacement_variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","quantity","send_replacement","description","refund_amount","paid_amount","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":true},"ClaimReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Claim":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"resolution":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"denied_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ClaimReason"},"claim_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ClaimLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id"],"x-typelizer":true},"CollectionRule":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string","nullable":true},"match_policy":{"type":"string"}},"required":["id","type","value","match_policy"],"x-typelizer":true},"Collection":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"sort_order":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"products_count":{"type":"number"},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CollectionRule"}}},"required":["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":true},"Country":{"type":"object","properties":{"iso":{"type":"string"},"iso3":{"type":"string"},"name":{"type":"string"},"states_required":{"type":"boolean"},"zipcode_required":{"type":"boolean"},"states":{"type":"array","items":{"$ref":"#/components/schemas/State"}},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["iso","iso3","name","states_required","zipcode_required","created_at","updated_at"],"x-typelizer":true},"CouponCode":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"state":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"promotion_id":{"type":"string"},"order_id":{"type":"string","nullable":true}},"required":["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":true},"CreditCard":{"type":"object","properties":{"id":{"type":"string"},"brand":{"type":"string"},"last4":{"type":"string"},"month":{"type":"number"},"year":{"type":"number"},"name":{"type":"string","nullable":true},"default":{"type":"boolean"},"gateway_payment_profile_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"payment_method_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":true},"CustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"namespace":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"resource_type":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"},"filter_key":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","namespace","key","label","field_type","resource_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at"],"x-typelizer":true},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","deprecated":true},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"key":{"type":"string"},"value":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"storefront_visible":{"type":"boolean"},"custom_field_definition_id":{"type":"string"}},"required":["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":true},"CustomerGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"customers_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":true},"Customer":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"accepts_email_marketing":{"type":"boolean"},"full_name":{"type":"string"},"available_store_credit_total":{"type":"string"},"display_available_store_credit_total":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"default_billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"default_shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"newsletter_subscriber":{"allOf":[{"$ref":"#/components/schemas/NewsletterSubscriber"}],"nullable":true},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"failed_attempts":{"type":"number"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"internal_note_html":{"type":"string","nullable":true},"default_billing_address_id":{"type":"string","nullable":true},"default_shipping_address_id":{"type":"string","nullable":true},"orders_count":{"type":"number"},"total_spent":{"type":"string"},"display_total_spent":{"type":"string"},"last_order_completed_at":{"type":"string","nullable":true},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"store_credits":{"type":"array","items":{"$ref":"#/components/schemas/StoreCredit"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}},"required":["id","email","first_name","last_name","phone","accepts_email_marketing","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","created_at","updated_at","tags","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":true},"DeliveryMethodRule":{"type":"object","properties":{"id":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","active","created_at","updated_at","type","name","description","preferences","preference_schema","product_ids"],"x-typelizer":true},"DeliveryMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"fulfillment_type":{"type":"string"},"estimated_transit_business_days_min":{"type":"number","nullable":true},"estimated_transit_business_days_max":{"type":"number","nullable":true},"admin_name":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string"},"pickup_point_provider":{"type":"string","nullable":true},"rate_provider":{"type":"string","nullable":true},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string"},"services":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodService"}},"tax_category_id":{"type":"string","nullable":true},"delivery_zone_ids":{"type":"array","items":{"type":"string"}},"stock_location_ids":{"type":"array","items":{"type":"string"}},"calculator_type":{"type":"string","nullable":true},"calculator_preferences":{"type":"object","nullable":true}},"required":["id","name","code","fulfillment_type","estimated_transit_business_days_min","estimated_transit_business_days_max","admin_name","fulfillment_provider","pickup_point_provider","rate_provider","storefront_visible","tracking_url","markup_flat","markup_percent","created_at","updated_at","deleted_at","services","tax_category_id","delivery_zone_ids","stock_location_ids","calculator_type","calculator_preferences"],"x-typelizer":true},"DeliveryMethodService":{"type":"object","properties":{"id":{"type":"string"},"carrier":{"type":"string"},"service":{"type":"string"},"label":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"position":{"type":"number"}},"required":["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":true},"DeliveryRate":{"type":"object","properties":{"id":{"type":"string"},"delivery_method_id":{"type":"string"},"name":{"type":"string"},"selected":{"type":"boolean"},"cost":{"type":"string"},"total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"carrier":{"type":"string","nullable":true},"service_level":{"type":"string","nullable":true},"estimated_delivery_date":{"type":"string","nullable":true},"display_cost":{"type":"string"},"display_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":true},"DeliveryZoneMember":{"type":"object","properties":{"id":{"type":"string"},"member_type":{"type":"string"},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","member_type","postal_code_prefix","postal_code_from","postal_code_to","country_iso","state_abbr","state_name","created_at","updated_at"],"x-typelizer":true},"DeliveryZone":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZoneMember"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_method_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","created_at","updated_at","delivery_method_ids"],"x-typelizer":true},"DigitalLink":{"type":"object","properties":{"id":{"type":"string"},"access_counter":{"type":"number"},"filename":{"type":"string"},"content_type":{"type":"string"},"download_url":{"type":"string"},"authorizable":{"type":"boolean"},"expired":{"type":"boolean"},"access_limit_exceeded":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","access_counter","filename","content_type","download_url","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":true},"Discount":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"code":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"value":{"type":"string","nullable":true},"promotion_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"ExchangeLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"original_price":{"type":"string"},"new_variant_price":{"type":"string"},"price_difference":{"type":"string"},"original_variant_id":{"type":"string","nullable":true},"new_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"original_variant":{"$ref":"#/components/schemas/Variant"},"new_variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"Exchange":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"price_difference":{"type":"string"},"display_price_difference":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"fulfilled_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"exchange_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ExchangeLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id"],"x-typelizer":true},"Export":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"format":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"done":{"type":"boolean"},"filename":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"download_url":{"type":"string","nullable":true}},"required":["id","number","format","created_at","updated_at","type","user_id","done","filename","byte_size","download_url"],"x-typelizer":true},"Fee":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"FulfillmentItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"status":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":true},"Fulfillment":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"tracking":{"type":"string","nullable":true},"tracking_url":{"type":"string","nullable":true},"pickup_point_data":{"type":"object","nullable":true},"selected_delivery_rate_id":{"type":"string","nullable":true},"cost":{"type":"string"},"display_cost":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"status":{"type":"string"},"fulfillment_type":{"type":"string"},"fulfilled_at":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentManifestItem"}},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"delivery_rates":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryRate"}},"metadata":{"type":"object"},"adjustment_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"fulfillment_items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentItem"}},"order":{"$ref":"#/components/schemas/Order"}},"required":["id","number","tracking","tracking_url","pickup_point_data","selected_delivery_rate_id","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","items","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id"],"x-typelizer":true},"GiftCardBatch":{"type":"object","properties":{"id":{"type":"string"},"codes_count":{"type":"number"},"currency":{"type":"string","nullable":true},"prefix":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true}},"required":["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":true},"GiftCard":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_authorized":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"expires_at":{"type":"string","nullable":true},"redeemed_at":{"type":"string","nullable":true},"expired":{"type":"boolean"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/AdminUser"},"gift_card_batch":{"$ref":"#/components/schemas/GiftCardBatch"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}},"required":["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":true},"ImportMapping":{"type":"object","properties":{"id":{"type":"string"},"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true},"required":{"type":"boolean"}},"required":["id","schema_field","file_column","required"],"x-typelizer":true},"ImportRow":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"number"},"status":{"type":"string"},"validation_errors":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"import_id":{"type":"string","nullable":true},"item_type":{"type":"string","nullable":true},"item_id":{"type":"string","nullable":true},"data":{"type":"object"}},"required":["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":true},"Import":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"rows_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"status":{"type":"string"},"owner_type":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"processing_errors":{"type":"string","nullable":true},"preferred_delimiter":{"type":"string"},"original_filename":{"type":"string","nullable":true},"original_byte_size":{"type":"number","nullable":true},"original_file_url":{"type":"string","nullable":true},"completed_rows_count":{"type":"number"},"failed_rows_count":{"type":"number"},"schema_fields":{"type":"array","items":{"$ref":"#/components/schemas/ImportSchemaField"}},"csv_headers":{"type":"array","items":{"type":"string"}},"sample_row":{"type":"object"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/ImportMapping"}}},"required":["id","number","rows_count","created_at","updated_at","type","status","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":true},"Integration":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"group":{"type":"string","nullable":true},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":true},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expires_at":{"type":"string"},"role_id":{"type":"string"},"role_name":{"type":"string"},"inviter_email":{"type":"string"},"acceptance_url":{"type":"string"},"invitee_exists":{"type":"boolean"},"store":{"type":"object"}},"required":["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":true},"LineItem":{"type":"object","properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"preorder":{"type":"boolean"},"preorder_ships_at":{"type":"string","nullable":true},"quantity":{"type":"number"},"currency":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"options_text":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"discounted_amount":{"type":"string"},"display_discounted_amount":{"type":"string"},"display_compare_at_amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"digital_links":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost_price":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"tax_category":{"$ref":"#/components/schemas/TaxCategory"}},"required":["id","variant_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","created_at","updated_at","cost_price","tax_category_id"],"x-typelizer":true},"Market":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"country_isos":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_isos","supported_locales","created_at","updated_at"],"x-typelizer":true},"Media":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string","nullable":true},"variant_ids":{"type":"array","items":{"type":"string"}},"position":{"type":"number"},"alt":{"type":"string","nullable":true},"media_type":{"type":"string"},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"external_video_url":{"type":"string","nullable":true},"original_url":{"type":"string","nullable":true},"mini_url":{"type":"string","nullable":true},"small_url":{"type":"string","nullable":true},"medium_url":{"type":"string","nullable":true},"large_url":{"type":"string","nullable":true},"xlarge_url":{"type":"string","nullable":true},"og_image_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"viewable_id":{"type":"string"},"download_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"viewable_type":{"type":"string"}},"required":["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","created_at","updated_at","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":true},"NewsletterSubscriber":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"verified":{"type":"boolean"},"verified_at":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true}},"required":["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":true},"OptionType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"kind":{"type":"string"},"translations":{"type":"object"},"metadata":{"type":"object"},"filterable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}}},"required":["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":true},"OptionValue":{"type":"object","properties":{"id":{"type":"string"},"option_type_id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"color_code":{"type":"string","nullable":true},"option_type_name":{"type":"string"},"option_type_label":{"type":"string"},"image_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_type":{"$ref":"#/components/schemas/OptionType"}},"required":["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":true},"OrderRoutingRule":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"channel_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Order":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"number":{"type":"string"},"email":{"type":"string"},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"coupon_code":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true},"payment_status":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"item_total":{"type":"string"},"display_item_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"gift_card_total":{"type":"string"},"display_gift_card_total":{"type":"string"},"amount_due":{"type":"string"},"display_amount_due":{"type":"string"},"delivery_total":{"type":"string"},"display_delivery_total":{"type":"string"},"store_credit_total":{"type":"string"},"display_store_credit_total":{"type":"string"},"covered_by_store_credit":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"fulfillments":{"type":"array","items":{"$ref":"#/components/schemas/Fulfillment"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"gift_card":{"allOf":[{"$ref":"#/components/schemas/GiftCard"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"status":{"type":"string"},"last_ip_address":{"type":"string","nullable":true},"considered_risky":{"type":"boolean"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean"},"payment_total":{"type":"string"},"display_payment_total":{"type":"string"},"metadata":{"type":"object"},"canceled_at":{"type":"string","nullable":true},"approved_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferred_stock_location_id":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"internal_note":{"type":"string","nullable":true},"approver_id":{"type":"string","nullable":true},"canceler_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}},"cart":{"$ref":"#/components/schemas/Cart"},"channel":{"$ref":"#/components/schemas/Channel"},"preferred_stock_location":{"$ref":"#/components/schemas/StockLocation"},"payment_methods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"customer":{"$ref":"#/components/schemas/Customer"},"approver":{"$ref":"#/components/schemas/Customer"},"canceler":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/Customer"},"returns":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"exchanges":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}}},"required":["id","market_id","cart_id","channel_id","number","email","customer_note","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","tags","internal_note","approver_id","canceler_id","created_by_id","customer_id"],"x-typelizer":true},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"session_required":{"type":"boolean"},"source_required":{"type":"boolean"},"metadata":{"type":"object"},"active":{"type":"boolean"},"auto_capture":{"type":"boolean","nullable":true},"storefront_visible":{"type":"boolean"},"position":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","description","type","session_required","source_required","metadata","active","auto_capture","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":true},"Payment":{"type":"object","properties":{"id":{"type":"string"},"payment_method_id":{"type":"string"},"response_code":{"type":"string","nullable":true},"number":{"type":"string"},"amount":{"type":"string"},"display_amount":{"type":"string"},"status":{"type":"string"},"source_type":{"type":"string","nullable":true,"enum":["credit_card","store_credit","payment_source"]},"source_id":{"type":"string","nullable":true},"source":{"anyOf":[{"$ref":"#/components/schemas/CreditCard"},{"$ref":"#/components/schemas/StoreCredit"},{"$ref":"#/components/schemas/PaymentSource"}],"nullable":true},"payment_method":{"$ref":"#/components/schemas/PaymentMethod"},"metadata":{"type":"object"},"avs_response":{"type":"string","nullable":true},"cvv_response_code":{"type":"string","nullable":true},"cvv_response_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"captured_amount":{"type":"string"},"order_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","payment_method_id","response_code","number","amount","display_amount","status","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":true},"PaymentSource":{"type":"object","properties":{"id":{"type":"string"},"gateway_payment_profile_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":true},"Permission":{"type":"object","properties":{"key":{"type":"string"},"resource":{"type":"string"},"kind":{"type":"string"},"group":{"type":"string"},"group_label":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","resource","kind","group","group_label","label","description"],"x-typelizer":true},"PriceHistory":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_in_cents":{"type":"number"},"currency":{"type":"string"},"display_amount":{"type":"string"},"recorded_at":{"type":"string"},"variant_id":{"type":"string"},"price_id":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":true},"PriceList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string"},"position":{"type":"number"},"match_policy":{"type":"string"},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"currently_active":{"type":"boolean"},"products_count":{"type":"number"},"prices_count":{"type":"number"},"product_ids":{"type":"array","items":{"type":"string"}},"price_rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceRule"}}},"required":["id","name","description","status","position","match_policy","starts_at","ends_at","deleted_at","created_at","updated_at","currently_active","products_count","prices_count","product_ids"],"x-typelizer":true},"PriceRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"price_list_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"description":{"type":"string","nullable":true},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","created_at","updated_at","type","price_list_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Price":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string","nullable":true},"amount_in_cents":{"type":"number","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"compare_at_amount_in_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"display_amount":{"type":"string","nullable":true},"display_compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","variant_id","created_at","updated_at"],"x-typelizer":true},"ProductPublication":{"type":"object","properties":{"id":{"type":"string"},"published_at":{"type":"string","nullable":true},"unpublished_at":{"type":"string","nullable":true},"product_id":{"type":"string"},"channel_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":true},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"variant_count":{"type":"number"},"available_on":{"type":"string","nullable":true},"preorder_ships_at":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"preorder":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"available":{"type":"boolean"},"description":{"type":"string","nullable":true},"description_html":{"type":"string","nullable":true},"default_variant_id":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"default_variant":{"$ref":"#/components/schemas/Variant"},"option_types":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"translations":{"type":"object"},"status":{"type":"string"},"metadata":{"type":"object"},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"product_type_id":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"collections":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"product_publications":{"type":"array","items":{"$ref":"#/components/schemas/ProductPublication"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"product_type":{"$ref":"#/components/schemas/ProductType"}},"required":["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","thumbnail_url","tags","price","original_price","status","metadata","deleted_at","created_at","updated_at","product_type_id","tax_category_id"],"x-typelizer":true},"ProductTypeCustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"namespace":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"required":{"type":"boolean"},"sort_order":{"type":"number"}},"required":["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":true},"ProductType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"translations":{"type":"object"},"fulfillment_types":{"type":"array","items":{"type":"string"}},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"$ref":"#/components/schemas/ProductTypeCustomFieldDefinition"}}},"required":["id","name","fulfillment_types","products_count","created_at","updated_at","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":true},"PromotionAction":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"calculator":{"allOf":[{"$ref":"#/components/schemas/PromotionActionCalculator"}],"nullable":true},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionLineItem"},"nullable":true}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","calculator","line_items"],"x-typelizer":true},"PromotionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"product_ids":{"type":"array","items":{"type":"string"},"nullable":true},"category_ids":{"type":"array","items":{"type":"string"},"nullable":true},"customer_ids":{"type":"array","items":{"type":"string"},"nullable":true},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","product_ids","category_ids","customer_ids"],"x-typelizer":true},"Promotion":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"usage_limit":{"type":"number","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"path":{"type":"string","nullable":true},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"number","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"action_ids":{"type":"array","items":{"type":"string"}},"rule_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":true},"RefundReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Refund":{"type":"object","properties":{"id":{"type":"string"},"transaction_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"payment_id":{"type":"string","nullable":true},"refund_reason_id":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true},"originator_type":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at"],"x-typelizer":true},"ReturnLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"line_item":{"$ref":"#/components/schemas/LineItem"}},"required":["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"ReturnReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Return":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"refunded_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"return_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ReturnLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"refunded_total":{"type":"string"},"refundable_total":{"type":"string"},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","refund_total","display_refund_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","refunded_total","refundable_total"],"x-typelizer":true},"Role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"mutable":{"type":"boolean"},"users_count":{"type":"number"}},"required":["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":true},"SetupTask":{"type":"object","properties":{"name":{"type":"string"},"done":{"type":"boolean"}},"required":["name","done"],"x-typelizer":true},"State":{"type":"object","properties":{"abbr":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["abbr","name","created_at","updated_at"],"x-typelizer":true},"StockItem":{"type":"object","properties":{"id":{"type":"string"},"count_on_hand":{"type":"number"},"backorderable":{"type":"boolean"},"stock_location_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"allocated_count":{"type":"number"},"available_count":{"type":"number"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","count_on_hand","backorderable","stock_location_id","variant_id","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":true},"StockLocation":{"type":"object","properties":{"id":{"type":"string"},"state_abbr":{"type":"string","nullable":true},"name":{"type":"string"},"address1":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_text":{"type":"string","nullable":true},"admin_name":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"propagate_all_variants":{"type":"boolean"},"kind":{"type":"string"},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string"},"pickup_ready_in_minutes":{"type":"number","nullable":true},"pickup_instructions":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","state_abbr","name","address1","city","zipcode","country_iso","country_name","state_text","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","pickup_ready_in_minutes","pickup_instructions","created_at","updated_at"],"x-typelizer":true},"StockReservation":{"type":"object","properties":{"id":{"type":"string"},"stock_item_id":{"type":"string"},"line_item_id":{"type":"string"},"order_id":{"type":"string"},"variant_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"quantity":{"type":"number"},"expires_at":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","stock_item_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":true},"StockTransfer":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source_location_id":{"type":"string","nullable":true},"destination_location_id":{"type":"string","nullable":true},"source_location":{"$ref":"#/components/schemas/StockLocation"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","reference","metadata","created_at","updated_at","source_location_id","destination_location_id"],"x-typelizer":true},"StoreCreditCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"non_expiring":{"type":"boolean"}},"required":["id","name","created_at","updated_at","non_expiring"],"x-typelizer":true},"StoreCredit":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"currency":{"type":"string"},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"category_id":{"type":"string","nullable":true},"category_name":{"type":"string","nullable":true}},"required":["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","customer_id","created_by_id","category_id","category_name"],"x-typelizer":true},"Store":{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object"},"name":{"type":"string"},"code":{"type":"string"},"preferred_storefront_url":{"type":"string","nullable":true},"default_currency":{"type":"string"},"default_locale":{"type":"string"},"mail_from_address":{"type":"string","nullable":true},"customer_support_email":{"type":"string","nullable":true},"new_order_notifications_email":{"type":"string","nullable":true},"preferred_send_consumer_transactional_emails":{"type":"boolean"},"preferred_admin_locale":{"type":"string","nullable":true},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_default_package_weight":{"type":"number"},"preferred_default_package_length":{"type":"number"},"preferred_default_package_width":{"type":"number"},"preferred_default_package_height":{"type":"number"},"preferred_unit_system":{"type":"string"},"preferred_storefront_access":{"type":"string"},"preferred_guest_checkout":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"url":{"type":"string"},"api_url":{"type":"string"},"setup_tasks":{"type":"array","items":{"$ref":"#/components/schemas/SetupTask"}},"supported_currencies":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"available_locales":{"type":"array","items":{"type":"string"}},"logo_url":{"type":"string","nullable":true},"mailer_logo_url":{"type":"string","nullable":true}},"required":["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_default_package_weight","preferred_default_package_length","preferred_default_package_width","preferred_default_package_height","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_order_routing_strategy","created_at","updated_at","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":true},"TaxCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tax_code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":true},"TaxLine":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"included":{"type":"boolean"},"rate":{"type":"string"},"tax_rate_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"fee_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"provider_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","included","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","amount","display_amount","provider_id","metadata","created_at","updated_at"],"x-typelizer":true},"Variant":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"sku":{"type":"string","nullable":true},"options_text":{"type":"string"},"track_inventory":{"type":"boolean"},"media_count":{"type":"number"},"preorder_ships_at":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"preorder":{"type":"boolean"},"weight":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"depth":{"type":"number","nullable":true},"price":{"$ref":"#/components/schemas/Price"},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"metadata":{"type":"object"},"position":{"type":"number"},"cost_price":{"type":"string","nullable":true},"cost_currency":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"weight_unit":{"type":"string","nullable":true},"dimensions_unit":{"type":"string","nullable":true},"backorder_limit":{"type":"number","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preorderable":{"type":"boolean"},"tax_category_id":{"type":"string","nullable":true},"available_stock":{"type":"number","nullable":true},"reserved_quantity":{"type":"number"},"total_on_hand":{"type":"number","nullable":true},"product_name":{"type":"string"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"stock_items":{"type":"array","items":{"$ref":"#/components/schemas/StockItem"}}},"required":["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","price","original_price","option_values","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","backorder_limit","deleted_at","created_at","updated_at","preorderable","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name"],"x-typelizer":true},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_name":{"type":"string"},"event_id":{"type":"string","nullable":true},"response_code":{"type":"number","nullable":true},"execution_time":{"type":"number","nullable":true},"error_type":{"type":"string","nullable":true},"request_errors":{"type":"string","nullable":true},"response_body":{"type":"string","nullable":true},"success":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivered_at":{"type":"string","nullable":true},"payload":{"type":"object"},"webhook_endpoint_id":{"type":"string"},"webhook_endpoint_url":{"type":"string"}},"required":["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":true},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}},"disabled_reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"disabled_at":{"type":"string","nullable":true},"secret_key":{"type":"string","nullable":true},"last_delivery_at":{"type":"string","nullable":true},"recent_delivery_count":{"type":"number"},"recent_failure_count":{"type":"number"},"total_delivery_count":{"type":"number"},"successful_delivery_count":{"type":"number"},"failed_delivery_count":{"type":"number"}},"required":["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":true}}}}\ No newline at end of file+{"info":{"title":"Admin API","contact":{"name":"Spree Commerce","url":"https://spreecommerce.org","email":"[email protected]"},"description":"Spree Admin API v3 - Administrative API for managing products, orders, and store settings.\n\n## Authentication\n\nThe Admin API requires a secret API key passed in the `x-spree-api-key` header.\nSecret API keys can be generated in the Spree admin dashboard.\n\n## Response Format\n\nAll responses are JSON. List endpoints return paginated responses with `data` and `meta` keys.\nSingle resource endpoints return a flat JSON object.\n\n## Resource IDs\n\nEvery resource is identified by an opaque string ID (e.g. `prod_86Rf07xd4z`,\n`variant_k5nR8xLq`, `or_UkLWZg9DAJ`). Use these IDs everywhere — URL paths,\nrequest bodies, and Ransack filters all accept them directly.\n\n## Error Handling\n\nErrors return a consistent format:\n```json\n{\n \"error\": {\n \"code\": \"validation_error\",\n \"message\": \"Validation failed\",\n \"details\": { \"name\": [\"can't be blank\"] }\n }\n}\n```\n","version":"v3"},"paths":{"/api/v3/admin/auth/login":{"post":{"summary":"Login","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Authenticates an admin user and returns a short-lived JWT access token.\nThe rotatable refresh token is set in an HttpOnly cookie — it is not\nincluded in the response body.\n\nThe `provider` field selects the authentication method. When omitted it\ndefaults to `email`, the built-in email/password login.\n\nTo authenticate against a third-party identity provider (Okta, Azure AD,\nGoogle Workspace SSO, a custom JWT issuer, SAML, etc.), send\n`{ \"provider\": \"<your_key>\", ... }` with the fields that provider\nrequires. The endpoint returns the same JWT regardless of which provider\nauthenticated the request. See\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication)\nfor the list of configured providers and their required fields.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"login successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"invalid credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"oneOf":[{"title":"EmailPasswordLogin","description":"Built-in email/password authentication (default when `provider` is omitted).","type":"object","properties":{"provider":{"type":"string","enum":["email"],"default":"email"},"email":{"type":"string","format":"email"},"password":{"type":"string"}},"required":["email","password"]},{"title":"ProviderLogin","description":"Provider-dispatched login. The `provider` key selects a configured\nauthentication provider; the remaining fields are forwarded to it.\nRequired fields depend on the provider — see\n[Custom API Authentication](https://spreecommerce.org/docs/developer/how-to/custom-api-authentication).\n","type":"object","properties":{"provider":{"type":"string","description":"Registered provider key (anything other than `email`).","not":{"enum":["email"]}}},"required":["provider"],"additionalProperties":true}]}}}}}},"/api/v3/admin/auth/refresh":{"post":{"summary":"Refresh token","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Exchanges the HttpOnly refresh-token cookie for a new access JWT and a\nrotated refresh token cookie. No request body or Authorization header\nis required — the cookie alone authenticates the call.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"refresh successful","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"401":{"description":"missing or invalid refresh-token cookie","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/auth/logout":{"post":{"summary":"Logout","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Revokes the refresh-token cookie, effectively logging the admin out.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"logout successful"}}}},"/api/v3/admin/me":{"get":{"summary":"Get current admin user and permissions","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current admin user profile and a serialized list of permissions (CanCanCan rules). The SPA uses these to drive UI permission checks.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current admin user and permissions","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current admin profile","tags":["Authentication"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Self-service update of the signed-in admin's own profile, such as their admin UI display language (`selected_locale`).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"profile updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"selected_locale":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"}}}}}}}},"/api/v3/admin/auth/password_resets":{"post":{"summary":"Request password reset","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Requests a password reset email for an admin user. Always returns `202`\nwhether or not the email matches an account, to prevent enumeration.\n\n`redirect_url` is where the emailed link should point (the reset token\nis appended as a `token` query param). It must match one of the store's\nallowed origins — otherwise it is silently ignored and the server-side\ndefault is used. The email is delivered by Spree itself via the\n`admin_user.password_reset_requested` event; this event is never\nforwarded to webhook endpoints.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"202":{"description":"reset requested","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","format":"email"},"redirect_url":{"type":"string","description":"Must match an allowed origin of the store; ignored otherwise."}},"required":["email"]}}}}}},"/api/v3/admin/auth/password_resets/{id}":{"patch":{"summary":"Reset password","tags":["Authentication"],"security":[{"api_key":[]}],"description":"Consumes a password reset token (the `token` query param from the\nemailed link), sets the new password, and signs the admin in: the\nresponse carries a JWT access token and the rotatable refresh token is\nset in an HttpOnly cookie. The token is single-use — it invalidates as\nsoon as the password changes.\n","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","description":"The reset token from the emailed link","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"password reset","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthResponse"}}}},"422":{"description":"invalid or expired token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"password":{"type":"string"},"password_confirmation":{"type":"string"}},"required":["password","password_confirmation"]}}}}}},"/api/v3/admin/allowed_origins":{"get":{"summary":"List allowed origins","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the CORS allowlist for the current store. Each entry is a\nbare `scheme://host[:port]` permitted to call the admin API from a\nbrowser. Backs the `Rack::Cors` allowlist and the CSRF boundary of\nthe admin cookie session (see\n`docs/plans/5.5-admin-auth-cookie-refresh.md`).\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[origin_cont]","in":"query","required":false,"description":"Filter by origin (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origins found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AllowedOrigin"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds an origin to the admin CORS allowlist. The value must be a bare\n`scheme://host[:port]` (no path, query, or fragment) and use `http` or\n`https`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"allowed origin created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}},"required":["origin"]}}}}}},"/api/v3/admin/allowed_origins/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Allowed origin ID","schema":{"type":"string"}}],"get":{"summary":"Get an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single allowed origin by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"404":{"description":"allowed origin not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing allowed origin.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"allowed origin updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AllowedOrigin"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"origin":{"type":"string"}}}}}}},"delete":{"summary":"Delete an allowed origin","tags":["Allowed Origins"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an origin from the admin CORS allowlist. After deletion the\nadmin SPA running at that origin will no longer be able to call the\nadmin API from a browser.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"allowed origin deleted"}}}},"/api/v3/admin/api_keys":{"get":{"summary":"List API keys","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns publishable and secret API keys for the current store. Secret keys are listed by `token_prefix` only — the plaintext token is delivered exactly once on create.\n\n**Required scope:** `read_api_keys` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"API keys found","content":{"application/json":{}}}}},"post":{"summary":"Create an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a publishable or secret API key. The plaintext token is included in the response **once** for secret keys; publishable keys expose their token on every read since they are intended for client-side use.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","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":"secret key created — plaintext token returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name","key_type"],"properties":{"name":{"type":"string"},"key_type":{"type":"string","enum":["publishable","secret"]},"scopes":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/api_keys/{id}":{"get":{"summary":"Show an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key found","content":{"application/json":{}}}}},"patch":{"summary":"Update an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Renames a key. `key_type` and `scopes` are fixed at creation — to change a key's authority, create a new key and revoke the old one.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key renamed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"}}}}}}},"delete":{"summary":"Delete an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"API key deleted"}}}},"/api/v3/admin/api_keys/current":{"get":{"summary":"Describe the current API key","tags":["API Keys"],"security":[{"api_key":[]}],"description":"Returns the secret key that authenticated this request, including its live scopes. Useful to confirm a key's real, current authority. Only secret-key principals have a single key to describe.\n\n**Required scope:** none — any key can describe itself (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"current API key","content":{"application/json":{}}}}}},"/api/v3/admin/api_keys/{id}/revoke":{"patch":{"summary":"Revoke an API key","tags":["API Keys"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks the key revoked. Future requests using its token will fail; the row is preserved for audit.\n\n**Required scope:** `write_api_keys` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"API key revoked","content":{"application/json":{}}}}}},"/api/v3/admin/categories":{"get":{"summary":"List categories","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's categories (manual hierarchical taxons; rule-based collections are excluded).\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a category. Nests under the parent when parent_id is given, otherwise creates a top-level category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"category created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}},"required":["name"]}}}}}},"/api/v3/admin/categories/{id}":{"get":{"summary":"Get a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single category by ID.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., children, parent, ancestors).","schema":{"type":"string"}}],"responses":{"200":{"description":"category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}},"404":{"description":"category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a category.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"parent_id":{"type":"string","description":"Prefixed ID of the parent category"},"description":{"type":"string"},"permalink":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"}}}}}}},"delete":{"summary":"Delete a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a category and its descendants.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"204":{"description":"category deleted"}}}},"/api/v3/admin/categories/{id}/reposition":{"patch":{"summary":"Reposition a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a category to a new parent and/or index within the tree.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"category repositioned","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Category"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_parent_id":{"type":"string","description":"Prefixed ID of the new parent (omit for top level)"},"new_position":{"type":"integer","description":"0-based index among the new parent's children"}},"required":["new_position"]}}}}}},"/api/v3/admin/categories/{category_id}/products":{"get":{"summary":"List category products","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products classified under the category, ordered by their classification position.\n\n**Required scope:** `read_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Classifies a product under the category (appended to the end).\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/categories/{category_id}/products/{id}":{"delete":{"summary":"Remove a product from a category","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the category's manual classification.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/categories/{category_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a category product","tags":["Categories"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the category's products.\n\n**Required scope:** `write_categories` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"category_id","in":"path","required":true,"description":"Category ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the category's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/channels":{"get":{"summary":"List channels","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channels configured for the current store.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}}],"responses":{"200":{"description":"channels found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new channel on the current store. `code` is normalized to a\nURL-safe slug (`Point of Sale` → `point-of-sale`); when omitted it's\nderived from `name`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"channel created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"code":{"type":"string","description":"Slug — auto-derived from `name` when blank."},"active":{"type":"boolean","default":true},"default":{"type":"boolean","default":false},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}}},"/api/v3/admin/channels/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel found","content":{"application/json":{}}}}},"patch":{"summary":"Update a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"channel updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true,"description":"Routing strategy class name. `null` inherits the store setting."},"preferred_storefront_access":{"type":"string","nullable":true,"enum":["public","prices_hidden","login_required"],"description":"Anonymous-visitor access posture. `null` inherits the store setting."},"preferred_guest_checkout":{"type":"boolean","nullable":true,"description":"Whether guests can check out without an account. `null` inherits the store setting."}}}}}}},"delete":{"summary":"Delete a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"channel deleted"}}}},"/api/v3/admin/channels/{id}/add_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Publish products on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the listed products on this channel. Idempotent — re-publishing\nan already-published product updates its publication window. Products from\nsibling stores are silently dropped.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}},"published_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications go live. `null` means immediately."},"unpublished_at":{"type":"string","format":"date-time","nullable":true,"description":"When the publications come down. `null` means never."}}}}}}}},"/api/v3/admin/channels/{id}/remove_products":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Unpublish products from a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes the listed products from this channel.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["product_ids"],"properties":{"product_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List order routing rules for a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the channel's routing rules in priority order. The rules engine walks them top-down; see the Order Routing guide.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create an order routing rule on a channel","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a rule to the channel's routing list. The `type` is the wire shorthand from `GET /order_routing_rules/types` (e.g. `preferred_location`). Omitting `position` appends the rule at the end of the list. Each rule kind can appear at most once per channel — a duplicate `type` is rejected with a validation error.\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"rule created","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/channels/{channel_id}/order_routing_rules/{id}":{"parameters":[{"name":"channel_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a rule's `active` flag, `position` (the list reorders around it), or `preferences`. The rule kind cannot be changed — delete and re-create instead.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"active":{"type":"boolean"},"position":{"type":"integer"},"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete an order routing rule","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/order_routing_rules/types":{"get":{"summary":"List available order routing rule types","tags":["Channels"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels, descriptions and preference schemas — drives the \"Add rule\" picker in the admin dashboard. Plugins extend the list by registering `Spree::OrderRoutingRule` subclasses via `Spree.order_routing.rules`.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/custom_field_definitions":{"get":{"summary":"List custom field definitions","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all defined custom fields. Filter by `?q[resource_type_eq]=Spree::Product` to narrow to one parent type.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definitions returned","content":{"application/json":{}}}}},"post":{"summary":"Create a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","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":"definition created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["key","field_type","resource_type"],"properties":{"namespace":{"type":"string","description":"Defaults to `custom`"},"key":{"type":"string"},"label":{"type":"string","description":"Human-readable name; defaults to titleized `key`"},"field_type":{"type":"string","description":"Custom field type identifier (one of the registered field-type class names)."},"resource_type":{"type":"string","description":"Owner class, e.g. `Spree::Product`"},"storefront_visible":{"type":"boolean","description":"When false, the definition is admin-only and never exposed in the Store API"},"searchable":{"type":"boolean","description":"When true, values are included in storefront product text search"},"sortable":{"type":"boolean","description":"When true, storefront product listings can sort by this field"}}}}}}}},"/api/v3/admin/custom_field_definitions/{id}":{"get":{"summary":"Show a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","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,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,label,field_type). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"definition found","content":{"application/json":{}}}}},"patch":{"summary":"Update a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"definition updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a custom field definition","tags":["Custom Fields"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the definition and cascades to all custom field values referencing it.\n\n**Required scope:** `write_settings` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"definition deleted"}}}},"/api/v3/admin/customer_groups":{"get":{"summary":"List customer groups","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer groups configured for the current store. Groups\nsegment customers for targeted promotions (see the `customer_group`\npromotion rule) and reporting. The list endpoint never embeds the\nmember list — fetch a single group with `?expand=customers` if you\nneed them inline, or query `/admin/customers?customer_group_id_in=…`\nfor paginated membership.\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer groups found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer group in the current store. `customer_ids` is\noptional; when present, customers are attached at create time.\nPass prefixed IDs (e.g. `cus_…`) — the server decodes them\nautomatically.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","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":"customer group created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customer_groups/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Customer group prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single customer group. Pass `?expand=customers` to embed\nthe full member list inline (recommended only for single-record\nreads — embed cost scales with membership size).\n\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `customers`.","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer group with embedded customers","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"404":{"description":"customer group not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, description, or membership. `customer_ids` is a\nfull-set replacement — the server reconciles the membership to\nmatch the array, adding new IDs and removing ones not present.\nSend `customer_ids: []` to clear all members.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer group updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerGroup"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"customer_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a customer group","tags":["Customer Groups"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the group. Member users are not deleted; their `customer_group_users` rows are dropped.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer group deleted"}}}},"/api/v3/admin/customers/{customer_id}/addresses":{"get":{"summary":"List customer addresses","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved addresses.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., country, state). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., first_name,last_name,address1,city). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"addresses found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new address to the customer's address book. Pass `is_default_billing: true` or `is_default_shipping: true` to set as the default — the previous default loses its flag in the same transaction.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"address created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"address2":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_iso":{"type":"string","description":"ISO-2 country code (e.g. US)"},"state_abbr":{"type":"string","description":"State/province abbreviation (e.g. NY)"},"phone":{"type":"string"},"company":{"type":"string"},"label":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}}},"/api/v3/admin/customers/{customer_id}/addresses/{id}":{"patch":{"summary":"Update a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a customer address.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"address updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"city":{"type":"string"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"}}}}}}},"delete":{"summary":"Delete a customer address","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes the address. If it was a default, the customer loses that default (no auto-promotion).\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"address deleted"}}}},"/api/v3/admin/customers/{customer_id}/credit_cards":{"get":{"summary":"List customer credit cards","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the customer's saved credit cards. Useful for off-session admin charges via `POST /admin/orders/:id/payments { source_id }`.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit cards found","content":{"application/json":{}}}}}},"/api/v3/admin/customers/{customer_id}/credit_cards/{id}":{"get":{"summary":"Show a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a saved credit card by ID.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., brand,last4,month,year). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"credit card found","content":{"application/json":{}}}}},"delete":{"summary":"Delete a customer credit card","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a saved credit card.\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"credit card deleted"}}}},"/api/v3/admin/customers/{customer_id}/store_credits":{"get":{"summary":"List customer store credits","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns store credits issued to the customer.\n\n**Required scope:** `read_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., category, store, created_by). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,amount_used,memo,currency). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credits found","content":{"application/json":{}}}}},"post":{"summary":"Issue a store credit to a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"`created_by` is set automatically from the authenticated admin.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"store credit created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount","currency","category_id"],"properties":{"amount":{"type":"string"},"currency":{"type":"string"},"category_id":{"type":"string","description":"StoreCreditCategory ID"},"memo":{"type":"string"}}}}}}}},"/api/v3/admin/customers/{customer_id}/store_credits/{id}":{"patch":{"summary":"Update a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Update memo / category / amount. The amount can only be changed if `amount_used == 0`.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"store credit updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"category_id":{"type":"string"},"memo":{"type":"string"}}}}}}},"delete":{"summary":"Delete a store credit","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused store credit (amount_used == 0). Returns 422 otherwise.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"customer_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"store credit deleted"}}}},"/api/v3/admin/customers":{"get":{"summary":"List customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of customers. Supports Ransack search/filters.\n\n**Required scope:** `read_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[search]","in":"query","required":false,"description":"Email + name full-text-ish search","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., addresses, store_credits). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customers found","content":{"application/json":{}}}}},"post":{"summary":"Create a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a customer. No welcome email is sent automatically.\n\n**Required scope:** `write_customers` (for API-key authentication).","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":"customer created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}}},"/api/v3/admin/customers/{id}":{"get":{"summary":"Show a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full customer details including computed order stats (orders_count, total_spent, last_order_completed_at).\n\n**Required scope:** `read_customers` (for API-key authentication).","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":"Customer ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations: addresses, orders, store_credits, default_billing_address, default_shipping_address","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., email,first_name,last_name). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"customer found","content":{"application/json":{}}}}},"patch":{"summary":"Update a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates customer attributes. `tags` replaces the full set.\n\n**Required scope:** `write_customers` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"customer updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"phone":{"type":"string"},"accepts_email_marketing":{"type":"boolean"},"internal_note":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"metadata":{"type":"object"}}}}}}},"delete":{"summary":"Delete a customer","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a customer. Returns 422 if the customer has any orders.\n\n**Required scope:** `write_customers` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"customer deleted"}}}},"/api/v3/admin/customers/bulk_add_to_groups":{"post":{"summary":"Bulk-add customers to groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each customer in `ids` to every group in `customer_group_ids`.\nIdempotent — customers already in a group are skipped server-side.\nGroups from sibling stores are silently ignored. Returns counts of\ncustomers and groups that were processed (post store-scoping).\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers added to groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_from_groups":{"post":{"summary":"Bulk-remove customers from groups","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each customer in `ids` from every group in `customer_group_ids`.\nNo-op for non-members. Groups from sibling stores are silently ignored.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"customers removed from groups","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"customer_group_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","customer_group_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_add_tags":{"post":{"summary":"Bulk-add tags to customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every customer in `ids`. Tags are\nupserted by name; re-adding an existing tag is a no-op.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/customers/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from customers","tags":["Customers"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag name in `tags` from every customer in `ids`. No-op\nfor customers that don't carry the tag.\n\n\n**Required scope:** `write_customers` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{"schema":{"type":"object","properties":{"customer_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/exports":{"get":{"summary":"List exports","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV exports queued or completed for the current store. Polled by the admin SPA to detect when an export finishes (`done: true`).\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"exports found","content":{"application/json":{}}}}},"post":{"summary":"Create an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV export. The `type` selects the dataset; `search_params` is an\noptional Ransack query (same shape used by the `q[...]` params on list endpoints)\nthat filters which records are exported. Pass `record_selection: \"all\"` to\nclear the filter server-side and export everything in scope.\n\nGeneration is asynchronous. Poll `GET /admin/exports/{id}` until `done` is `true`,\nthen redirect the browser to `download_url` to fetch the file.\n\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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":"export queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type"],"properties":{"type":{"type":"string","enum":["products","orders","customers","product_translations","gift_cards","coupon_codes","newsletter_subscribers"]},"record_selection":{"type":"string","enum":["filtered","all"],"description":"Set to \"all\" to ignore search_params and export everything in scope."},"search_params":{"type":"object","description":"Ransack query hash. Same predicates accepted by the list endpoint.","additionalProperties":true},"results_url":{"type":"string","description":"Absolute URL of your admin exports view; the export-done email uses it as the download button target. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/exports/{id}":{"get":{"summary":"Show an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns export status. While `done` is `false`, the SPA continues polling.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"export found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the export and purges its attachment.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"export deleted"}}}},"/api/v3/admin/exports/{id}/download":{"get":{"summary":"Download an export","tags":["Exports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the exported CSV with `Content-Disposition: attachment`. Returns 422 with `code: export_not_ready` while `done` is still `false`. The endpoint is JWT/API-key protected, so SPA clients must fetch it (with `Authorization` header) and trigger the browser download via a Blob URL — a top-level navigation cannot carry the JWT.\n\n**Required scope:** the read scope of the exported resource — `read_products` for product exports, `read_customers` for customer exports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments":{"get":{"summary":"List fulfillments","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all shipments for an order.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillments found","content":{"application/json":{}}}}},"post":{"summary":"Create a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually creates a fulfillment on a completed order, bypassing order routing — for example to mirror a shipment handled by an external carrier or 3PL. Moves the requested line item quantities out of their current fulfillments; when `items` is omitted, every not-yet-shipped unit is moved. Pass `status: 'shipped'` to register an already-shipped fulfillment (fires shipped webhooks and freezes cost/carrier). When `delivery_method_id` is omitted, the fulfillment inherits the delivery method and cost of the source fulfillment(s) it fully drains — keeping the order total unchanged; partially drained splits get no carrier when shipped, and pending fulfillments are otherwise (re)priced by the standard rate engine, which selects the lowest-cost available rate. Pass `cost` to set an explicit shipping cost instead (e.g. the 3PL price) — note this changes the order total and payment state, and is guaranteed to persist only with `status: 'shipped'` (pending fulfillments are re-priced by the rate engine).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fulfillment created","content":{"application/json":{}}},"422":{"description":"order not completed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["stock_location_id"],"properties":{"stock_location_id":{"type":"string","description":"Stock location the fulfillment ships from"},"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link — a full URL is served back as tracking_url unchanged instead of being templated into the delivery method tracking URL"},"delivery_method_id":{"type":"string","description":"Delivery method (carrier) to attach as the selected rate. Defaults to the delivery method of the fully drained source fulfillment(s)"},"cost":{"type":"string","description":"Explicit shipping cost. Defaults to the summed cost of the fully drained source fulfillment(s), which keeps the order total unchanged; an explicit cost changes the order total and payment state. Guaranteed to persist only with status: 'shipped' — pending fulfillments are re-priced by the rate engine"},"status":{"type":"string","enum":["shipped"],"description":"Pass 'shipped' to register the fulfillment as already shipped"},"items":{"type":"array","description":"Line item quantities to fulfill. Omit to fulfill every not-yet-shipped unit.","items":{"type":"object","required":["item_id","quantity"],"properties":{"item_id":{"type":"string","description":"Line item ID"},"quantity":{"type":"integer"}}}},"metadata":{"type":"object","additionalProperties":true}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}":{"get":{"summary":"Show a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific shipment.\n\n**Required scope:** `read_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., inventory_units, stock_location, shipping_rates). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,status,tracking,cost). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment found","content":{"application/json":{}}}}},"patch":{"summary":"Update a shipment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a fulfillment (tracking, delivery rate).\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"shipment updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tracking":{"type":"string","description":"Carrier tracking number, or a full https:// tracking link served back as tracking_url unchanged"},"selected_delivery_rate_id":{"type":"string","description":"Delivery rate ID (dr_...) to select"}}}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/fulfill":{"patch":{"summary":"Fulfill a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Marks a fulfillment as fulfilled.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment fulfilled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/cancel":{"patch":{"summary":"Cancel a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment canceled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/resume":{"patch":{"summary":"Resume a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a canceled fulfillment.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/fulfillments/{id}/split":{"patch":{"summary":"Split a fulfillment","tags":["Fulfillments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Transfers items from this shipment to a new shipment at a different stock location.\n\n**Required scope:** `write_fulfillments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Fulfillment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"fulfillment split","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"stock_location_id":{"type":"string","description":"Target stock location ID"}}}}}}}},"/api/v3/admin/gift_card_batches":{"get":{"summary":"List gift card batches","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift card batches issued by the current store. Each batch\ngroups the cards generated together for a campaign or bulk-issuance\n— the cards themselves live under `/admin/gift_cards` and reference\nthe batch via `gift_card_batch_id`.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Records per page","schema":{"type":"integer"}},{"name":"q[prefix_cont]","in":"query","required":false,"description":"Filter by prefix (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batches found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCardBatch"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a batch of gift cards in a single call. The server generates\n`codes_count` cards inline for small batches (configurable via\n`Spree.config.gift_card_batch_web_limit`, default 500) or enqueues\na background job for larger ones. Each card's code is the batch\n`prefix` followed by random hex.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","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":"gift card batch created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prefix","amount","codes_count"],"properties":{"prefix":{"type":"string","description":"Lowercased and prepended to every generated code."},"amount":{"type":"string","description":"Decimal amount per card, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"codes_count":{"type":"integer","description":"Number of cards to generate. Capped at `gift_card_batch_limit`."},"expires_at":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/gift_card_batches/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card batch prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card batch","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single batch.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card batch found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCardBatch"}}}},"404":{"description":"gift card batch not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/gift_cards":{"get":{"summary":"List gift cards","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the gift cards issued by the current store. Filter by\n`q[code_cont]` for code search, `q[user_id_eq]` for cards issued\nto a specific customer, or `q[state_eq]` for status filtering.\n\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[code_cont]","in":"query","required":false,"description":"Filter by gift card code (contains)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by status (active, redeemed, partially_redeemed, canceled)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift cards found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/GiftCard"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a gift card scoped to the current store. The code is\nauto-generated when omitted. `currency` defaults to the store's\nconfigured currency. Pass `user_id` (prefixed ID) to attach the\ncard to a specific customer.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","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":"gift card created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["amount"],"properties":{"amount":{"type":"string","description":"Decimal amount, greater than zero."},"currency":{"type":"string","description":"ISO 4217 currency code. Defaults to the store currency."},"code":{"type":"string","description":"Optional caller-supplied code. Auto-generated when omitted."},"expires_at":{"type":"string","description":"ISO 8601 date.","nullable":true},"user_id":{"type":"string","description":"Optional customer prefixed ID.","nullable":true}}}}}}}},"/api/v3/admin/gift_cards/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Gift card prefixed ID","schema":{"type":"string"}}],"get":{"summary":"Get a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single gift card.\n\n**Required scope:** `read_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"gift card found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}},"404":{"description":"gift card not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an active gift card's editable attributes. Redeemed or\npartially-redeemed cards cannot be edited.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"gift card updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GiftCard"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string"},"expires_at":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a gift card","tags":["Gift Cards"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an unused gift card. Cards that have been redeemed or\npartially redeemed cannot be deleted and return 422.\n\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"gift card deleted"},"422":{"description":"redeemed gift card cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/imports":{"get":{"summary":"List imports","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns CSV imports queued or completed for the current store.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"imports found","content":{"application/json":{}}}}},"post":{"summary":"Create an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Queues a CSV import. Upload the file first via `POST /api/v3/admin/direct_uploads`\nand pass the returned `signed_id` as `attachment`. On success the import is in the\n`mapping` state and the response carries the mapping payload: `schema_fields`\n(the canonical columns for the type), `csv_headers`, a `sample_row`, and the\nauto-assigned `mappings`.\n\nAdjust mappings if needed, then call `PATCH /admin/imports/{id}/complete_mapping`\nto start processing. Poll `GET /admin/imports/{id}` while `status` is\n`completed_mapping`/`processing`; terminal statuses are `completed` and `failed`.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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":"import created in mapping state","content":{"application/json":{}}},"422":{"description":"unknown import type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["type","attachment"],"properties":{"type":{"type":"string","enum":["products","customers","product_translations"]},"attachment":{"type":"string","description":"ActiveStorage signed blob id from POST /api/v3/admin/direct_uploads."},"preferred_delimiter":{"type":"string","enum":[",",";","|","\t"],"description":"CSV column separator. Defaults to a comma."},"results_url":{"type":"string","description":"Absolute URL of your admin imports view; the import-done email links back to it with `?import=<id>` appended. Only honored when it matches one of the store's configured allowed origins."}}}}}}}},"/api/v3/admin/imports/template":{"get":{"summary":"Download an import template","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a CSV header row for the given import type, including the custom field columns available for the model.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"200":{"description":"CSV template","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/example":{"get":{"summary":"Download an example import file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Redirects to a populated example CSV for the given import type — the same sample data `rake spree:load_sample_data` uses, pinned to the installed Spree version. Returns 404 for a type that ships no example file.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"type","in":"query","required":true,"description":"Registered import type, e.g. products.","schema":{"type":"string"}}],"responses":{"302":{"description":"Redirect to the example CSV"}}}},"/api/v3/admin/imports/{id}":{"get":{"summary":"Show an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns import status and row counters. The admin dashboard polls this endpoint while `status` is `completed_mapping` or `processing`; `rows_count`, `completed_rows_count` and `failed_rows_count` drive the progress bar. The mapping payload (`csv_headers`, `sample_row`) is only present while `status` is `mapping`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"import found","content":{"application/json":{}}}}},"delete":{"summary":"Delete an import","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the import, its rows and the uploaded file. Returns 422 while the import is being processed.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"import deleted"}}}},"/api/v3/admin/imports/{id}/download":{"get":{"summary":"Download the originally uploaded file","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Streams the CSV exactly as it was uploaded — the audit trail for what was imported. JWT/API-key protected; SPA clients fetch it with the Authorization header and trigger the browser download via a Blob URL.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"CSV file","content":{"application/json":{},"text/csv":{"schema":{"type":"string","format":"binary"}}}}}}},"/api/v3/admin/imports/{id}/complete_mapping":{"patch":{"summary":"Complete mapping and start processing","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the submitted column mappings, then starts row processing. Omit `mappings`\nto accept the auto-assigned ones from the create response. Returns 422 when a\nrequired schema field is left unmapped (`details.missing_required_fields`) or a\nfile column is assigned twice.\n\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"mapping completed, processing queued","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"mappings":{"type":"array","description":"Column assignments to apply before starting. `file_column: null` unmaps a field.","items":{"type":"object","required":["schema_field"],"properties":{"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/imports/{id}/retry_failed_rows":{"patch":{"summary":"Retry failed rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-processes the rows that failed. The import re-enters `processing`; poll `GET /admin/imports/{id}` until it completes again. Returns 422 when the import is not `completed` or has no failed rows.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"retry queued","content":{"application/json":{}}}}}},"/api/v3/admin/imports/{import_id}/rows":{"get":{"summary":"List import rows","tags":["Imports"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Paginated rows of an import — the failure report. Filter with `q[status_eq]=failed` to list only rows that could not be imported; each row carries the raw CSV `data` and its `validation_errors`.\n\n**Required scope:** the write scope of the imported resource — `write_products` for product imports, `write_customers` for customer imports, etc. (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"import_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter rows by status: pending, processing, completed, failed.","schema":{"type":"string"}}],"responses":{"200":{"description":"rows found","content":{"application/json":{}}}}}},"/api/v3/admin/markets":{"get":{"summary":"List markets","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the markets configured for the current store. Markets are\nstore-scoped and ordered by `position` (an `acts_as_list` column —\nupdate the order via `PATCH /markets/{id}` with `position`).\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `countries`.","schema":{"type":"string"}}],"responses":{"200":{"description":"markets found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new market for the current store.\n\n- `country_isos` accepts 2-letter ISO country codes (e.g. `[\"DE\", \"FR\"]`);\n the market must contain at least one country. Unknown codes are\n silently dropped.\n- `supported_locales` accepts an array of locale codes; the\n `default_locale` is always implicitly included.\n- Setting `default: true` automatically demotes the previous default\n market in the store.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"market created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string","description":"ISO 4217 currency code."},"default_locale":{"type":"string","description":"IETF locale tag used as the market default."},"supported_locales":{"type":"array","items":{"type":"string"},"description":"Locale codes available in this market. The default is always implicitly included."},"tax_inclusive":{"type":"boolean","default":false,"description":"Display prices with tax included."},"default":{"type":"boolean","default":false,"description":"Setting to true demotes the previous default."},"position":{"type":"integer","description":"Sort order within the store; lower = first."},"country_isos":{"type":"array","items":{"type":"string"},"description":"2-letter ISO country codes assigned to this market. At least one is required."}},"required":["name","currency","default_locale","country_isos"]}}}}}},"/api/v3/admin/markets/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"market found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"404":{"description":"market not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing market. Pass `country_isos` to replace the\nmarket's country list (full-set update), `supported_locales` to\nreplace the supported locales, or `position` to reorder the market\nwithin the store.\n\nSetting `default: true` automatically demotes the previous default.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"market updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Market"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"supported_locales":{"type":"array","items":{"type":"string"}},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"position":{"type":"integer"},"country_isos":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a market","tags":["Markets"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the market (sets `deleted_at`). The default market and\nthe last remaining market in a store cannot be deleted — both return\n422 with a `validation_error`.\n\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"market deleted"},"422":{"description":"cannot delete default or last market","content":{"application/json":{}}}}}},"/api/v3/admin/option_types":{"get":{"summary":"List option types","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of option types.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new option type. Supports nested option values.\n\nOption values can be provided inline and will be created or updated by name.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"option type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}},"required":["name","label"]}}}}}},"/api/v3/admin/option_types/{id}":{"get":{"summary":"Get an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single option type by ID, including its option values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,label,position). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"option type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"404":{"description":"option type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an option type. Supports updating nested option values.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"200":{"description":"option type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OptionType"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"},"filterable":{"type":"boolean"},"option_values":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Existing option value ID to update"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete an option type","tags":["Option Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes an option type.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Option type ID","schema":{"type":"string"}}],"responses":{"204":{"description":"option type deleted"}}}},"/api/v3/admin/orders/{order_id}/tax_lines":{"get":{"summary":"List tax lines","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed tax rows on the order. Read-only — written exclusively by the tax provider.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"tax lines found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/discounts":{"get":{"summary":"List discounts","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Typed discount rows (promotion-sourced and manual) on the order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"200":{"description":"discounts found","content":{"application/json":{}}}}},"post":{"summary":"Create manual discount","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual discount. With line_item_id a single row is created; without it the amount is distributed across line items (largest remainder). This is the sanctioned post-placement discount path and works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"discount created","content":{"application/json":{}}},"422":{"description":"invalid discount","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"value":{"type":"number"},"value_type":{"type":"string","enum":["flat","percent"]},"line_item_id":{"type":"string","nullable":true,"description":"Target line item; omit to distribute order-level"}},"required":["label","value"]}}}}}},"/api/v3/admin/orders/{order_id}/fees":{"post":{"summary":"Create fee","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a fee (surcharge, handling, gift wrap, COD, payment fee). Order-level when no target is given. Works on completed orders.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order prefixed ID","schema":{"type":"string"}}],"responses":{"201":{"description":"fee created","content":{"application/json":{}}},"422":{"description":"invalid fee","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string"},"amount":{"type":"number"},"kind":{"type":"string","enum":["surcharge","handling","gift_wrap","cod","payment"],"description":"Defaults to 'surcharge'"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true}},"required":["label","amount"]}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards":{"post":{"summary":"Apply a gift card to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies a gift card by code to the order. Returns the gift card.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"gift card applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Gift card code"}}}}}}}},"/api/v3/admin/orders/{order_id}/gift_cards/{id}":{"delete":{"summary":"Remove a gift card from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the gift card from the order.\n\n**Required scope:** `write_gift_cards` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Gift card ID","schema":{"type":"string"}}],"responses":{"204":{"description":"gift card removed"}}}},"/api/v3/admin/orders/{order_id}/items":{"get":{"summary":"List order items","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all line items for an order.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"items found","content":{"application/json":{}}}}},"post":{"summary":"Add an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new line item to the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"item added","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Prefixed variant ID"},"quantity":{"type":"integer","default":1}}}}}}}},"/api/v3/admin/orders/{order_id}/items/{id}":{"get":{"summary":"Show an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific line item.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variant, variant.product). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., quantity,price,total). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"item found","content":{"application/json":{}}}}},"patch":{"summary":"Update an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order item quantity or metadata.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"200":{"description":"item updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"quantity":{"type":"integer"}}}}}}},"delete":{"summary":"Remove an item","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes an item from the order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Item ID","schema":{"type":"string"}}],"responses":{"204":{"description":"line item removed"}}}},"/api/v3/admin/orders/{order_id}/store_credits":{"post":{"summary":"Apply customer's store credit to an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Applies the order customer's available store credit. When `amount` is omitted, applies up to the order outstanding balance.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"store credit applied","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","description":"Optional explicit amount; defaults to order outstanding balance"}}}}}}},"delete":{"summary":"Remove store credit from an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes any applied store credit from the order.\n\n**Required scope:** `write_store_credits` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"store credit removed"}}}},"/api/v3/admin/orders":{"get":{"summary":"List orders","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of orders for the current store.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., created_at, -created_at, completed_at)","schema":{"type":"string"}},{"name":"q[state_eq]","in":"query","required":false,"description":"Filter by state (cart, address, delivery, payment, confirm, complete, canceled)","schema":{"type":"string"}},{"name":"q[email_cont]","in":"query","required":false,"description":"Filter by email (contains)","schema":{"type":"string"}},{"name":"q[number_eq]","in":"query","required":false,"description":"Filter by order number","schema":{"type":"string"}},{"name":"q[completed_at_gt]","in":"query","required":false,"description":"Filter by completed after date","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"orders found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft order in one shot. Customer, items, addresses, currency,\nmarket, channel, locale, notes, metadata, and a coupon code can all be\nprovided inline.\n\nSetting `preferred_stock_location_id` pins the order's preferred fulfillment\nlocation — Order Routing's built-in `PreferredLocation` rule consumes it\nwhen picking which stock location ships each shipment.\n\nInvalid coupon codes are non-fatal — the order is created and the failure\nis reported on the service result (not in the API response body for now).\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"order created with preferred_stock_location_id","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_id":{"type":"string","description":"Customer ID. Alias: user_id (legacy)."},"use_customer_default_address":{"type":"boolean","description":"When true with customer_id, copies the customer's saved billing/shipping addresses onto the order."},"currency":{"type":"string"},"market_id":{"type":"string","description":"Market ID"},"channel_id":{"type":"string","description":"Channel ID. Defaults to the store primary channel when omitted."},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Order Routing's built-in PreferredLocation rule reads this and ranks the location first; routing falls back to the next rule when the preferred location can't cover the cart."},"locale":{"type":"string"},"customer_note":{"type":"string","description":"Public, customer-visible note"},"internal_note":{"type":"string","description":"Staff-only note"},"metadata":{"type":"object","description":"Arbitrary key/value metadata"},"shipping_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"shipping_address_id":{"type":"string","description":"Existing customer address ID"},"billing_address":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"postal_code":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"billing_address_id":{"type":"string","description":"Existing customer address ID"},"items":{"type":"array","items":{"type":"object","required":["variant_id","quantity"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}},"coupon_code":{"type":"string","description":"Optional. Applied non-fatally; invalid codes do not block creation."}}}}}}}},"/api/v3/admin/orders/{id}":{"get":{"summary":"Show an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns full order details including admin-only fields.\n\n**Required scope:** `read_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID (e.g., or_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., items, fulfillments, payments, customer, discounts, billing_address, shipping_address). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., number,total,status,completed_at). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"order found","content":{"application/json":{}}},"404":{"description":"order not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an order. Supports updating email, addresses, special instructions, and line items.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"customer_note":{"type":"string"},"internal_note":{"type":"string"},"channel_id":{"type":"string","description":"Channel ID"},"preferred_stock_location_id":{"type":"string","description":"Stock Location ID to prefer for fulfillment. Re-runs Order Routing's PreferredLocation rule on subsequent shipment rebuilds."},"ship_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"bill_address":{"type":"object","properties":{"firstname":{"type":"string"},"lastname":{"type":"string"},"address1":{"type":"string"},"city":{"type":"string"},"zipcode":{"type":"string"},"country_iso":{"type":"string"},"state_abbr":{"type":"string"},"phone":{"type":"string"}}},"items":{"type":"array","items":{"type":"object","required":["variant_id"],"properties":{"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer"},"metadata":{"type":"object"}}}}}}}}}},"delete":{"summary":"Delete a draft order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a draft order. Completed orders cannot be deleted.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"204":{"description":"order deleted"}}}},"/api/v3/admin/orders/{id}/complete":{"patch":{"summary":"Complete an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Completes an order in the `confirm` state, marking it as placed.\n\nSet `notify_customer: true` to send the order confirmation email.\n\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order completed","content":{"application/json":{}}},"422":{"description":"order cannot be completed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"notify_customer":{"type":"boolean","description":"Send the order confirmation email after completion."}}}}}}}},"/api/v3/admin/orders/{id}/cancel":{"patch":{"summary":"Cancel an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Cancels a completed order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order canceled","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/approve":{"patch":{"summary":"Approve an order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Approves an order (e.g., for fraud review).\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order approved","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resume":{"patch":{"summary":"Resume a canceled order","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Resumes a previously canceled order.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"order resumed","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{id}/resend_confirmation":{"post":{"summary":"Resend confirmation email","tags":["Orders"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes the order.completed event to trigger confirmation email delivery.\n\n**Required scope:** `write_orders` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"200":{"description":"confirmation resent","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods":{"get":{"summary":"List payment methods","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's configured payment methods. Use `source_required: true` to know which methods need a saved source.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment methods found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/types":{"get":{"summary":"List available payment provider types","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PaymentMethod subclasses that can be used to create new payment methods. Useful for populating a \"Provider\" dropdown in admin UIs.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"provider types found","content":{"application/json":{}}}}}},"/api/v3/admin/payment_methods/{id}":{"get":{"summary":"Show a payment method","tags":["Payment Methods"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a payment method by ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","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,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand. Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,type,active). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment method found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments":{"get":{"summary":"List payments","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all payments for an order.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payments found","content":{"application/json":{}}}}},"post":{"summary":"Create a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new payment for the order.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"payment created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_method_id"],"properties":{"payment_method_id":{"type":"string","description":"Payment method ID"},"amount":{"type":"string"},"source_id":{"type":"string","description":"Payment source ID"}}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}":{"get":{"summary":"Show a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns details of a specific payment.\n\n**Required scope:** `read_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment_method, source). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,status,number,response_code). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"payment found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/capture":{"patch":{"summary":"Capture a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Captures a pending payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment captured","content":{"application/json":{}}},"422":{"description":"capture failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/orders/{order_id}/payments/{id}/void":{"patch":{"summary":"Void a payment","tags":["Payments"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Voids a payment.\n\n**Required scope:** `write_payments` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Payment ID","schema":{"type":"string"}}],"responses":{"200":{"description":"payment voided","content":{"application/json":{}}}}}},"/api/v3/admin/price_lists":{"get":{"summary":"List price lists","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the price lists configured for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `price_rules`.","schema":{"type":"string"}}],"responses":{"200":{"description":"price lists found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/PriceList"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new draft price list.\n\n**Required scope:** `write_products` (for API-key authentication).","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":"price list created (server-to-server — rules + prices, no product_ids)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids to seed the list with."},"rules":{"type":"array","description":"STI-typed price rules to attach on create. Existing rules on the same payload via PATCH reconcile by id.","items":{"type":"object","required":["type"],"properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Server-to-server alternative to `product_ids`: ship the exact per-variant prices the list should contain. Each row upserts on the unique key `(variant_id, currency, price_list_id)`. Mix-and-match with `product_ids` is supported but typically unnecessary — `prices` alone tells the server which variants belong to the list and what the override amount is.","items":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/price_lists/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}},"404":{"description":"price list not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a price list. The optional `rules:` array reconciles nested\nSTI-typed price rules in a single round-trip — existing rules update\nby `id`, new rules build, missing rules destroy. Mirrors the\npromotion editor's \"save the whole thing on Save\" pattern.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list updated with nested rules","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer"},"product_ids":{"type":"array","items":{"type":"string"},"description":"Prefixed product ids — reconciles list membership (adds + removes)."},"rules":{"type":"array","items":{"type":"object","required":["type"],"properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"prices":{"type":"array","description":"Individual price overrides (the spreadsheet payload). Each row updates by `id` if shipped, otherwise upserts on the unique key `(variant_id, currency, price_list_id)`.","items":{"type":"object","oneOf":[{"required":["id"]},{"required":["variant_id","currency"]}],"properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}},"delete":{"summary":"Delete a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price list. Associated prices are removed asynchronously.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price list deleted"}}}},"/api/v3/admin/price_lists/{id}/activate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Activate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Transitions a draft / inactive list to `active`. If `starts_at` is\nin the future the list is marked `scheduled` instead, matching the\nlegacy admin behaviour.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list activated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/price_lists/{id}/deactivate":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Deactivate a price list","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price list deactivated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PriceList"}}}}}}},"/api/v3/admin/prices":{"get":{"summary":"List prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Generic prices endpoint covering both base prices and price-list\noverrides. Filter with Ransack: `q[price_list_id_eq]=…`,\n`q[currency_eq]=USD`, `q[price_list_id_null]=true` (base prices only).\n\nThe admin spreadsheet uses this with server-side pagination so it\nscales past the metadata-PATCH path on `/price_lists/:id`.\n\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"page","in":"query","required":false,"schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer"}},{"name":"q[price_list_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[price_list_id_null]","in":"query","required":false,"schema":{"type":"boolean"}},{"name":"q[currency_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"q[variant_id_eq]","in":"query","required":false,"schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Comma-separated sort keys. Supports e.g. `variant_product_name,variant_id`.","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed. Supported: `variant`.","schema":{"type":"string"}}],"responses":{"200":{"description":"prices found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a single price. Omit `price_list_id` to create a base price.\nFor more than a handful of rows, prefer `POST /admin/prices/bulk_upsert`.\n\n\n**Required scope:** `write_products` (for API-key authentication).","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":"price created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["variant_id","currency"],"properties":{"variant_id":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true}}}}}}}},"/api/v3/admin/prices/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"Get a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}},"404":{"description":"price not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"price updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Price"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a price","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the price (acts_as_paranoid).\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"price deleted"}}}},"/api/v3/admin/prices/bulk_upsert":{"post":{"summary":"Bulk-upsert prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Upserts a batch of prices in a single SQL round trip.\n\nEach row either:\n* targets an existing price by `id`, OR\n* matches on the unique key `(variant_id, currency, price_list_id)` —\n updating the existing row if one exists, creating one otherwise.\n\nModel callbacks (e.g. PriceHistory) are bypassed; this is a\nbulk-write fast path for the admin spreadsheet. The response\ncarries `price_count` — the number of rows touched.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices upserted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}},"422":{"description":"missing prices key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["prices"],"properties":{"prices":{"type":"array","items":{"type":"object","required":["variant_id","currency"],"properties":{"id":{"type":"string","nullable":true},"variant_id":{"type":"string"},"currency":{"type":"string"},"price_list_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true}}}}}}}}}}},"/api/v3/admin/prices/bulk_destroy":{"delete":{"summary":"Bulk-delete prices","tags":["Pricing"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each price in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"prices deleted","content":{"application/json":{"schema":{"type":"object","properties":{"price_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields":{"get":{"summary":"List product custom fields","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the product's custom field values.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom fields found","content":{"application/json":{}}}}},"post":{"summary":"Create a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets a custom field value on the product. Requires an existing CustomFieldDefinition; pass its prefixed `cfdef_…` id.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"custom field created","content":{"application/json":{}}},"422":{"description":"duplicate definition for the same product","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["custom_field_definition_id","value"],"properties":{"custom_field_definition_id":{"type":"string","description":"Prefixed `cfdef_…` id"},"value":{"description":"Value matching the definition's `field_type`"}}}}}}}},"/api/v3/admin/products/{product_id}/custom_fields/{id}":{"get":{"summary":"Show a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., custom_field_definition). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., key,value,namespace). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"custom field found","content":{"application/json":{}}}}},"patch":{"summary":"Update a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the custom field's `value`. The linked definition cannot be changed — delete and recreate to switch.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"custom field updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"description":"New value"}}}}}}},"delete":{"summary":"Delete a product custom field","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"custom field deleted"}}}},"/api/v3/admin/products/{product_id}/translations":{"get":{"summary":"List product translations","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the full translation matrix for the product: the source value and content type per translatable field, plus the translated value for every supported locale.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations found","content":{"application/json":{}}}}}},"/api/v3/admin/products":{"get":{"summary":"List products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of products for the current store.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"sort","in":"query","required":false,"description":"Sort field (e.g., name, -name, price, -price, best_selling)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[status_eq]","in":"query","required":false,"description":"Filter by status","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new product. Supports nested variants with prices and option types.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}},"required":["name"]}}}}}},"/api/v3/admin/products/{id}":{"get":{"summary":"Get a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID (e.g., prod_xxx)","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., variants, media, option_types, categories). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., name,slug,price,status). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"product found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"404":{"description":"product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"200":{"description":"product updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"slug":{"type":"string"},"status":{"type":"string","enum":["draft","active","archived"]},"tax_category_id":{"type":"string","description":"Tax category ID"},"category_ids":{"type":"array","items":{"type":"string"},"description":"Array of category IDs"},"tags":{"type":"array","items":{"type":"string"}},"prices":{"type":"array","description":"Shorthand for a simple (no-options) product: per-currency prices that forward to the product's sole variant. For products with options, set prices per variant under `variants:` instead.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"variants":{"type":"array","description":"Array of variant payloads. Variants can declare multiple option pairs via `options:` and per-currency prices via `prices:`. Stock counts go in `stock_items:` (per stock location).","items":{"type":"object","properties":{"sku":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}}}},"delete":{"summary":"Delete a product","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a product.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product deleted"}}}},"/api/v3/admin/products/bulk_status_update":{"post":{"summary":"Bulk-update product status","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Sets `status` on each product in `ids`. Reindexes the affected products\nfor search. Cross-store IDs are silently dropped. Returns counts.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"cross-store products silently dropped","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"status":{"type":"string"}}}}}},"422":{"description":"invalid status","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","status"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"status":{"type":"string","enum":["draft","active","archived"]}}}}}}}},"/api/v3/admin/products/bulk_add_to_categories":{"post":{"summary":"Bulk-add products to categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every category (category) in `category_ids`.\nCategories from sibling stores are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to categories","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"category_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_categories":{"post":{"summary":"Bulk-remove products from categories","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every category in `category_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from categories","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","category_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_collections":{"post":{"summary":"Bulk-add products to collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Attaches each product in `ids` to every manual collection in `collection_ids`.\nAutomatic (rule-based) and sibling-store collections are silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products added to collections","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"collection_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_collections":{"post":{"summary":"Bulk-remove products from collections","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Detaches each product in `ids` from every collection in `collection_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products removed from collections","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","collection_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"collection_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_to_channels":{"post":{"summary":"Bulk-add products to channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Publishes each product in `ids` on every channel in `channel_ids`. Idempotent —\nre-publishing on an existing channel is a no-op. Channels from sibling stores\nare silently ignored.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products published on channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_from_channels":{"post":{"summary":"Bulk-remove products from channels","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Unpublishes each product in `ids` from every channel in `channel_ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products unpublished from channels","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"channel_count":{"type":"integer"},"removed":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","channel_ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"channel_ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_add_tags":{"post":{"summary":"Bulk-add tags to products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds each tag name in `tags` to every product in `ids`. Tags are upserted by name.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags added","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"},"tag_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_remove_tags":{"post":{"summary":"Bulk-remove tags from products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes each tag in `tags` from every product in `ids`.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"tags removed","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids","tags"],"properties":{"ids":{"type":"array","items":{"type":"string"}},"tags":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/products/bulk_destroy":{"delete":{"summary":"Bulk-delete products","tags":["Products"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes each product in `ids`. Returns the count actually destroyed.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"products deleted","content":{"application/json":{"schema":{"type":"object","properties":{"product_count":{"type":"integer"}}}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["ids"],"properties":{"ids":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/promotions/{promotion_id}/coupon_codes":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List coupon codes for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the auto-generated coupon codes for a multi-code promotion. Single-code promotions store the code on the promotion itself; this endpoint returns an empty list for them.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"coupon codes found","content":{"application/json":{}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List actions for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"actions found","content":{"application/json":{}}}}},"post":{"summary":"Create an action on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new action to a promotion. The `type` is the wire shorthand from `GET /promotion_actions/types` (e.g. `free_shipping`, `create_item_adjustments`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).","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":"action created","content":{"application/json":{}}},"422":{"description":"unknown action type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_actions/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"delete":{"summary":"Delete an action from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"action deleted"}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}}],"get":{"summary":"List rules for a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules found","content":{"application/json":{}}}}},"post":{"summary":"Create a rule on a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Adds a new rule to a promotion. The `type` is the wire shorthand from `GET /promotion_rules/types` (e.g. `currency`, `item_total`, `product`). Fully-qualified Ruby class names are also accepted for backward compatibility.\n\n**Required scope:** `write_promotions` (for API-key authentication).","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":"rule created with preferences","content":{"application/json":{}}},"422":{"description":"unknown rule type","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}},"required":["type"]}}}}}},"/api/v3/admin/promotions/{promotion_id}/promotion_rules/{id}":{"parameters":[{"name":"promotion_id","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a rule's preferences","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"preferences":{"type":"object","additionalProperties":true}}}}}}},"delete":{"summary":"Delete a rule from a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"rule deleted"}}}},"/api/v3/admin/promotions":{"get":{"summary":"List promotions","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the store's promotions, including manual coupon and automatic promotions.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotions found","content":{"application/json":{}}}}},"post":{"summary":"Create a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new promotion. `code` is required for single-code coupon promotions;\npass `multi_codes: true` with `number_of_codes` to auto-generate a batch.\n\nRules and actions can be created in the same request by passing arrays of\n`{ type, preferences, ... }` rows. The server reconciles to the desired set:\nnew rows are built, existing rows (by `id`) are updated, omitted rows are removed.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).","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":"promotion created with rules and actions","content":{"application/json":{}}},"422":{"description":"invalid params","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"integer","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}},"required":["name"]}}}}}},"/api/v3/admin/promotions/{id}":{"get":{"summary":"Show a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_promotions` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"promotion found","content":{"application/json":{}}}}},"patch":{"summary":"Update a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a promotion. The `rules` and `actions` arrays are treated as\na *desired set* — rows with `id` update in place, rows without `id` are\nbuilt fresh, and any existing row not present in the array is destroyed.\nPass `rules: []` or `actions: []` to clear them.\n\n\n**Required scope:** `write_promotions` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"rules and actions cleared with empty arrays","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","format":"date-time","nullable":true},"expires_at":{"type":"string","format":"date-time","nullable":true},"usage_limit":{"type":"integer","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"kind":{"type":"string","enum":["coupon_code","automatic"]},"promotion_category_id":{"type":"string","nullable":true},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true,"description":"Pass to update an existing rule; omit to build a new one"},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"product_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"customer_ids":{"type":"array","items":{"type":"string"}}},"required":["type"]}},"actions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","nullable":true},"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"calculator":{"type":"object","properties":{"type":{"type":"string"},"preferences":{"type":"object","additionalProperties":true}}}},"required":["type"]}}}}}}}},"delete":{"summary":"Delete a promotion","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_promotions` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"promotion deleted"}}}},"/api/v3/admin/promotion_actions/types":{"get":{"summary":"List available promotion action types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PromotionAction subclasses with their preference schemas. Used by admin UIs to populate the \"Add action\" picker and render generic preference forms.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"action types found","content":{"application/json":{}}}}}},"/api/v3/admin/promotion_rules/types":{"get":{"summary":"List available promotion rule types","tags":["Promotions"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the registered Spree::PromotionRule subclasses with their preference schemas.\n\n**Required scope:** `read_promotions` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"rule types found","content":{"application/json":{}}}}}},"/api/v3/admin/orders/{order_id}/refunds":{"get":{"summary":"List refunds","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all refunds for an order.\n\n**Required scope:** `read_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., payment, refund_reason). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., amount,reason,transaction_id). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"refunds found","content":{"application/json":{}}}}},"post":{"summary":"Create a refund","tags":["Refunds"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a refund for a payment on the order. The refund is automatically processed via the payment gateway.\n\n**Required scope:** `write_refunds` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"order_id","in":"path","required":true,"description":"Order ID","schema":{"type":"string"}}],"responses":{"201":{"description":"refund created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["payment_id","amount"],"properties":{"payment_id":{"type":"string","description":"Payment ID"},"amount":{"type":"string"},"refund_reason_id":{"type":"string","description":"Refund reason ID"}}}}}}}},"/api/v3/admin/locales":{"get":{"summary":"List supported locales","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the locales a merchant can translate content into for the current store, with the default and right-to-left flags.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"locales found","content":{"application/json":{}}}}}},"/api/v3/admin/store_credit_categories":{"get":{"summary":"List store credit categories","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured store credit categories. Categories classify\nstore credits (e.g., \"Goodwill\", \"Gift Card\", \"Refund\") and surface\nin the admin UI as a dropdown when issuing or editing a store\ncredit. Category names matching `Spree::Config[:non_expiring_credit_types]`\nare flagged via `non_expiring: true`.\n\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit categories found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StoreCreditCategory"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store_credit_categories/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Store credit category ID","schema":{"type":"string"}}],"get":{"summary":"Get a store credit category","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single store credit category by prefixed ID.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"store credit category found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoreCreditCategory"}}}},"404":{"description":"store credit category not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/store":{"get":{"summary":"Get the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the current store configuration. The store is resolved from the request context (host or admin selection); there is no `id` parameter.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"current store","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update the current store","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates the current store configuration.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"store updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Store"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"preferred_admin_locale":{"type":"string"},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_unit_system":{"type":"string"}}}}}}}},"/api/v3/admin/tags":{"get":{"summary":"List tags","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns tag names for a given taggable type. Used for autocomplete in tag inputs on products, orders, and customers.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"taggable_type","in":"query","required":true,"description":"Taggable type (`Spree::Product`, `Spree::Order`, or `Spree::User`)","schema":{"type":"string"}},{"name":"q","in":"query","required":false,"description":"Optional case-insensitive substring filter","schema":{"type":"string"}}],"responses":{"200":{"description":"tags found","content":{"application/json":{}}},"422":{"description":"invalid taggable type","content":{"application/json":{}}}}}},"/api/v3/admin/translatable_resources":{"get":{"summary":"List translatable resources","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns every translatable resource type and its translatable fields (key + content type), so clients can render translation editors generically.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translatable resources found","content":{"application/json":{}}}}}},"/api/v3/admin/translations/batch":{"post":{"summary":"Batch upsert translations","tags":["Settings"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Atomically upserts translations across many records of (possibly) different translatable resource types in one request — e.g. an option type and all its option values in one save. A flat list of independent registry writes; all entries succeed or none do.\n\n**Required scope:** `write_<resource>` for every resource type in the batch (for API-key authentication) (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"translations upserted","content":{"application/json":{}}},"422":{"description":"unsupported locale rolls back the whole batch","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["translations"],"properties":{"translations":{"type":"array","items":{"type":"object","required":["resource_type","resource_id","values"],"properties":{"resource_type":{"type":"string","description":"Translatable resource type token, e.g. `option_type`"},"resource_id":{"type":"string","description":"Prefixed id of the record"},"values":{"type":"object","description":"Map of locale code to { field: value }","additionalProperties":{"type":"object","additionalProperties":true}}}}}}}}}}}},"/api/v3/admin/admin_users":{"get":{"summary":"List staff","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns admin users with at least one role assignment on the current store.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff found","content":{"application/json":{}}}}}},"/api/v3/admin/admin_users/{id}":{"get":{"summary":"Show a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `read_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member found","content":{"application/json":{}}}}},"patch":{"summary":"Update a staff member","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name fields and reassigns roles for the current store. `role_ids` is a complete replacement — roles not in the array are removed for this store.\n\n**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"staff member updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"first_name":{"type":"string"},"last_name":{"type":"string"},"role_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Remove a staff member from this store","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes the user's role assignments on the current store. The account is preserved — the user keeps access to any other stores.\n\n**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"staff removed from store"}}}},"/api/v3/admin/invitations":{"get":{"summary":"List invitations","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns invitations for the current store, including pending and accepted.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitations found","content":{"application/json":{}}}}},"post":{"summary":"Create an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Invites a teammate by email. The invitation is scoped to the current store and carries the chosen role; on accept, a `RoleUser` is created via the invitation's `after_accept` callback.\n\n**Required scope:** `write_staff` (for API-key authentication).","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":"invitation created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email","role_id"],"properties":{"email":{"type":"string"},"role_id":{"type":"string"}}}}}}}},"/api/v3/admin/invitations/{id}":{"delete":{"summary":"Revoke an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"204":{"description":"invitation revoked"}}}},"/api/v3/admin/invitations/{id}/resend":{"patch":{"summary":"Resend an invitation","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Issues a fresh token and dispatches the invitation email again.\n\n**Required scope:** `write_staff` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"invitation resent","content":{"application/json":{}}}}}},"/api/v3/admin/permissions":{"get":{"summary":"List the permission catalog","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the permission catalog — the grant vocabulary shared by staff role permissions and secret API key scopes. Entries are grouped for permission pickers; labels and descriptions are localized. Readable by any authenticated admin credential.","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"catalog returned","content":{"application/json":{}}}}}},"/api/v3/admin/roles":{"get":{"summary":"List roles","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns staff roles with their catalog permissions. Roles are global, not per-store; `mutable: false` marks the protected admin role and host-locked rows.\n\n**Required scope:** `read_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"roles found","content":{"application/json":{}}}}},"post":{"summary":"Create a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a staff role. `permissions` holds catalog keys (see GET /admin/permissions); a caller may only grant keys they effectively hold.\n\n**Required scope:** `write_staff` (for API-key authentication).","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":"role created","content":{"application/json":{}}},"422":{"description":"invalid request","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}},"required":["name"]}}}}}},"/api/v3/admin/roles/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a role name, description or permissions. The admin role and host-locked roles (`mutable: false`) reject changes.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"role updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"permissions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a role","tags":["Staff"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a role. Fails with 422 while the role is protected or still referenced by staff members or pending invitations.\n\n**Required scope:** `write_staff` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"role deleted"},"422":{"description":"role cannot be deleted","content":{"application/json":{}}}}}},"/api/v3/admin/stock_locations":{"get":{"summary":"List stock locations","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the configured stock locations. Stock locations are global\n(shared across stores). Filter with Ransack predicates such as\n`q[active_eq]`, `q[kind_eq]`, `q[pickup_enabled_eq]`, or\n`q[name_cont]`.\n\nPickup-related attributes (`kind`, `pickup_enabled`,\n`pickup_stock_policy`, `pickup_ready_in_minutes`,\n`pickup_instructions`) drive merchant pickup support at checkout —\ncustomers can collect orders from any active location with\n`pickup_enabled: true`.\n\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[active_eq]","in":"query","required":false,"description":"Filter by active status","schema":{"type":"boolean"}},{"name":"q[kind_eq]","in":"query","required":false,"description":"Filter by kind (built-in: 'warehouse', 'store', 'fulfillment_center')","schema":{"type":"string"}},{"name":"q[pickup_enabled_eq]","in":"query","required":false,"description":"Filter by pickup-enabled flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock locations found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StockLocation"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new stock location.\n\nSetting `default: true` automatically demotes the previous default\nlocation.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"stock location created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true,"description":"Internal name shown only in the admin"},"active":{"type":"boolean"},"default":{"type":"boolean","description":"Setting to true demotes the previous default."},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"],"description":"Categorizes the location."},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true,"description":"ISO-3166 alpha-2 country code (e.g. \"US\")."},"state_abbr":{"type":"string","nullable":true,"description":"State / province abbreviation (e.g. \"NY\"). Resolved against the selected country."},"state_name":{"type":"string","nullable":true,"description":"Free-text state for countries without a states list."},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"],"description":"'local' = items at this location only; 'any' = transfer-eligible (ship-to-store)."},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}},"required":["name"]}}}}}},"/api/v3/admin/stock_locations/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Stock location ID","schema":{"type":"string"}}],"get":{"summary":"Get a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single stock location by prefixed ID.\n\n**Required scope:** `read_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"404":{"description":"stock location not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates an existing stock location. Same address-field conventions as\nthe create endpoint.\n\nSetting `default: true` automatically demotes the previous default.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"stock location updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StockLocation"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"kind":{"type":"string","enum":["warehouse","store","fulfillment_center"]},"propagate_all_variants":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string","enum":["local","any"]},"pickup_ready_in_minutes":{"type":"number","nullable":true,"minimum":0},"pickup_instructions":{"type":"string","nullable":true}}}}}}},"delete":{"summary":"Delete a stock location","tags":["Stock Locations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the stock location (sets `deleted_at`). Existing\nfulfillments that referenced it keep the historical record via\n`Spree::StockLocation.with_deleted`.\n\n\n**Required scope:** `write_stock` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"stock location deleted"}}}},"/api/v3/admin/products/{product_id}/variants":{"get":{"summary":"List product variants","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of variants for a product, including the default variant.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variants found","content":{"application/json":{}}}}},"post":{"summary":"Create a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new variant for a product. Supports nested prices and stock items.\n\nOption types and values are auto-created if they don't exist.\nPrices are upserted by currency. Stock items are upserted by stock location.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"201":{"description":"variant created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"A variant on a product with option types should declare its option pairs (e.g. size + color) — one per option type it participates in. Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}}},"/api/v3/admin/products/{product_id}/variants/{id}":{"get":{"summary":"Get a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single variant by ID.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., images, prices, stock_items, option_values). Use dot notation for nested expand (max 4 levels).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include (e.g., sku,price,stock). id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"variant found","content":{"application/json":{}}},"404":{"description":"variant not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a variant. Only provided fields are updated.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"200":{"description":"variant updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"sku":{"type":"string"},"cost_price":{"type":"string"},"cost_currency":{"type":"string"},"weight":{"type":"number"},"height":{"type":"number"},"width":{"type":"number"},"depth":{"type":"number"},"weight_unit":{"type":"string"},"dimensions_unit":{"type":"string"},"track_inventory":{"type":"boolean"},"tax_category_id":{"type":"string"},"options":{"type":"array","description":"One pair per option type the variant participates in (e.g. size + color). Option types and values are auto-created if missing.","items":{"type":"object","required":["name","value"],"properties":{"name":{"type":"string"},"value":{"type":"string"}}}},"position":{"type":"integer"},"barcode":{"type":"string"},"prices":{"type":"array","description":"Per-currency prices. Upserted by currency.","items":{"type":"object","required":["currency","amount"],"properties":{"currency":{"type":"string"},"amount":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true}}}},"stock_items":{"type":"array","description":"Per-stock-location inventory. Upserted by stock_location_id.","items":{"type":"object","required":["stock_location_id","count_on_hand"],"properties":{"stock_location_id":{"type":"string","description":"Stock location ID (e.g. sloc_xxx)"},"count_on_hand":{"type":"integer"},"backorderable":{"type":"boolean"}}}}}}}}}},"delete":{"summary":"Delete a variant","tags":["Variants"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes a variant.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"product_id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Variant ID","schema":{"type":"string"}}],"responses":{"204":{"description":"variant deleted"}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"List webhook deliveries","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns delivery attempts for the given endpoint, most recent first.\nEach row carries the original request payload, the response code\n(when the receiver replied), the execution time, and any transport\nerror — everything needed to audit failures and decide whether to\nredeliver.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[event_name_eq]","in":"query","required":false,"description":"Filter by event name (exact)","schema":{"type":"string"}},{"name":"q[success_eq]","in":"query","required":false,"description":"Filter by success flag","schema":{"type":"boolean"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-delivered_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"deliveries found","content":{"application/json":{}}},"404":{"description":"parent webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single delivery attempt with the full request payload and\nthe response body the receiver returned. Use this for ad-hoc debug\nof failed deliveries.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"delivery found","content":{"application/json":{}}},"404":{"description":"delivery not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/api/v3/admin/webhook_endpoints/{webhook_endpoint_id}/deliveries/{id}/redeliver":{"parameters":[{"name":"webhook_endpoint_id","in":"path","required":true,"description":"Parent webhook endpoint ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Webhook delivery ID to redeliver","schema":{"type":"string"}}],"post":{"summary":"Redeliver a webhook delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new delivery row with the same payload + event_name and\nqueues it. The original row is preserved for audit history.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"redelivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints":{"get":{"summary":"List webhook endpoints","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns outbound webhook subscriptions for the current store. Each\nendpoint receives a signed POST when any subscribed event fires.\n`secret_key` is `null` on list reads — the plaintext is delivered\nexactly once on create.\n\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"q[name_cont]","in":"query","required":false,"description":"Filter by name (contains)","schema":{"type":"string"}},{"name":"q[url_cont]","in":"query","required":false,"description":"Filter by URL (contains)","schema":{"type":"string"}},{"name":"sort","in":"query","required":false,"description":"Sort by field. Prefix with `-` for descending (e.g., `-created_at`).","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoints found","content":{"application/json":{}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a new outbound webhook subscription. The plaintext\n`secret_key` is returned **once** in this response — persist it\nimmediately to verify incoming webhook signatures. Subsequent reads\nreturn `null` for the secret. Pass an empty `subscriptions` array or\nomit it to receive every event.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"webhook endpoint created — secret_key returned once","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["url"],"properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}}},"/api/v3/admin/webhook_endpoints/{id}":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"get":{"summary":"Get a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single webhook endpoint by prefixed ID.\n\n**Required scope:** `read_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"fields","in":"query","required":false,"description":"Comma-separated list of fields to include. id is always included.","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint found","content":{"application/json":{}}},"404":{"description":"webhook endpoint not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates name, URL, active flag, or the event subscription list.\nToggling `active` here is equivalent to calling `disable`/`enable`\nwithout an audit reason.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint updated","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Soft-deletes the endpoint and stops future deliveries.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"webhook endpoint deleted"}}}},"/api/v3/admin/webhook_endpoints/{id}/send_test":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"post":{"summary":"Send a test delivery","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a `webhook.test` delivery record and queues it. Use this to\nverify the endpoint is reachable and your signature verification\naccepts Spree's payloads.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"test delivery queued","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/enable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Re-enable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Re-enables an endpoint that was manually or automatically disabled.\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint enabled","content":{"application/json":{}}}}}},"/api/v3/admin/webhook_endpoints/{id}/disable":{"parameters":[{"name":"id","in":"path","required":true,"description":"Webhook endpoint ID","schema":{"type":"string"}}],"patch":{"summary":"Disable a webhook endpoint","tags":["Webhooks"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Manually pauses an endpoint. Unlike auto-disable (triggered after\nrepeated delivery failures), no notification email is sent.\n\n\n**Required scope:** `write_webhooks` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"webhook endpoint disabled","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string"}}}}}}}},"/api/v3/admin/collections":{"get":{"summary":"List collections","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of the store's collections.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collections found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Create a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a manual or automatic (rule-based) collection. For automatic collections, send the full desired rule set under `rules`.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"collection created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"422":{"description":"validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"sort_order":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"rules":{"type":"array","description":"Full desired rule set. Entries with an id update, id-less entries create, omitted rules are removed.","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}},"required":["name"]}}}}}},"/api/v3/admin/collections/{id}":{"get":{"summary":"Get a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single collection by ID, including its rules.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to expand (e.g., rules, custom_fields, translations).","schema":{"type":"string"}}],"responses":{"200":{"description":"collection found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}},"404":{"description":"collection not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a collection. Send `position` to reorder it within the flat list; send the full `rules` set to sync automatic rules.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"collection updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Collection"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"permalink":{"type":"string"},"description":{"type":"string"},"meta_title":{"type":"string"},"meta_description":{"type":"string"},"meta_keywords":{"type":"string"},"sort_order":{"type":"string"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string","enum":["all","any"]},"position":{"type":"integer","description":"Reorders the collection within the flat list (acts_as_list)"},"rules":{"type":"array","description":"Full desired rule set (see create).","items":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string"},"match_policy":{"type":"string"}}}}}}}}}},"delete":{"summary":"Delete a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a collection.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"204":{"description":"collection deleted"}}}},"/api/v3/admin/collections/{collection_id}/products":{"get":{"summary":"List collection products","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Products curated in the collection, ordered by their membership position.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"200":{"description":"products found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}}}},"post":{"summary":"Add a product to a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Curates a product into the collection (appended to the end).\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}}],"responses":{"201":{"description":"product added","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"product_id":{"type":"string"}},"required":["product_id"]}}}}}},"/api/v3/admin/collections/{collection_id}/products/{id}":{"delete":{"summary":"Remove a product from a collection","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Removes a product from the collection's manual curation.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product removed"}}}},"/api/v3/admin/collections/{collection_id}/products/{id}/reposition":{"patch":{"summary":"Reposition a collection product","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Moves a product to a new index among the collection's products.\n\n**Required scope:** `write_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"collection_id","in":"path","required":true,"description":"Collection ID","schema":{"type":"string"}},{"name":"id","in":"path","required":true,"description":"Product ID","schema":{"type":"string"}}],"responses":{"204":{"description":"product repositioned"}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"new_position":{"type":"integer","description":"0-based index among the collection's products"}},"required":["new_position"]}}}}}},"/api/v3/admin/collection_rules/types":{"get":{"summary":"List available collection rule types","tags":["Collections"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Enumerates the registered rule kinds with their labels and descriptions — drives the rule picker on an automatic collection. Plugins extend the list by registering `Spree::CollectionRule` subclasses via `config.spree.collection_rules`. The `type` returned here is the wire shorthand accepted when writing a collection's `rules`.\n\n**Required scope:** `read_collections` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"types found","content":{"application/json":{}}}}}},"/api/v3/admin/delivery_profiles":{"get":{"summary":"List delivery profiles","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Fulfillment profiles group products with the stock locations, delivery zones and delivery methods that fulfill them. Every store has exactly one default profile.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery profiles found","content":{"application/json":{}}}}},"post":{"summary":"Create a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery profile. `kind` selects the registered profile kind (shipping, digital, extension kinds); `stock_location_ids` limits fulfillment to those locations — empty means every store location.\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"delivery profile created","content":{"application/json":{}}},"422":{"description":"validation error","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"kind":{"type":"string","description":"Registered profile kind; defaults to shipping."},"default":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Empty means every store location."}},"required":["name"]}}}}}},"/api/v3/admin/delivery_profiles/{delivery_profile_id}/origin_groups":{"parameters":[{"name":"delivery_profile_id","in":"path","required":true,"schema":{"type":"string"}}],"post":{"summary":"Create an origin group","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Origin groups partition a profile's fulfillment origins: zones and methods belong to a group, so the same products can quote different rate tables per warehouse. `stock_location_ids` replaces the full membership; empty means every store location.\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"origin group created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","nullable":true},"position":{"type":"integer","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"},"description":"Empty means every store location."}}}}}}}},"/api/v3/admin/delivery_profiles/{id}":{"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"patch":{"summary":"Update a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery profile updated","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"default":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}}}}}}}},"delete":{"summary":"Delete a delivery profile","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"The default profile and profiles still referenced by products cannot be deleted.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"delivery profile deleted"}}}},"/api/v3/admin/delivery_methods":{"get":{"summary":"List delivery methods","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns all delivery methods with calculator and zone configuration.\n\n**Required scope:** `read_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"delivery methods found","content":{"application/json":{}}}}},"post":{"summary":"Create delivery method","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery method inside a delivery profile (defaults to the store default profile). Delivery behavior comes from the fulfillment provider.\n\n**Required scope:** `write_settings` (for API-key authentication).","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":"delivery method created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"admin_name":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string","nullable":true},"delivery_profile_id":{"type":"string","nullable":true},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"estimated_transit_business_days_min":{"type":"integer","nullable":true},"estimated_transit_business_days_max":{"type":"integer","nullable":true},"tax_category_id":{"type":"string","nullable":true},"calculator_type":{"type":"string"},"calculator_preferences":{"type":"object"},"delivery_zone_id":{"type":"string","nullable":true}},"required":["name"]}}}}}},"/api/v3/admin/delivery_methods/calculators":{"get":{"summary":"List delivery calculators","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Registered delivery calculator classes with preference schemas for building configuration forms.\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"calculators found","content":{"application/json":{}}}}}},"/api/v3/admin/delivery_zones":{"post":{"summary":"Create delivery zone","tags":["Delivery"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a delivery zone with typed members: country, state, or postal_code (prefix or from/to range).\n\n**Required scope:** `write_settings` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}},{"name":"expand","in":"query","required":false,"description":"Comma-separated associations to embed, e.g. `members`","schema":{"type":"string"}}],"responses":{"201":{"description":"delivery zone created","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"type":"object","properties":{"member_type":{"type":"string","enum":["country","state","postal_code"]},"country_iso":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true}},"required":["member_type"]}}},"required":["name"]}}}}}},"/api/v3/admin/integrations":{"get":{"summary":"List integrations","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns the integrations connected to the current store. Secret preference values are masked.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integrations found","content":{"application/json":{}}}}},"post":{"summary":"Connect integration","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Connects an integration type to the current store. Setting active: true verifies the connection and fails with 422 when it cannot connect. Submitting a masked secret value back keeps the stored secret.\n\n**Required scope:** `write_integrations` (for API-key authentication).","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":"integration connected","content":{"application/json":{}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"type":{"type":"string","description":"Wire shorthand from GET /integrations/types"},"active":{"type":"boolean"},"preferences":{"type":"object"}},"required":["type"]}}}}}},"/api/v3/admin/integrations/types":{"get":{"summary":"List integration types","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Every registered integration type with its gallery metadata and configuration schema. Pure registry discovery — read live connection state from GET /integrations.\n\n**Required scope:** `read_integrations` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"integration types found","content":{"application/json":{}}}}}},"/api/v3/admin/integrations/{id}/test":{"post":{"summary":"Test integration connection","tags":["Integrations"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Runs a live connection check against the provider. Nothing is persisted; a failed check reports the vendor error message.\n\n**Required scope:** `write_integrations` (for API-key authentication).","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,"schema":{"type":"string"}}],"responses":{"200":{"description":"connection checked","content":{"application/json":{}}}}}},"/api/v3/admin/product_types":{"get":{"summary":"List product types","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a paginated list of product types.\n\nA product type is a back-office template: it seeds option types and\ncategories onto products created with it, and defines which custom\nfields those products' forms show. It is not exposed on the Store API.\n\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}},{"name":"page","in":"query","required":false,"description":"Page number","schema":{"type":"integer"}},{"name":"limit","in":"query","required":false,"description":"Number of records per page","schema":{"type":"integer"}}],"responses":{"200":{"description":"product types found","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProductType"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}},"required":["data","meta"]}}}},"401":{"description":"unauthorized","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"post":{"summary":"Create a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Creates a product type.\n\n`option_type_ids` and `category_ids` seed products created with this\ntype. `custom_field_definitions` is a replace-set of the definitions the\nproduct form renders, in `sort_order`. `required` is advisory — the\ndashboard marks the field, but a blank value is never rejected.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"201":{"description":"product type created","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"422":{"description":"unprocessable entity","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true,"description":"Fulfillment profile stamped onto products created with this type. Null leaves new products on the store default profile."},"option_type_ids":{"type":"array","items":{"type":"string"},"description":"Option types seeded onto products created with this type."},"category_ids":{"type":"array","items":{"type":"string"},"description":"Categories seeded onto products created with this type."},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","description":"Prefixed custom field definition id."},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}},"required":["name"]}}}}}},"/api/v3/admin/product_types/{id}":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"get":{"summary":"Retrieve a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Returns a single product type with its option types, categories and custom fields.\n\n**Required scope:** `read_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}},"404":{"description":"product type not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}},"patch":{"summary":"Update a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Updates a product type.\n\nChanges never modify products that already carry the type — use\n`apply_to_products` to backfill those.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"200":{"description":"product type updated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductType"}}}}},"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"required":{"type":"boolean"},"sort_order":{"type":"integer"}}}}}}}}}},"delete":{"summary":"Delete a product type","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Deletes a product type. Types still used by products cannot be deleted.\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"204":{"description":"product type deleted"}}}},"/api/v3/admin/product_types/{id}/apply_to_products":{"parameters":[{"name":"id","in":"path","description":"Product type ID","required":true,"schema":{"type":"string"}}],"post":{"summary":"Apply a product type to its existing products","tags":["Product Types"],"security":[{"api_key":[],"bearer_auth":[]}],"description":"Backfills the type's option types and categories onto the products that\nalready carry it. Additive and idempotent — nothing is removed, and\nre-running is safe.\n\nRuns in the background; the response reports how many products the type\ncurrently has.\n\n\n**Required scope:** `write_products` (for API-key authentication).","parameters":[{"name":"x-spree-api-key","in":"header","required":true,"schema":{"type":"string"}},{"name":"Authorization","in":"header","required":true,"description":"Bearer token for admin authentication","schema":{"type":"string"}}],"responses":{"202":{"description":"backfill accepted","content":{"application/json":{"schema":{"type":"object","properties":{"products_count":{"type":"integer"}}}}}}}}}},"components":{"schemas":{"PaginationMeta":{"type":"object","properties":{"page":{"type":"integer"},"limit":{"type":"integer"},"count":{"type":"integer","description":"Total number of records"},"pages":{"type":"integer","description":"Total number of pages"},"from":{"type":"integer","description":"Index of first record on this page"},"to":{"type":"integer","description":"Index of last record on this page"},"in":{"type":"integer","description":"Number of records on this page"},"previous":{"type":"integer","nullable":true,"description":"Previous page number"},"next":{"type":"integer","nullable":true,"description":"Next page number"}},"required":["page","limit","count","pages","from","to","in"]},"ErrorResponse":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"},"details":{"type":"object","description":"Field-specific validation errors","nullable":true}},"required":["code","message"]}},"required":["error"]},"AuthResponse":{"type":"object","properties":{"token":{"type":"string","description":"JWT access token"},"user":{"$ref":"#/components/schemas/AdminUser"}},"required":["token","user"]},"PermissionRule":{"type":"object","description":"A single permission rule (CanCanCan rule). Rules are applied in order, last-matching-wins.","properties":{"allow":{"type":"boolean","description":"true for `can`, false for `cannot`"},"actions":{"type":"array","items":{"type":"string"},"description":"Action names, e.g. [\"read\", \"update\"] or [\"manage\"]"},"subjects":{"type":"array","items":{"type":"string"},"description":"Subject class names, e.g. [\"Spree::Product\"] or [\"all\"]"},"has_conditions":{"type":"boolean","description":"True if the server-side rule has per-record conditions. The SPA shows the action optimistically and handles 403 from the API."}},"required":["allow","actions","subjects","has_conditions"]},"MeResponse":{"type":"object","description":"Current admin user profile and serialized permissions","properties":{"user":{"$ref":"#/components/schemas/AdminUser"},"permissions":{"type":"array","items":{"$ref":"#/components/schemas/PermissionRule"}}},"required":["user","permissions"]},"ImportSchemaField":{"type":"object","description":"A canonical column of an import type, including per-store custom field columns","properties":{"name":{"type":"string","description":"Canonical field name used in mappings"},"label":{"type":"string","description":"Human-readable label"},"required":{"type":"boolean","description":"Whether the field must be mapped before processing"}},"required":["name","label","required"]},"CheckoutRequirement":{"type":"object","properties":{"step":{"type":"string","description":"Checkout step this requirement belongs to"},"field":{"type":"string","description":"Field that needs to be satisfied"},"message":{"type":"string","description":"Human-readable requirement message"}},"required":["step","field","message"]},"CartWarning":{"type":"object","description":"A warning about a cart issue (e.g., item removed due to stock change)","properties":{"code":{"type":"string","description":"Machine-readable warning code"},"message":{"type":"string","description":"Human-readable warning message"},"line_item_id":{"type":"string","nullable":true,"description":"Prefixed line item ID (when applicable)"},"variant_id":{"type":"string","nullable":true,"description":"Prefixed variant ID (when applicable)"}},"required":["code","message"]},"FulfillmentManifestItem":{"type":"object","description":"An item within a fulfillment — which line item and how many units are in this fulfillment","properties":{"item_id":{"type":"string","description":"Line item ID"},"variant_id":{"type":"string","description":"Variant ID"},"quantity":{"type":"integer","description":"Quantity in this fulfillment"}},"required":["item_id","variant_id","quantity"]},"AdminUserRoleAssignment":{"type":"object","description":"A role assignment for the current store on a staff member","properties":{"id":{"type":"string","description":"Prefixed role ID"},"name":{"type":"string","description":"Role name"}},"required":["id","name"]},"AdminUserStore":{"type":"object","description":"A store the staff member can access through a role assignment","properties":{"id":{"type":"string","description":"Prefixed store ID"},"name":{"type":"string","description":"Store name"},"code":{"type":"string","description":"Store code"}},"required":["id","name","code"]},"PreferenceField":{"type":"object","description":"A single configurable preference on a payment method, promotion rule/action, or calculator. The frontend uses `type` + `default` to render a sensible input.","properties":{"key":{"type":"string"},"type":{"type":"string","description":"string | text | password | integer | decimal | boolean | array | hash"},"default":{"description":"Default value (any JSON type), null when there is no default","nullable":true}},"required":["key","type"]},"PromotionActionCalculator":{"type":"object","description":"The action's nested calculator (when the action carries one — null for actions like `free_shipping`)","properties":{"type":{"type":"string","description":"Wire shorthand for the calculator subclass"},"label":{"type":"string"},"preferences":{"type":"object","additionalProperties":true},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}}},"required":["type","label","preferences","preference_schema"]},"PromotionActionLineItem":{"type":"object","description":"One row in a `create_line_items` action — the variant added to the order and how many","properties":{"variant_id":{"type":"string"},"quantity":{"type":"integer"}},"required":["variant_id","quantity"]},"Address":{"type":"object","properties":{"id":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string"},"address1":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"postal_code":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"country_name":{"type":"string"},"country_iso":{"type":"string"},"state_text":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"quick_checkout":{"type":"boolean"},"is_default_billing":{"type":"boolean"},"is_default_shipping":{"type":"boolean"},"state_name":{"type":"string","nullable":true},"label":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true}},"required":["id","first_name","last_name","full_name","address1","address2","postal_code","city","phone","company","country_name","country_iso","state_text","state_abbr","quick_checkout","is_default_billing","is_default_shipping","state_name","label","metadata","created_at","updated_at","customer_id"],"x-typelizer":true},"AdminUser":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"full_name":{"type":"string","nullable":true},"selected_locale":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"avatar_url":{"type":"string","nullable":true},"roles":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserRoleAssignment"}},"stores":{"type":"array","items":{"$ref":"#/components/schemas/AdminUserStore"}}},"required":["id","email","first_name","last_name","full_name","selected_locale","created_at","updated_at","avatar_url","roles","stores"],"x-typelizer":true},"AllowedOrigin":{"type":"object","properties":{"id":{"type":"string"},"origin":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","origin","created_at","updated_at"],"x-typelizer":true},"ApiKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"key_type":{"type":"string"},"token_prefix":{"type":"string","nullable":true},"scopes":{"type":"array","items":{"type":"string"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"revoked_at":{"type":"string","nullable":true},"last_used_at":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"plaintext_token":{"type":"string","nullable":true},"created_by_email":{"type":"string","nullable":true}},"required":["id","name","key_type","token_prefix","scopes","created_at","updated_at","revoked_at","last_used_at","channel_id","plaintext_token","created_by_email"],"x-typelizer":true},"AppliedPromotion":{"type":"object","properties":{"id":{"type":"string"},"promotion_id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","promotion_id","name","description","code","amount","display_amount","created_at","updated_at"],"x-typelizer":true},"Cart":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"preferred_stock_location_id":{"type":"string","nullable":true},"number":{"type":"string"},"token":{"type":"string"},"email":{"type":"string","nullable":true},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/CartWarning"}},"coupon_code":{"type":"string","nullable":true},"item_total":{"type":"string","nullable":true},"display_item_total":{"type":"string","nullable":true},"adjustment_total":{"type":"string","nullable":true},"display_adjustment_total":{"type":"string","nullable":true},"discount_total":{"type":"string","nullable":true},"display_discount_total":{"type":"string","nullable":true},"tax_total":{"type":"string","nullable":true},"display_tax_total":{"type":"string","nullable":true},"included_tax_total":{"type":"string","nullable":true},"display_included_tax_total":{"type":"string","nullable":true},"additional_tax_total":{"type":"string","nullable":true},"display_additional_tax_total":{"type":"string","nullable":true},"total":{"type":"string","nullable":true},"display_total":{"type":"string","nullable":true},"gift_card_total":{"type":"string","nullable":true},"display_gift_card_total":{"type":"string","nullable":true},"amount_due":{"type":"string","nullable":true},"display_amount_due":{"type":"string","nullable":true},"delivery_total":{"type":"string","nullable":true},"display_delivery_total":{"type":"string","nullable":true},"store_credit_total":{"type":"string","nullable":true},"display_store_credit_total":{"type":"string","nullable":true},"covered_by_store_credit":{"type":"boolean"},"current_step":{"type":"string"},"completed_steps":{"type":"array","items":{"type":"string"}},"requirements":{"type":"array","items":{"$ref":"#/components/schemas/CheckoutRequirement"}},"shipping_eq_billing_address":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"completed_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}}},"required":["id","market_id","channel_id","preferred_stock_location_id","number","token","email","customer_note","currency","locale","total_quantity","warnings","coupon_code","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","store_credit_total","display_store_credit_total","covered_by_store_credit","current_step","completed_steps","requirements","shipping_eq_billing_address","items","billing_address","shipping_address","market","completed_at","created_at","updated_at","applied_promotions"],"x-typelizer":true},"Category":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"depth":{"type":"number"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"children_count":{"type":"number"},"parent_id":{"type":"string","nullable":true},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"is_root":{"type":"boolean"},"is_child":{"type":"boolean"},"is_leaf":{"type":"boolean"},"parent":{"$ref":"#/components/schemas/Category"},"children":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"ancestors":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"metadata":{"type":"object"},"pretty_name":{"type":"string"},"lft":{"type":"number"},"rgt":{"type":"number"},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","permalink","position","depth","meta_title","meta_description","meta_keywords","children_count","parent_id","description","description_html","image_url","square_image_url","is_root","is_child","is_leaf","metadata","pretty_name","lft","rgt","products_count","created_at","updated_at"],"x-typelizer":true},"Channel":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string"},"active":{"type":"boolean"},"default":{"type":"boolean"},"storefront_access":{"type":"string"},"guest_checkout":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string","nullable":true},"preferred_storefront_access":{"type":"string","nullable":true},"preferred_guest_checkout":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","code","active","default","storefront_access","guest_checkout","preferred_order_routing_strategy","preferred_storefront_access","preferred_guest_checkout","created_at","updated_at","stock_location_ids"],"x-typelizer":true},"ClaimLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"send_replacement":{"type":"boolean"},"description":{"type":"string","nullable":true},"refund_amount":{"type":"string"},"paid_amount":{"type":"string"},"display_refund_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"replacement_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"replacement_variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","quantity","send_replacement","description","refund_amount","paid_amount","display_refund_amount","variant_id","replacement_variant_id","line_item_id","created_at","updated_at"],"x-typelizer":true},"ClaimReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Claim":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"resolution":{"type":"string","nullable":true},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true},"denied_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ClaimReason"},"claim_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ClaimLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","resolution","order_id","reason_id","refund_total","display_refund_total","approved_at","resolved_at","denied_at","canceled_at","memo","metadata","created_at","updated_at","created_by_id"],"x-typelizer":true},"CollectionRule":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"value":{"type":"string","nullable":true},"match_policy":{"type":"string"}},"required":["id","type","value","match_policy"],"x-typelizer":true},"Collection":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"permalink":{"type":"string"},"position":{"type":"number"},"sort_order":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"products_count":{"type":"number"},"description":{"type":"string"},"description_html":{"type":"string"},"image_url":{"type":"string","nullable":true},"square_image_url":{"type":"string","nullable":true},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"translations":{"type":"object"},"automatic":{"type":"boolean"},"rules_match_policy":{"type":"string"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"rules":{"type":"array","items":{"$ref":"#/components/schemas/CollectionRule"}}},"required":["id","name","permalink","position","sort_order","meta_title","meta_description","meta_keywords","products_count","description","description_html","image_url","square_image_url","automatic","rules_match_policy","metadata","created_at","updated_at"],"x-typelizer":true},"Country":{"type":"object","properties":{"iso":{"type":"string"},"iso3":{"type":"string"},"name":{"type":"string"},"states_required":{"type":"boolean"},"zipcode_required":{"type":"boolean"},"states":{"type":"array","items":{"$ref":"#/components/schemas/State"}},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["iso","iso3","name","states_required","zipcode_required","created_at","updated_at"],"x-typelizer":true},"CouponCode":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"state":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"promotion_id":{"type":"string"},"order_id":{"type":"string","nullable":true}},"required":["id","code","state","created_at","updated_at","promotion_id","order_id"],"x-typelizer":true},"CreditCard":{"type":"object","properties":{"id":{"type":"string"},"brand":{"type":"string"},"last4":{"type":"string"},"month":{"type":"number"},"year":{"type":"number"},"name":{"type":"string","nullable":true},"default":{"type":"boolean"},"gateway_payment_profile_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"payment_method_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","brand","last4","month","year","name","default","gateway_payment_profile_id","customer_id","payment_method_id","metadata","created_at","updated_at"],"x-typelizer":true},"CustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"namespace":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"resource_type":{"type":"string"},"storefront_visible":{"type":"boolean"},"searchable":{"type":"boolean"},"sortable":{"type":"boolean"},"filter_key":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","namespace","key","label","field_type","resource_type","storefront_visible","searchable","sortable","filter_key","created_at","updated_at"],"x-typelizer":true},"CustomField":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"type":{"type":"string","deprecated":true},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"key":{"type":"string"},"value":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"storefront_visible":{"type":"boolean"},"custom_field_definition_id":{"type":"string"}},"required":["id","label","type","field_type","key","value","created_at","updated_at","storefront_visible","custom_field_definition_id"],"x-typelizer":true},"CustomerGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"customers_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","name","description","customers_count","created_at","updated_at"],"x-typelizer":true},"Customer":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"first_name":{"type":"string","nullable":true},"last_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"accepts_email_marketing":{"type":"boolean"},"full_name":{"type":"string"},"available_store_credit_total":{"type":"string"},"display_available_store_credit_total":{"type":"string"},"addresses":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"default_billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"default_shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"newsletter_subscriber":{"allOf":[{"$ref":"#/components/schemas/NewsletterSubscriber"}],"nullable":true},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"failed_attempts":{"type":"number"},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"internal_note":{"type":"string","nullable":true},"internal_note_html":{"type":"string","nullable":true},"default_billing_address_id":{"type":"string","nullable":true},"default_shipping_address_id":{"type":"string","nullable":true},"orders_count":{"type":"number"},"total_spent":{"type":"string"},"display_total_spent":{"type":"string"},"last_order_completed_at":{"type":"string","nullable":true},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}},"store_credits":{"type":"array","items":{"$ref":"#/components/schemas/StoreCredit"}},"customer_group_ids":{"type":"array","items":{"type":"string"}}},"required":["id","email","first_name","last_name","phone","accepts_email_marketing","full_name","available_store_credit_total","display_available_store_credit_total","failed_attempts","metadata","created_at","updated_at","tags","internal_note","internal_note_html","default_billing_address_id","default_shipping_address_id","orders_count","total_spent","display_total_spent","last_order_completed_at","customer_group_ids"],"x-typelizer":true},"DeliveryMethodRule":{"type":"object","properties":{"id":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"product_ids":{"type":"array","items":{"type":"string"}}},"required":["id","active","created_at","updated_at","type","name","description","preferences","preference_schema","product_ids"],"x-typelizer":true},"DeliveryMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"code":{"type":"string","nullable":true},"estimated_transit_business_days_min":{"type":"number","nullable":true},"estimated_transit_business_days_max":{"type":"number","nullable":true},"digital":{"type":"boolean"},"pickup":{"type":"boolean"},"pickup_point":{"type":"boolean"},"admin_name":{"type":"string","nullable":true},"fulfillment_provider":{"type":"string"},"pickup_point_provider":{"type":"string","nullable":true},"rate_provider":{"type":"string","nullable":true},"storefront_visible":{"type":"boolean"},"tracking_url":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"deleted_at":{"type":"string"},"services":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodService"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryMethodRule"}},"tax_category_id":{"type":"string","nullable":true},"delivery_profile_id":{"type":"string"},"delivery_origin_group_id":{"type":"string","nullable":true},"delivery_zone_id":{"type":"string","nullable":true},"stock_location_ids":{"type":"array","items":{"type":"string"}},"calculator_type":{"type":"string","nullable":true},"calculator_preferences":{"type":"object","nullable":true}},"required":["id","name","code","estimated_transit_business_days_min","estimated_transit_business_days_max","digital","pickup","pickup_point","admin_name","fulfillment_provider","pickup_point_provider","rate_provider","storefront_visible","tracking_url","markup_flat","markup_percent","created_at","updated_at","deleted_at","services","rules","tax_category_id","delivery_profile_id","delivery_origin_group_id","delivery_zone_id","stock_location_ids","calculator_type","calculator_preferences"],"x-typelizer":true},"DeliveryMethodService":{"type":"object","properties":{"id":{"type":"string"},"carrier":{"type":"string"},"service":{"type":"string"},"label":{"type":"string","nullable":true},"markup_flat":{"type":"string","nullable":true},"markup_percent":{"type":"string","nullable":true},"position":{"type":"number"}},"required":["id","carrier","service","label","markup_flat","markup_percent","position"],"x-typelizer":true},"DeliveryOriginGroup":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"position":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"delivery_zones_count":{"type":"number"},"delivery_methods_count":{"type":"number"}},"required":["id","name","position","created_at","updated_at","delivery_profile_id","stock_location_ids","delivery_zones_count","delivery_methods_count"],"x-typelizer":true},"DeliveryProfile":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"default":{"type":"boolean"},"position":{"type":"number","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"kind":{"type":"string"},"digital":{"type":"boolean"},"offers_pickup":{"type":"boolean"},"offers_shipping":{"type":"boolean"},"stock_location_ids":{"type":"array","items":{"type":"string"}},"origin_groups":{"type":"object"},"products_count":{"type":"number"},"delivery_methods_count":{"type":"number"},"delivery_zones_count":{"type":"number"}},"required":["id","name","default","position","created_at","updated_at","kind","digital","offers_pickup","offers_shipping","stock_location_ids","origin_groups","products_count","delivery_methods_count","delivery_zones_count"],"x-typelizer":true},"DeliveryRate":{"type":"object","properties":{"id":{"type":"string"},"delivery_method_id":{"type":"string"},"name":{"type":"string"},"selected":{"type":"boolean"},"cost":{"type":"string"},"total":{"type":"string"},"additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"carrier":{"type":"string","nullable":true},"service_level":{"type":"string","nullable":true},"estimated_delivery_date":{"type":"string","nullable":true},"display_cost":{"type":"string"},"display_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","delivery_method_id","name","selected","cost","total","additional_tax_total","included_tax_total","tax_total","carrier","service_level","estimated_delivery_date","display_cost","display_total","display_additional_tax_total","display_included_tax_total","display_tax_total","metadata","created_at","updated_at"],"x-typelizer":true},"DeliveryZoneMember":{"type":"object","properties":{"id":{"type":"string"},"member_type":{"type":"string"},"postal_code_prefix":{"type":"string","nullable":true},"postal_code_from":{"type":"string","nullable":true},"postal_code_to":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_abbr":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","member_type","postal_code_prefix","postal_code_from","postal_code_to","country_iso","country_name","state_abbr","state_name","created_at","updated_at"],"x-typelizer":true},"DeliveryZone":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"members":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryZoneMember"}},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string"},"delivery_origin_group_id":{"type":"string","nullable":true},"delivery_method_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","created_at","updated_at","delivery_profile_id","delivery_origin_group_id","delivery_method_ids"],"x-typelizer":true},"DigitalLink":{"type":"object","properties":{"id":{"type":"string"},"access_counter":{"type":"number"},"filename":{"type":"string"},"content_type":{"type":"string"},"download_url":{"type":"string"},"authorizable":{"type":"boolean"},"expired":{"type":"boolean"},"access_limit_exceeded":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","access_counter","filename","content_type","download_url","authorizable","expired","access_limit_exceeded","created_at","updated_at"],"x-typelizer":true},"Discount":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"code":{"type":"string","nullable":true},"value_type":{"type":"string","nullable":true},"value":{"type":"string","nullable":true},"promotion_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","code","value_type","value","promotion_id","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"ExchangeLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"original_price":{"type":"string"},"new_variant_price":{"type":"string"},"price_difference":{"type":"string"},"original_variant_id":{"type":"string","nullable":true},"new_variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"original_variant":{"$ref":"#/components/schemas/Variant"},"new_variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","quantity","received_quantity","resellable","original_price","new_variant_price","price_difference","original_variant_id","new_variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"Exchange":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"price_difference":{"type":"string"},"display_price_difference":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"fulfilled_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"exchange_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ExchangeLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","price_difference","display_price_difference","approved_at","received_at","fulfilled_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id"],"x-typelizer":true},"Export":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"format":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"done":{"type":"boolean"},"filename":{"type":"string","nullable":true},"byte_size":{"type":"number","nullable":true},"download_url":{"type":"string","nullable":true}},"required":["id","number","format","created_at","updated_at","type","user_id","done","filename","byte_size","download_url"],"x-typelizer":true},"Fee":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"kind":{"type":"string"},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","kind","line_item_id","fulfillment_id","amount","display_amount","metadata","created_at","updated_at"],"x-typelizer":true},"FulfillmentItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"status":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"name":{"type":"string","nullable":true},"options_text":{"type":"string","nullable":true}},"required":["id","quantity","status","variant_id","line_item_id","name","options_text"],"x-typelizer":true},"Fulfillment":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"tracking":{"type":"string","nullable":true},"tracking_url":{"type":"string","nullable":true},"pickup_point_data":{"type":"object","nullable":true},"selected_delivery_rate_id":{"type":"string","nullable":true},"cost":{"type":"string"},"display_cost":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"status":{"type":"string"},"fulfillment_type":{"type":"string"},"fulfilled_at":{"type":"string","nullable":true},"items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentManifestItem"}},"delivery_method":{"$ref":"#/components/schemas/DeliveryMethod"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"delivery_rates":{"type":"array","items":{"$ref":"#/components/schemas/DeliveryRate"}},"metadata":{"type":"object"},"adjustment_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"order_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"fulfillment_items":{"type":"array","items":{"$ref":"#/components/schemas/FulfillmentItem"}},"order":{"$ref":"#/components/schemas/Order"}},"required":["id","number","tracking","tracking_url","pickup_point_data","selected_delivery_rate_id","cost","display_cost","total","display_total","discount_total","display_discount_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","tax_total","display_tax_total","status","fulfillment_type","fulfilled_at","items","metadata","adjustment_total","pre_tax_amount","created_at","updated_at","order_id","stock_location_id"],"x-typelizer":true},"GiftCardBatch":{"type":"object","properties":{"id":{"type":"string"},"codes_count":{"type":"number"},"currency":{"type":"string","nullable":true},"prefix":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"amount":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true}},"required":["id","codes_count","currency","prefix","created_at","updated_at","amount","expires_at","created_by_id"],"x-typelizer":true},"GiftCard":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":"string"},"status":{"type":"string"},"currency":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_authorized":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"expires_at":{"type":"string","nullable":true},"redeemed_at":{"type":"string","nullable":true},"expired":{"type":"boolean"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/AdminUser"},"gift_card_batch":{"$ref":"#/components/schemas/GiftCardBatch"},"orders":{"type":"array","items":{"$ref":"#/components/schemas/Order"}}},"required":["id","code","status","currency","amount","amount_used","amount_authorized","amount_remaining","display_amount","display_amount_used","display_amount_remaining","expires_at","redeemed_at","expired","active","created_at","updated_at","customer_id","created_by_id"],"x-typelizer":true},"ImportMapping":{"type":"object","properties":{"id":{"type":"string"},"schema_field":{"type":"string"},"file_column":{"type":"string","nullable":true},"required":{"type":"boolean"}},"required":["id","schema_field","file_column","required"],"x-typelizer":true},"ImportRow":{"type":"object","properties":{"id":{"type":"string"},"row_number":{"type":"number"},"status":{"type":"string"},"validation_errors":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"import_id":{"type":"string","nullable":true},"item_type":{"type":"string","nullable":true},"item_id":{"type":"string","nullable":true},"data":{"type":"object"}},"required":["id","row_number","status","validation_errors","created_at","updated_at","import_id","item_type","item_id","data"],"x-typelizer":true},"Import":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"rows_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string","nullable":true},"status":{"type":"string"},"owner_type":{"type":"string","nullable":true},"owner_id":{"type":"string","nullable":true},"user_id":{"type":"string","nullable":true},"processing_errors":{"type":"string","nullable":true},"preferred_delimiter":{"type":"string"},"original_filename":{"type":"string","nullable":true},"original_byte_size":{"type":"number","nullable":true},"original_file_url":{"type":"string","nullable":true},"completed_rows_count":{"type":"number"},"failed_rows_count":{"type":"number"},"schema_fields":{"type":"array","items":{"$ref":"#/components/schemas/ImportSchemaField"}},"csv_headers":{"type":"array","items":{"type":"string"}},"sample_row":{"type":"object"},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/ImportMapping"}}},"required":["id","number","rows_count","created_at","updated_at","type","status","owner_type","owner_id","user_id","processing_errors","preferred_delimiter","original_filename","original_byte_size","original_file_url","completed_rows_count","failed_rows_count","schema_fields","csv_headers","sample_row","mappings"],"x-typelizer":true},"Integration":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"group":{"type":"string","nullable":true},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","active","created_at","updated_at","type","group","preferences","preference_schema"],"x-typelizer":true},"Invitation":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"expires_at":{"type":"string"},"role_id":{"type":"string"},"role_name":{"type":"string"},"inviter_email":{"type":"string"},"acceptance_url":{"type":"string"},"invitee_exists":{"type":"boolean"},"store":{"type":"object"}},"required":["id","email","status","created_at","updated_at","expires_at","role_id","role_name","inviter_email","acceptance_url","invitee_exists","store"],"x-typelizer":true},"LineItem":{"type":"object","properties":{"id":{"type":"string"},"variant_id":{"type":"string"},"preorder":{"type":"boolean"},"preorder_ships_at":{"type":"string","nullable":true},"quantity":{"type":"number"},"currency":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"options_text":{"type":"string"},"price":{"type":"string"},"display_price":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"discounted_amount":{"type":"string"},"display_discounted_amount":{"type":"string"},"display_compare_at_amount":{"type":"string","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"digital_links":{"type":"array","items":{"$ref":"#/components/schemas/DigitalLink"}},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"cost_price":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"tax_category":{"$ref":"#/components/schemas/TaxCategory"}},"required":["id","variant_id","preorder","preorder_ships_at","quantity","currency","name","slug","options_text","price","display_price","total","display_total","adjustment_total","display_adjustment_total","additional_tax_total","display_additional_tax_total","included_tax_total","display_included_tax_total","discount_total","display_discount_total","pre_tax_amount","display_pre_tax_amount","discounted_amount","display_discounted_amount","display_compare_at_amount","compare_at_amount","thumbnail_url","option_values","digital_links","metadata","created_at","updated_at","cost_price","tax_category_id"],"x-typelizer":true},"Market":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"currency":{"type":"string"},"default_locale":{"type":"string"},"tax_inclusive":{"type":"boolean"},"default":{"type":"boolean"},"country_isos":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","currency","default_locale","tax_inclusive","default","country_isos","supported_locales","created_at","updated_at"],"x-typelizer":true},"Media":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string","nullable":true},"variant_ids":{"type":"array","items":{"type":"string"}},"position":{"type":"number"},"alt":{"type":"string","nullable":true},"media_type":{"type":"string"},"focal_point_x":{"type":"number","nullable":true},"focal_point_y":{"type":"number","nullable":true},"external_video_url":{"type":"string","nullable":true},"original_url":{"type":"string","nullable":true},"mini_url":{"type":"string","nullable":true},"small_url":{"type":"string","nullable":true},"medium_url":{"type":"string","nullable":true},"large_url":{"type":"string","nullable":true},"xlarge_url":{"type":"string","nullable":true},"og_image_url":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"viewable_id":{"type":"string"},"download_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"viewable_type":{"type":"string"}},"required":["id","product_id","variant_ids","position","alt","media_type","focal_point_x","focal_point_y","external_video_url","original_url","mini_url","small_url","medium_url","large_url","xlarge_url","og_image_url","created_at","updated_at","viewable_id","download_url","metadata","viewable_type"],"x-typelizer":true},"NewsletterSubscriber":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"verified":{"type":"boolean"},"verified_at":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true}},"required":["id","email","created_at","updated_at","verified","verified_at","customer_id"],"x-typelizer":true},"OptionType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"kind":{"type":"string"},"translations":{"type":"object"},"metadata":{"type":"object"},"filterable":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}}},"required":["id","name","label","position","kind","metadata","filterable","created_at","updated_at"],"x-typelizer":true},"OptionValue":{"type":"object","properties":{"id":{"type":"string"},"option_type_id":{"type":"string"},"name":{"type":"string"},"label":{"type":"string"},"position":{"type":"number"},"color_code":{"type":"string","nullable":true},"option_type_name":{"type":"string"},"option_type_label":{"type":"string"},"image_url":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"option_type":{"$ref":"#/components/schemas/OptionType"}},"required":["id","option_type_id","name","label","position","color_code","option_type_name","option_type_label","image_url","metadata","created_at","updated_at"],"x-typelizer":true},"OrderRoutingRule":{"type":"object","properties":{"id":{"type":"string"},"position":{"type":"number"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"channel_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"},"label":{"type":"string"},"description":{"type":"string"}},"required":["id","position","active","created_at","updated_at","type","channel_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Order":{"type":"object","properties":{"id":{"type":"string"},"market_id":{"type":"string","nullable":true},"cart_id":{"type":"string","nullable":true},"channel_id":{"type":"string","nullable":true},"number":{"type":"string"},"email":{"type":"string"},"customer_note":{"type":"string","nullable":true},"currency":{"type":"string"},"locale":{"type":"string","nullable":true},"total_quantity":{"type":"number"},"coupon_code":{"type":"string","nullable":true},"fulfillment_status":{"type":"string","nullable":true},"payment_status":{"type":"string","nullable":true},"completed_at":{"type":"string","nullable":true},"item_total":{"type":"string"},"display_item_total":{"type":"string"},"adjustment_total":{"type":"string"},"display_adjustment_total":{"type":"string"},"discount_total":{"type":"string"},"display_discount_total":{"type":"string"},"tax_total":{"type":"string"},"display_tax_total":{"type":"string"},"included_tax_total":{"type":"string"},"display_included_tax_total":{"type":"string"},"additional_tax_total":{"type":"string"},"display_additional_tax_total":{"type":"string"},"total":{"type":"string"},"display_total":{"type":"string"},"gift_card_total":{"type":"string"},"display_gift_card_total":{"type":"string"},"amount_due":{"type":"string"},"display_amount_due":{"type":"string"},"delivery_total":{"type":"string"},"display_delivery_total":{"type":"string"},"store_credit_total":{"type":"string"},"display_store_credit_total":{"type":"string"},"covered_by_store_credit":{"type":"boolean"},"items":{"type":"array","items":{"$ref":"#/components/schemas/LineItem"}},"fulfillments":{"type":"array","items":{"$ref":"#/components/schemas/Fulfillment"}},"payments":{"type":"array","items":{"$ref":"#/components/schemas/Payment"}},"billing_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"shipping_address":{"allOf":[{"$ref":"#/components/schemas/Address"}],"nullable":true},"gift_card":{"allOf":[{"$ref":"#/components/schemas/GiftCard"}],"nullable":true},"market":{"allOf":[{"$ref":"#/components/schemas/Market"}],"nullable":true},"status":{"type":"string"},"last_ip_address":{"type":"string","nullable":true},"considered_risky":{"type":"boolean"},"confirmation_delivered":{"type":"boolean"},"store_owner_notification_delivered":{"type":"boolean"},"payment_total":{"type":"string"},"display_payment_total":{"type":"string"},"metadata":{"type":"object"},"canceled_at":{"type":"string","nullable":true},"approved_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferred_stock_location_id":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"internal_note":{"type":"string","nullable":true},"internal_note_html":{"type":"string","nullable":true},"approver_id":{"type":"string","nullable":true},"canceler_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"applied_promotions":{"type":"array","items":{"$ref":"#/components/schemas/AppliedPromotion"}},"cart":{"$ref":"#/components/schemas/Cart"},"channel":{"$ref":"#/components/schemas/Channel"},"preferred_stock_location":{"$ref":"#/components/schemas/StockLocation"},"payment_methods":{"type":"array","items":{"$ref":"#/components/schemas/PaymentMethod"}},"customer":{"$ref":"#/components/schemas/Customer"},"approver":{"$ref":"#/components/schemas/Customer"},"canceler":{"$ref":"#/components/schemas/Customer"},"created_by":{"$ref":"#/components/schemas/Customer"},"returns":{"type":"array","items":{"$ref":"#/components/schemas/Return"}},"exchanges":{"type":"array","items":{"$ref":"#/components/schemas/Exchange"}},"claims":{"type":"array","items":{"$ref":"#/components/schemas/Claim"}}},"required":["id","market_id","cart_id","channel_id","number","email","customer_note","currency","locale","total_quantity","coupon_code","fulfillment_status","payment_status","completed_at","item_total","display_item_total","adjustment_total","display_adjustment_total","discount_total","display_discount_total","tax_total","display_tax_total","included_tax_total","display_included_tax_total","additional_tax_total","display_additional_tax_total","total","display_total","gift_card_total","display_gift_card_total","amount_due","display_amount_due","delivery_total","display_delivery_total","store_credit_total","display_store_credit_total","covered_by_store_credit","gift_card","market","status","last_ip_address","considered_risky","confirmation_delivered","store_owner_notification_delivered","payment_total","display_payment_total","metadata","canceled_at","approved_at","created_at","updated_at","preferred_stock_location_id","tags","internal_note","internal_note_html","approver_id","canceler_id","created_by_id","customer_id"],"x-typelizer":true},"PaymentMethod":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"type":{"type":"string"},"session_required":{"type":"boolean"},"source_required":{"type":"boolean"},"metadata":{"type":"object"},"active":{"type":"boolean"},"auto_capture":{"type":"boolean","nullable":true},"storefront_visible":{"type":"boolean"},"position":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"object"}},"required":["id","name","description","type","session_required","source_required","metadata","active","auto_capture","storefront_visible","position","created_at","updated_at","preferences","preference_schema"],"x-typelizer":true},"Payment":{"type":"object","properties":{"id":{"type":"string"},"payment_method_id":{"type":"string"},"response_code":{"type":"string","nullable":true},"number":{"type":"string"},"amount":{"type":"string"},"display_amount":{"type":"string"},"status":{"type":"string"},"source_type":{"type":"string","nullable":true,"enum":["credit_card","store_credit","payment_source"]},"source_id":{"type":"string","nullable":true},"source":{"anyOf":[{"$ref":"#/components/schemas/CreditCard"},{"$ref":"#/components/schemas/StoreCredit"},{"$ref":"#/components/schemas/PaymentSource"}],"nullable":true},"payment_method":{"$ref":"#/components/schemas/PaymentMethod"},"metadata":{"type":"object"},"avs_response":{"type":"string","nullable":true},"cvv_response_code":{"type":"string","nullable":true},"cvv_response_message":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"captured_amount":{"type":"string"},"order_id":{"type":"string","nullable":true},"order":{"$ref":"#/components/schemas/Order"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","payment_method_id","response_code","number","amount","display_amount","status","source_type","source_id","source","metadata","avs_response","cvv_response_code","cvv_response_message","created_at","updated_at","captured_amount","order_id"],"x-typelizer":true},"PaymentSource":{"type":"object","properties":{"id":{"type":"string"},"gateway_payment_profile_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","gateway_payment_profile_id","metadata","created_at","updated_at"],"x-typelizer":true},"Permission":{"type":"object","properties":{"key":{"type":"string"},"resource":{"type":"string"},"kind":{"type":"string"},"group":{"type":"string"},"group_label":{"type":"string"},"label":{"type":"string"},"description":{"type":"string"}},"required":["key","resource","kind","group","group_label","label","description"],"x-typelizer":true},"PriceHistory":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_in_cents":{"type":"number"},"currency":{"type":"string"},"display_amount":{"type":"string"},"recorded_at":{"type":"string"},"variant_id":{"type":"string"},"price_id":{"type":"string"},"compare_at_amount":{"type":"string","nullable":true},"created_at":{"type":"string"}},"required":["id","amount","amount_in_cents","currency","display_amount","recorded_at","variant_id","price_id","compare_at_amount","created_at"],"x-typelizer":true},"PriceList":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"status":{"type":"string"},"position":{"type":"number"},"match_policy":{"type":"string"},"starts_at":{"type":"string","nullable":true},"ends_at":{"type":"string","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"currently_active":{"type":"boolean"},"products_count":{"type":"number"},"prices_count":{"type":"number"},"product_ids":{"type":"array","items":{"type":"string"}},"price_rules":{"type":"array","items":{"$ref":"#/components/schemas/PriceRule"}}},"required":["id","name","description","status","position","match_policy","starts_at","ends_at","deleted_at","created_at","updated_at","currently_active","products_count","prices_count","product_ids"],"x-typelizer":true},"PriceRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"price_list_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"description":{"type":"string","nullable":true},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}}},"required":["id","created_at","updated_at","type","price_list_id","preferences","preference_schema","label","description"],"x-typelizer":true},"Price":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string","nullable":true},"amount_in_cents":{"type":"number","nullable":true},"compare_at_amount":{"type":"string","nullable":true},"compare_at_amount_in_cents":{"type":"number","nullable":true},"currency":{"type":"string","nullable":true},"display_amount":{"type":"string","nullable":true},"display_compare_at_amount":{"type":"string","nullable":true},"price_list_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","amount","amount_in_cents","compare_at_amount","compare_at_amount_in_cents","currency","display_amount","display_compare_at_amount","price_list_id","variant_id","created_at","updated_at"],"x-typelizer":true},"ProductPublication":{"type":"object","properties":{"id":{"type":"string"},"published_at":{"type":"string","nullable":true},"unpublished_at":{"type":"string","nullable":true},"product_id":{"type":"string"},"channel_id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","published_at","unpublished_at","product_id","channel_id","created_at","updated_at"],"x-typelizer":true},"Product":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"meta_title":{"type":"string","nullable":true},"meta_description":{"type":"string","nullable":true},"meta_keywords":{"type":"string","nullable":true},"variant_count":{"type":"number"},"available_on":{"type":"string","nullable":true},"preorder_ships_at":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"preorder":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"available":{"type":"boolean"},"description":{"type":"string","nullable":true},"description_html":{"type":"string","nullable":true},"default_variant_id":{"type":"string"},"thumbnail_url":{"type":"string","nullable":true},"tags":{"type":"array","items":{"type":"string"}},"price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"variants":{"type":"array","items":{"$ref":"#/components/schemas/Variant"}},"default_variant":{"$ref":"#/components/schemas/Variant"},"option_types":{"type":"array","items":{"$ref":"#/components/schemas/OptionType"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"translations":{"type":"object"},"status":{"type":"string"},"metadata":{"type":"object"},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"product_type_id":{"type":"string","nullable":true},"tax_category_id":{"type":"string","nullable":true},"collections":{"type":"array","items":{"$ref":"#/components/schemas/Collection"}},"product_publications":{"type":"array","items":{"$ref":"#/components/schemas/ProductPublication"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"product_type":{"$ref":"#/components/schemas/ProductType"}},"required":["id","name","slug","meta_title","meta_description","meta_keywords","variant_count","available_on","preorder_ships_at","purchasable","preorder","in_stock","backorderable","available","description","description_html","default_variant_id","thumbnail_url","tags","price","original_price","status","metadata","deleted_at","created_at","updated_at","delivery_profile_id","product_type_id","tax_category_id"],"x-typelizer":true},"ProductTypeCustomFieldDefinition":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"namespace":{"type":"string"},"label":{"type":"string"},"field_type":{"type":"string","enum":["short_text","long_text","rich_text","number","boolean","json"]},"required":{"type":"boolean"},"sort_order":{"type":"number"}},"required":["id","key","namespace","label","field_type","required","sort_order"],"x-typelizer":true},"ProductType":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"translations":{"type":"object"},"products_count":{"type":"number"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivery_profile_id":{"type":"string","nullable":true},"option_type_ids":{"type":"array","items":{"type":"string"}},"category_ids":{"type":"array","items":{"type":"string"}},"custom_field_definitions":{"type":"array","items":{"$ref":"#/components/schemas/ProductTypeCustomFieldDefinition"}}},"required":["id","name","products_count","created_at","updated_at","delivery_profile_id","option_type_ids","category_ids","custom_field_definitions"],"x-typelizer":true},"PromotionAction":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"calculator":{"allOf":[{"$ref":"#/components/schemas/PromotionActionCalculator"}],"nullable":true},"line_items":{"type":"array","items":{"$ref":"#/components/schemas/PromotionActionLineItem"},"nullable":true}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","calculator","line_items"],"x-typelizer":true},"PromotionRule":{"type":"object","properties":{"id":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"type":{"type":"string"},"promotion_id":{"type":"string"},"preferences":{"type":"object"},"preference_schema":{"type":"array","items":{"$ref":"#/components/schemas/PreferenceField"}},"label":{"type":"string"},"product_ids":{"type":"array","items":{"type":"string"},"nullable":true},"category_ids":{"type":"array","items":{"type":"string"},"nullable":true},"customer_ids":{"type":"array","items":{"type":"string"},"nullable":true},"products":{"type":"array","items":{"$ref":"#/components/schemas/Product"}},"categories":{"type":"array","items":{"$ref":"#/components/schemas/Category"}},"customers":{"type":"array","items":{"$ref":"#/components/schemas/Customer"}},"customer_groups":{"type":"array","items":{"$ref":"#/components/schemas/CustomerGroup"}},"countries":{"type":"array","items":{"$ref":"#/components/schemas/Country"}},"channels":{"type":"array","items":{"$ref":"#/components/schemas/Channel"}},"markets":{"type":"array","items":{"$ref":"#/components/schemas/Market"}}},"required":["id","created_at","updated_at","type","promotion_id","preferences","preference_schema","label","product_ids","category_ids","customer_ids"],"x-typelizer":true},"Promotion":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"code":{"type":"string","nullable":true},"starts_at":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"usage_limit":{"type":"number","nullable":true},"match_policy":{"type":"string","enum":["all","any"]},"path":{"type":"string","nullable":true},"kind":{"type":"string","enum":["coupon_code","automatic"]},"multi_codes":{"type":"boolean"},"number_of_codes":{"type":"number","nullable":true},"code_prefix":{"type":"string","nullable":true},"promotion_category_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"action_ids":{"type":"array","items":{"type":"string"}},"rule_ids":{"type":"array","items":{"type":"string"}}},"required":["id","name","description","code","starts_at","expires_at","usage_limit","match_policy","path","kind","multi_codes","number_of_codes","code_prefix","promotion_category_id","metadata","created_at","updated_at","action_ids","rule_ids"],"x-typelizer":true},"RefundReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Refund":{"type":"object","properties":{"id":{"type":"string"},"transaction_id":{"type":"string","nullable":true},"amount":{"type":"string","nullable":true},"payment_id":{"type":"string","nullable":true},"refund_reason_id":{"type":"string","nullable":true},"originator_id":{"type":"string","nullable":true},"originator_type":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"payment":{"$ref":"#/components/schemas/Payment"}},"required":["id","transaction_id","amount","payment_id","refund_reason_id","originator_id","originator_type","metadata","created_at","updated_at"],"x-typelizer":true},"ReturnLineItem":{"type":"object","properties":{"id":{"type":"string"},"quantity":{"type":"number"},"received_quantity":{"type":"number"},"resellable":{"type":"boolean"},"pre_tax_amount":{"type":"string"},"display_pre_tax_amount":{"type":"string"},"variant_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_item_id":{"type":"string","nullable":true},"variant":{"$ref":"#/components/schemas/Variant"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"line_item":{"$ref":"#/components/schemas/LineItem"}},"required":["id","quantity","received_quantity","resellable","pre_tax_amount","display_pre_tax_amount","variant_id","line_item_id","fulfillment_item_id","created_at","updated_at"],"x-typelizer":true},"ReturnReason":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"can_be_deleted":{"type":"boolean"}},"required":["id","name","active","created_at","updated_at","can_be_deleted"],"x-typelizer":true},"Return":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"status":{"type":"string"},"order_id":{"type":"string","nullable":true},"reason_id":{"type":"string","nullable":true},"refund_total":{"type":"string"},"display_refund_total":{"type":"string"},"approved_at":{"type":"string","nullable":true},"received_at":{"type":"string","nullable":true},"refunded_at":{"type":"string","nullable":true},"canceled_at":{"type":"string","nullable":true},"reason":{"$ref":"#/components/schemas/ReturnReason"},"return_line_items":{"type":"array","items":{"$ref":"#/components/schemas/ReturnLineItem"}},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"stock_location_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"refunded_total":{"type":"string"},"refundable_total":{"type":"string"},"order":{"$ref":"#/components/schemas/Order"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"refunds":{"type":"array","items":{"$ref":"#/components/schemas/Refund"}}},"required":["id","number","status","order_id","reason_id","refund_total","display_refund_total","approved_at","received_at","refunded_at","canceled_at","memo","metadata","created_at","updated_at","stock_location_id","created_by_id","refunded_total","refundable_total"],"x-typelizer":true},"Role":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"permissions":{"type":"array","items":{"type":"string"}},"mutable":{"type":"boolean"},"users_count":{"type":"number"}},"required":["id","name","description","created_at","updated_at","permissions","mutable","users_count"],"x-typelizer":true},"SetupTask":{"type":"object","properties":{"name":{"type":"string"},"done":{"type":"boolean"}},"required":["name","done"],"x-typelizer":true},"State":{"type":"object","properties":{"abbr":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["abbr","name","created_at","updated_at"],"x-typelizer":true},"StockItem":{"type":"object","properties":{"id":{"type":"string"},"count_on_hand":{"type":"number"},"backorderable":{"type":"boolean"},"stock_location_id":{"type":"string","nullable":true},"variant_id":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"allocated_count":{"type":"number"},"available_count":{"type":"number"},"stock_location":{"$ref":"#/components/schemas/StockLocation"},"variant":{"$ref":"#/components/schemas/Variant"}},"required":["id","count_on_hand","backorderable","stock_location_id","variant_id","metadata","created_at","updated_at","allocated_count","available_count"],"x-typelizer":true},"StockLocation":{"type":"object","properties":{"id":{"type":"string"},"state_abbr":{"type":"string","nullable":true},"name":{"type":"string"},"address1":{"type":"string","nullable":true},"city":{"type":"string","nullable":true},"zipcode":{"type":"string","nullable":true},"country_iso":{"type":"string","nullable":true},"country_name":{"type":"string","nullable":true},"state_text":{"type":"string","nullable":true},"pickup_ready_in_minutes":{"type":"number","nullable":true},"pickup_instructions":{"type":"string","nullable":true},"admin_name":{"type":"string","nullable":true},"address2":{"type":"string","nullable":true},"state_name":{"type":"string","nullable":true},"phone":{"type":"string","nullable":true},"company":{"type":"string","nullable":true},"active":{"type":"boolean"},"default":{"type":"boolean"},"backorderable_default":{"type":"boolean"},"propagate_all_variants":{"type":"boolean"},"kind":{"type":"string"},"pickup_enabled":{"type":"boolean"},"pickup_stock_policy":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","state_abbr","name","address1","city","zipcode","country_iso","country_name","state_text","pickup_ready_in_minutes","pickup_instructions","admin_name","address2","state_name","phone","company","active","default","backorderable_default","propagate_all_variants","kind","pickup_enabled","pickup_stock_policy","created_at","updated_at"],"x-typelizer":true},"StockReservation":{"type":"object","properties":{"id":{"type":"string"},"stock_item_id":{"type":"string"},"line_item_id":{"type":"string"},"order_id":{"type":"string"},"variant_id":{"type":"string","nullable":true},"stock_location_id":{"type":"string","nullable":true},"quantity":{"type":"number"},"expires_at":{"type":"string"},"active":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","stock_item_id","line_item_id","order_id","variant_id","stock_location_id","quantity","expires_at","active","created_at","updated_at"],"x-typelizer":true},"StockTransfer":{"type":"object","properties":{"id":{"type":"string"},"number":{"type":"string"},"reference":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"source_location_id":{"type":"string","nullable":true},"destination_location_id":{"type":"string","nullable":true},"source_location":{"$ref":"#/components/schemas/StockLocation"},"destination_location":{"$ref":"#/components/schemas/StockLocation"}},"required":["id","number","reference","metadata","created_at","updated_at","source_location_id","destination_location_id"],"x-typelizer":true},"StoreCreditCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"non_expiring":{"type":"boolean"}},"required":["id","name","created_at","updated_at","non_expiring"],"x-typelizer":true},"StoreCredit":{"type":"object","properties":{"id":{"type":"string"},"amount":{"type":"string"},"amount_used":{"type":"string"},"amount_remaining":{"type":"string"},"display_amount":{"type":"string"},"display_amount_used":{"type":"string"},"display_amount_remaining":{"type":"string"},"currency":{"type":"string"},"memo":{"type":"string","nullable":true},"metadata":{"type":"object"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"customer_id":{"type":"string","nullable":true},"created_by_id":{"type":"string","nullable":true},"category_id":{"type":"string","nullable":true},"category_name":{"type":"string","nullable":true}},"required":["id","amount","amount_used","amount_remaining","display_amount","display_amount_used","display_amount_remaining","currency","memo","metadata","created_at","updated_at","customer_id","created_by_id","category_id","category_name"],"x-typelizer":true},"Store":{"type":"object","properties":{"id":{"type":"string"},"metadata":{"type":"object"},"name":{"type":"string"},"code":{"type":"string"},"preferred_storefront_url":{"type":"string","nullable":true},"default_currency":{"type":"string"},"default_locale":{"type":"string"},"mail_from_address":{"type":"string","nullable":true},"customer_support_email":{"type":"string","nullable":true},"new_order_notifications_email":{"type":"string","nullable":true},"preferred_send_consumer_transactional_emails":{"type":"boolean"},"preferred_admin_locale":{"type":"string","nullable":true},"preferred_timezone":{"type":"string"},"preferred_weight_unit":{"type":"string"},"preferred_default_package_weight":{"type":"number"},"preferred_default_package_length":{"type":"number"},"preferred_default_package_width":{"type":"number"},"preferred_default_package_height":{"type":"number"},"preferred_unit_system":{"type":"string"},"preferred_storefront_access":{"type":"string"},"preferred_guest_checkout":{"type":"boolean"},"preferred_order_routing_strategy":{"type":"string"},"created_at":{"type":"string"},"updated_at":{"type":"string"},"url":{"type":"string"},"api_url":{"type":"string"},"setup_tasks":{"type":"array","items":{"$ref":"#/components/schemas/SetupTask"}},"supported_currencies":{"type":"array","items":{"type":"string"}},"supported_locales":{"type":"array","items":{"type":"string"}},"available_locales":{"type":"array","items":{"type":"string"}},"logo_url":{"type":"string","nullable":true},"mailer_logo_url":{"type":"string","nullable":true}},"required":["id","metadata","name","code","preferred_storefront_url","default_currency","default_locale","mail_from_address","customer_support_email","new_order_notifications_email","preferred_send_consumer_transactional_emails","preferred_admin_locale","preferred_timezone","preferred_weight_unit","preferred_default_package_weight","preferred_default_package_length","preferred_default_package_width","preferred_default_package_height","preferred_unit_system","preferred_storefront_access","preferred_guest_checkout","preferred_order_routing_strategy","created_at","updated_at","url","api_url","setup_tasks","supported_currencies","supported_locales","available_locales","logo_url","mailer_logo_url"],"x-typelizer":true},"TaxCategory":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"tax_code":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"is_default":{"type":"boolean"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","name","tax_code","description","is_default","created_at","updated_at"],"x-typelizer":true},"TaxLine":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"included":{"type":"boolean"},"rate":{"type":"string"},"tax_rate_id":{"type":"string","nullable":true},"line_item_id":{"type":"string","nullable":true},"fulfillment_id":{"type":"string","nullable":true},"fee_id":{"type":"string","nullable":true},"amount":{"type":"string"},"display_amount":{"type":"string"},"provider_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","label","included","rate","tax_rate_id","line_item_id","fulfillment_id","fee_id","amount","display_amount","provider_id","metadata","created_at","updated_at"],"x-typelizer":true},"Variant":{"type":"object","properties":{"id":{"type":"string"},"product_id":{"type":"string"},"sku":{"type":"string","nullable":true},"options_text":{"type":"string"},"track_inventory":{"type":"boolean"},"media_count":{"type":"number"},"preorder_ships_at":{"type":"string","nullable":true},"thumbnail_url":{"type":"string","nullable":true},"purchasable":{"type":"boolean"},"in_stock":{"type":"boolean"},"backorderable":{"type":"boolean"},"preorder":{"type":"boolean"},"weight":{"type":"number","nullable":true},"height":{"type":"number","nullable":true},"width":{"type":"number","nullable":true},"depth":{"type":"number","nullable":true},"price":{"$ref":"#/components/schemas/Price"},"original_price":{"allOf":[{"$ref":"#/components/schemas/Price"}],"nullable":true},"primary_media":{"$ref":"#/components/schemas/Media"},"media":{"type":"array","items":{"$ref":"#/components/schemas/Media"}},"option_values":{"type":"array","items":{"$ref":"#/components/schemas/OptionValue"}},"custom_fields":{"type":"array","items":{"$ref":"#/components/schemas/CustomField"}},"prior_price":{"allOf":[{"$ref":"#/components/schemas/PriceHistory"}],"nullable":true},"metadata":{"type":"object"},"position":{"type":"number"},"cost_price":{"type":"string","nullable":true},"cost_currency":{"type":"string","nullable":true},"barcode":{"type":"string","nullable":true},"weight_unit":{"type":"string","nullable":true},"dimensions_unit":{"type":"string","nullable":true},"backorder_limit":{"type":"number","nullable":true},"deleted_at":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"preorderable":{"type":"boolean"},"tax_category_id":{"type":"string","nullable":true},"available_stock":{"type":"number","nullable":true},"reserved_quantity":{"type":"number"},"total_on_hand":{"type":"number","nullable":true},"product_name":{"type":"string"},"prices":{"type":"array","items":{"$ref":"#/components/schemas/Price"}},"stock_items":{"type":"array","items":{"$ref":"#/components/schemas/StockItem"}}},"required":["id","product_id","sku","options_text","track_inventory","media_count","preorder_ships_at","thumbnail_url","purchasable","in_stock","backorderable","preorder","weight","height","width","depth","price","original_price","option_values","metadata","position","cost_price","cost_currency","barcode","weight_unit","dimensions_unit","backorder_limit","deleted_at","created_at","updated_at","preorderable","tax_category_id","available_stock","reserved_quantity","total_on_hand","product_name"],"x-typelizer":true},"WebhookDelivery":{"type":"object","properties":{"id":{"type":"string"},"event_name":{"type":"string"},"event_id":{"type":"string","nullable":true},"response_code":{"type":"number","nullable":true},"execution_time":{"type":"number","nullable":true},"error_type":{"type":"string","nullable":true},"request_errors":{"type":"string","nullable":true},"response_body":{"type":"string","nullable":true},"success":{"type":"boolean","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"delivered_at":{"type":"string","nullable":true},"payload":{"type":"object"},"webhook_endpoint_id":{"type":"string"},"webhook_endpoint_url":{"type":"string"}},"required":["id","event_name","event_id","response_code","execution_time","error_type","request_errors","response_body","success","created_at","updated_at","delivered_at","payload","webhook_endpoint_id","webhook_endpoint_url"],"x-typelizer":true},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"url":{"type":"string"},"active":{"type":"boolean"},"subscriptions":{"type":"array","items":{"type":"string"}},"disabled_reason":{"type":"string","nullable":true},"created_at":{"type":"string"},"updated_at":{"type":"string"},"disabled_at":{"type":"string","nullable":true},"secret_key":{"type":"string","nullable":true},"last_delivery_at":{"type":"string","nullable":true},"recent_delivery_count":{"type":"number"},"recent_failure_count":{"type":"number"},"total_delivery_count":{"type":"number"},"successful_delivery_count":{"type":"number"},"failed_delivery_count":{"type":"number"}},"required":["id","name","url","active","subscriptions","disabled_reason","created_at","updated_at","disabled_at","secret_key","last_delivery_at","recent_delivery_count","recent_failure_count","total_delivery_count","successful_delivery_count","failed_delivery_count"],"x-typelizer":true}}}}\ No newline at end of filediff --git a/packages/cli/src/generated/resource-paths.json b/packages/cli/src/generated/resource-paths.jsonindex 9847fee12b..2f061b9606 100644--- a/packages/cli/src/generated/resource-paths.json+++ b/packages/cli/src/generated/resource-paths.json@@ -1 +1 @@-["/admin_users","/allowed_origins","/api_keys","/auth","/categories","/channels","/collection_rules","/collections","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_zones","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/option_types","/order_routing_rules","/orders","/payment_methods","/permissions","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/roles","/stock_locations","/store","/store_credit_categories","/tags","/translatable_resources","/translations","/webhook_endpoints"]\ No newline at end of file+["/admin_users","/allowed_origins","/api_keys","/auth","/categories","/channels","/collection_rules","/collections","/custom_field_definitions","/customer_groups","/customers","/delivery_methods","/delivery_profiles","/delivery_zones","/exports","/gift_card_batches","/gift_cards","/imports","/integrations","/invitations","/locales","/markets","/me","/option_types","/order_routing_rules","/orders","/payment_methods","/permissions","/price_lists","/prices","/product_types","/products","/promotion_actions","/promotion_rules","/promotions","/roles","/stock_locations","/store","/store_credit_categories","/tags","/translatable_resources","/translations","/webhook_endpoints"]\ No newline at end of filediff --git a/packages/dashboard-core/src/lib/permissions.ts b/packages/dashboard-core/src/lib/permissions.tsindex 4b7084bff4..89914fa2ee 100644--- a/packages/dashboard-core/src/lib/permissions.ts+++ b/packages/dashboard-core/src/lib/permissions.ts@@ -34,6 +34,7 @@ export const Subject = {PaymentMethod: 'Spree::PaymentMethod',DeliveryMethod: 'Spree::DeliveryMethod',DeliveryZone: 'Spree::DeliveryZone',+ DeliveryProfile: 'Spree::DeliveryProfile',/** @deprecated Use Subject.DeliveryMethod — removed in Spree 6.1. */ShippingMethod: 'Spree::ShippingMethod',StockLocation: 'Spree::StockLocation',diff --git a/packages/dashboard-starter/src/routeTree.gen.ts b/packages/dashboard-starter/src/routeTree.gen.tsindex 3b1b3338f8..631be42ea1 100644--- a/packages/dashboard-starter/src/routeTree.gen.ts+++ b/packages/dashboard-starter/src/routeTree.gen.ts@@ -40,8 +40,6 @@ import { Route as SettingsPaymentMethodsRouteImport } from './../../dashboard/srimport { Route as SettingsMarketsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/markets'import { Route as SettingsIntegrationsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/integrations'import { Route as SettingsEmailsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/emails'-import { Route as SettingsDeliveryZonesRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/delivery-zones'-import { Route as SettingsDeliveryMethodsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/delivery-methods'import { Route as SettingsCustomFieldDefinitionsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/custom-field-definitions'import { Route as SettingsChannelsRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/channels'import { Route as SettingsApiKeysRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/api-keys'@@ -61,6 +59,7 @@ import { Route as CustomersCustomerIdRouteImport } from './../../dashboard/src/rimport { Route as BrandsDotbrandIdRouteImport } from './../../dashboard-plugin-example/src/routes/brands.$brandId'import { Route as SettingsWebhooksIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/webhooks/index'import { Route as SettingsImportsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/imports/index'+import { Route as SettingsDeliveryProfilesIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/index'import { Route as ProductsPriceListsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/price-lists/index'import { Route as ProductsCollectionsIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/collections/index'import { Route as ProductsCategoriesIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/categories/index'@@ -70,7 +69,10 @@ import { Route as ProductsCollectionsNewRouteImport } from './../../dashboard/srimport { Route as ProductsCollectionsCollectionIdRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/collections/$collectionId'import { Route as ProductsCategoriesNewRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/categories/new'import { Route as ProductsCategoriesCategoryIdRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/categories/$categoryId'+import { Route as SettingsDeliveryProfilesProfileIdIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/index'import { Route as ProductsPriceListsPriceListIdIndexRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/products/price-lists/$priceListId/index'+import { Route as SettingsDeliveryProfilesProfileIdMethodsNewRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new'+import { Route as SettingsDeliveryProfilesProfileIdMethodsMethodIdRouteImport } from './../../dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'const resetPasswordRoute = resetPasswordRouteImport.update({id: '/reset-password',@@ -227,16 +229,6 @@ const SettingsEmailsRoute = SettingsEmailsRouteImport.update({path: '/emails',getParentRoute: () => SettingsRoute,} as any)-const SettingsDeliveryZonesRoute = SettingsDeliveryZonesRouteImport.update({- id: '/delivery-zones',- path: '/delivery-zones',- getParentRoute: () => SettingsRoute,-} as any)-const SettingsDeliveryMethodsRoute = SettingsDeliveryMethodsRouteImport.update({- id: '/delivery-methods',- path: '/delivery-methods',- getParentRoute: () => SettingsRoute,-} as any)const SettingsCustomFieldDefinitionsRoute =SettingsCustomFieldDefinitionsRouteImport.update({id: '/custom-field-definitions',@@ -333,6 +325,12 @@ const SettingsImportsIndexRoute = SettingsImportsIndexRouteImport.update({path: '/imports/',getParentRoute: () => SettingsRoute,} as any)+const SettingsDeliveryProfilesIndexRoute =+ SettingsDeliveryProfilesIndexRouteImport.update({+ id: '/delivery-profiles/',+ path: '/delivery-profiles/',+ getParentRoute: () => SettingsRoute,+ } as any)const ProductsPriceListsIndexRoute = ProductsPriceListsIndexRouteImport.update({id: '/products/price-lists/',path: '/products/price-lists/',@@ -382,12 +380,30 @@ const ProductsCategoriesCategoryIdRoute =path: '/products/categories/$categoryId',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const SettingsDeliveryProfilesProfileIdIndexRoute =+ SettingsDeliveryProfilesProfileIdIndexRouteImport.update({+ id: '/delivery-profiles/$profileId/',+ path: '/delivery-profiles/$profileId/',+ getParentRoute: () => SettingsRoute,+ } as any)const ProductsPriceListsPriceListIdIndexRoute =ProductsPriceListsPriceListIdIndexRouteImport.update({id: '/products/price-lists/$priceListId/',path: '/products/price-lists/$priceListId/',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const SettingsDeliveryProfilesProfileIdMethodsNewRoute =+ SettingsDeliveryProfilesProfileIdMethodsNewRouteImport.update({+ id: '/delivery-profiles/$profileId/methods/new',+ path: '/delivery-profiles/$profileId/methods/new',+ getParentRoute: () => SettingsRoute,+ } as any)+const SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute =+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRouteImport.update({+ id: '/delivery-profiles/$profileId/methods/$methodId',+ path: '/delivery-profiles/$profileId/methods/$methodId',+ getParentRoute: () => SettingsRoute,+ } as any)export interface FileRoutesByFullPath {'/': typeof authenticatedIndexRoute@@ -420,8 +436,6 @@ export interface FileRoutesByFullPath {'/$storeId/settings/api-keys': typeof SettingsApiKeysRoute'/$storeId/settings/channels': typeof SettingsChannelsRoute'/$storeId/settings/custom-field-definitions': typeof SettingsCustomFieldDefinitionsRoute- '/$storeId/settings/delivery-methods': typeof SettingsDeliveryMethodsRoute- '/$storeId/settings/delivery-zones': typeof SettingsDeliveryZonesRoute'/$storeId/settings/emails': typeof SettingsEmailsRoute'/$storeId/settings/integrations': typeof SettingsIntegrationsRoute'/$storeId/settings/markets': typeof SettingsMarketsRoute@@ -448,9 +462,13 @@ export interface FileRoutesByFullPath {'/$storeId/products/categories/': typeof ProductsCategoriesIndexRoute'/$storeId/products/collections/': typeof ProductsCollectionsIndexRoute'/$storeId/products/price-lists/': typeof ProductsPriceListsIndexRoute+ '/$storeId/settings/delivery-profiles/': typeof SettingsDeliveryProfilesIndexRoute'/$storeId/settings/imports/': typeof SettingsImportsIndexRoute'/$storeId/settings/webhooks/': typeof SettingsWebhooksIndexRoute'/$storeId/products/price-lists/$priceListId/': typeof ProductsPriceListsPriceListIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId/': typeof SettingsDeliveryProfilesProfileIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/new': typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}export interface FileRoutesByTo {'/forgot-password': typeof forgotPasswordRoute@@ -481,8 +499,6 @@ export interface FileRoutesByTo {'/$storeId/settings/api-keys': typeof SettingsApiKeysRoute'/$storeId/settings/channels': typeof SettingsChannelsRoute'/$storeId/settings/custom-field-definitions': typeof SettingsCustomFieldDefinitionsRoute- '/$storeId/settings/delivery-methods': typeof SettingsDeliveryMethodsRoute- '/$storeId/settings/delivery-zones': typeof SettingsDeliveryZonesRoute'/$storeId/settings/emails': typeof SettingsEmailsRoute'/$storeId/settings/integrations': typeof SettingsIntegrationsRoute'/$storeId/settings/markets': typeof SettingsMarketsRoute@@ -509,9 +525,13 @@ export interface FileRoutesByTo {'/$storeId/products/categories': typeof ProductsCategoriesIndexRoute'/$storeId/products/collections': typeof ProductsCollectionsIndexRoute'/$storeId/products/price-lists': typeof ProductsPriceListsIndexRoute+ '/$storeId/settings/delivery-profiles': typeof SettingsDeliveryProfilesIndexRoute'/$storeId/settings/imports': typeof SettingsImportsIndexRoute'/$storeId/settings/webhooks': typeof SettingsWebhooksIndexRoute'/$storeId/products/price-lists/$priceListId': typeof ProductsPriceListsPriceListIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId': typeof SettingsDeliveryProfilesProfileIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/new': typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}export interface FileRoutesById {__root__: typeof rootRouteImport@@ -546,8 +566,6 @@ export interface FileRoutesById {'/_authenticated/$storeId/settings/api-keys': typeof SettingsApiKeysRoute'/_authenticated/$storeId/settings/channels': typeof SettingsChannelsRoute'/_authenticated/$storeId/settings/custom-field-definitions': typeof SettingsCustomFieldDefinitionsRoute- '/_authenticated/$storeId/settings/delivery-methods': typeof SettingsDeliveryMethodsRoute- '/_authenticated/$storeId/settings/delivery-zones': typeof SettingsDeliveryZonesRoute'/_authenticated/$storeId/settings/emails': typeof SettingsEmailsRoute'/_authenticated/$storeId/settings/integrations': typeof SettingsIntegrationsRoute'/_authenticated/$storeId/settings/markets': typeof SettingsMarketsRoute@@ -574,9 +592,13 @@ export interface FileRoutesById {'/_authenticated/$storeId/products/categories/': typeof ProductsCategoriesIndexRoute'/_authenticated/$storeId/products/collections/': typeof ProductsCollectionsIndexRoute'/_authenticated/$storeId/products/price-lists/': typeof ProductsPriceListsIndexRoute+ '/_authenticated/$storeId/settings/delivery-profiles/': typeof SettingsDeliveryProfilesIndexRoute'/_authenticated/$storeId/settings/imports/': typeof SettingsImportsIndexRoute'/_authenticated/$storeId/settings/webhooks/': typeof SettingsWebhooksIndexRoute'/_authenticated/$storeId/products/price-lists/$priceListId/': typeof ProductsPriceListsPriceListIdIndexRoute+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/': typeof SettingsDeliveryProfilesProfileIdIndexRoute+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new': typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}export interface FileRouteTypes {fileRoutesByFullPath: FileRoutesByFullPath@@ -611,8 +633,6 @@ export interface FileRouteTypes {| '/$storeId/settings/api-keys'| '/$storeId/settings/channels'| '/$storeId/settings/custom-field-definitions'- | '/$storeId/settings/delivery-methods'- | '/$storeId/settings/delivery-zones'| '/$storeId/settings/emails'| '/$storeId/settings/integrations'| '/$storeId/settings/markets'@@ -639,9 +659,13 @@ export interface FileRouteTypes {| '/$storeId/products/categories/'| '/$storeId/products/collections/'| '/$storeId/products/price-lists/'+ | '/$storeId/settings/delivery-profiles/'| '/$storeId/settings/imports/'| '/$storeId/settings/webhooks/'| '/$storeId/products/price-lists/$priceListId/'+ | '/$storeId/settings/delivery-profiles/$profileId/'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/new'fileRoutesByTo: FileRoutesByToto:| '/forgot-password'@@ -672,8 +696,6 @@ export interface FileRouteTypes {| '/$storeId/settings/api-keys'| '/$storeId/settings/channels'| '/$storeId/settings/custom-field-definitions'- | '/$storeId/settings/delivery-methods'- | '/$storeId/settings/delivery-zones'| '/$storeId/settings/emails'| '/$storeId/settings/integrations'| '/$storeId/settings/markets'@@ -700,9 +722,13 @@ export interface FileRouteTypes {| '/$storeId/products/categories'| '/$storeId/products/collections'| '/$storeId/products/price-lists'+ | '/$storeId/settings/delivery-profiles'| '/$storeId/settings/imports'| '/$storeId/settings/webhooks'| '/$storeId/products/price-lists/$priceListId'+ | '/$storeId/settings/delivery-profiles/$profileId'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/new'id:| '__root__'| '/_authenticated'@@ -736,8 +762,6 @@ export interface FileRouteTypes {| '/_authenticated/$storeId/settings/api-keys'| '/_authenticated/$storeId/settings/channels'| '/_authenticated/$storeId/settings/custom-field-definitions'- | '/_authenticated/$storeId/settings/delivery-methods'- | '/_authenticated/$storeId/settings/delivery-zones'| '/_authenticated/$storeId/settings/emails'| '/_authenticated/$storeId/settings/integrations'| '/_authenticated/$storeId/settings/markets'@@ -764,9 +788,13 @@ export interface FileRouteTypes {| '/_authenticated/$storeId/products/categories/'| '/_authenticated/$storeId/products/collections/'| '/_authenticated/$storeId/products/price-lists/'+ | '/_authenticated/$storeId/settings/delivery-profiles/'| '/_authenticated/$storeId/settings/imports/'| '/_authenticated/$storeId/settings/webhooks/'| '/_authenticated/$storeId/products/price-lists/$priceListId/'+ | '/_authenticated/$storeId/settings/delivery-profiles/$profileId/'+ | '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ | '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new'fileRoutesById: FileRoutesById}export interface RootRouteChildren {@@ -996,20 +1024,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof SettingsEmailsRouteImportparentRoute: typeof SettingsRoute}- '/_authenticated/$storeId/settings/delivery-zones': {- id: '/_authenticated/$storeId/settings/delivery-zones'- path: '/delivery-zones'- fullPath: '/$storeId/settings/delivery-zones'- preLoaderRoute: typeof SettingsDeliveryZonesRouteImport- parentRoute: typeof SettingsRoute- }- '/_authenticated/$storeId/settings/delivery-methods': {- id: '/_authenticated/$storeId/settings/delivery-methods'- path: '/delivery-methods'- fullPath: '/$storeId/settings/delivery-methods'- preLoaderRoute: typeof SettingsDeliveryMethodsRouteImport- parentRoute: typeof SettingsRoute- }'/_authenticated/$storeId/settings/custom-field-definitions': {id: '/_authenticated/$storeId/settings/custom-field-definitions'path: '/custom-field-definitions'@@ -1143,6 +1157,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof SettingsImportsIndexRouteImportparentRoute: typeof SettingsRoute}+ '/_authenticated/$storeId/settings/delivery-profiles/': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/'+ path: '/delivery-profiles'+ fullPath: '/$storeId/settings/delivery-profiles/'+ preLoaderRoute: typeof SettingsDeliveryProfilesIndexRouteImport+ parentRoute: typeof SettingsRoute+ }'/_authenticated/$storeId/products/price-lists/': {id: '/_authenticated/$storeId/products/price-lists/'path: '/products/price-lists'@@ -1206,6 +1227,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof ProductsCategoriesCategoryIdRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/$profileId/'+ path: '/delivery-profiles/$profileId'+ fullPath: '/$storeId/settings/delivery-profiles/$profileId/'+ preLoaderRoute: typeof SettingsDeliveryProfilesProfileIdIndexRouteImport+ parentRoute: typeof SettingsRoute+ }'/_authenticated/$storeId/products/price-lists/$priceListId/': {id: '/_authenticated/$storeId/products/price-lists/$priceListId/'path: '/products/price-lists/$priceListId'@@ -1213,6 +1241,20 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof ProductsPriceListsPriceListIdIndexRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new'+ path: '/delivery-profiles/$profileId/methods/new'+ fullPath: '/$storeId/settings/delivery-profiles/$profileId/methods/new'+ preLoaderRoute: typeof SettingsDeliveryProfilesProfileIdMethodsNewRouteImport+ parentRoute: typeof SettingsRoute+ }+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ path: '/delivery-profiles/$profileId/methods/$methodId'+ fullPath: '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ preLoaderRoute: typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRouteImport+ parentRoute: typeof SettingsRoute+ }}}@@ -1221,8 +1263,6 @@ interface SettingsRouteChildren {SettingsApiKeysRoute: typeof SettingsApiKeysRouteSettingsChannelsRoute: typeof SettingsChannelsRouteSettingsCustomFieldDefinitionsRoute: typeof SettingsCustomFieldDefinitionsRoute- SettingsDeliveryMethodsRoute: typeof SettingsDeliveryMethodsRoute- SettingsDeliveryZonesRoute: typeof SettingsDeliveryZonesRouteSettingsEmailsRoute: typeof SettingsEmailsRouteSettingsIntegrationsRoute: typeof SettingsIntegrationsRouteSettingsMarketsRoute: typeof SettingsMarketsRoute@@ -1236,8 +1276,12 @@ interface SettingsRouteChildren {SettingsTaxCategoriesRoute: typeof SettingsTaxCategoriesRouteSettingsIndexRoute: typeof SettingsIndexRouteSettingsWebhooksWebhookEndpointIdRoute: typeof SettingsWebhooksWebhookEndpointIdRoute+ SettingsDeliveryProfilesIndexRoute: typeof SettingsDeliveryProfilesIndexRouteSettingsImportsIndexRoute: typeof SettingsImportsIndexRouteSettingsWebhooksIndexRoute: typeof SettingsWebhooksIndexRoute+ SettingsDeliveryProfilesProfileIdIndexRoute: typeof SettingsDeliveryProfilesProfileIdIndexRoute+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute: typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ SettingsDeliveryProfilesProfileIdMethodsNewRoute: typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}const SettingsRouteChildren: SettingsRouteChildren = {@@ -1245,8 +1289,6 @@ const SettingsRouteChildren: SettingsRouteChildren = {SettingsApiKeysRoute: SettingsApiKeysRoute,SettingsChannelsRoute: SettingsChannelsRoute,SettingsCustomFieldDefinitionsRoute: SettingsCustomFieldDefinitionsRoute,- SettingsDeliveryMethodsRoute: SettingsDeliveryMethodsRoute,- SettingsDeliveryZonesRoute: SettingsDeliveryZonesRoute,SettingsEmailsRoute: SettingsEmailsRoute,SettingsIntegrationsRoute: SettingsIntegrationsRoute,SettingsMarketsRoute: SettingsMarketsRoute,@@ -1261,8 +1303,15 @@ const SettingsRouteChildren: SettingsRouteChildren = {SettingsIndexRoute: SettingsIndexRoute,SettingsWebhooksWebhookEndpointIdRoute:SettingsWebhooksWebhookEndpointIdRoute,+ SettingsDeliveryProfilesIndexRoute: SettingsDeliveryProfilesIndexRoute,SettingsImportsIndexRoute: SettingsImportsIndexRoute,SettingsWebhooksIndexRoute: SettingsWebhooksIndexRoute,+ SettingsDeliveryProfilesProfileIdIndexRoute:+ SettingsDeliveryProfilesProfileIdIndexRoute,+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute:+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute,+ SettingsDeliveryProfilesProfileIdMethodsNewRoute:+ SettingsDeliveryProfilesProfileIdMethodsNewRoute,}const SettingsRouteWithChildren = SettingsRoute._addFileChildren(diff --git a/packages/dashboard/e2e/delivery-settings.spec.ts b/packages/dashboard/e2e/delivery-settings.spec.tsindex 01ca8a72f0..f10dbaa508 100644--- a/packages/dashboard/e2e/delivery-settings.spec.ts+++ b/packages/dashboard/e2e/delivery-settings.spec.ts@@ -1,69 +1,203 @@import { expect, test } from '@playwright/test'import { gotoIndex, login } from './helpers'-const ZONES_PATH = (storeId: string) => `/${storeId}/settings/delivery-zones`-const METHODS_PATH = (storeId: string) => `/${storeId}/settings/delivery-methods`-const ZONES_CTA = /add delivery zone/i-const METHODS_CTA = /add delivery method/i+const DELIVERY_PROFILES_PATH = (storeId: string) => `/${storeId}/settings/delivery-profiles`+const PROFILE_CTA = /add profile/i-test.describe('delivery zones', () => {- test('lists delivery zones', async ({ page }) => {+test.describe('delivery profiles', () => {+ test('lists delivery profiles including the store default', async ({ page }) => {const creds = await login(page)- await gotoIndex(page, ZONES_PATH(creds.store_id), ZONES_CTA)+ await gotoIndex(page, DELIVERY_PROFILES_PATH(creds.store_id), PROFILE_CTA)++ // Every store is seeded with a default profile, so the list is never empty.+ await expect(page.getByText(/^default$/i).first()).toBeVisible({ timeout: 15_000 })})- test('creates a delivery zone with a country member', async ({ page }) => {+ test('creates a profile, a zone inside it, and a method inside the zone', async ({ page }) => {const creds = await login(page)- await gotoIndex(page, ZONES_PATH(creds.store_id), ZONES_CTA)+ await gotoIndex(page, DELIVERY_PROFILES_PATH(creds.store_id), PROFILE_CTA)++ const stamp = Date.now()+ const profileName = `E2E Profile ${stamp}`+ const zoneName = `E2E Zone ${stamp}`+ const methodName = `E2E Method ${stamp}`++ // ---- profile -----------------------------------------------------------+ await page.getByRole('button', { name: PROFILE_CTA }).click()+ await expect(page.getByRole('heading', { name: /new delivery profile/i })).toBeVisible()- const name = `E2E Zone ${Date.now()}`+ await page.locator('#name').fill(profileName)+ await page.getByRole('button', { name: /create profile/i }).click()- await page.getByRole('button', { name: ZONES_CTA }).click()+ // Creating a profile lands on its detail page, where zones and methods live.+ await expect(page.getByRole('heading', { name: profileName })).toBeVisible({ timeout: 15_000 })++ // ---- zone --------------------------------------------------------------+ await page.getByRole('button', { name: /add delivery zone/i }).click()await expect(page.getByRole('heading', { name: /new delivery zone/i })).toBeVisible()- await page.locator('#name').fill(name)- await page.getByRole('button', { name: /add member/i }).click()- // Second combobox in the member row is the country picker.- await page.getByRole('combobox').nth(1).click()- await page.getByRole('option', { name: /united states/i }).click()+ await page.locator('#name').fill(zoneName)++ // Coverage is picked from the store's market countries: search narrows the+ // list, then the country's own checkbox selects the whole country.+ const zoneSheet = page.getByRole('dialog')+ await zoneSheet.getByPlaceholder(/search countries and regions/i).fill('United States')+ await zoneSheet.getByRole('checkbox', { name: /^united states$/i }).check()await page.getByRole('button', { name: /create delivery zone/i }).click()- await expect(page.getByText(name)).toBeVisible({ timeout: 15_000 })+ await expect(page.getByText(zoneName)).toBeVisible({ timeout: 15_000 })++ // ---- method ------------------------------------------------------------+ await page+ .getByRole('button', { name: /add method/i })+ .first()+ .click()+ await expect(page.getByRole('heading', { name: /new delivery method/i })).toBeVisible({+ timeout: 15_000,+ })++ // The method form is a sheet over the profile, so the profile stays put+ // behind it rather than being navigated away from. The modal sheet marks+ // the page behind as aria-hidden, which removes it from role queries —+ // assert through a CSS locator instead.+ await expect(page.locator('h1', { hasText: profileName })).toBeVisible()++ // Started from inside a zone, so the zone is already answered — asking+ // again could silently file the method under a different one.+ await expect(page.getByRole('dialog').getByText(/^zone$/i)).toHaveCount(0)++ await page.getByRole('dialog').locator('#name').fill(methodName)+ await page.getByRole('button', { name: /create delivery method/i }).click()++ // Saving closes the sheet and the method appears under its zone.+ await expect(page.getByRole('heading', { name: /new delivery method/i })).toHaveCount(0, {+ timeout: 15_000,+ })+ await expect(page.getByText(methodName)).toBeVisible({ timeout: 15_000 })})-})-test.describe('delivery methods', () => {- test('lists delivery methods', async ({ page }) => {+ // Opening a method is a search-param change, so the sheet must survive a+ // reload and a direct link — that is what keeps bookmarked methods working.+ test('opens the method sheet straight from a URL', async ({ page }) => {const creds = await login(page)- await gotoIndex(page, METHODS_PATH(creds.store_id), METHODS_CTA)+ await gotoIndex(page, DELIVERY_PROFILES_PATH(creds.store_id), PROFILE_CTA)++ const profileName = `E2E Deeplink Profile ${Date.now()}`++ await page.getByRole('button', { name: PROFILE_CTA }).click()+ await expect(page.getByRole('heading', { name: /new delivery profile/i })).toBeVisible()++ await page.locator('#name').fill(profileName)+ await page.getByRole('button', { name: /create profile/i }).click()++ await expect(page.getByRole('heading', { name: profileName })).toBeVisible({ timeout: 15_000 })++ await page.getByRole('button', { name: /offer pickup/i }).click()+ await expect(page.getByRole('heading', { name: /new delivery method/i })).toBeVisible({+ timeout: 15_000,+ })++ // Reloading the URL the sheet put in the address bar reopens it, over a+ // profile page that rendered underneath.+ await page.reload()+ await expect(page.getByRole('heading', { name: /new delivery method/i })).toBeVisible({+ timeout: 15_000,+ })+ // Behind a modal sheet the page is aria-hidden, so role queries can't see+ // the heading — a CSS locator proves it stayed rendered.+ await expect(page.locator('h1', { hasText: profileName })).toBeVisible()++ // Cancelling leaves the profile behind, with no sheet left open.+ await page.getByRole('button', { name: /^cancel$/i }).click()+ await expect(page.getByRole('heading', { name: /new delivery method/i })).toHaveCount(0)+ await expect(page.getByRole('heading', { name: profileName })).toBeVisible()})- test('creates a pickup delivery method', async ({ page }) => {+ // Pickup is a separate card because it has no destination: the merchant+ // reaches the method form through it, and that form must drop the zone.+ test('offers pickup from a fresh profile, on a form with no zone', async ({ page }) => {const creds = await login(page)- await gotoIndex(page, METHODS_PATH(creds.store_id), METHODS_CTA)+ await gotoIndex(page, DELIVERY_PROFILES_PATH(creds.store_id), PROFILE_CTA)- const name = `E2E Pickup ${Date.now()}`+ const profileName = `E2E Pickup Profile ${Date.now()}`- await page.getByRole('button', { name: METHODS_CTA }).click()- await expect(page.getByRole('heading', { name: /new delivery method/i })).toBeVisible()+ await page.getByRole('button', { name: PROFILE_CTA }).click()+ await expect(page.getByRole('heading', { name: /new delivery profile/i })).toBeVisible()- await page.locator('#name').fill(name)+ await page.locator('#name').fill(profileName)+ await page.getByRole('button', { name: /create profile/i }).click()- // Target selects through their labels — the sheet renders several, and- // positional lookups break whenever a field is added.- const selectFor = (label: RegExp) =>- page.locator('[data-slot="field"]').filter({ hasText: label }).getByRole('combobox').first()+ await expect(page.getByRole('heading', { name: profileName })).toBeVisible({ timeout: 15_000 })- await selectFor(/fulfillment type/i).click()- await page.getByRole('option', { name: /^pickup$/i }).click()+ // A brand-new profile collects nowhere yet, so the pickup card offers the+ // way in rather than listing methods.+ await expect(page.getByText(/customers cannot collect orders/i)).toBeVisible({+ timeout: 15_000,+ })- // Choosing pickup steers the fulfillment provider to the one that- // actually does pickup, not generic Manual.- await expect(selectFor(/fulfillment provider/i)).toHaveText(/pickup/i)+ await page.getByRole('button', { name: /offer pickup/i }).click()+ await expect(page.getByRole('heading', { name: /new delivery method/i })).toBeVisible({+ timeout: 15_000,+ })- await page.getByRole('button', { name: /create delivery method/i }).click()+ // Pickup preselected: collection counters replace the zone entirely.+ const sheet = page.getByRole('dialog')+ await expect(sheet.getByText(/collection locations/i)).toBeVisible({ timeout: 15_000 })+ await expect(sheet.getByText(/^zone$/i)).toHaveCount(0)+ })- await expect(page.getByText(name)).toBeVisible({ timeout: 15_000 })+ // The origin-group layer stays invisible until a profile is split, so this+ // covers both directions: splitting reveals the per-group sections, and+ // deleting the second group returns the page to its flat rendering.+ test('splits shipping origins into a second group, then collapses back', async ({ page }) => {+ const creds = await login(page)+ await gotoIndex(page, DELIVERY_PROFILES_PATH(creds.store_id), PROFILE_CTA)++ const profileName = `E2E Origins Profile ${Date.now()}`+ const groupName = 'EU warehouse'++ await page.getByRole('button', { name: PROFILE_CTA }).click()+ await expect(page.getByRole('heading', { name: /new delivery profile/i })).toBeVisible()++ await page.locator('#name').fill(profileName)+ await page.getByRole('button', { name: /create profile/i }).click()++ await expect(page.getByRole('heading', { name: profileName })).toBeVisible({ timeout: 15_000 })++ // A fresh profile has one nameless group, so no group header renders yet+ // ("Ships from" itself also appears in the Locations card — assert on the+ // group name, which cannot exist before the split).+ await expect(page.getByText(groupName)).toHaveCount(0)++ await page.getByRole('button', { name: /split shipping origins/i }).click()+ await expect(page.getByRole('heading', { name: /split shipping origins/i })).toBeVisible()++ await page.locator('#origin-group-name').fill(groupName)+ await page+ .getByRole('dialog')+ .getByRole('button', { name: /^split shipping origins$/i })+ .click()++ // Two groups now: the nameless default renders as "All locations", the new+ // one under its own name.+ await expect(page.getByText(groupName)).toBeVisible({ timeout: 15_000 })+ await expect(page.getByText(/ships from all locations/i)).toHaveCount(2)++ // Deleting the empty second group takes the profile back to one group,+ // and the group framing disappears with it.+ // The last actions menu on the page belongs to the group just created,+ // which renders below the default one.+ await page+ .getByRole('button', { name: /open actions/i })+ .last()+ .click()+ await page.getByRole('menuitem', { name: /delete/i }).click()+ await page+ .getByRole('dialog')+ .getByRole('button', { name: /^delete$/i })+ .click()++ await expect(page.getByText(groupName)).toHaveCount(0, { timeout: 15_000 })})})diff --git a/packages/dashboard/e2e/global-setup.ts b/packages/dashboard/e2e/global-setup.tsindex 6e2eeb0bc8..894a0ebeab 100644--- a/packages/dashboard/e2e/global-setup.ts+++ b/packages/dashboard/e2e/global-setup.ts@@ -57,8 +57,7 @@ const BOOTSTRAP_RUBY = [// Looked up by permalink, not name: category names are not unique, so a name// lookup could match an unrelated (or child) category.`category = s.categories.where(permalink: '${FIXTURE_PROMO_TAXON_PERMALINK}').first_or_create!(name: '${FIXTURE_PROMO_TAXON}', parent: nil)`,- `shipping_category = Spree::ShippingCategory.first || Spree::ShippingCategory.create!(name: 'Default')`,- `product = Spree::Product.where(name: '${FIXTURE_PROMO_PRODUCT}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active')`,+ `product = Spree::Product.where(name: '${FIXTURE_PROMO_PRODUCT}').first_or_create!(store: s, status: 'active')`,`product.default_variant.set_price(s.default_currency, 19.99)`,`product.taxons << category unless product.taxons.include?(category)`,// Stock the promo product on the store's default stock location so@@ -71,20 +70,20 @@ const BOOTSTRAP_RUBY = [// I → row-action clone/delete) so the serial suite can mutate them in any// order without poisoning siblings. All start `active` so the status spec// sees a clean transition.- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_A}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_B}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_C}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_D}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_E}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_F}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_G}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_H}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_I}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_J}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_K}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_L}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_M}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,- `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_N}').first_or_create!(shipping_category: shipping_category, store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_A}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_B}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_C}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_D}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_E}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_F}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_G}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_H}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_I}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_J}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_K}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_L}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_M}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,+ `Spree::Product.where(name: '${FIXTURE_BULK_PRODUCT_N}').first_or_create!(store: s, status: 'active').tap { |p| p.default_variant.set_price(s.default_currency, 9.99); p.update!(status: 'active') }`,// Second channel beyond the seeded default; the channels bulk-action// and filter specs need a non-default channel to add/remove against.`bulk_channel = s.channels.where(code: '${FIXTURE_BULK_CHANNEL_CODE}').first_or_create!(name: '${FIXTURE_BULK_CHANNEL_NAME}')`,diff --git a/packages/dashboard/e2e/product-types.spec.ts b/packages/dashboard/e2e/product-types.spec.tsindex 15eb4cab0c..eefb7d012f 100644--- a/packages/dashboard/e2e/product-types.spec.ts+++ b/packages/dashboard/e2e/product-types.spec.ts@@ -10,7 +10,7 @@ test.describe('product types', () => {await gotoIndex(page, PATH(creds.store_id), CTA)})- test('creates a pickup-capable product type', async ({ page }) => {+ test('creates a product type', async ({ page }) => {const creds = await login(page)await gotoIndex(page, PATH(creds.store_id), CTA)@@ -20,24 +20,16 @@ test.describe('product types', () => {await expect(page.getByRole('heading', { name: /new product type/i })).toBeVisible()await page.locator('#name').fill(name)- // Shipping is preselected; add pickup on top. Base UI renders the real- // control as a button (the id lands on a visually-hidden input), so- // drive it through its label like a user would.- await page.getByRole('checkbox', { name: /^pickup$/i }).click()-await page.getByRole('button', { name: /create product type/i }).click()await expect(page.getByText(name)).toBeVisible({ timeout: 15_000 })})- test('rejects a product type with no fulfillment types', async ({ page }) => {+ test('rejects a product type with no name', async ({ page }) => {const creds = await login(page)await gotoIndex(page, PATH(creds.store_id), CTA)await page.getByRole('button', { name: CTA }).click()- await page.locator('#name').fill(`E2E Invalid ${Date.now()}`)- await page.getByRole('checkbox', { name: /^shipping$/i }).click() // uncheck the default-await page.getByRole('button', { name: /create product type/i }).click()// Client-side validation keeps the sheet open with an error.diff --git a/packages/dashboard/src/components/spree/products/product-form-cards.tsx b/packages/dashboard/src/components/spree/products/product-form-cards.tsxindex 9612626bf0..cb4b787066 100644--- a/packages/dashboard/src/components/spree/products/product-form-cards.tsx+++ b/packages/dashboard/src/components/spree/products/product-form-cards.tsx@@ -46,6 +46,7 @@ import { useTranslation } from 'react-i18next'import { toast } from 'sonner'import { categoryAutocompleteProps, useCategories } from '../../../hooks/use-categories'import { collectionAutocompleteProps, useCollections } from '../../../hooks/use-collections'+import { useDeliveryProfiles } from '../../../hooks/use-delivery-profiles'import { useOptionTypesByIds } from '../../../hooks/use-option-types'import { useDeleteProductMedia } from '../../../hooks/use-product-media'import { useProductType, useProductTypes } from '../../../hooks/use-product-types'@@ -650,6 +651,11 @@ export function CategorizationCard({ form }: FormCardProps) {const { data: collectionsData } = useCollections()const { data: productTypesData } = useProductTypes()const productTypes = productTypesData?.data ?? []+ const { data: deliveryProfilesData } = useDeliveryProfiles()+ const deliveryProfiles = useMemo(() => deliveryProfilesData?.data ?? [], [deliveryProfilesData])+ // A product with no profile of its own ships on the store default, so the+ // select shows that rather than an empty trigger the merchant has to guess at.+ const defaultDeliveryProfileId = deliveryProfiles.find((profile) => profile.default)?.idconst selectedProductTypeId = form.watch('product_type_id') as string | null | undefinedconst { data: selectedProductType } = useProductType(selectedProductTypeId ?? undefined)// Resolved by id: the type may reference option types beyond the first page@@ -736,6 +742,36 @@ export function CategorizationCard({ form }: FormCardProps) {)}</Field>+ <Field>+ <FieldLabel>{t('admin.fields.product.delivery_profile_id.label')}</FieldLabel>+ <Controller+ name="delivery_profile_id"+ control={form.control}+ render={({ field }) => (+ <Select+ value={field.value ?? defaultDeliveryProfileId ?? ''}+ onValueChange={(v) => field.onChange(v || null)}+ >+ <SelectTrigger className="w-full">+ <SelectValue>+ {(v) => deliveryProfiles.find((profile) => profile.id === v)?.name ?? ''}+ </SelectValue>+ </SelectTrigger>+ <SelectContent>+ {deliveryProfiles.map((profile) => (+ <SelectItem key={profile.id} value={profile.id}>+ {profile.name}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ <span className="text-muted-foreground text-xs">+ {t('admin.fields.product.delivery_profile_id.help')}+ </span>+ </Field>+<Field><FieldLabel>{t('admin.fields.product.category_ids.label')}</FieldLabel><Controllerdiff --git a/packages/dashboard/src/components/spree/shipping/delivery-method-form.tsx b/packages/dashboard/src/components/spree/shipping/delivery-method-form.tsxnew file mode 100644index 0000000000..17e25627ca--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/delivery-method-form.tsx@@ -0,0 +1,1270 @@+import type {+ Channel,+ DeliveryProfile,+ DeliveryRateProviderCatalogEntry,+ DeliveryRateProviderOption,+ DeliveryZone,+ IntegrationTypeDefinition,+ PreferenceField,+ Product,+} from '@spree/admin-sdk'+import {+ type adminClient,+ Can,+ PreferencesForm,+ ResourceMultiAutocomplete,+ Subject,+ useResourceKey,+ useStore,+} from '@spree/dashboard-core'+import {+ Button,+ Card,+ CardContent,+ CardHeader,+ CardTitle,+ Checkbox,+ DropdownMenu,+ DropdownMenuContent,+ DropdownMenuItem,+ DropdownMenuTrigger,+ Field,+ FieldError,+ FieldLabel,+ Input,+ RadioGroup,+ RadioGroupItem,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ Sheet,+ SheetContent,+ SheetFooter,+ SheetHeader,+ SheetTitle,+ Switch,+} from '@spree/dashboard-ui'+import { useQueryClient } from '@tanstack/react-query'+import { PencilIcon, PlusIcon, Trash2Icon } from 'lucide-react'+import { useEffect, useMemo, useState } from 'react'+import { Controller, type UseFormReturn, useFieldArray } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import { channelAutocompleteProps } from '../../../hooks/use-channels'+import {+ useDeliveryCalculators,+ useDeliveryMethodRuleTypes,+ useDeliveryRateProviders,+ useFulfillmentProviders,+} from '../../../hooks/use-delivery-methods'+import { useIntegrations, useIntegrationTypes } from '../../../hooks/use-integrations'+import { productAutocompleteProps } from '../../../hooks/use-products'+import { useStockLocations } from '../../../hooks/use-stock-locations'+import { useTaxCategories } from '../../../hooks/use-tax-categories'+import type { DeliveryMethodFormValues } from '../../../schemas/delivery-method'+import { ConfigureIntegrationSheet } from '../integrations/configure-integration-sheet'+import { StockLocationScopeField } from './stock-location-scope-field'++/**+ * Calculators whose price is a plain amount, which a multi-currency store+ * quotes per currency through the `amounts` preference. Every other+ * calculator (percent, tiered) is currency-neutral and keeps the generic+ * preference rendering.+ */+const AMOUNT_BASED_CALCULATORS = [+ 'Spree::Calculator::Shipping::FlatRate',+ 'Spree::Calculator::Shipping::PerItem',+ 'Spree::Calculator::Shipping::DigitalDelivery',+]++/**+ * Preference keys the per-currency editor owns on those calculators. `amount`+ * and `currency` are the pre-6.0 single-currency pair, kept authoritative for+ * the store's default currency so an upgraded store quotes unchanged.+ */+const CURRENCY_AMOUNT_KEYS = ['amount', 'currency', 'amounts']++/** One entry from the delivery-method-rule discovery endpoint. */+type DeliveryMethodRuleType = Awaited<+ ReturnType<typeof adminClient.deliveryMethods.ruleTypes>+>['data'][number]++interface MethodFormProps {+ form: UseFormReturn<DeliveryMethodFormValues>+ profile: DeliveryProfile+ zones: DeliveryZone[]+ /**+ * True when the merchant opened this form from inside a zone, so the zone+ * is already decided. Re-asking would be redundant, and answering+ * differently would silently file the method under another zone.+ */+ zonePreselected?: boolean+}++/** The fulfillment provider currently chosen, resolved to its catalog entry. */+function useSelectedFulfillmentProvider(form: UseFormReturn<DeliveryMethodFormValues>) {+ const { data: fulfillmentProviders } = useFulfillmentProviders()+ const fulfillmentProvider = form.watch('fulfillment_provider')++ return useMemo(+ () => (fulfillmentProviders?.data ?? []).find((p) => p.type === fulfillmentProvider),+ [fulfillmentProviders, fulfillmentProvider],+ )+}++/**+ * Every card of the delivery method page, in the order a merchant fills them:+ * what the method is, who fulfills and prices it, which services it offers,+ * what it costs, where it applies, and when it is eligible.+ *+ * Zones and carrier services are destination concerns, so a method collected+ * at a counter or delivered digitally shows neither — pickup gets the counters+ * it can be collected from instead. The zone card also disappears when the+ * merchant started from a zone: it is answered already.+ */+export function DeliveryMethodFormCards({+ form,+ profile,+ zones,+ zonePreselected,+}: MethodFormProps) {+ const selectedProvider = useSelectedFulfillmentProvider(form)+ const isPickup = !!(selectedProvider?.pickup || selectedProvider?.pickup_point)+ const isDigital = !!selectedProvider?.digital+ const shipsToAddress = !isPickup && !isDigital++ return (+ <>+ <GeneralCard form={form} />+ <ProvidersCard form={form} profile={profile} />+ {shipsToAddress && <CarrierServicesCard form={form} />}+ <PricingCard form={form} />+ {isPickup && <CollectionLocationsCard form={form} />}+ {shipsToAddress && !zonePreselected && <ZoneCard form={form} zones={zones} />}+ <ConditionsCard form={form} />+ </>+ )+}++// ---------------------------------------------------------------------------+// Collection locations — which counters a pickup method can be collected from+// ---------------------------------------------------------------------------++function CollectionLocationsCard({ form }: { form: UseFormReturn<DeliveryMethodFormValues> }) {+ const { t } = useTranslation()+ const { data: stockLocations } = useStockLocations()+ const selectedIds = form.watch('stock_location_ids') ?? []++ // Only counters that accept collection can serve a pickup method; the rest+ // would be an option the storefront never offers.+ const locations = (stockLocations?.data ?? []).filter((location) => location.pickup_enabled)++ // "Every pickup-enabled location" is the absence of a narrowing, exactly as+ // the API reads an empty array — so the radio reads the field rather than+ // holding state of its own.+ const [scope, setScope] = useState<'all' | 'selected'>(+ selectedIds.length > 0 ? 'selected' : 'all',+ )+ useEffect(() => {+ if (selectedIds.length > 0) setScope('selected')+ }, [selectedIds.length])++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_methods.collection_locations.title')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ <Controller+ name="stock_location_ids"+ control={form.control}+ render={({ field }) => (+ <StockLocationScopeField+ idPrefix="collection"+ scope={scope}+ onScopeChange={(next) => {+ setScope(next)+ if (next === 'all') field.onChange([])+ }}+ locations={locations}+ selectedIds={field.value ?? []}+ onSelectedIdsChange={field.onChange}+ allLabel={t('admin.delivery_methods.collection_locations.all')}+ selectedLabel={t('admin.delivery_methods.collection_locations.specific')}+ emptyLabel={t('admin.delivery_methods.collection_locations.none_enabled')}+ />+ )}+ />+ </CardContent>+ </Card>+ )+}++function GeneralCard({ form }: { form: UseFormReturn<DeliveryMethodFormValues> }) {+ const { t } = useTranslation()+ const { errors } = form.formState++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_methods.cards.general')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ {errors.root?.message && (+ <p className="text-sm text-destructive" role="alert">+ {errors.root.message}+ </p>+ )}+ <Field>+ <FieldLabel htmlFor="name">{t('admin.fields.name.label')}</FieldLabel>+ <Input+ id="name"+ autoFocus+ aria-invalid={!!errors.name || undefined}+ {...form.register('name')}+ />+ <FieldError errors={[errors.name]} />+ </Field>++ <div className="grid grid-cols-2 gap-3">+ <Field>+ <FieldLabel htmlFor="admin_name">+ {t('admin.fields.delivery_method.admin_name.label')}+ </FieldLabel>+ <Input id="admin_name" {...form.register('admin_name')} />+ </Field>+ <Field>+ <FieldLabel htmlFor="code">{t('admin.fields.delivery_method.code.label')}</FieldLabel>+ <Input id="code" {...form.register('code')} />+ </Field>+ </div>++ <div className="grid grid-cols-2 gap-3">+ <Field>+ <FieldLabel htmlFor="estimated_transit_business_days_min">+ {t('admin.fields.delivery_method.transit_days_min.label')}+ </FieldLabel>+ <Input+ id="estimated_transit_business_days_min"+ type="number"+ min="1"+ {...form.register('estimated_transit_business_days_min')}+ />+ </Field>+ <Field>+ <FieldLabel htmlFor="estimated_transit_business_days_max">+ {t('admin.fields.delivery_method.transit_days_max.label')}+ </FieldLabel>+ <Input+ id="estimated_transit_business_days_max"+ type="number"+ min="1"+ {...form.register('estimated_transit_business_days_max')}+ />+ </Field>+ </div>++ <Field>+ <FieldLabel htmlFor="tracking_url">+ {t('admin.fields.delivery_method.tracking_url.label')}+ </FieldLabel>+ <Input+ id="tracking_url"+ placeholder="https://carrier.example/track?num=:tracking"+ {...form.register('tracking_url')}+ />+ </Field>++ <Field>+ <div className="flex items-start justify-between gap-4">+ <div className="flex flex-col">+ <FieldLabel htmlFor="storefront_visible" className="cursor-pointer">+ {t('admin.fields.storefront_visible.label')}+ </FieldLabel>+ <span className="text-xs text-muted-foreground">+ {t('admin.fields.delivery_method.storefront_visible.help')}+ </span>+ </div>+ <Controller+ name="storefront_visible"+ control={form.control}+ render={({ field }) => (+ <Switch+ id="storefront_visible"+ checked={!!field.value}+ onCheckedChange={field.onChange}+ />+ )}+ />+ </div>+ </Field>+ </CardContent>+ </Card>+ )+}++// ---------------------------------------------------------------------------+// Providers — who fulfills the method and where its price comes from+// ---------------------------------------------------------------------------++function ProviderSelectField({+ form,+ name,+ label,+ help,+ options,+}: {+ form: UseFormReturn<DeliveryMethodFormValues>+ name: 'fulfillment_provider' | 'rate_provider'+ label: string+ help: string+ options: { value: string; label: string; disabled?: boolean }[]+}) {+ return (+ <Field>+ <FieldLabel>{label}</FieldLabel>+ <Controller+ name={name}+ control={form.control}+ render={({ field }) => (+ <Select items={options} value={field.value || ''} onValueChange={field.onChange}>+ <SelectTrigger>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {options.map((option) => (+ <SelectItem key={option.value} value={option.value} disabled={option.disabled}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ <span className="text-muted-foreground text-xs">{help}</span>+ </Field>+ )+}++function ProvidersCard({+ form,+ profile,+}: {+ form: UseFormReturn<DeliveryMethodFormValues>+ profile: DeliveryProfile+}) {+ const { t } = useTranslation()+ const { data: fulfillmentProviders } = useFulfillmentProviders()+ const { data: rateProviders } = useDeliveryRateProviders()++ const fulfillmentProvider = form.watch('fulfillment_provider')+ const rateProvider = form.watch('rate_provider')++ // A digital profile only fulfills digitally, and a physical one never does —+ // offering a provider the server would reject just produces a 422 the+ // merchant has to decode.+ const eligibleFulfillmentProviders = useMemo(+ () =>+ (fulfillmentProviders?.data ?? []).filter((provider) =>+ profile.digital ? provider.digital : !provider.digital,+ ),+ [fulfillmentProviders, profile.digital],+ )++ // An unconnected carrier provider stays listed but unselectable, with a+ // connect prompt below — hiding it would leave the merchant wondering+ // where their carrier went.+ const providerOptions = eligibleFulfillmentProviders.map((provider) => ({+ value: provider.type,+ label: provider.available+ ? provider.name+ : t('admin.delivery_methods.provider_needs_connection', { name: provider.name }),+ disabled: !provider.available,+ }))++ const selectedFulfillmentProvider = useMemo(+ () => (fulfillmentProviders?.data ?? []).find((p) => p.type === fulfillmentProvider),+ [fulfillmentProviders, fulfillmentProvider],+ )++ // A carrier quotes real shipments, so it can only price a method that ships+ // to an address — on a pickup or digital method those options are dead ends.+ const shipsToAddress = selectedFulfillmentProvider?.requires_address ?? true+ const rateProviderOptions = (rateProviders?.data ?? [])+ .filter((provider) => shipsToAddress || !provider.requires_address)+ .map((provider) => ({+ value: provider.type,+ label: provider.available+ ? provider.name+ : t('admin.delivery_methods.provider_needs_connection', { name: provider.name }),+ disabled: !provider.available,+ }))++ // Every installed shipping integration that isn't connected yet, straight+ // from the integrations registry — a carrier gem is offered here even+ // before it registers a provider, so the merchant never has to discover+ // Settings → Integrations on their own.+ const { data: integrationTypes } = useIntegrationTypes()+ const { data: connectedIntegrations } = useIntegrations()+ const connectableIntegrations = useMemo(() => {+ const connected = new Set(+ (connectedIntegrations?.data ?? []).filter((row) => row.active).map((row) => row.type),+ )+ return (integrationTypes?.data ?? []).filter(+ (type) => type.group === 'shipping' && !connected.has(type.type),+ )+ }, [integrationTypes, connectedIntegrations])++ const [connectingType, setConnectingType] = useState<IntegrationTypeDefinition | null>(null)+ // Set when a connect finishes, so the effect below can select the+ // providers that integration unlocks once the refreshed lists arrive.+ const [justConnected, setJustConnected] = useState<string | null>(null)+ const queryClient = useQueryClient()+ const rateProvidersKey = useResourceKey('delivery-methods', 'rate-providers')+ const fulfillmentProvidersKey = useResourceKey('delivery-methods', 'fulfillment-providers')+ const integrationsKey = useResourceKey('integrations')++ // Connecting an integration from this form is an act of intent: select+ // the providers it unlocks once the refreshed lists arrive, so the+ // merchant does not have to find and set them by hand afterwards.+ useEffect(() => {+ if (!justConnected) return++ const unlockedRateProvider = (rateProviders?.data ?? []).find(+ (provider) => provider.integration_type === justConnected && provider.available,+ )+ const unlockedFulfillmentProvider = eligibleFulfillmentProviders.find(+ (provider) => provider.integration_type === justConnected && provider.available,+ )+ if (!unlockedRateProvider && !unlockedFulfillmentProvider) return++ if (unlockedRateProvider) {+ form.setValue('rate_provider', unlockedRateProvider.type, { shouldDirty: true })+ }+ if (unlockedFulfillmentProvider) {+ form.setValue('fulfillment_provider', unlockedFulfillmentProvider.type, { shouldDirty: true })+ }+ setJustConnected(null)+ }, [justConnected, rateProviders, eligibleFulfillmentProviders, form])++ // Keep the fulfillment provider valid for this profile's kind: a physical+ // profile must not keep a digital provider that a kind switch left behind.+ useEffect(() => {+ if (eligibleFulfillmentProviders.length === 0) return+ if (eligibleFulfillmentProviders.some((provider) => provider.type === fulfillmentProvider)) {+ return+ }++ const fallback =+ eligibleFulfillmentProviders.find((provider) => provider.available) ??+ eligibleFulfillmentProviders[0]+ form.setValue('fulfillment_provider', fallback.type)+ }, [eligibleFulfillmentProviders, fulfillmentProvider, form])++ // A carrier rate provider left over from a shipping method would make a+ // pickup method unsavable — drop back to calculator pricing instead.+ useEffect(() => {+ if (shipsToAddress || !rateProvider) return+ const selected = (rateProviders?.data ?? []).find((p) => p.type === rateProvider)+ if (selected?.requires_address) form.setValue('rate_provider', '')+ }, [shipsToAddress, rateProvider, rateProviders, form])++ // The select displayed the server default while submitting a blank value —+ // harmless (blank resolves to Internal) but the shown and saved values+ // disagreed. Seed it once the default is known, leaving a touched field or+ // a loaded record alone.+ const defaultRateProvider = rateProviders?.default ?? ''+ const rateProviderDirty = !!form.formState.dirtyFields.rate_provider+ useEffect(() => {+ if (!defaultRateProvider || rateProvider || rateProviderDirty) return++ form.setValue('rate_provider', defaultRateProvider)+ }, [defaultRateProvider, rateProvider, rateProviderDirty, form])++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_methods.cards.providers')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ <ProviderSelectField+ form={form}+ name="fulfillment_provider"+ label={t('admin.fields.delivery_method.fulfillment_provider.label')}+ help={t('admin.fields.delivery_method.fulfillment_provider.help')}+ options={providerOptions}+ />++ {/* A carrier can only quote a shipment it can address, so a pickup or+ digital method has no rate provider to choose between. */}+ {shipsToAddress && (+ <ProviderSelectField+ form={form}+ name="rate_provider"+ label={t('admin.fields.delivery_method.rate_provider.label')}+ help={t('admin.fields.delivery_method.rate_provider.help')}+ options={rateProviderOptions}+ />+ )}++ {connectableIntegrations.map((integrationType) => (+ <div+ key={integrationType.type}+ className="flex items-center justify-between gap-3 rounded-md border border-dashed p-3"+ >+ <span className="text-sm text-muted-foreground">+ {t('admin.delivery_methods.connect_provider_hint', { name: integrationType.name })}+ </span>+ <Can I="create" a={Subject.Integration}>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => setConnectingType(integrationType)}+ >+ {t('admin.integrations.connect_cta')}+ </Button>+ </Can>+ </div>+ ))}++ {connectingType && (+ <ConfigureIntegrationSheet+ type={connectingType}+ open+ onOpenChange={(next) => {+ if (next) return+ setJustConnected(connectingType.type)+ setConnectingType(null)+ // Provider lists are cached for half an hour — a fresh connect+ // must surface the provider in both selects immediately.+ queryClient.invalidateQueries({ queryKey: rateProvidersKey })+ queryClient.invalidateQueries({ queryKey: fulfillmentProvidersKey })+ queryClient.invalidateQueries({ queryKey: integrationsKey })+ }}+ />+ )}+ </CardContent>+ </Card>+ )+}++/** The rate provider currently chosen, resolved through the store default. */+function useSelectedRateProvider(+ form: UseFormReturn<DeliveryMethodFormValues>,+): DeliveryRateProviderOption | undefined {+ const { data: rateProviders } = useDeliveryRateProviders()+ const rateProvider = form.watch('rate_provider')+ const defaultRateProvider = rateProviders?.default ?? ''++ return useMemo(+ () =>+ (rateProviders?.data ?? []).find(+ (provider) => provider.available && provider.type === (rateProvider || defaultRateProvider),+ ),+ [rateProviders, rateProvider, defaultRateProvider],+ )+}++// ---------------------------------------------------------------------------+// Carrier services — which of the provider's services this method offers,+// with per-service label + markup overrides. No rows = everything the carrier+// returns, named by the carrier.+// ---------------------------------------------------------------------------++function CarrierServicesCard({ form }: { form: UseFormReturn<DeliveryMethodFormValues> }) {+ const { t } = useTranslation()+ const selectedRateProvider = useSelectedRateProvider(form)+ const servicesArray = useFieldArray({ control: form.control, name: 'services', keyName: '_key' })+ const rows = form.watch('services') ?? []+ const [editingIndex, setEditingIndex] = useState<number | null>(null)++ const catalog = selectedRateProvider?.service_catalog ?? []+ const catalogError = selectedRateProvider?.service_catalog_error ?? null+ // Only a provider that quotes its own rates has services to narrow; a+ // calculator-priced method has a single price and no service list.+ const carrierPriced = selectedRateProvider?.uses_calculator === false++ // "Choose specific services" is what having rows means, so the radio reads+ // the rows rather than carrying its own state — a saved method reopens on+ // the branch it was left in.+ const [scope, setScope] = useState<'all' | 'selected'>(rows.length > 0 ? 'selected' : 'all')+ useEffect(() => {+ if (rows.length > 0) setScope('selected')+ }, [rows.length])++ if (!carrierPriced) return null++ const rowIndex = (entry: DeliveryRateProviderCatalogEntry) =>+ rows.findIndex((row) => row.carrier === entry.carrier && row.service === entry.service)++ const toggleEntry = (entry: DeliveryRateProviderCatalogEntry, next: boolean) => {+ const index = rowIndex(entry)+ if (next && index === -1) {+ servicesArray.append({+ carrier: entry.carrier,+ service: entry.service,+ label: '',+ markup_flat: '',+ markup_percent: '',+ })+ } else if (!next && index >= 0) {+ servicesArray.remove(index)+ }+ }++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_methods.carrier_services.label')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ {catalogError && (+ <p className="rounded-md bg-muted p-2 text-xs text-muted-foreground">+ {t('admin.delivery_methods.carrier_services.catalog_unavailable', {+ message: catalogError,+ })}+ </p>+ )}++ <RadioGroup+ value={scope}+ onValueChange={(next) => {+ const value = next as 'all' | 'selected'+ setScope(value)+ // Offering everything is the absence of rows, so switching back+ // clears them rather than leaving a hidden narrowing behind.+ if (value === 'all') form.setValue('services', [], { shouldDirty: true })+ }}+ >+ <label htmlFor="services-all" className="flex items-center gap-2 text-sm">+ <RadioGroupItem id="services-all" value="all" />+ {t('admin.delivery_methods.carrier_services.offer_all')}+ </label>+ <label htmlFor="services-selected" className="flex items-center gap-2 text-sm">+ <RadioGroupItem id="services-selected" value="selected" />+ {t('admin.delivery_methods.carrier_services.choose_specific')}+ </label>+ </RadioGroup>++ <span className="text-muted-foreground text-xs">+ {scope === 'all'+ ? t('admin.delivery_methods.carrier_services.all_hint')+ : t('admin.delivery_methods.carrier_services.narrowed_hint', { count: rows.length })}+ </span>++ {scope === 'selected' &&+ (catalog.length > 0 ? (+ <div className="flex flex-col gap-1">+ {catalog.map((entry) => {+ const index = rowIndex(entry)+ const checked = index >= 0+ const key = `${entry.carrier}/${entry.service}`+ return (+ <div key={key} className="flex items-center justify-between gap-2 py-1">+ <label htmlFor={`service-${key}`} className="flex items-center gap-2 text-sm">+ <Checkbox+ id={`service-${key}`}+ checked={checked}+ onCheckedChange={(next) => toggleEntry(entry, !!next)}+ />+ {entry.label}+ </label>+ {checked && (+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ aria-label={t('admin.delivery_methods.carrier_services.edit_service', {+ service: entry.label,+ })}+ onClick={() => setEditingIndex(index)}+ >+ <PencilIcon className="size-4" />+ </Button>+ )}+ </div>+ )+ })}+ </div>+ ) : (+ <div className="flex flex-col gap-2">+ {servicesArray.fields.map((row, index) => (+ <div key={row._key} className="grid grid-cols-[1fr_1fr_1fr_auto] gap-2">+ <Input+ aria-label={t('admin.delivery_methods.carrier_services.carrier')}+ placeholder={t('admin.delivery_methods.carrier_services.carrier')}+ {...form.register(`services.${index}.carrier`)}+ />+ <Input+ aria-label={t('admin.delivery_methods.carrier_services.service')}+ placeholder={t('admin.delivery_methods.carrier_services.service')}+ {...form.register(`services.${index}.service`)}+ />+ <Input+ aria-label={t('admin.fields.delivery_method.service_label.label')}+ placeholder={t('admin.fields.delivery_method.service_label.label')}+ {...form.register(`services.${index}.label`)}+ />+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ aria-label={t('admin.actions.remove')}+ onClick={() => servicesArray.remove(index)}+ >+ <Trash2Icon className="size-4" />+ </Button>+ </div>+ ))}+ <Button+ type="button"+ variant="outline"+ size="sm"+ className="self-start"+ onClick={() =>+ servicesArray.append({+ carrier: '',+ service: '',+ label: '',+ markup_flat: '',+ markup_percent: '',+ })+ }+ >+ <PlusIcon className="size-4" />+ {t('admin.delivery_methods.carrier_services.add_service')}+ </Button>+ </div>+ ))}++ {editingIndex !== null && (+ <ServiceOverridesSheet+ form={form}+ index={editingIndex}+ label={+ catalog.find(+ (entry) =>+ entry.carrier === rows[editingIndex]?.carrier &&+ entry.service === rows[editingIndex]?.service,+ )?.label ?? rows[editingIndex]?.service+ }+ onClose={() => setEditingIndex(null)}+ />+ )}+ </CardContent>+ </Card>+ )+}++/** Label + markup overrides for one chosen carrier service. */+function ServiceOverridesSheet({+ form,+ index,+ label,+ onClose,+}: {+ form: UseFormReturn<DeliveryMethodFormValues>+ index: number+ label?: string+ onClose: () => void+}) {+ const { t } = useTranslation()++ return (+ <Sheet open onOpenChange={(open) => !open && onClose()}>+ <SheetContent>+ <SheetHeader>+ <SheetTitle>+ {t('admin.delivery_methods.carrier_services.edit_service', { service: label ?? '' })}+ </SheetTitle>+ </SheetHeader>+ <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">+ <Field>+ <FieldLabel htmlFor={`service-label-${index}`}>+ {t('admin.fields.delivery_method.service_label.label')}+ </FieldLabel>+ <Input+ id={`service-label-${index}`}+ placeholder={label}+ {...form.register(`services.${index}.label`)}+ />+ </Field>+ <Field>+ <FieldLabel htmlFor={`service-markup-flat-${index}`}>+ {t('admin.fields.delivery_method.markup_flat.label')}+ </FieldLabel>+ <Input+ id={`service-markup-flat-${index}`}+ type="number"+ step="0.01"+ min="0"+ placeholder="0"+ {...form.register(`services.${index}.markup_flat`)}+ />+ </Field>+ <Field>+ <FieldLabel htmlFor={`service-markup-percent-${index}`}>+ {t('admin.fields.delivery_method.markup_percent.label')}+ </FieldLabel>+ <Input+ id={`service-markup-percent-${index}`}+ type="number"+ step="0.01"+ min="0"+ placeholder="0"+ {...form.register(`services.${index}.markup_percent`)}+ />+ </Field>+ </div>+ <SheetFooter>+ <Button type="button" size="sm" onClick={onClose}>+ {t('admin.actions.done')}+ </Button>+ </SheetFooter>+ </SheetContent>+ </Sheet>+ )+}++// ---------------------------------------------------------------------------+// Pricing — the calculator for internally priced methods, markups for+// carrier-quoted ones+// ---------------------------------------------------------------------------++/**+ * The amount an amount-based calculator charges, one input per currency the+ * store sells in. The default currency writes the legacy single `amount`+ * preference, so an upgraded store keeps quoting from the value it already+ * had; every other currency lives in the `amounts` hash. A currency left+ * blank has no amount, and the method is simply not offered to those carts.+ *+ * A single-currency store sees one plain amount field, exactly as before.+ */+function CurrencyAmountsField({+ values,+ onChange,+}: {+ values: Record<string, unknown>+ onChange: (next: Record<string, unknown>) => void+}) {+ const { t } = useTranslation()+ const { currencies, defaultCurrency } = useStore()++ // The store's currency list is the source of truth, but a method may already+ // carry an amount in a currency the store has since stopped selling in —+ // dropping that input would silently discard the amount on the next save.+ const amounts = (values.amounts ?? {}) as Record<string, unknown>+ const extraCodes = Object.keys(amounts).join(',')+ const codes = useMemo(() => {+ const supported = currencies.length > 0 ? currencies : [defaultCurrency]+ const extra = extraCodes.split(',').filter((code) => code && !supported.includes(code))+ return [defaultCurrency, ...supported.filter((code) => code !== defaultCurrency), ...extra]+ }, [currencies, defaultCurrency, extraCodes])++ const multiCurrency = codes.length > 1++ function amountFor(code: string): string {+ const raw = code === defaultCurrency ? values.amount : amounts[code]+ return raw === null || raw === undefined ? '' : String(raw)+ }++ function setAmount(code: string, raw: string) {+ if (code === defaultCurrency) {+ onChange({ ...values, amount: raw === '' ? null : Number(raw) })+ return+ }+ const nextAmounts = { ...amounts }+ // An empty input is the absence of an amount, not a zero — a zero would+ // offer the method free of charge in that currency.+ if (raw === '') {+ delete nextAmounts[code]+ } else {+ nextAmounts[code] = Number(raw)+ }+ onChange({ ...values, amounts: nextAmounts })+ }++ return (+ <Field>+ <FieldLabel htmlFor={`calculator-amount-${defaultCurrency}`}>+ {t('admin.preferences.amount')}+ </FieldLabel>+ <div className="flex flex-col gap-2">+ {codes.map((code) => (+ <div key={code} className="flex items-center gap-2">+ <Input+ id={`calculator-amount-${code}`}+ type="number"+ step="any"+ min="0"+ aria-label={t('admin.delivery_methods.pricing.amount_in_currency', {+ currency: code,+ })}+ value={amountFor(code)}+ onChange={(event) => setAmount(code, event.target.value)}+ />+ <span className="w-12 shrink-0 text-muted-foreground text-xs">{code}</span>+ </div>+ ))}+ </div>+ {multiCurrency && (+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_methods.pricing.currency_amounts_help')}+ </span>+ )}+ </Field>+ )+}++function PricingCard({ form }: { form: UseFormReturn<DeliveryMethodFormValues> }) {+ const { t } = useTranslation()+ const { data: calculators } = useDeliveryCalculators()+ const { data: taxCategories } = useTaxCategories()+ const selectedRateProvider = useSelectedRateProvider(form)+ const calculatorType = form.watch('calculator_type')++ // Carrier providers quote live rates, so the calculator's amount is never+ // read — the field is hidden rather than offering pricing that does nothing.+ // (The record still carries a calculator: the Estimator consults its+ // `available?`, which the API fills in with a free-rate default.)+ const usesCalculator = selectedRateProvider?.uses_calculator ?? true++ const calculatorOptions = (calculators?.data ?? []).map((calculator) => ({+ value: calculator.type,+ label: calculator.name,+ }))+ const selectedCalculator = (calculators?.data ?? []).find((c) => c.type === calculatorType)+ const preferenceSchema = (selectedCalculator?.preference_schema ?? []) as PreferenceField[]++ // An amount-based calculator prices per currency, so its amount fields are+ // rendered by the editor below rather than one-by-one from the schema. The+ // rest of its preferences (weight and total bounds) still render generically.+ const amountBased = AMOUNT_BASED_CALCULATORS.includes(calculatorType ?? '')+ const genericSchema = amountBased+ ? preferenceSchema.filter((field) => !CURRENCY_AMOUNT_KEYS.includes(field.key))+ : preferenceSchema++ const taxCategoryOptions = [+ { value: '', label: t('admin.common.none') },+ ...(taxCategories?.data ?? []).map((tc) => ({ value: tc.id, label: tc.name })),+ ]++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_methods.cards.pricing')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ {usesCalculator ? (+ <>+ <Field>+ <FieldLabel>{t('admin.fields.delivery_method.calculator.label')}</FieldLabel>+ <Controller+ name="calculator_type"+ control={form.control}+ render={({ field }) => (+ <Select+ items={calculatorOptions}+ value={field.value ?? ''}+ onValueChange={field.onChange}+ >+ <SelectTrigger>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {calculatorOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ </Field>++ <Controller+ name="calculator_preferences"+ control={form.control}+ render={({ field }) => (+ <>+ {amountBased && (+ <CurrencyAmountsField+ values={(field.value ?? {}) as Record<string, unknown>}+ onChange={field.onChange}+ />+ )}+ <PreferencesForm+ schema={genericSchema}+ values={(field.value ?? {}) as Record<string, unknown>}+ onChange={field.onChange}+ />+ </>+ )}+ />+ </>+ ) : (+ <>+ <div className="grid grid-cols-2 gap-3">+ <Field>+ <FieldLabel htmlFor="markup_percent">+ {t('admin.fields.delivery_method.markup_percent.label')}+ </FieldLabel>+ <Input+ id="markup_percent"+ type="number"+ step="0.01"+ min="0"+ placeholder="0"+ {...form.register('markup_percent')}+ />+ </Field>+ <Field>+ <FieldLabel htmlFor="markup_flat">+ {t('admin.fields.delivery_method.markup_flat.label')}+ </FieldLabel>+ <Input+ id="markup_flat"+ type="number"+ step="0.01"+ min="0"+ placeholder="0"+ {...form.register('markup_flat')}+ />+ </Field>+ </div>+ <span className="text-xs text-muted-foreground">+ {t('admin.fields.delivery_method.markup_percent.help')}+ </span>+ </>+ )}++ <Field>+ <FieldLabel>{t('admin.fields.delivery_method.tax_category.label')}</FieldLabel>+ <Controller+ name="tax_category_id"+ control={form.control}+ render={({ field }) => (+ <Select+ items={taxCategoryOptions}+ value={field.value ?? ''}+ onValueChange={field.onChange}+ >+ <SelectTrigger>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {taxCategoryOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ </Field>+ </CardContent>+ </Card>+ )+}++// ---------------------------------------------------------------------------+// Zone — which of the profile's zones this method serves+// ---------------------------------------------------------------------------++function ZoneCard({+ form,+ zones,+}: {+ form: UseFormReturn<DeliveryMethodFormValues>+ zones: DeliveryZone[]+}) {+ const { t } = useTranslation()++ const zoneOptions = [+ { value: '', label: t('admin.delivery_methods.no_zone_restriction') },+ ...zones.map((zone) => ({ value: zone.id, label: zone.name })),+ ]++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_methods.cards.zone')}</CardTitle>+ </CardHeader>+ <CardContent>+ <Field>+ <FieldLabel>{t('admin.fields.delivery_method.delivery_zone.label')}</FieldLabel>+ <Controller+ name="delivery_zone_id"+ control={form.control}+ render={({ field }) => (+ <Select items={zoneOptions} value={field.value} onValueChange={field.onChange}>+ <SelectTrigger>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {zoneOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ <span className="text-muted-foreground text-xs">+ {t('admin.fields.delivery_method.delivery_zone.help')}+ </span>+ </Field>+ </CardContent>+ </Card>+ )+}++// ---------------------------------------------------------------------------+// Conditions (eligibility rules) — held in form state, saved with the page+// ---------------------------------------------------------------------------++function ConditionsCard({ form }: { form: UseFormReturn<DeliveryMethodFormValues> }) {+ const { t } = useTranslation()+ const { data: ruleTypes } = useDeliveryMethodRuleTypes()+ const rulesArray = useFieldArray({ control: form.control, name: 'rules', keyName: '_key' })++ const existingTypes = new Set(rulesArray.fields.map((rule) => rule.type))+ const availableTypes = (ruleTypes?.data ?? []).filter((type) => !existingTypes.has(type.type))++ return (+ <Card>+ <CardHeader className="flex flex-row items-center justify-between gap-2">+ <CardTitle>{t('admin.delivery_methods.conditions.title')}</CardTitle>+ {availableTypes.length > 0 && (+ <DropdownMenu>+ <DropdownMenuTrigger+ render={+ <Button type="button" variant="outline" size="sm">+ <PlusIcon className="size-4" />+ {t('admin.delivery_methods.conditions.add')}+ </Button>+ }+ />+ <DropdownMenuContent align="end">+ {availableTypes.map((type) => (+ <DropdownMenuItem+ key={type.type}+ onClick={() =>+ rulesArray.append({+ type: type.type,+ preferences: {},+ product_ids: [],+ takes_products: type.association_fields.includes('product_ids'),+ })+ }+ >+ {type.name}+ </DropdownMenuItem>+ ))}+ </DropdownMenuContent>+ </DropdownMenu>+ )}+ </CardHeader>+ <CardContent className="flex flex-col gap-3">+ {rulesArray.fields.length === 0 && (+ <p className="text-muted-foreground text-sm">+ {t('admin.delivery_methods.conditions.empty')}+ </p>+ )}++ {rulesArray.fields.map((field, index) => (+ <ConditionRuleRow+ key={field._key}+ form={form}+ index={index}+ ruleType={(ruleTypes?.data ?? []).find((candidate) => candidate.type === field.type)}+ fallbackLabel={field.type}+ onRemove={() => rulesArray.remove(index)}+ />+ ))}+ </CardContent>+ </Card>+ )+}++function ConditionRuleRow({+ form,+ index,+ ruleType,+ fallbackLabel,+ onRemove,+}: {+ form: UseFormReturn<DeliveryMethodFormValues>+ index: number+ ruleType?: DeliveryMethodRuleType+ fallbackLabel: string+ onRemove: () => void+}) {+ const { t } = useTranslation()+ // Rules naming other records get a picker; every other kind renders its+ // preference schema. Driven by the discovery endpoint, so a plugin rule with+ // the same shape works without a change here.+ const productBacked = ruleType?.association_fields?.includes('product_ids') ?? false+ // Channel ids ride in preferences rather than an association field, but a+ // bare id array is unusable as a text input — it needs the same picker.+ const channelBacked = (ruleType?.preference_schema ?? []).some(+ (preference) => preference.key === 'channel_ids',+ )+ const label = ruleType?.name ?? fallbackLabel+ const schema = ruleType?.preference_schema ?? []++ return (+ <div className="flex flex-col gap-2 rounded-md border p-3">+ <div className="flex items-center justify-between">+ <span className="text-sm">{label}</span>+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ onClick={onRemove}+ aria-label={t('admin.actions.delete')}+ >+ <Trash2Icon className="size-4" />+ </Button>+ </div>+ {productBacked ? (+ <Controller+ control={form.control}+ name={`rules.${index}.product_ids`}+ render={({ field }) => (+ <ResourceMultiAutocomplete<Product>+ {...productAutocompleteProps('delivery-method-rule-products')}+ value={field.value}+ onChange={field.onChange}+ />+ )}+ />+ ) : channelBacked ? (+ <Controller+ control={form.control}+ name={`rules.${index}.preferences`}+ render={({ field }) => (+ <ResourceMultiAutocomplete<Channel>+ {...channelAutocompleteProps('delivery-method-rule-channels')}+ value={(field.value?.channel_ids ?? []) as string[]}+ onChange={(channelIds) => field.onChange({ ...field.value, channel_ids: channelIds })}+ />+ )}+ />+ ) : (+ <Controller+ control={form.control}+ name={`rules.${index}.preferences`}+ render={({ field }) => (+ <PreferencesForm schema={schema} values={field.value} onChange={field.onChange} />+ )}+ />+ )}+ </div>+ )+}diff --git a/packages/dashboard/src/components/spree/shipping/delivery-method-sheet.tsx b/packages/dashboard/src/components/spree/shipping/delivery-method-sheet.tsxnew file mode 100644index 0000000000..a5769b3f39--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/delivery-method-sheet.tsx@@ -0,0 +1,245 @@+import { zodResolver } from '@hookform/resolvers/zod'+import type { DeliveryProfile, DeliveryZone } from '@spree/admin-sdk'+import { mapSpreeErrorsToForm } from '@spree/dashboard-core'+import {+ Button,+ Sheet,+ SheetContent,+ SheetDescription,+ SheetFooter,+ SheetHeader,+ SheetTitle,+} from '@spree/dashboard-ui'+import { useEffect } from 'react'+import { useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import {+ useCreateDeliveryMethod,+ useDeliveryMethod,+ useDeliveryMethodRuleTypes,+ useFulfillmentProviders,+ useUpdateDeliveryMethod,+} from '../../../hooks/use-delivery-methods'+import {+ DELIVERY_METHOD_DEFAULTS,+ type DeliveryMethodFormValues,+ deliveryMethodFormSchema,+ deliveryMethodValuesToParams,+} from '../../../schemas/delivery-method'+import { DeliveryMethodFormCards } from './delivery-method-form'++/** API decimals arrive as strings ("0.0"); show blank instead of a noisy zero. */+function decimalToForm(value: string | null | undefined) {+ if (value === null || value === undefined || value === '') return ''+ return Number(value) === 0 ? '' : String(value)+}++/** Whether a rule kind is configured with a product list rather than preferences. */+function takesProducts(+ ruleTypes: { type: string; association_fields: string[] }[] | undefined,+ type: string,+) {+ return (+ ruleTypes?.find((candidate) => candidate.type === type)?.association_fields ?? []+ ).includes('product_ids')+}++/**+ * Creates or edits one delivery method. Methods are managed from the profile+ * page that owns them, so the profile always comes from the page that opened+ * this sheet and stays visible behind it.+ */+export function DeliveryMethodSheet({+ profile,+ zones,+ methodId,+ zoneId,+ originGroupId,+ provider,+ open,+ onOpenChange,+}: {+ profile: DeliveryProfile+ zones: DeliveryZone[]+ /** Absent when creating a new method. */+ methodId?: string+ /** Preselects the zone the merchant clicked "Add method" inside. Create only. */+ zoneId?: string+ /**+ * Files the new method under the origin group it was added from, which+ * matters only once a profile has been split into several. Create only.+ */+ originGroupId?: string+ /**+ * The kind of fulfillment the merchant asked for, so "Offer pickup" opens a+ * sheet already set up for a counter. Create only.+ */+ provider?: 'pickup' | 'digital'+ open: boolean+ onOpenChange: (open: boolean) => void+}) {+ const { t } = useTranslation()+ const editing = !!methodId++ const { data: method, isLoading: methodLoading } = useDeliveryMethod(methodId)+ const { data: ruleTypes, isLoading: ruleTypesLoading } = useDeliveryMethodRuleTypes()+ const { data: fulfillmentProviders } = useFulfillmentProviders()+ const createMutation = useCreateDeliveryMethod()+ const updateMutation = useUpdateDeliveryMethod(methodId ?? '')++ // Saving sends the full rule set for reconciliation, so the form must not be+ // reachable until the existing rules have loaded — otherwise a quick save+ // would submit an empty set and delete them all. Rule types are needed too,+ // since they decide which rules carry a product list.+ const loading = editing ? methodLoading || ruleTypesLoading : ruleTypesLoading++ const form = useForm<DeliveryMethodFormValues>({+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ resolver: zodResolver(deliveryMethodFormSchema) as any,+ defaultValues: { ...DELIVERY_METHOD_DEFAULTS, delivery_zone_id: zoneId ?? '' },+ })++ useEffect(() => {+ if (!editing) {+ form.reset({ ...DELIVERY_METHOD_DEFAULTS, delivery_zone_id: zoneId ?? '' })+ return+ }+ // Wait for rule types too — seeding the form before they arrive would+ // reset again once they land, discarding anything already edited.+ if (!method || !ruleTypes) return++ form.reset({+ name: method.name,+ admin_name: method.admin_name ?? '',+ code: method.code ?? '',+ fulfillment_provider:+ method.fulfillment_provider ?? DELIVERY_METHOD_DEFAULTS.fulfillment_provider,+ rate_provider: method.rate_provider ?? DELIVERY_METHOD_DEFAULTS.rate_provider,+ storefront_visible: method.storefront_visible,+ tracking_url: method.tracking_url ?? '',+ estimated_transit_business_days_min:+ method.estimated_transit_business_days_min?.toString() ?? '',+ estimated_transit_business_days_max:+ method.estimated_transit_business_days_max?.toString() ?? '',+ tax_category_id: method.tax_category_id ?? '',+ calculator_type: method.calculator_type ?? '',+ calculator_preferences: (method.calculator_preferences as Record<string, unknown>) ?? {},+ delivery_zone_id: method.delivery_zone_id ?? '',+ stock_location_ids: method.stock_location_ids ?? [],+ markup_flat: decimalToForm(method.markup_flat),+ markup_percent: decimalToForm(method.markup_percent),+ services: (method.services ?? []).map((row) => ({+ id: row.id,+ carrier: row.carrier,+ service: row.service,+ label: row.label ?? '',+ markup_flat: decimalToForm(row.markup_flat),+ markup_percent: decimalToForm(row.markup_percent),+ })),+ rules: (method.rules ?? []).map((rule) => ({+ id: rule.id,+ type: rule.type,+ preferences: rule.preferences as Record<string, unknown>,+ product_ids: rule.product_ids,+ takes_products: takesProducts(ruleTypes?.data, rule.type),+ })),+ })+ }, [editing, method, ruleTypes, zoneId, form])++ // The merchant arrived by asking for a specific kind of fulfillment+ // ("Offer pickup"), so select the provider that does it as soon as the+ // catalog arrives — leaving the field alone once they have touched it.+ const providerDirty = !!form.formState.dirtyFields.fulfillment_provider+ useEffect(() => {+ if (editing || !provider || providerDirty) return++ const match = (fulfillmentProviders?.data ?? []).find(+ (candidate) => candidate.available && candidate[provider],+ )+ if (match) form.setValue('fulfillment_provider', match.type)+ }, [editing, provider, providerDirty, fulfillmentProviders, form])++ async function onSubmit(values: DeliveryMethodFormValues) {+ try {+ if (editing) {+ await updateMutation.mutateAsync(deliveryMethodValuesToParams(values))+ } else {+ await createMutation.mutateAsync({+ ...deliveryMethodValuesToParams(values),+ delivery_profile_id: profile.id,+ // Only sent when the merchant added the method from a specific+ // group; otherwise the server files it under the zone's group, else+ // the profile's default one.+ ...(originGroupId ? { delivery_origin_group_id: originGroupId } : {}),+ })+ }+ onOpenChange(false)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ return (+ <Sheet open={open} onOpenChange={onOpenChange}>+ <SheetContent className="sm:max-w-2xl">+ <SheetHeader>+ <SheetTitle>+ {editing+ ? (method?.name ?? t('admin.delivery_methods.edit_sheet_title'))+ : t('admin.delivery_methods.add_sheet_title')}+ </SheetTitle>+ <SheetDescription>{profile.name}</SheetDescription>+ </SheetHeader>+ {loading ? (+ <div className="p-4 text-sm text-muted-foreground">{t('admin.common.loading')}</div>+ ) : (+ <form+ onSubmit={(event) => {+ // This sheet renders inside the profile page's cards, which sit+ // in their own forms — without stopping the bubble the browser+ // would submit the outer one instead.+ form.handleSubmit(onSubmit)(event)+ event.stopPropagation()+ }}+ className="flex min-h-0 flex-1 flex-col"+ >+ <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">+ <DeliveryMethodFormCards+ form={form}+ profile={profile}+ zones={zones}+ // Creating from inside a zone card answers the zone question;+ // editing still needs the picker to move a method or clear it.+ zonePreselected={!methodId && !!zoneId}+ />+ </div>+ <SheetFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => onOpenChange(false)}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button+ type="submit"+ size="sm"+ disabled={form.formState.isSubmitting || (editing && !form.formState.isDirty)}+ >+ {form.formState.isSubmitting+ ? editing+ ? t('admin.actions.saving')+ : t('admin.actions.creating')+ : editing+ ? t('admin.actions.save')+ : t('admin.delivery_methods.create_label')}+ </Button>+ </SheetFooter>+ </form>+ )}+ </SheetContent>+ </Sheet>+ )+}diff --git a/packages/dashboard/src/components/spree/shipping/delivery-origin-group-dialog.tsx b/packages/dashboard/src/components/spree/shipping/delivery-origin-group-dialog.tsxnew file mode 100644index 0000000000..4872e418b5--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/delivery-origin-group-dialog.tsx@@ -0,0 +1,200 @@+import { zodResolver } from '@hookform/resolvers/zod'+import type { DeliveryOriginGroup } from '@spree/admin-sdk'+import { mapSpreeErrorsToForm } from '@spree/dashboard-core'+import {+ Button,+ Dialog,+ DialogBody,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldError,+ FieldLabel,+ Input,+} from '@spree/dashboard-ui'+import { useEffect, useState } from 'react'+import { Controller, useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import {+ useCreateDeliveryOriginGroup,+ useUpdateDeliveryOriginGroup,+} from '../../../hooks/use-delivery-origin-groups'+import { useStockLocations } from '../../../hooks/use-stock-locations'+import {+ DELIVERY_ORIGIN_GROUP_DEFAULTS,+ type DeliveryOriginGroupFormValues,+ deliveryOriginGroupFormSchema,+ deliveryOriginGroupValuesToParams,+} from '../../../schemas/delivery-origin-group'+import { StockLocationScopeField } from './stock-location-scope-field'++/**+ * Creates or renames one origin group. Splitting origins is what creating a+ * second group means, so the create copy talks about the split rather than+ * about the record.+ */+export function DeliveryOriginGroupDialog({+ deliveryProfileId,+ group,+ open,+ onOpenChange,+}: {+ deliveryProfileId: string+ /** Absent when splitting off a new group. */+ group?: DeliveryOriginGroup+ open: boolean+ onOpenChange: (open: boolean) => void+}) {+ const { t } = useTranslation()+ const { data: stockLocations } = useStockLocations()+ const createMutation = useCreateDeliveryOriginGroup(deliveryProfileId)+ const updateMutation = useUpdateDeliveryOriginGroup(deliveryProfileId, group?.id ?? '')++ const editing = !!group++ const form = useForm<DeliveryOriginGroupFormValues>({+ resolver: zodResolver(deliveryOriginGroupFormSchema),+ defaultValues: DELIVERY_ORIGIN_GROUP_DEFAULTS,+ })++ useEffect(() => {+ form.reset(+ group+ ? { name: group.name ?? '', stock_location_ids: group.stock_location_ids }+ : DELIVERY_ORIGIN_GROUP_DEFAULTS,+ )+ }, [group, form])++ // "Every location" is the absence of a narrowing, exactly as the API reads+ // an empty array — so the radio reads the field rather than holding a second+ // source of truth.+ const selectedIds = form.watch('stock_location_ids')+ const [scope, setScope] = useState<'all' | 'selected'>('all')+ useEffect(() => {+ setScope((group?.stock_location_ids.length ?? 0) > 0 ? 'selected' : 'all')+ }, [group])++ async function onSubmit(values: DeliveryOriginGroupFormValues) {+ try {+ const params = deliveryOriginGroupValuesToParams(values)+ if (group) {+ await updateMutation.mutateAsync(params)+ } else {+ await createMutation.mutateAsync(params)+ }+ onOpenChange(false)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ const { errors } = form.formState+ const locations = stockLocations?.data ?? []++ return (+ <Dialog open={open} onOpenChange={onOpenChange}>+ <DialogContent>+ <form+ onSubmit={(event) => {+ // The profile page renders its cards inside their own forms —+ // without stopping the bubble the browser submits the outer one.+ form.handleSubmit(onSubmit)(event)+ event.stopPropagation()+ }}+ >+ <DialogHeader>+ <DialogTitle>+ {editing+ ? t('admin.delivery_origin_groups.edit_title')+ : t('admin.delivery_origin_groups.split_title')}+ </DialogTitle>+ <DialogDescription>+ {editing+ ? t('admin.delivery_origin_groups.edit_description')+ : t('admin.delivery_origin_groups.split_description')}+ </DialogDescription>+ </DialogHeader>++ <DialogBody className="flex flex-col gap-4">+ {errors.root?.message && (+ <p className="text-sm text-destructive" role="alert">+ {errors.root.message}+ </p>+ )}++ <Field>+ <FieldLabel htmlFor="origin-group-name">+ {t('admin.fields.delivery_origin_group.name.label')}+ </FieldLabel>+ <Input+ id="origin-group-name"+ autoFocus+ placeholder={t('admin.delivery_profiles.all_locations')}+ aria-invalid={!!errors.name || undefined}+ {...form.register('name')}+ />+ <FieldError errors={[errors.name]} />+ <span className="text-muted-foreground text-xs">+ {t('admin.fields.delivery_origin_group.name.help')}+ </span>+ </Field>++ <Field>+ <FieldLabel>{t('admin.delivery_origin_groups.ships_from_label')}</FieldLabel>+ <Controller+ name="stock_location_ids"+ control={form.control}+ render={({ field }) => (+ <StockLocationScopeField+ idPrefix="origin-group"+ scope={scope}+ onScopeChange={(next) => {+ setScope(next)+ if (next === 'all') field.onChange([])+ }}+ locations={locations}+ selectedIds={field.value}+ onSelectedIdsChange={field.onChange}+ allLabel={t('admin.delivery_profiles.all_locations')}+ selectedLabel={t('admin.delivery_profiles.selected_locations')}+ emptyLabel={t('admin.delivery_profiles.detail.no_stock_locations')}+ />+ )}+ />+ </Field>++ {scope === 'selected' && selectedIds.length === 0 && (+ <p className="text-muted-foreground text-xs">+ {t('admin.delivery_origin_groups.no_locations_hint')}+ </p>+ )}+ </DialogBody>++ <DialogFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => onOpenChange(false)}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>+ {form.formState.isSubmitting+ ? editing+ ? t('admin.actions.saving')+ : t('admin.actions.creating')+ : editing+ ? t('admin.actions.save')+ : t('admin.delivery_origin_groups.split_cta')}+ </Button>+ </DialogFooter>+ </form>+ </DialogContent>+ </Dialog>+ )+}diff --git a/packages/dashboard/src/components/spree/shipping/delivery-zone-region-picker.tsx b/packages/dashboard/src/components/spree/shipping/delivery-zone-region-picker.tsxnew file mode 100644index 0000000000..29591225f7--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/delivery-zone-region-picker.tsx@@ -0,0 +1,491 @@+import type { DeliveryZone } from '@spree/admin-sdk'+import { useStore } from '@spree/dashboard-core'+import {+ Button,+ Checkbox,+ Input,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+} from '@spree/dashboard-ui'+import { Link } from '@tanstack/react-router'+import { ChevronDownIcon, ChevronRightIcon, PlusIcon, SearchIcon, Trash2Icon } from 'lucide-react'+import { useMemo, useRef, useState } from 'react'+import { useTranslation } from 'react-i18next'+import { useCountryNames, useCountryStates, useMarketCountries } from '../../../hooks/use-geography'+import type { DeliveryZoneMemberValues } from '../../../schemas/delivery-zone'+import {+ type CountryRow,+ claimedByOtherZones,+ readSelection,+ type Selection,+ supersedeCountry,+ writeSelection,+} from './delivery-zone-selection'++/**+ * Picks the countries, states and postal-code rules a delivery zone covers.+ * The value is the flat member list the Admin API takes; the tree shape only+ * exists while the merchant is editing.+ */+export function DeliveryZoneRegionPicker({+ value,+ onChange,+ siblingZones,+}: {+ value: DeliveryZoneMemberValues[]+ onChange: (members: DeliveryZoneMemberValues[]) => void+ /** Other zones of the same profile — their countries cannot be claimed twice. */+ siblingZones: DeliveryZone[]+}) {+ const { t } = useTranslation()+ const { storeId } = useStore()+ const { countries: marketCountries, isLoading } = useMarketCountries()+ const countryNames = useCountryNames()+ const [search, setSearch] = useState('')+ const [expanded, setExpanded] = useState<string[]>([])+ const [postalOpen, setPostalOpen] = useState(false)++ const selection = useMemo(() => readSelection(value), [value])+ const claimed = useMemo(() => claimedByOtherZones(siblingZones), [siblingZones])++ const rows = useMemo<CountryRow[]>(() => {+ const byIso = new Map<string, CountryRow>()++ for (const country of marketCountries) {+ byIso.set(country.iso, {+ iso: country.iso,+ name: country.name,+ statesRequired: country.states_required,+ offMarket: false,+ claimed: claimed.countries.has(country.iso),+ })+ }++ // Anything the zone already holds outside the markets still gets a row —+ // dropping it here would delete the member on the next save.+ for (const iso of [...selection.countries, ...selection.states.keys()]) {+ if (byIso.has(iso)) continue+ byIso.set(iso, {+ iso,+ name: countryNames.get(iso) ?? iso,+ statesRequired: selection.states.has(iso),+ offMarket: true,+ claimed: false,+ })+ }++ return [...byIso.values()].sort((left, right) => left.name.localeCompare(right.name))+ }, [marketCountries, countryNames, claimed, selection])++ const visibleRows = useMemo(() => {+ const term = search.trim().toLowerCase()+ if (!term) return rows+ return rows.filter(+ (row) => row.name.toLowerCase().includes(term) || row.iso.toLowerCase().includes(term),+ )+ }, [rows, search])++ function apply(next: Partial<Selection>) {+ onChange(writeSelection({ ...selection, ...next }))+ }++ function toggleCountry(iso: string, checked: boolean) {+ if (checked) {+ apply(supersedeCountry(selection, iso))+ return+ }++ const countries = new Set(selection.countries)+ countries.delete(iso)+ apply({ countries })+ }++ /**+ * `allAbbrs` is the country's full state list, needed to unselect one state+ * of a wholly-selected country: that country member has to become an+ * explicit member per remaining state before one can be dropped.+ */+ function toggleState(iso: string, abbr: string, checked: boolean, allAbbrs: string[]) {+ const countries = new Set(selection.countries)+ const states = new Map(selection.states)+ const wholeCountry = countries.has(iso)+ const forCountry = new Set(wholeCountry ? allAbbrs : (states.get(iso) ?? []))++ if (checked) {+ forCountry.add(abbr)+ } else {+ forCountry.delete(abbr)+ }++ // Either way the country is no longer covered as a whole — it is now+ // described by the states below it.+ countries.delete(iso)++ if (forCountry.size > 0) states.set(iso, forCountry)+ else states.delete(iso)++ apply({ countries, states })+ }++ const selectedStateCount = [...selection.states.values()].reduce(+ (total, abbrs) => total + abbrs.size,+ 0,+ )++ return (+ <div className="flex flex-col gap-3">+ <div className="flex flex-wrap items-center justify-between gap-2">+ <span className="font-medium text-sm">{t('admin.delivery_zones.regions_title')}</span>+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_zones.selection_summary', {+ countries: selection.countries.size,+ states: selectedStateCount,+ rules: selection.postalRules.length,+ })}+ </span>+ </div>++ <div className="relative">+ <SearchIcon className="-translate-y-1/2 absolute top-1/2 left-2.5 size-4 text-muted-foreground" />+ <Input+ value={search}+ onChange={(event) => setSearch(event.target.value)}+ placeholder={t('admin.delivery_zones.region_search_placeholder')}+ aria-label={t('admin.delivery_zones.region_search_placeholder')}+ className="pl-8"+ />+ </div>++ <div className="max-h-72 overflow-y-auto rounded-md border">+ {isLoading && (+ <p className="p-3 text-muted-foreground text-sm">{t('admin.common.loading')}</p>+ )}++ {!isLoading && visibleRows.length === 0 && (+ <p className="p-3 text-muted-foreground text-sm">+ {t('admin.delivery_zones.no_regions_found')}+ </p>+ )}++ {visibleRows.map((row) => (+ <CountryListRow+ key={row.iso}+ row={row}+ selectedWholeCountry={selection.countries.has(row.iso)}+ selectedStates={selection.states.get(row.iso) ?? new Set()}+ claimedStates={claimed.states.get(row.iso) ?? new Set()}+ expanded={expanded.includes(row.iso)}+ onToggleExpanded={() =>+ setExpanded((current) =>+ current.includes(row.iso)+ ? current.filter((iso) => iso !== row.iso)+ : [...current, row.iso],+ )+ }+ onToggleCountry={(checked) => toggleCountry(row.iso, checked)}+ onToggleState={(abbr, checked, allAbbrs) =>+ toggleState(row.iso, abbr, checked, allAbbrs)+ }+ />+ ))}+ </div>++ <Link+ to="/$storeId/settings/markets"+ params={{ storeId }}+ className="text-primary text-sm underline-offset-4 hover:underline"+ >+ {t('admin.delivery_zones.add_countries_in_markets')}+ </Link>++ <div className="rounded-md border">+ <button+ type="button"+ onClick={() => setPostalOpen((open) => !open)}+ className="flex w-full items-center gap-2 p-3 text-left font-medium text-sm"+ aria-expanded={postalOpen}+ >+ {postalOpen ? (+ <ChevronDownIcon className="size-4" />+ ) : (+ <ChevronRightIcon className="size-4" />+ )}+ {t('admin.delivery_zones.postal_rules_title')}+ {selection.postalRules.length > 0 && (+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_zones.postal_rules_count', {+ count: selection.postalRules.length,+ })}+ </span>+ )}+ </button>++ {postalOpen && (+ <PostalRulesSection+ rules={selection.postalRules}+ // A checked country already matches every address in it, so a+ // postal rule for it would be dead config — members OR together.+ countries={rows.filter((row) => !selection.countries.has(row.iso))}+ onChange={(postalRules) => apply({ postalRules })}+ />+ )}+ </div>+ </div>+ )+}++function CountryListRow({+ row,+ selectedWholeCountry,+ selectedStates,+ claimedStates,+ expanded,+ onToggleExpanded,+ onToggleCountry,+ onToggleState,+}: {+ row: CountryRow+ selectedWholeCountry: boolean+ selectedStates: Set<string>+ claimedStates: Set<string>+ expanded: boolean+ onToggleExpanded: () => void+ onToggleCountry: (checked: boolean) => void+ onToggleState: (abbr: string, checked: boolean, allAbbrs: string[]) => void+}) {+ const { t } = useTranslation()+ // Only an opened country pays for its states — the list runs to ~250 rows.+ const { states, isLoading } = useCountryStates(row.iso, expanded && row.statesRequired)++ const checked = selectedWholeCountry+ const indeterminate = !selectedWholeCountry && selectedStates.size > 0++ return (+ <div className="border-b last:border-b-0">+ <div className="flex items-center gap-2 px-3 py-2">+ <Checkbox+ checked={checked}+ indeterminate={indeterminate}+ disabled={row.claimed}+ onCheckedChange={onToggleCountry}+ aria-label={row.name}+ />+ <span+ className={`flex-1 text-sm ${row.claimed ? 'text-muted-foreground' : ''}`}+ data-testid="country-name"+ >+ {row.name}+ {row.offMarket && (+ <span className="ml-2 text-muted-foreground text-xs">+ {t('admin.delivery_zones.not_in_any_market')}+ </span>+ )}+ </span>++ {row.claimed ? (+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_zones.in_another_zone')}+ </span>+ ) : (+ row.statesRequired && (+ <button+ type="button"+ onClick={onToggleExpanded}+ className="flex items-center gap-1 text-muted-foreground text-xs hover:text-foreground"+ aria-expanded={expanded}+ aria-label={t('admin.delivery_zones.toggle_states', { country: row.name })}+ >+ {selectedWholeCountry+ ? t('admin.delivery_zones.all_states')+ : // The total is only known once the row has been opened and its+ // states fetched, so before that only the selection is shown.+ states.length > 0+ ? t('admin.delivery_zones.states_summary', {+ selected: selectedStates.size,+ total: states.length,+ })+ : t('admin.delivery_zones.states_selected', {+ count: selectedStates.size,+ })}+ {expanded ? (+ <ChevronDownIcon className="size-4" />+ ) : (+ <ChevronRightIcon className="size-4" />+ )}+ </button>+ )+ )}+ </div>++ {expanded && row.statesRequired && !row.claimed && (+ <div className="border-t bg-muted/30 pl-9">+ {isLoading && (+ <p className="px-3 py-2 text-muted-foreground text-sm">{t('admin.common.loading')}</p>+ )}+ {!isLoading && states.length === 0 && (+ <p className="px-3 py-2 text-muted-foreground text-sm">+ {t('admin.delivery_zones.no_states')}+ </p>+ )}+ {states.map((state) => {+ const stateClaimed = claimedStates.has(state.abbr)+ return (+ <div key={state.abbr} className="flex items-center gap-2 px-3 py-1.5">+ <Checkbox+ checked={selectedWholeCountry || selectedStates.has(state.abbr)}+ disabled={stateClaimed}+ onCheckedChange={(next) =>+ onToggleState(+ state.abbr,+ next,+ states.map((each) => each.abbr),+ )+ }+ aria-label={state.name}+ />+ <span className={`flex-1 text-sm ${stateClaimed ? 'text-muted-foreground' : ''}`}>+ {state.name}+ </span>+ {stateClaimed && (+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_zones.in_another_zone')}+ </span>+ )}+ </div>+ )+ })}+ </div>+ )}+ </div>+ )+}++/**+ * Postal-code members: either a prefix or a from/to range, always tied to one+ * country. They sit apart from the country list because they narrow a country+ * the zone may not otherwise cover in full.+ */+function PostalRulesSection({+ rules,+ countries,+ onChange,+}: {+ rules: DeliveryZoneMemberValues[]+ countries: CountryRow[]+ onChange: (rules: DeliveryZoneMemberValues[]) => void+}) {+ const { t } = useTranslation()+ // Postal rules carry no id until they are saved, and the submitted payload+ // must not gain one, so React keys are minted here and kept out of the value.+ const keys = useRef<string[]>([])+ while (keys.current.length < rules.length) {+ keys.current = [...keys.current, `postal-rule-${crypto.randomUUID()}`]+ }++ const countryOptions = countries+ .filter((country) => !country.claimed)+ .map((country) => ({ value: country.iso, label: country.name }))++ function update(index: number, patch: Partial<DeliveryZoneMemberValues>) {+ onChange(rules.map((rule, position) => (position === index ? { ...rule, ...patch } : rule)))+ }++ function remove(index: number) {+ keys.current = keys.current.filter((_, position) => position !== index)+ onChange(rules.filter((_, position) => position !== index))+ }++ return (+ <div className="flex flex-col gap-2 border-t p-3">+ {rules.length === 0 && (+ <p className="text-muted-foreground text-sm">+ {t('admin.delivery_zones.no_postal_rules_hint')}+ </p>+ )}++ {rules.map((rule, index) => (+ <div key={keys.current[index]} className="flex flex-col gap-2 rounded-md border p-2">+ <div className="flex items-center gap-2">+ <Select+ items={countryOptions}+ value={rule.country_iso ?? ''}+ onValueChange={(next) => update(index, { country_iso: next as string })}+ >+ <SelectTrigger className="flex-1">+ <SelectValue>+ {(value) =>+ countryOptions.find((option) => option.value === value)?.label ??+ t('admin.delivery_zones.select_country')+ }+ </SelectValue>+ </SelectTrigger>+ <SelectContent>+ {countryOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ <Button+ type="button"+ variant="ghost"+ size="icon-sm"+ onClick={() => remove(index)}+ aria-label={t('admin.delivery_zones.remove_postal_rule')}+ >+ <Trash2Icon className="size-4" />+ </Button>+ </div>++ <div className="grid grid-cols-3 gap-2">+ <Input+ value={rule.postal_code_prefix ?? ''}+ onChange={(event) => update(index, { postal_code_prefix: event.target.value })}+ placeholder={t('admin.delivery_zones.prefix_placeholder')}+ aria-label={t('admin.delivery_zones.prefix_placeholder')}+ />+ <Input+ value={rule.postal_code_from ?? ''}+ onChange={(event) => update(index, { postal_code_from: event.target.value })}+ placeholder={t('admin.delivery_zones.from_placeholder')}+ aria-label={t('admin.delivery_zones.from_placeholder')}+ />+ <Input+ value={rule.postal_code_to ?? ''}+ onChange={(event) => update(index, { postal_code_to: event.target.value })}+ placeholder={t('admin.delivery_zones.to_placeholder')}+ aria-label={t('admin.delivery_zones.to_placeholder')}+ />+ </div>+ </div>+ ))}++ <div>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() =>+ onChange([+ ...rules,+ {+ member_type: 'postal_code',+ country_iso: countryOptions[0]?.value ?? '',+ postal_code_prefix: '',+ postal_code_from: '',+ postal_code_to: '',+ },+ ])+ }+ >+ <PlusIcon className="size-4" />+ {t('admin.delivery_zones.add_postal_rule')}+ </Button>+ </div>+ </div>+ )+}diff --git a/packages/dashboard/src/components/spree/shipping/delivery-zone-selection.test.ts b/packages/dashboard/src/components/spree/shipping/delivery-zone-selection.test.tsnew file mode 100644index 0000000000..b2fd2df3de--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/delivery-zone-selection.test.ts@@ -0,0 +1,107 @@+import type { DeliveryZone, DeliveryZoneMember } from '@spree/admin-sdk'+import { describe, expect, it } from 'vitest'+import type { DeliveryZoneMemberValues } from '../../../schemas/delivery-zone'+import {+ claimedByOtherZones,+ readSelection,+ supersedeCountry,+ writeSelection,+} from './delivery-zone-selection'++/** Only the member fields the claim computation reads have to be real. */+function zone(members: Partial<DeliveryZoneMember>[]): DeliveryZone {+ return { members } as DeliveryZone+}++describe('readSelection', () => {+ it('splits members into whole countries, states and postal rules', () => {+ const selection = readSelection([+ { member_type: 'country', country_iso: 'DE' },+ { member_type: 'state', country_iso: 'US', state_abbr: 'CA' },+ { member_type: 'state', country_iso: 'US', state_abbr: 'NY' },+ { member_type: 'postal_code', country_iso: 'FR', postal_code_prefix: '75' },+ ])++ expect([...selection.countries]).toEqual(['DE'])+ expect([...(selection.states.get('US') ?? [])]).toEqual(['CA', 'NY'])+ expect(selection.postalRules).toHaveLength(1)+ })++ it('ignores members missing the fields that give them meaning', () => {+ const selection = readSelection([+ { member_type: 'country', country_iso: '' },+ { member_type: 'state', country_iso: 'US', state_abbr: '' },+ ])++ expect(selection.countries.size).toBe(0)+ expect(selection.states.size).toBe(0)+ })+})++describe('writeSelection', () => {+ it('round-trips a selection back into the flat member list', () => {+ const members: DeliveryZoneMemberValues[] = [+ { member_type: 'country', country_iso: 'DE' },+ { member_type: 'state', country_iso: 'US', state_abbr: 'CA' },+ { member_type: 'postal_code', country_iso: 'FR', postal_code_prefix: '75' },+ ]++ expect(writeSelection(readSelection(members))).toEqual(members)+ })++ it('orders countries before states and keeps postal rules last', () => {+ const members = writeSelection({+ countries: new Set(['US', 'DE']),+ states: new Map([['CA', new Set(['ON'])]]),+ postalRules: [{ member_type: 'postal_code', country_iso: 'FR', postal_code_prefix: '75' }],+ })++ expect(members.map((member) => member.member_type)).toEqual([+ 'country',+ 'country',+ 'state',+ 'postal_code',+ ])+ // Countries are emitted in ISO order so a saved zone reads consistently.+ expect(members[0].country_iso).toBe('DE')+ expect(members[1].country_iso).toBe('US')+ })+})++describe('supersedeCountry', () => {+ it('drops the states and postal rules a whole country makes redundant', () => {+ const selection = readSelection([+ { member_type: 'state', country_iso: 'US', state_abbr: 'NY' },+ { member_type: 'postal_code', country_iso: 'US', postal_code_prefix: '10' },+ { member_type: 'postal_code', country_iso: 'DE', postal_code_prefix: '10' },+ ])++ const next = supersedeCountry(selection, 'US')++ expect([...next.countries]).toEqual(['US'])+ expect(next.states.has('US')).toBe(false)+ // Germany's rule is untouched — only the superseded country is cleaned up.+ expect(next.postalRules.map((rule: DeliveryZoneMemberValues) => rule.country_iso)).toEqual([+ 'DE',+ ])+ })+})++describe('claimedByOtherZones', () => {+ it('collects the countries and states sibling zones already cover', () => {+ const claimed = claimedByOtherZones([+ zone([+ { member_type: 'country', country_iso: 'DE' },+ { member_type: 'state', country_iso: 'US', state_abbr: 'CA' },+ ]),+ zone([{ member_type: 'country', country_iso: 'FR' }]),+ ])++ expect([...claimed.countries].sort()).toEqual(['DE', 'FR'])+ expect([...(claimed.states.get('US') ?? [])]).toEqual(['CA'])+ })++ it('treats a zone with no expanded members as claiming nothing', () => {+ expect(claimedByOtherZones([{} as DeliveryZone]).countries.size).toBe(0)+ })+})diff --git a/packages/dashboard/src/components/spree/shipping/delivery-zone-selection.ts b/packages/dashboard/src/components/spree/shipping/delivery-zone-selection.tsnew file mode 100644index 0000000000..dc3dd77cbe--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/delivery-zone-selection.ts@@ -0,0 +1,109 @@+import type { DeliveryZone } from '@spree/admin-sdk'+import type { DeliveryZoneMemberValues } from '../../../schemas/delivery-zone'++/**+ * One row of the country list, whether or not the store sells there. Countries+ * outside every market only appear when the zone already claims them, so an+ * older member is never silently dropped on the next save.+ */+export interface CountryRow {+ iso: string+ name: string+ statesRequired: boolean+ /** The zone kept this country but no market covers it any more. */+ offMarket: boolean+ /** Another zone in the same profile already claims it. */+ claimed: boolean+}++/** What the member list means, expressed the way the picker manipulates it. */+export interface Selection {+ /** ISOs selected as a whole country. */+ countries: Set<string>+ /** ISO → selected state abbreviations, for partially selected countries. */+ states: Map<string, Set<string>>+ postalRules: DeliveryZoneMemberValues[]+}++export function readSelection(members: DeliveryZoneMemberValues[]): Selection {+ const countries = new Set<string>()+ const states = new Map<string, Set<string>>()+ const postalRules: DeliveryZoneMemberValues[] = []++ for (const member of members) {+ if (member.member_type === 'country' && member.country_iso) {+ countries.add(member.country_iso)+ } else if (member.member_type === 'state' && member.country_iso && member.state_abbr) {+ const forCountry = states.get(member.country_iso) ?? new Set<string>()+ forCountry.add(member.state_abbr)+ states.set(member.country_iso, forCountry)+ } else if (member.member_type === 'postal_code') {+ postalRules.push(member)+ }+ }++ return { countries, states, postalRules }+}++/**+ * Rebuilds the flat member list the API expects. Country members come first so+ * a saved zone reads top-down the same way the picker renders it.+ */+export function writeSelection(selection: Selection): DeliveryZoneMemberValues[] {+ const members: DeliveryZoneMemberValues[] = []++ for (const iso of [...selection.countries].sort()) {+ members.push({ member_type: 'country', country_iso: iso })+ }++ for (const [iso, abbrs] of [...selection.states.entries()].sort(([left], [right]) =>+ left.localeCompare(right),+ )) {+ for (const abbr of [...abbrs].sort()) {+ members.push({ member_type: 'state', country_iso: iso, state_abbr: abbr })+ }+ }++ return [...members, ...selection.postalRules]+}++/** ISOs and per-country states that sibling zones of the same profile hold. */+/**+ * Checking a country supersedes anything narrower inside it: its individual+ * states, and its postal rules. Members OR together at match time, so a whole+ * country already matches every address a narrower member could — leaving+ * those behind would persist config that can never change an outcome.+ */+export function supersedeCountry(selection: Selection, iso: string): Selection {+ const countries = new Set(selection.countries)+ const states = new Map(selection.states)++ countries.add(iso)+ states.delete(iso)++ return {+ countries,+ states,+ postalRules: selection.postalRules.filter((rule) => rule.country_iso !== iso),+ }+}++export function claimedByOtherZones(siblingZones: DeliveryZone[]) {+ const countries = new Set<string>()+ const states = new Map<string, Set<string>>()++ for (const zone of siblingZones) {+ for (const member of zone.members ?? []) {+ if (!member.country_iso) continue+ if (member.member_type === 'country') {+ countries.add(member.country_iso)+ } else if (member.member_type === 'state' && member.state_abbr) {+ const forCountry = states.get(member.country_iso) ?? new Set<string>()+ forCountry.add(member.state_abbr)+ states.set(member.country_iso, forCountry)+ }+ }+ }++ return { countries, states }+}diff --git a/packages/dashboard/src/components/spree/shipping/delivery-zone-sheet.tsx b/packages/dashboard/src/components/spree/shipping/delivery-zone-sheet.tsxnew file mode 100644index 0000000000..f59386079b--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/delivery-zone-sheet.tsx@@ -0,0 +1,231 @@+import { zodResolver } from '@hookform/resolvers/zod'+import type { DeliveryZone } from '@spree/admin-sdk'+import { mapSpreeErrorsToForm } from '@spree/dashboard-core'+import {+ Button,+ Field,+ FieldError,+ FieldGroup,+ FieldLabel,+ Input,+ Sheet,+ SheetContent,+ SheetDescription,+ SheetFooter,+ SheetHeader,+ SheetTitle,+} from '@spree/dashboard-ui'+import { useEffect } from 'react'+import { Controller, type UseFormReturn, useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import {+ useCreateDeliveryZone,+ useDeliveryZone,+ useUpdateDeliveryZone,+} from '../../../hooks/use-delivery-zones'+import {+ DELIVERY_ZONE_DEFAULTS,+ type DeliveryZoneFormValues,+ deliveryZoneFormSchema,+ deliveryZoneValuesToParams,+} from '../../../schemas/delivery-zone'+import { DeliveryZoneRegionPicker } from './delivery-zone-region-picker'++/**+ * Creates or edits one delivery zone. Zones are managed inside the profile+ * that owns them and never move between profiles, so the profile always+ * comes from the page that opened this sheet.+ */+export function DeliveryZoneSheet({+ deliveryProfileId,+ deliveryOriginGroupId,+ zoneId,+ siblingZones = [],+ open,+ onOpenChange,+}: {+ deliveryProfileId: string+ /**+ * Origin group the new zone hangs off. Only sent on create — a zone never+ * moves between groups, and the server files it under the profile's default+ * group when omitted.+ */+ deliveryOriginGroupId?: string+ /** Absent when creating a new zone. */+ zoneId?: string+ /**+ * The profile's other zones, members included. A country served by one zone+ * cannot be served by another, so those rows are shown but locked.+ */+ siblingZones?: DeliveryZone[]+ open: boolean+ onOpenChange: (open: boolean) => void+}) {+ const { t } = useTranslation()+ const { data: zone, isLoading } = useDeliveryZone(zoneId)+ const createMutation = useCreateDeliveryZone()+ const updateMutation = useUpdateDeliveryZone(zoneId ?? '')++ const form = useForm<DeliveryZoneFormValues>({+ // eslint-disable-next-line @typescript-eslint/no-explicit-any+ resolver: zodResolver(deliveryZoneFormSchema) as any,+ defaultValues: DELIVERY_ZONE_DEFAULTS,+ })++ useEffect(() => {+ if (!zoneId) {+ form.reset(DELIVERY_ZONE_DEFAULTS)+ return+ }+ if (!zone) return++ form.reset({+ name: zone.name,+ // No longer edited in this sheet, but carried through the form so+ // saving never blanks a description an older zone already has.+ description: zone.description ?? '',+ // `useDeliveryZone` expands members; without them the picker would come+ // up empty and saving would wipe the zone's real coverage.+ members: (zone.members ?? []).map((member) => ({+ member_type: member.member_type as DeliveryZoneFormValues['members'][number]['member_type'],+ country_iso: member.country_iso ?? '',+ state_abbr: member.state_abbr ?? '',+ postal_code_prefix: member.postal_code_prefix ?? '',+ postal_code_from: member.postal_code_from ?? '',+ postal_code_to: member.postal_code_to ?? '',+ })),+ })+ }, [zone, zoneId, form])++ async function onSubmit(values: DeliveryZoneFormValues) {+ try {+ if (zoneId) {+ await updateMutation.mutateAsync(deliveryZoneValuesToParams(values))+ } else {+ await createMutation.mutateAsync(+ deliveryZoneValuesToParams(values, deliveryProfileId, deliveryOriginGroupId),+ )+ }+ form.reset(zoneId ? values : DELIVERY_ZONE_DEFAULTS)+ onOpenChange(false)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ const editing = !!zoneId+ const loading = editing && isLoading++ return (+ <Sheet+ open={open}+ onOpenChange={(next) => {+ if (!next && !editing) form.reset(DELIVERY_ZONE_DEFAULTS)+ onOpenChange(next)+ }}+ >+ <SheetContent>+ <SheetHeader>+ <SheetTitle>+ {editing+ ? (zone?.name ?? t('admin.delivery_zones.edit_sheet_title'))+ : t('admin.delivery_zones.add_sheet_title')}+ </SheetTitle>+ <SheetDescription>+ {editing+ ? t('admin.delivery_zones.edit_description')+ : t('admin.delivery_zones.create_description')}+ </SheetDescription>+ </SheetHeader>+ {loading ? (+ <div className="p-4 text-sm text-muted-foreground">{t('admin.common.loading')}</div>+ ) : (+ <form+ onSubmit={(event) => {+ // This sheet renders inside the profile page's cards, which sit+ // in their own forms — without stopping the bubble the browser+ // would submit the outer one instead.+ form.handleSubmit(onSubmit)(event)+ event.stopPropagation()+ }}+ className="flex min-h-0 flex-1 flex-col"+ >+ <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">+ <DeliveryZoneFormFields+ form={form}+ siblingZones={siblingZones.filter((sibling) => sibling.id !== zoneId)}+ />+ </div>+ <SheetFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => onOpenChange(false)}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button+ type="submit"+ size="sm"+ disabled={form.formState.isSubmitting || (editing && !form.formState.isDirty)}+ >+ {form.formState.isSubmitting+ ? editing+ ? t('admin.actions.saving')+ : t('admin.actions.creating')+ : editing+ ? t('admin.actions.save')+ : t('admin.delivery_zones.create_label')}+ </Button>+ </SheetFooter>+ </form>+ )}+ </SheetContent>+ </Sheet>+ )+}++function DeliveryZoneFormFields({+ form,+ siblingZones,+}: {+ form: UseFormReturn<DeliveryZoneFormValues>+ siblingZones: DeliveryZone[]+}) {+ const { t } = useTranslation()+ const { errors } = form.formState++ return (+ <FieldGroup>+ {errors.root?.message && (+ <p className="text-sm text-destructive" role="alert">+ {errors.root.message}+ </p>+ )}+ <Field>+ <FieldLabel htmlFor="name">{t('admin.fields.name.label')}</FieldLabel>+ <Input+ id="name"+ autoFocus+ aria-invalid={!!errors.name || undefined}+ {...form.register('name')}+ />+ <FieldError errors={[errors.name]} />+ </Field>++ <Controller+ name="members"+ control={form.control}+ render={({ field }) => (+ <DeliveryZoneRegionPicker+ value={field.value}+ onChange={field.onChange}+ siblingZones={siblingZones}+ />+ )}+ />+ </FieldGroup>+ )+}diff --git a/packages/dashboard/src/components/spree/shipping/stock-location-scope-field.tsx b/packages/dashboard/src/components/spree/shipping/stock-location-scope-field.tsxnew file mode 100644index 0000000000..c17def17fa--- /dev/null+++ b/packages/dashboard/src/components/spree/shipping/stock-location-scope-field.tsx@@ -0,0 +1,76 @@+import { Checkbox, RadioGroup, RadioGroupItem } from '@spree/dashboard-ui'++/**+ * "All locations" versus a chosen few — the shape every fulfillment-origin+ * setting takes (delivery profiles, origin groups, pickup counters, channels).+ *+ * All locations is the empty array, not every box ticked: naming today's+ * locations would silently exclude any warehouse added later, which is the+ * opposite of what the merchant asked for.+ */+export function StockLocationScopeField({+ idPrefix,+ scope,+ onScopeChange,+ locations,+ selectedIds,+ onSelectedIdsChange,+ allLabel,+ selectedLabel,+ emptyLabel,+}: {+ /** Namespaces the input ids so several of these can share a page. */+ idPrefix: string+ scope: 'all' | 'selected'+ onScopeChange: (scope: 'all' | 'selected') => void+ locations: Array<{ id: string; name: string }>+ selectedIds: string[]+ onSelectedIdsChange: (ids: string[]) => void+ allLabel: string+ selectedLabel: string+ /** Shown instead of the list when the store has no locations yet. */+ emptyLabel: string+}) {+ return (+ <>+ <RadioGroup value={scope} onValueChange={(next) => onScopeChange(next as 'all' | 'selected')}>+ <label htmlFor={`${idPrefix}-all`} className="flex items-center gap-2 text-sm">+ <RadioGroupItem id={`${idPrefix}-all`} value="all" />+ {allLabel}+ </label>+ <label htmlFor={`${idPrefix}-selected`} className="flex items-center gap-2 text-sm">+ <RadioGroupItem id={`${idPrefix}-selected`} value="selected" />+ {selectedLabel}+ </label>+ </RadioGroup>++ {scope === 'selected' &&+ (locations.length === 0 ? (+ <p className="text-muted-foreground text-sm">{emptyLabel}</p>+ ) : (+ <div className="flex flex-col gap-2">+ {locations.map((location) => (+ <label+ key={location.id}+ htmlFor={`${idPrefix}-location-${location.id}`}+ className="flex items-center gap-2 text-sm"+ >+ <Checkbox+ id={`${idPrefix}-location-${location.id}`}+ checked={selectedIds.includes(location.id)}+ onCheckedChange={(next) =>+ onSelectedIdsChange(+ next+ ? [...selectedIds, location.id]+ : selectedIds.filter((id) => id !== location.id),+ )+ }+ />+ {location.name}+ </label>+ ))}+ </div>+ ))}+ </>+ )+}diff --git a/packages/dashboard/src/hooks/use-delivery-origin-groups.ts b/packages/dashboard/src/hooks/use-delivery-origin-groups.tsnew file mode 100644index 0000000000..6a00aa2407--- /dev/null+++ b/packages/dashboard/src/hooks/use-delivery-origin-groups.ts@@ -0,0 +1,49 @@+import type { DeliveryOriginGroup, DeliveryOriginGroupParams } from '@spree/admin-sdk'+import { adminClient, useResourceMutation } from '@spree/dashboard-core'+import i18n from 'i18next'++export function useCreateDeliveryOriginGroup(deliveryProfileId: string) {+ return useResourceMutation<DeliveryOriginGroup, Error, DeliveryOriginGroupParams>({+ mutationFn: (params) =>+ adminClient.deliveryProfiles.originGroups.create(deliveryProfileId, params),+ invalidate: [+ ['delivery-origin-groups', deliveryProfileId],+ ['delivery-profiles'],+ ['delivery-profiles', deliveryProfileId],+ ],+ successMessage: i18n.t('admin.delivery_origin_groups.messages.created'),+ errorMessage: i18n.t('admin.errors.failed_to_create'),+ })+}++export function useUpdateDeliveryOriginGroup(deliveryProfileId: string, id: string) {+ return useResourceMutation<DeliveryOriginGroup, Error, DeliveryOriginGroupParams>({+ mutationFn: (params) =>+ adminClient.deliveryProfiles.originGroups.update(deliveryProfileId, id, params),+ invalidate: [+ ['delivery-origin-groups', deliveryProfileId],+ ['delivery-profiles'],+ ['delivery-profiles', deliveryProfileId],+ ],+ successMessage: i18n.t('admin.delivery_origin_groups.messages.updated'),+ errorMessage: i18n.t('admin.errors.failed_to_update'),+ })+}++export function useDeleteDeliveryOriginGroup(deliveryProfileId: string) {+ return useResourceMutation<void, Error, string>({+ mutationFn: (id) => adminClient.deliveryProfiles.originGroups.delete(deliveryProfileId, id),+ invalidate: [+ ['delivery-origin-groups', deliveryProfileId],+ ['delivery-profiles'],+ ['delivery-profiles', deliveryProfileId],+ // Deleting a group is refused while it still holds zones or methods, so+ // a success means both lists are unchanged — but the profile's zones are+ // re-read anyway, since the merchant may have moved them first.+ ['delivery-zones'],+ ['delivery-methods'],+ ],+ successMessage: i18n.t('admin.delivery_origin_groups.messages.deleted'),+ errorMessage: i18n.t('admin.errors.failed_to_delete'),+ })+}diff --git a/packages/dashboard/src/hooks/use-delivery-profiles.ts b/packages/dashboard/src/hooks/use-delivery-profiles.tsnew file mode 100644index 0000000000..d0b99c49c8--- /dev/null+++ b/packages/dashboard/src/hooks/use-delivery-profiles.ts@@ -0,0 +1,73 @@+import type { DeliveryProfile, DeliveryProfileParams } from '@spree/admin-sdk'+import {+ adminClient,+ useResourceKey,+ useResourceKeyBuilder,+ useResourceMutation,+} from '@spree/dashboard-core'+import { useQuery, useQueryClient } from '@tanstack/react-query'+import i18n from 'i18next'++export function useDeliveryProfiles({+ page = 1,+ limit = 100,+}: {+ page?: number+ limit?: number+} = {}) {+ return useQuery({+ queryKey: useResourceKey('delivery-profiles', { page, limit }),+ queryFn: () => adminClient.deliveryProfiles.list({ page, limit }),+ staleTime: 1000 * 60 * 5,+ })+}++export function useDeliveryProfile(id: string | undefined) {+ return useQuery({+ queryKey: useResourceKey('delivery-profiles', id ?? 'noop'),+ queryFn: () => adminClient.deliveryProfiles.get(id as string),+ enabled: !!id,+ })+}++/** Registered profile kinds — shipping, digital, plus any an extension adds. */+export function useDeliveryProfileKinds() {+ return useQuery({+ queryKey: useResourceKey('delivery-profile-kinds'),+ queryFn: () => adminClient.deliveryProfiles.kinds(),+ staleTime: 1000 * 60 * 30,+ })+}++export function useCreateDeliveryProfile() {+ return useResourceMutation<DeliveryProfile, Error, DeliveryProfileParams & { name: string }>({+ mutationFn: (params) => adminClient.deliveryProfiles.create(params),+ invalidate: [['delivery-profiles']],+ successMessage: i18n.t('admin.delivery_profiles.messages.created'),+ errorMessage: i18n.t('admin.errors.failed_to_create'),+ })+}++export function useUpdateDeliveryProfile(id: string) {+ return useResourceMutation<DeliveryProfile, Error, DeliveryProfileParams>({+ mutationFn: (params) => adminClient.deliveryProfiles.update(id, params),+ invalidate: [['delivery-profiles'], ['delivery-profiles', id]],+ successMessage: i18n.t('admin.delivery_profiles.messages.updated'),+ errorMessage: i18n.t('admin.errors.failed_to_update'),+ })+}++export function useDeleteDeliveryProfile() {+ const queryClient = useQueryClient()+ const buildKey = useResourceKeyBuilder()++ return useResourceMutation<void, Error, string>({+ mutationFn: (id) => adminClient.deliveryProfiles.delete(id),+ invalidate: [['delivery-profiles']],+ successMessage: i18n.t('admin.delivery_profiles.messages.deleted'),+ errorMessage: i18n.t('admin.errors.failed_to_delete'),+ onSuccess: (_data, id) => {+ queryClient.removeQueries({ queryKey: buildKey('delivery-profiles', id) })+ },+ })+}diff --git a/packages/dashboard/src/hooks/use-delivery-zones.ts b/packages/dashboard/src/hooks/use-delivery-zones.tsindex 2b865692d9..593fd39cc6 100644--- a/packages/dashboard/src/hooks/use-delivery-zones.ts+++ b/packages/dashboard/src/hooks/use-delivery-zones.ts@@ -8,24 +8,46 @@ import {import { useQuery, useQueryClient } from '@tanstack/react-query'import i18n from 'i18next'-export function useDeliveryZones({- page = 1,- limit = 100,-}: {- page?: number- limit?: number-} = {}) {+/**+ * Every zone of one profile, members included — the profile page renders each+ * zone as its own card, so a page-one cap would hide zones from the merchant.+ */+export function useProfileDeliveryZones(deliveryProfileId: string | undefined) {return useQuery({- queryKey: useResourceKey('delivery-zones', { page, limit }),- queryFn: () => adminClient.deliveryZones.list({ page, limit }),- staleTime: 1000 * 60 * 5,+ queryKey: useResourceKey('delivery-zones', 'by-profile', deliveryProfileId ?? 'noop'),+ queryFn: async () => {+ const first = await adminClient.deliveryZones.list({+ page: 1,+ limit: 100,+ expand: ['members'],+ delivery_profile_id_eq: deliveryProfileId,+ })+ const rest = await Promise.all(+ Array.from({ length: (first.meta?.pages ?? 1) - 1 }, (_, index) =>+ adminClient.deliveryZones.list({+ page: index + 2,+ limit: 100,+ expand: ['members'],+ delivery_profile_id_eq: deliveryProfileId,+ }),+ ),+ )+ const zones = [...first.data, ...rest.flatMap((page) => page.data)]+ // The filter is a Ransack hint the server may not honour, so the+ // profile's own zones are selected here as well — a zone leaking in+ // from another profile would offer methods this profile cannot use.+ return zones.filter((zone) => zone.delivery_profile_id === deliveryProfileId)+ },+ enabled: !!deliveryProfileId,})}export function useDeliveryZone(id: string | undefined) {return useQuery({queryKey: useResourceKey('delivery-zones', id ?? 'noop'),- queryFn: () => adminClient.deliveryZones.get(id as string),+ // Members are expand-gated: without this the edit form loads an empty+ // member list and saving would replace the real members with nothing.+ queryFn: () => adminClient.deliveryZones.get(id as string, { expand: ['members'] }),enabled: !!id,})}diff --git a/packages/dashboard/src/hooks/use-geography.ts b/packages/dashboard/src/hooks/use-geography.tsnew file mode 100644index 0000000000..3e54c8e89f--- /dev/null+++ b/packages/dashboard/src/hooks/use-geography.ts@@ -0,0 +1,65 @@+import type { Country, State } from '@spree/admin-sdk'+import { adminClient, useResourceKey } from '@spree/dashboard-core'+import { useQuery } from '@tanstack/react-query'++/**+ * Every country the store actually sells into, unioned across its markets and+ * sorted by name. Pickers that ask "where can we deliver?" scope to this rather+ * than the ~250-row country table, since a country outside every market can+ * never appear on an order.+ */+export function useMarketCountries() {+ const { data, isLoading } = useQuery({+ queryKey: useResourceKey('markets', 'countries'),+ queryFn: () => adminClient.markets.list({ limit: 100, expand: ['countries'] }),+ staleTime: 1000 * 60 * 30,+ })++ const byIso = new Map<string, Country>()+ for (const market of data?.data ?? []) {+ for (const country of market.countries ?? []) {+ if (!byIso.has(country.iso)) byIso.set(country.iso, country)+ }+ }++ const countries = [...byIso.values()].sort((left, right) => left.name.localeCompare(right.name))++ return { countries, isLoading }+}++/**+ * ISO → name for every country Spree knows. Pickers scope their rows to the+ * store's markets, but a zone saved earlier may hold countries outside them;+ * those rows still need a readable name rather than a bare code.+ */+export function useCountryNames() {+ const { data } = useQuery({+ queryKey: useResourceKey('countries', 'names'),+ queryFn: () => adminClient.countries.list({ limit: 300 }),+ staleTime: 1000 * 60 * 60,+ })++ const names = new Map<string, string>()+ for (const country of data?.data ?? []) names.set(country.iso, country.name)++ return names+}++/**+ * States of one country, fetched only once the caller asks for them — a picker+ * listing dozens of countries would otherwise fire a request per row.+ */+export function useCountryStates(iso: string | undefined, enabled = true) {+ const { data, isLoading } = useQuery({+ queryKey: useResourceKey('countries', iso ?? 'noop', 'states'),+ queryFn: () => adminClient.countries.get(iso as string, { expand: ['states'] }),+ enabled: !!iso && enabled,+ staleTime: 1000 * 60 * 60,+ })++ const states: State[] = [...(data?.states ?? [])].sort((left, right) =>+ left.name.localeCompare(right.name),+ )++ return { states, isLoading }+}diff --git a/packages/dashboard/src/hooks/use-stock-locations.ts b/packages/dashboard/src/hooks/use-stock-locations.tsindex 5c77a8f428..dc5a659aea 100644--- a/packages/dashboard/src/hooks/use-stock-locations.ts+++ b/packages/dashboard/src/hooks/use-stock-locations.ts@@ -52,6 +52,23 @@ export function useUpdateStockLocation(id: string) {})}+/**+ * Update variant that takes the id per call, for lists where every row writes+ * to a different location (the pickup toggles on a delivery profile).+ */+export function useUpdateStockLocationById() {+ return useResourceMutation<+ StockLocation,+ Error,+ { id: string; params: StockLocationUpdateParams }+ >({+ mutationFn: ({ id, params }) => adminClient.stockLocations.update(id, params),+ invalidate: [['stock-locations']],+ successMessage: i18n.t('admin.messages.updated'),+ errorMessage: i18n.t('admin.errors.failed_to_update'),+ })+}+export function useDeleteStockLocation() {const queryClient = useQueryClient()const buildKey = useResourceKeyBuilder()diff --git a/packages/dashboard/src/lib/delivery-method-summary.ts b/packages/dashboard/src/lib/delivery-method-summary.tsnew file mode 100644index 0000000000..ce3240d44c--- /dev/null+++ b/packages/dashboard/src/lib/delivery-method-summary.ts@@ -0,0 +1,105 @@+import type { DeliveryMethodRule } from '@spree/admin-sdk'+import type { TFunction } from 'i18next'++/**+ * The flat amount a calculator-priced method charges, or null when it is+ * priced some other way (per item, tiered, per carrier quote) and has no+ * single number to show.+ */+export function flatAmount(preferences: Record<string, unknown> | null | undefined): number | null {+ const amount = preferences?.amount+ if (amount === null || amount === undefined || amount === '') return null+ const parsed = Number(amount)+ return Number.isNaN(parsed) ? null : parsed+}++/** Formats an amount in the store's currency, falling back to a bare number. */+export function formatAmount(amount: number, currency: string, locale?: string): string {+ try {+ return new Intl.NumberFormat(locale, { style: 'currency', currency }).format(amount)+ } catch {+ return `${amount} ${currency}`+ }+}++function toNumber(value: unknown): number | null {+ if (value === null || value === undefined || value === '') return null+ const parsed = Number(value)+ return Number.isNaN(parsed) ? null : parsed+}++interface RuleSummaryContext {+ t: TFunction+ /** Currency the item-total bounds are quoted in. */+ currency: string+ /** The store's weight unit ('kg' or 'lb') — weight rules carry no unit of their own. */+ weightUnit: string+ locale?: string+}++/**+ * A compact reading of one rule's bounds — "20kg and up", "Under $50",+ * "$100 and up". Returns null for rules with no bounds set (a half-configured+ * rule passes everything, so it has nothing to announce) and for kinds whose+ * shape is a list rather than a range.+ */+function summarizeRule(+ rule: Pick<DeliveryMethodRule, 'type' | 'preferences'>,+ { t, currency, weightUnit, locale }: RuleSummaryContext,+): string | null {+ const preferences = (rule.preferences ?? {}) as Record<string, unknown>++ if (rule.type === 'weight_rule') {+ const min = toNumber(preferences.minimum_weight)+ const max = toNumber(preferences.maximum_weight)+ if (min !== null && max !== null) {+ return t('admin.delivery_methods.rule_summary.weight_between', {+ min,+ max,+ unit: weightUnit,+ })+ }+ if (min !== null) {+ return t('admin.delivery_methods.rule_summary.weight_min', { min, unit: weightUnit })+ }+ if (max !== null) {+ return t('admin.delivery_methods.rule_summary.weight_max', { max, unit: weightUnit })+ }+ return null+ }++ if (rule.type === 'item_total_rule') {+ const min = toNumber(preferences.minimum_amount)+ const max = toNumber(preferences.maximum_amount)+ const money = (value: number) => formatAmount(value, currency, locale)+ if (min !== null && max !== null) {+ return t('admin.delivery_methods.rule_summary.total_between', {+ min: money(min),+ max: money(max),+ })+ }+ if (min !== null) return t('admin.delivery_methods.rule_summary.total_min', { min: money(min) })+ if (max !== null) return t('admin.delivery_methods.rule_summary.total_max', { max: money(max) })+ return null+ }++ return null+}++/**+ * One line summarizing every bound a method's rules impose, for the method+ * rows on the delivery profile page. Empty when the method is eligible+ * everywhere, so the caller renders nothing.+ */+export function summarizeRules(+ rules: Pick<DeliveryMethodRule, 'type' | 'preferences'>[] | null | undefined,+ context: RuleSummaryContext,+): string | null {+ const parts = (rules ?? [])+ .map((rule) => summarizeRule(rule, context))+ .filter((part): part is string => part !== null)++ return parts.length > 0+ ? parts.join(context.t('admin.delivery_methods.rule_summary.separator'))+ : null+}diff --git a/packages/dashboard/src/locales/ar.json b/packages/dashboard/src/locales/ar.jsonindex 7cdf122104..e622523fac 100644--- a/packages/dashboard/src/locales/ar.json+++ b/packages/dashboard/src/locales/ar.json@@ -468,54 +468,92 @@}},"delivery_methods": {- "add_cta": "إضافة طريقة توصيل","add_sheet_title": "طريقة توصيل جديدة",+ "cards": {+ "general": "عام",+ "pricing": "التسعير",+ "providers": "المزوّدون",+ "zone": "المنطقة"+ },+ "carrier_services": {+ "add_service": "إضافة خدمة",+ "all_hint": "تُعرض كل الخدمات التي يعيدها الناقل بأسمائها من الناقل.",+ "carrier": "الناقل",+ "catalog_unavailable": "تعذّر جلب خدمات هذا الناقل ({{message}}). أدخل معرّفات الناقل والخدمة يدويًا، أو اتركها فارغة لعرض كل ما يسعّره الناقل.",+ "choose_specific": "اختيار خدمات محددة",+ "edit_service": "تعديل {{service}}",+ "label": "خدمات الناقل",+ "narrowed_hint": "تُعرض الخدمات المحددة فقط ({{count}}).",+ "offer_all": "عرض جميع الخدمات",+ "service": "الخدمة"+ },+ "collection_locations": {+ "all": "جميع المواقع التي تتيح الاستلام",+ "none_enabled": "لا يوجد موقع يتيح الاستلام بعد — فعّل موقعًا في ملف التسليم.",+ "specific": "مواقع محددة",+ "title": "مواقع الاستلام"+ },"conditions": {"add": "إضافة شرط",- "empty": "لا توجد شروط — تُعرض الطريقة متى تطابقت مناطقها.",+ "empty": "لا توجد شروط — تُعرض هذه الطريقة أينما كانت سارية.","title": "الشروط"},- "create_description": "حدّد كيفية وصول الطلبات إلى العملاء: شحن أو تسليم رقمي أو استلام.",+ "connect_provider_hint": "يمكن لـ {{name}} تقديم أسعار ناقل فورية — قم بالربط للتفعيل.","create_label": "إنشاء طريقة التوصيل","delete_confirm": {"message": "حذف \"{{name}}\"؟ ستتوقف الواجهات فورًا عن عرضها.","title": "حذف طريقة التوصيل"},- "edit_description": "تحديث إعدادات طريقة التوصيل هذه.",+ "detail": {},"edit_sheet_title": "تعديل طريقة التوصيل",- "empty": "لا توجد طرق توصيل بعد.",- "fulfillment_types": {- "digital": "رقمي",- "local_delivery": "توصيل محلي",- "pickup": "استلام",- "pickup_point": "نقطة استلام",- "shipping": "شحن"- },+ "free": "مجاني","messages": {"created": "تم إنشاء طريقة التوصيل","deleted": "تم حذف طريقة التوصيل","updated": "تم تحديث طريقة التوصيل"},- "no_zones_hint": "لا توجد مناطق توصيل بعد — تنطبق الطريقة في كل مكان.",- "pickup_locations_hint": "بدون اختيار، تُعرض جميع مواقع المخزون المفعّل فيها الاستلام.",- "search_placeholder": "البحث في طرق التوصيل…",- "connect_provider_hint": "يمكن لـ {{name}} تقديم أسعار ناقل فورية — قم بالربط للتفعيل.",- "carrier_services": {- "label": "خدمات الناقل",- "all_hint": "تُعرض كل الخدمات التي يعيدها الناقل بأسمائها من الناقل.",- "narrowed_hint": "تُعرض الخدمات المحددة فقط ({{count}}).",- "add_service": "إضافة خدمة",- "carrier": "الناقل",- "service": "الخدمة",- "custom_label": "تسمية مخصصة لـ {{service}}",- "catalog_unavailable": "تعذّر جلب خدمات هذا الناقل ({{message}}). أدخل معرّفات الناقل والخدمة يدويًا، أو اتركها فارغة لعرض كل ما يسعّره الناقل."+ "no_zone_restriction": "بدون تقييد",+ "pricing": {+ "amount_in_currency": "المبلغ بعملة {{currency}}",+ "currency_amounts_help": "العملات المتروكة فارغة لا تُعرض لها طريقة التوصيل هذه."+ },+ "provider_needs_connection": "اربط {{name}} لاستخدامه",+ "rule_summary": {+ "separator": " · ",+ "total_between": "{{min}}–{{max}}",+ "total_max": "أقل من {{max}}",+ "total_min": "{{min}} فأكثر",+ "weight_between": "{{min}}–{{max}} {{unit}}",+ "weight_max": "أقل من {{max}} {{unit}}",+ "weight_min": "{{min}} {{unit}} فأكثر"+ }+ },+ "delivery_origin_groups": {+ "delete_confirm": {+ "message": "هل تريد حذف \"{{name}}\"؟ انقل مناطقها وطرقها إلى مجموعة أخرى أولاً.",+ "title": "حذف مجموعة المصادر"},- "provider_needs_connection": "اربط {{name}} لاستخدامه"+ "edit_description": "أعد تسمية هذه المجموعة أو غيّر المواقع التي تشحن منها.",+ "edit_title": "تعديل مجموعة المصادر",+ "messages": {+ "created": "تم إنشاء مجموعة المصادر",+ "deleted": "تم حذف مجموعة المصادر",+ "updated": "تم تحديث مجموعة المصادر"+ },+ "no_locations_hint": "اختر موقعًا واحدًا على الأقل، أو اختر جميع المواقع.",+ "ships_from": "الشحن من: {{locations}}",+ "ships_from_all": "الشحن من جميع المواقع",+ "ships_from_label": "الشحن من",+ "split_cta": "تقسيم مصادر الشحن",+ "split_description": "اشحن المنتجات نفسها من مستودع ثانٍ له مناطقه وأسعاره الخاصة.",+ "split_title": "تقسيم مصادر الشحن"},"delivery_zones": {+ "add_countries_in_markets": "أضف المزيد من البلدان في الأسواق","add_cta": "إضافة منطقة توصيل",- "add_member": "إضافة عضو",+ "add_postal_rule": "إضافة قاعدة","add_sheet_title": "منطقة توصيل جديدة",+ "all_states": "كل المناطق","create_description": "اجمع الدول أو الولايات أو الرموز البريدية في منطقة تخدمها طرق التوصيل.","create_label": "إنشاء منطقة التوصيل","delete_confirm": {@@ -524,26 +562,45 @@},"edit_description": "الأعضاء أدناه يستبدلون قائمة أعضاء المنطقة كاملة عند الحفظ.","edit_sheet_title": "تعديل منطقة التوصيل",- "empty": "لا توجد مناطق توصيل بعد.","from_placeholder": "من",- "member_types": {- "country": "دولة",- "postal_code": "رمز بريدي",- "state": "ولاية"- },- "members_column": "الأعضاء",- "members_count": "{{count}} أعضاء",+ "in_another_zone": "ضمن منطقة أخرى",+ "member_separator": "، ",+ "members_more_few": "{{count}} أخرى",+ "members_more_many": "{{count}} أخرى",+ "members_more_one": "واحدة أخرى",+ "members_more_other": "{{count}} أخرى",+ "members_more_two": "اثنتان أخريان",+ "members_more_zero": "{{count}} أخرى","messages": {"created": "تم إنشاء منطقة التوصيل","deleted": "تم حذف منطقة التوصيل","updated": "تم تحديث منطقة التوصيل"},- "no_members_hint": "لا يوجد أعضاء بعد — أضف دولًا أو ولايات أو قواعد رموز بريدية.",+ "no_postal_rules_hint": "لا توجد قواعد رمز بريدي بعد.",+ "no_regions_found": "لا توجد بلدان مطابقة لبحثك.",+ "no_states": "لا توجد مناطق لهذا البلد.",+ "not_in_any_market": "ليست ضمن أي سوق",+ "postal_rules_count_few": "{{count}} قواعد",+ "postal_rules_count_many": "{{count}} قاعدة",+ "postal_rules_count_one": "قاعدة واحدة",+ "postal_rules_count_other": "{{count}} قاعدة",+ "postal_rules_count_two": "قاعدتان",+ "postal_rules_title": "قواعد الرمز البريدي","prefix_placeholder": "بادئة",- "search_placeholder": "البحث في مناطق التوصيل…",+ "region_search_placeholder": "ابحث عن البلدان والمناطق للشحن إليها",+ "regions_title": "البلدان والمناطق",+ "remove_postal_rule": "إزالة القاعدة","select_country": "اختر الدولة",- "state_placeholder": "رمز الولاية أو اسمها",- "to_placeholder": "إلى"+ "selection_summary": "{{countries}} بلدًا، {{states}} منطقة، {{rules}} قاعدة رمز بريدي",+ "states_selected_few": "{{count}} مناطق",+ "states_selected_many": "{{count}} منطقة",+ "states_selected_one": "منطقة واحدة",+ "states_selected_other": "{{count}} منطقة",+ "states_selected_two": "منطقتان",+ "states_selected_zero": "لا مناطق",+ "states_summary": "{{selected}} من {{total}} منطقة",+ "to_placeholder": "إلى",+ "toggle_states": "عرض مناطق {{country}}"},"errors": {"forbidden_description": "ليس لديك إذن لعرض هذه الصفحة.",@@ -592,6 +649,13 @@"help": "قناة واحدة فقط لكل متجر هي الافتراضية. تُستخدم كبديل عند عدم اختيار قناة وكهدف نشر تلقائي للمنتجات الجديدة.","label": "القناة الافتراضية"},+ "fulfillment_locations": {+ "all": "جميع المواقع",+ "help": "المستودعات ونقاط الاستلام التي تنفّذ الطلبات الواردة من قناة البيع هذه.",+ "label": "مواقع التنفيذ",+ "none_selected_hint": "اختر موقعًا واحدًا على الأقل، أو اختر «جميع المواقع».",+ "selected": "مواقع محددة"+ },"guest_checkout": {"help": "ما إذا كان بإمكان المتسوّقين إتمام الشراء دون حساب في هذه القناة. اتركه فارغًا للاستناد إلى إعداد المتجر.","inherit": "التوريث من المتجر",@@ -711,22 +775,27 @@"code": {"label": "الرمز"},- "delivery_zones": {- "label": "مناطق التوصيل"+ "delivery_zone": {+ "help": "أين تُعرض هذه الطريقة. بدون منطقة تنطبق في كل مكان يغطيه الملف.",+ "label": "منطقة التوصيل"},"fulfillment_provider": {"help": "كيفية معالجة عمليات التنفيذ لهذه الطريقة وتتبعها.","label": "مزود التنفيذ"},- "fulfillment_type": {- "label": "نوع التنفيذ"+ "markup_flat": {+ "label": "هامش (ثابت)"+ },+ "markup_percent": {+ "help": "رسوم مناولة تُضاف إلى أسعار الناقل. القيم لكل خدمة تتجاوز هذه الافتراضات.",+ "label": "هامش %"},"rate_provider": {- "label": "مزوّد الأسعار",- "help": "مصدر أسعار طريقة التوصيل هذه. المزوّد المدمج يحسب عبر الآلة الحاسبة أدناه؛ ومزوّدو شركات الشحن يوفّرون أسعارًا فورية."+ "help": "مصدر أسعار طريقة التوصيل هذه. المزوّد المدمج يحسب عبر الآلة الحاسبة أدناه؛ ومزوّدو شركات الشحن يوفّرون أسعارًا فورية.",+ "label": "مزوّد الأسعار"},- "pickup_locations": {- "label": "مواقع الاستلام"+ "service_label": {+ "label": "تسمية مخصصة"},"storefront_visible": {"help": "يمكن للعملاء اختيار هذه الطريقة عند الدفع."@@ -742,16 +811,33 @@},"transit_days_min": {"label": "أيام النقل (الأدنى)"+ }+ },+ "delivery_origin_group": {+ "name": {+ "help": "اتركه فارغًا لتسمية هذه المجموعة \"جميع المواقع\".",+ "label": "الاسم"+ }+ },+ "delivery_profile": {+ "capabilities": {+ "label": "الإمكانات"},- "markup_percent": {- "label": "هامش %",- "help": "رسوم مناولة تُضاف إلى أسعار الناقل. القيم لكل خدمة تتجاوز هذه الافتراضات."+ "kind": {+ "help": "يحدد مزوّدي التنفيذ الذين يمكن لطرق هذا الملف استخدامهم.",+ "label": "النوع"},- "markup_flat": {- "label": "هامش (ثابت)"+ "methods_count": {+ "label": "الطرق"},- "service_label": {- "label": "تسمية مخصصة"+ "origins": {+ "label": "الشحن من"+ },+ "products_count": {+ "label": "المنتجات"+ },+ "zones_count": {+ "label": "المناطق"}},"gift_card": {@@ -984,6 +1070,10 @@"discontinue_on": {"label": "إيقاف في"},+ "delivery_profile_id": {+ "help": "يحدد المناطق وطرق التوصيل التي تصل إلى هذا المنتج.",+ "label": "ملف الشحن"+ },"make_active_at": {"label": "تفعيل في"},@@ -1021,9 +1111,9 @@"label": "الحقول المخصصة","required": "مطلوب"},- "fulfillment_types": {- "help": "كيف يمكن تسليم منتجات هذا النوع — شحن، استلام من المتجر، نقطة استلام، أو رقمي.",- "label": "طرق التنفيذ"+ "delivery_profile_id": {+ "help": "يُطبَّق على المنتجات المنشأة بهذا النوع. لا يغيّر المنتجات الموجودة.",+ "label": "قالب ملف الشحن"},"name": {"placeholder": "مثال: تي شيرت"@@ -1188,6 +1278,17 @@"label": "لغة لوحة الإدارة","placeholder": "استخدام اللغة الافتراضية"},+ "preferred_default_package_dimensions": {+ "height": "الارتفاع",+ "help": "الصندوق المعتاد للشحن، تستخدمه شركات النقل لتسعير الوزن الحجمي — بوصات للنظام الإمبراطوري وسنتيمترات للمتري. تلزم القيم الثلاث ليصبح ساريًا.",+ "label": "أبعاد الطرد الافتراضية",+ "length": "الطول",+ "width": "العرض"+ },+ "preferred_default_package_weight": {+ "help": "وزن التغليف (الصندوق والحشو) الذي يُضاف إلى محتويات كل طرد عند حساب أسعار التوصيل. اضبطه على 0 للتعطيل.",+ "label": "الوزن الافتراضي للطرد"+ },"preferred_send_consumer_transactional_emails": {"help": "عند الإيقاف، لا تُرسل رسائل تأكيد الطلب أو الشحن أو الاسترداد.","label": "إرسال رسائل المعاملات للعملاء"@@ -1202,17 +1303,6 @@"preferred_weight_unit": {"label": "وحدة الوزن"},- "preferred_default_package_weight": {- "label": "الوزن الافتراضي للطرد",- "help": "وزن التغليف (الصندوق والحشو) الذي يُضاف إلى محتويات كل طرد عند حساب أسعار التوصيل. اضبطه على 0 للتعطيل."- },- "preferred_default_package_dimensions": {- "label": "أبعاد الطرد الافتراضية",- "length": "الطول",- "width": "العرض",- "height": "الارتفاع",- "help": "الصندوق المعتاد للشحن، تستخدمه شركات النقل لتسعير الوزن الحجمي — بوصات للنظام الإمبراطوري وسنتيمترات للمتري. تلزم القيم الثلاث ليصبح ساريًا."- },"storefront_access": {"help": "الإعداد الافتراضي على مستوى المتجر لما يراه الزوار غير المسجّلين. يمكن للقنوات تجاوزه. عند إخفاء الأسعار، يجب على الضيوف تسجيل الدخول لإتمام الشراء.","label": "الوصول إلى المتجر",@@ -1321,6 +1411,67 @@}}},+ "delivery_profiles": {+ "add_cta": "إضافة ملف",+ "add_dialog_title": "ملف توصيل جديد",+ "all_locations": "جميع المواقع",+ "capabilities": {+ "digital": "رقمي",+ "pickup": "استلام",+ "ships": "شحن"+ },+ "create_description": "اجمع المنتجات التي تُشحن بالطريقة نفسها، مع مواقع ومناطق وطرق توصيل خاصة بها.",+ "create_label": "إنشاء الملف",+ "default_badge": "افتراضي",+ "default_confirm": {+ "message": "ستُشحن المنتجات التي لا ملف خاص لها عبر «{{name}}».",+ "title": "تعيينه ملفًا افتراضيًا"+ },+ "delete_confirm": {+ "message": "هل تريد حذف «{{name}}»؟ ستُحذف معه مناطقه وطرق التوصيل الخاصة به.",+ "title": "حذف ملف الشحن"+ },+ "detail": {+ "add_digital_method": "إضافة طريقة رقمية",+ "add_method": "إضافة طريقة",+ "collect_from": "الاستلام من",+ "collect_from_hint": "المواقع التي يمكن للعملاء الاستلام منها. تسري التغييرات فورًا.",+ "delete_label": "حذف الملف",+ "digital_empty": "لا توجد طريقة تسليم رقمي بعد.",+ "digital_hint": "يُسلَّم دون شحن أو استلام.",+ "digital_title": "التسليم الرقمي",+ "general_title": "عام",+ "hidden_badge": "مخفية",+ "load_failed_title": "تعذّر تحميل ملف الشحن هذا",+ "no_methods": "لا توجد طرق توصيل هنا بعد.",+ "no_stock_locations": "لا توجد مواقع بعد — أضف موقعًا من الإعدادات ← المواقع.",+ "no_zone_hint": "تُعرض هذه الطرق في كل مكان يغطيه هذا الملف.",+ "no_zone_title": "بدون تقييد بمنطقة",+ "no_zones": "لا توجد مناطق بعد — أضف واحدة لتبدأ بعرض طرق التوصيل.",+ "offer_pickup": "إتاحة الاستلام",+ "origins_title": "الشحن من",+ "pickup_empty": "لا توجد طريقة استلام بعد — لا يمكن للعملاء استلام الطلبات في هذا الملف.",+ "pickup_hint": "يستلم العملاء هذه الطلبات بأنفسهم. الاستلام ليس له وجهة، لذا لا تنطبق المناطق.",+ "pickup_title": "الاستلام من المتجر",+ "zones_title": "المناطق وطرق التوصيل"+ },+ "empty": "لا توجد ملفات توصيل بعد.",+ "is_default_hint": "المنتجات التي لا ملف خاص لها تُشحن عبر هذا الملف.",+ "kind_immutable_hint": "يُحدَّد النوع عند إنشاء الملف ولا يمكن تغييره.",+ "kinds": {+ "digital": "رقمي",+ "shipping": "شحن"+ },+ "locations_count": "{{count}} مواقع",+ "make_default": "تعيين كافتراضي",+ "messages": {+ "created": "تم إنشاء ملف الشحن",+ "deleted": "تم حذف ملف الشحن",+ "updated": "تم تحديث ملف الشحن"+ },+ "search_placeholder": "ابحث في ملفات التوصيل…",+ "selected_locations": "المواقع المحددة"+ },"gift_cards": {"batch_autocomplete": {"empty": "لا توجد دفعات مطابقة",@@ -1418,6 +1569,50 @@},"wizard_title": "الاستيراد"},+ "integrations": {+ "active_toggle": {+ "help": "التفعيل يتحقق من الاتصال ويجعل التكامل متاحًا للمزوّدين.",+ "label": "مفعّل"+ },+ "configure_cta": "إعداد",+ "connect_cta": "اتصال",+ "connect_description": "أدخل بيانات اعتماد هذا المزوّد. الحفظ يخزّنها؛ والتفعيل يتحقق من الاتصال.",+ "description": "اربط خدمات المزوّدين بهذا المتجر. تُخزَّن بيانات الاعتماد لكل متجر ويستخدمها مزوّدو التوصيل والضرائب وغيرهم.",+ "disconnect": "قطع الاتصال",+ "disconnect_confirm": {+ "message": "هل تريد قطع اتصال {{name}}؟ ستُحذف بيانات الاعتماد المخزّنة وسيتوقف المزوّدون الذين يستخدمونها عن العمل.",+ "title": "قطع اتصال التكامل"+ },+ "edit_description": "حدّث بيانات الاعتماد أو التفعيل. القيم السرّية مقنّعة؛ اتركها دون تغيير للاحتفاظ بالسر المخزّن.",+ "empty": {+ "description": "تأتي التكاملات مع إضافات المزوّدين. ثبّت حزمة مزوّد وستظهر تكاملاتها هنا.",+ "title": "لا توجد تكاملات مثبّتة"+ },+ "groups": {+ "other": "أخرى",+ "shipping": "الشحن",+ "tax": "الضرائب"+ },+ "messages": {+ "connected": "تم توصيل التكامل",+ "disconnected": "تم قطع اتصال التكامل",+ "updated": "تم تحديث التكامل"+ },+ "status": {+ "active": "مفعّل",+ "connected_inactive": "متصل (غير مفعّل)",+ "not_connected": "غير متصل"+ },+ "test": {+ "failure": "فشل الاتصال.",+ "label": "الاتصال",+ "run": "اختبار الاتصال",+ "success": "نجح الاتصال.",+ "testing": "جارٍ الاختبار…"+ },+ "title": "التكاملات",+ "view_cta": "عرض"+ },"invitation": {"accepting": "قبول…","could_not_accept": "لا يمكن قبول الدعوة",@@ -2360,11 +2555,11 @@"search_placeholder": "البحث عن مواقع المخزون…"},"store": {+ "default_package_description": "الصندوق المعتاد للشحن. يضيف مزوّدو أسعار النقل وزنه إلى كل طرد ويستخدمون أبعاده لتسعير الوزن الحجمي.","subtitle": "التكوين العام والإعدادات الافتراضية على مستوى المتجر.",+ "tab_default_package": "الطرد الافتراضي","tab_general": "عام","tab_standards": "المعايير والأشكال",- "tab_default_package": "الطرد الافتراضي",- "default_package_description": "الصندوق المعتاد للشحن. يضيف مزوّدو أسعار النقل وزنه إلى كل طرد ويستخدمون أبعاده لتسعير الوزن الحجمي.","tab_storefront_access": "الوصول إلى المتجر","title": "إعدادات المتجر"},@@ -2687,6 +2882,8 @@},"create_description": "جمّع المنتجات وحدد طرق تسليمها.","create_label": "إنشاء نوع منتج",+ "custom_delivery_profile": "مخصص",+ "default_delivery_profile": "الملف الافتراضي للمتجر","delete_confirm": {"message": "هل أنت متأكد من حذف “{{name}}”؟ لا يمكن حذف الأنواع التي لا تزال مستخدمة من قبل منتجات.","title": "حذف نوع المنتج"@@ -2829,6 +3026,11 @@},"variants": {"add_option": "إضافة خيار",+ "bulk_edit": {+ "grid_aria": "جدول التحرير الجماعي للمتغيرات",+ "title": "تحرير المتغيرات جماعيًا",+ "trigger": "تحرير جماعي"+ },"create_option_type": "إنشاء نوع خيار جديد","create_option_type_title": "نوع خيار جديد","create_value": "قيمة جديدة",@@ -2853,12 +3055,7 @@"tax_category_placeholder": "ترث من المنتج"},"title": "المتغيرات",- "variant_label": "البديل",- "bulk_edit": {- "trigger": "تحرير جماعي",- "title": "تحرير المتغيرات جماعيًا",- "grid_aria": "جدول التحرير الجماعي للمتغيرات"- }+ "variant_label": "البديل"}},"promotions": {@@ -3208,12 +3405,11 @@"allowed_origins": "المصادر المسموح بها","api_keys": "مفاتيح API","channels": "قنوات البيع",- "integrations": "التكاملات","custom_field_definitions": "الحقول المخصصة",- "delivery_methods": "طرق التوصيل",- "delivery_zones": "مناطق التوصيل",+ "delivery_profiles": "ملفات التوصيل","emails": "البريد الإلكتروني","imports": "عمليات الاستيراد",+ "integrations": "التكاملات","markets": "الأسواق","payment_methods": "طرق الدفع","product_types": "أنواع المنتجات",@@ -3390,50 +3586,6 @@"saved": "تم حفظ الترجمات","source": "المصدر","title": "الترجمات"- },- "integrations": {- "title": "التكاملات",- "description": "اربط خدمات المزوّدين بهذا المتجر. تُخزَّن بيانات الاعتماد لكل متجر ويستخدمها مزوّدو التوصيل والضرائب وغيرهم.",- "empty": {- "title": "لا توجد تكاملات مثبّتة",- "description": "تأتي التكاملات مع إضافات المزوّدين. ثبّت حزمة مزوّد وستظهر تكاملاتها هنا."- },- "status": {- "active": "مفعّل",- "connected_inactive": "متصل (غير مفعّل)",- "not_connected": "غير متصل"- },- "connect_cta": "اتصال",- "configure_cta": "إعداد",- "view_cta": "عرض",- "connect_description": "أدخل بيانات اعتماد هذا المزوّد. الحفظ يخزّنها؛ والتفعيل يتحقق من الاتصال.",- "edit_description": "حدّث بيانات الاعتماد أو التفعيل. القيم السرّية مقنّعة؛ اتركها دون تغيير للاحتفاظ بالسر المخزّن.",- "active_toggle": {- "label": "مفعّل",- "help": "التفعيل يتحقق من الاتصال ويجعل التكامل متاحًا للمزوّدين."- },- "test": {- "label": "الاتصال",- "run": "اختبار الاتصال",- "testing": "جارٍ الاختبار…",- "success": "نجح الاتصال.",- "failure": "فشل الاتصال."- },- "disconnect": "قطع الاتصال",- "disconnect_confirm": {- "title": "قطع اتصال التكامل",- "message": "هل تريد قطع اتصال {{name}}؟ ستُحذف بيانات الاعتماد المخزّنة وسيتوقف المزوّدون الذين يستخدمونها عن العمل."- },- "messages": {- "connected": "تم توصيل التكامل",- "updated": "تم تحديث التكامل",- "disconnected": "تم قطع اتصال التكامل"- },- "groups": {- "shipping": "الشحن",- "tax": "الضرائب",- "other": "أخرى"- }}}}diff --git a/packages/dashboard/src/locales/de.json b/packages/dashboard/src/locales/de.jsonindex 9e2bc67438..ac4702116a 100644--- a/packages/dashboard/src/locales/de.json+++ b/packages/dashboard/src/locales/de.json@@ -468,54 +468,92 @@}},"delivery_methods": {- "add_cta": "Versandart hinzufügen","add_sheet_title": "Neue Versandart",+ "cards": {+ "general": "Allgemein",+ "pricing": "Preisgestaltung",+ "providers": "Anbieter",+ "zone": "Zone"+ },+ "carrier_services": {+ "add_service": "Service hinzufügen",+ "all_hint": "Alle vom Carrier zurückgegebenen Services werden angeboten, benannt vom Carrier.",+ "carrier": "Carrier",+ "catalog_unavailable": "Die Services dieses Carriers konnten nicht geladen werden ({{message}}). Gib Carrier- und Service-Kennungen manuell ein oder lasse das Feld leer, um alle angebotenen Services zu nutzen.",+ "choose_specific": "Bestimmte Services auswählen",+ "edit_service": "{{service}} bearbeiten",+ "label": "Carrier-Services",+ "narrowed_hint": "Nur die {{count}} ausgewählten Services werden angeboten.",+ "offer_all": "Alle Services anbieten",+ "service": "Service"+ },+ "collection_locations": {+ "all": "Alle Standorte mit Abholung",+ "none_enabled": "Noch kein Standort erlaubt Abholung — aktivieren Sie einen im Lieferprofil.",+ "specific": "Bestimmte Standorte",+ "title": "Abholstandorte"+ },"conditions": {"add": "Bedingung hinzufügen",- "empty": "Keine Bedingungen — die Methode wird angeboten, sobald ihre Zonen passen.",+ "empty": "Keine Bedingungen — diese Methode wird überall angeboten, wo sie gilt.","title": "Bedingungen"},- "create_description": "Konfiguriere, wie Bestellungen die Kundschaft erreichen: Versand, digital oder Abholung.",+ "connect_provider_hint": "{{name}} kann Live-Carrier-Tarife anbieten — zum Aktivieren verbinden.","create_label": "Versandart erstellen","delete_confirm": {"message": "\"{{name}}\" löschen? Storefronts bieten sie sofort nicht mehr an.","title": "Versandart löschen"},- "edit_description": "Konfiguration dieser Versandart aktualisieren.",+ "detail": {},"edit_sheet_title": "Versandart bearbeiten",- "empty": "Noch keine Versandarten.",- "fulfillment_types": {- "digital": "Digital",- "local_delivery": "Lokale Lieferung",- "pickup": "Abholung",- "pickup_point": "Abholstation",- "shipping": "Versand"- },+ "free": "Kostenlos","messages": {"created": "Versandart erstellt","deleted": "Versandart gelöscht","updated": "Versandart aktualisiert"},- "no_zones_hint": "Noch keine Lieferzonen definiert — die Methode gilt überall.",- "pickup_locations_hint": "Ohne Auswahl werden alle abholfähigen Lagerorte angeboten.",- "search_placeholder": "Versandarten durchsuchen…",- "connect_provider_hint": "{{name}} kann Live-Carrier-Tarife anbieten — zum Aktivieren verbinden.",- "carrier_services": {- "label": "Carrier-Services",- "all_hint": "Alle vom Carrier zurückgegebenen Services werden angeboten, benannt vom Carrier.",- "narrowed_hint": "Nur die {{count}} ausgewählten Services werden angeboten.",- "add_service": "Service hinzufügen",- "carrier": "Carrier",- "service": "Service",- "custom_label": "Eigene Bezeichnung für {{service}}",- "catalog_unavailable": "Die Services dieses Carriers konnten nicht geladen werden ({{message}}). Gib Carrier- und Service-Kennungen manuell ein oder lasse das Feld leer, um alle angebotenen Services zu nutzen."+ "no_zone_restriction": "Keine Beschränkung",+ "pricing": {+ "amount_in_currency": "Betrag in {{currency}}",+ "currency_amounts_help": "Währungen ohne Betrag wird diese Versandart nicht angeboten."+ },+ "provider_needs_connection": "{{name}} verbinden, um es zu nutzen",+ "rule_summary": {+ "separator": " · ",+ "total_between": "{{min}}–{{max}}",+ "total_max": "Unter {{max}}",+ "total_min": "Ab {{min}}",+ "weight_between": "{{min}}–{{max}} {{unit}}",+ "weight_max": "Unter {{max}} {{unit}}",+ "weight_min": "Ab {{min}} {{unit}}"+ }+ },+ "delivery_origin_groups": {+ "delete_confirm": {+ "message": "\"{{name}}\" löschen? Verschieben Sie zuerst die Zonen und Methoden in eine andere Gruppe.",+ "title": "Standortgruppe löschen"},- "provider_needs_connection": "{{name}} verbinden, um es zu nutzen"+ "edit_description": "Benennen Sie diese Gruppe um oder ändern Sie, aus welchen Standorten sie versendet.",+ "edit_title": "Standortgruppe bearbeiten",+ "messages": {+ "created": "Standortgruppe erstellt",+ "deleted": "Standortgruppe gelöscht",+ "updated": "Standortgruppe aktualisiert"+ },+ "no_locations_hint": "Wählen Sie mindestens einen Standort oder alle Standorte aus.",+ "ships_from": "Versand aus: {{locations}}",+ "ships_from_all": "Versand aus allen Standorten",+ "ships_from_label": "Versand aus",+ "split_cta": "Versandstandorte aufteilen",+ "split_description": "Versenden Sie dieselben Produkte aus einem zweiten Lager mit eigenen Zonen und Tarifen.",+ "split_title": "Versandstandorte aufteilen"},"delivery_zones": {+ "add_countries_in_markets": "Weitere Länder unter Märkte hinzufügen","add_cta": "Lieferzone hinzufügen",- "add_member": "Mitglied hinzufügen",+ "add_postal_rule": "Regel hinzufügen","add_sheet_title": "Neue Lieferzone",+ "all_states": "Alle Bundesländer","create_description": "Gruppiere Länder, Bundesländer oder Postleitzahlen zu einem Liefergebiet.","create_label": "Lieferzone erstellen","delete_confirm": {@@ -524,26 +562,34 @@},"edit_description": "Die folgenden Mitglieder ersetzen beim Speichern die gesamte Liste.","edit_sheet_title": "Lieferzone bearbeiten",- "empty": "Noch keine Lieferzonen.","from_placeholder": "Von",- "member_types": {- "country": "Land",- "postal_code": "Postleitzahl",- "state": "Bundesland"- },- "members_column": "Mitglieder",- "members_count": "{{count}} Mitglieder",+ "in_another_zone": "In einer anderen Zone",+ "member_separator": ", ",+ "members_more_one": "{{count}} weiterer",+ "members_more_other": "{{count}} weitere","messages": {"created": "Lieferzone erstellt","deleted": "Lieferzone gelöscht","updated": "Lieferzone aktualisiert"},- "no_members_hint": "Noch keine Mitglieder — füge Länder, Bundesländer oder PLZ-Regeln hinzu.",+ "no_postal_rules_hint": "Noch keine Postleitzahlregeln.",+ "no_regions_found": "Keine Länder entsprechen Ihrer Suche.",+ "no_states": "Dieses Land hat keine Bundesländer.",+ "not_in_any_market": "In keinem Markt",+ "postal_rules_count_one": "{{count}} Regel",+ "postal_rules_count_other": "{{count}} Regeln",+ "postal_rules_title": "Postleitzahlregeln","prefix_placeholder": "Präfix",- "search_placeholder": "Lieferzonen durchsuchen…",+ "region_search_placeholder": "Länder und Regionen für den Versand suchen",+ "regions_title": "Länder und Regionen",+ "remove_postal_rule": "Regel entfernen","select_country": "Land wählen",- "state_placeholder": "Bundesland-Kürzel oder Name",- "to_placeholder": "Bis"+ "selection_summary": "{{countries}} Länder, {{states}} Bundesländer, {{rules}} Postleitzahlregeln",+ "states_selected_one": "{{count}} Bundesland",+ "states_selected_other": "{{count}} Bundesländer",+ "states_summary": "{{selected}} von {{total}} Bundesländern",+ "to_placeholder": "Bis",+ "toggle_states": "Bundesländer von {{country}} anzeigen"},"errors": {"forbidden_description": "Sie haben keine Berechtigung, diese Seite anzuzeigen.",@@ -592,6 +638,13 @@"help": "Pro Store ist genau ein Kanal der Standard. Wird als Fallback verwendet, wenn kein Kanal ausgewählt ist, und als Auto-Veröffentlichungsziel für neue Produkte.","label": "Standardkanal"},+ "fulfillment_locations": {+ "all": "Alle Standorte",+ "help": "Welche Lager und Abholstationen Bestellungen aus diesem Verkaufskanal erfüllen.",+ "label": "Erfüllungsstandorte",+ "none_selected_hint": "Wählen Sie mindestens einen Standort oder „Alle Standorte“.",+ "selected": "Ausgewählte Standorte"+ },"guest_checkout": {"help": "Ob Kunden in diesem Vertriebskanal ohne Konto zur Kasse gehen können. Leer lassen, um die Store-Einstellung zu übernehmen.","inherit": "Vom Store übernehmen",@@ -711,22 +764,27 @@"code": {"label": "Code"},- "delivery_zones": {- "label": "Lieferzonen"+ "delivery_zone": {+ "help": "Wo diese Versandart angeboten wird. Ohne Zone gilt sie überall, wohin das Profil reicht.",+ "label": "Versandzone"},"fulfillment_provider": {"help": "Wie Sendungen dieser Methode abgewickelt und verfolgt werden.","label": "Fulfillment-Anbieter"},- "fulfillment_type": {- "label": "Fulfillment-Typ"+ "markup_flat": {+ "label": "Aufschlag (fix)"+ },+ "markup_percent": {+ "help": "Bearbeitungsgebühr auf Carrier-Tarife. Werte pro Service überschreiben diese Vorgaben.",+ "label": "Aufschlag %"},"rate_provider": {- "label": "Tarifanbieter",- "help": "Woher die Preise dieser Methode stammen. Der integrierte Anbieter rechnet mit dem Kalkulator unten; Carrier-Anbieter liefern Echtzeit-Tarife."+ "help": "Woher die Preise dieser Methode stammen. Der integrierte Anbieter rechnet mit dem Kalkulator unten; Carrier-Anbieter liefern Echtzeit-Tarife.",+ "label": "Tarifanbieter"},- "pickup_locations": {- "label": "Abholorte"+ "service_label": {+ "label": "Eigene Bezeichnung"},"storefront_visible": {"help": "Kundschaft kann diese Methode im Checkout wählen."@@ -742,16 +800,33 @@},"transit_days_min": {"label": "Laufzeit (min. Tage)"+ }+ },+ "delivery_origin_group": {+ "name": {+ "help": "Leer lassen, um diese Gruppe „Alle Standorte“ zu nennen.",+ "label": "Name"+ }+ },+ "delivery_profile": {+ "capabilities": {+ "label": "Funktionen"},- "markup_percent": {- "label": "Aufschlag %",- "help": "Bearbeitungsgebühr auf Carrier-Tarife. Werte pro Service überschreiben diese Vorgaben."+ "kind": {+ "help": "Bestimmt, welche Fulfillment-Anbieter die Versandarten dieses Profils nutzen können.",+ "label": "Art"},- "markup_flat": {- "label": "Aufschlag (fix)"+ "methods_count": {+ "label": "Versandarten"},- "service_label": {- "label": "Eigene Bezeichnung"+ "origins": {+ "label": "Versand ab"+ },+ "products_count": {+ "label": "Produkte"+ },+ "zones_count": {+ "label": "Zonen"}},"gift_card": {@@ -984,6 +1059,10 @@"discontinue_on": {"label": "Einstellen am"},+ "delivery_profile_id": {+ "help": "Bestimmt, welche Zonen und Versandarten dieses Produkt erreichen.",+ "label": "Versandprofil"+ },"make_active_at": {"label": "Aktiv schalten am"},@@ -1021,9 +1100,9 @@"label": "Benutzerdefinierte Felder","required": "Pflichtfeld"},- "fulfillment_types": {- "help": "Wie Produkte dieses Typs geliefert werden können — Versand, Abholung im Geschäft, Abholstation oder digital.",- "label": "Fulfillment-Arten"+ "delivery_profile_id": {+ "help": "Wird Produkten zugewiesen, die mit diesem Typ erstellt werden. Bestehende Produkte bleiben unverändert.",+ "label": "Vorlage für Versandprofil"},"name": {"placeholder": "z. B. T-Shirt"@@ -1188,6 +1267,17 @@"label": "Admin-Sprache","placeholder": "Standardsprache verwenden"},+ "preferred_default_package_dimensions": {+ "height": "Höhe",+ "help": "Der übliche Versandkarton, von Carrier-Tarifanbietern für Volumengewicht-Preise genutzt — Zoll bei imperial, Zentimeter bei metrisch. Wirksam nur mit allen drei Werten.",+ "label": "Standard-Paketabmessungen",+ "length": "Länge",+ "width": "Breite"+ },+ "preferred_default_package_weight": {+ "help": "Verpackungsgewicht (Karton und Füllmaterial), das bei der Berechnung von Versandtarifen zum Inhalt jedes Pakets addiert wird. 0 deaktiviert es.",+ "label": "Standard-Paketgewicht"+ },"preferred_send_consumer_transactional_emails": {"help": "Wenn deaktiviert, werden keine Bestellbestätigungen, Versand- oder Erstattungs-E-Mails gesendet.","label": "Transaktionale E-Mails an Kunden senden"@@ -1202,17 +1292,6 @@"preferred_weight_unit": {"label": "Gewichtseinheit"},- "preferred_default_package_weight": {- "label": "Standard-Paketgewicht",- "help": "Verpackungsgewicht (Karton und Füllmaterial), das bei der Berechnung von Versandtarifen zum Inhalt jedes Pakets addiert wird. 0 deaktiviert es."- },- "preferred_default_package_dimensions": {- "label": "Standard-Paketabmessungen",- "length": "Länge",- "width": "Breite",- "height": "Höhe",- "help": "Der übliche Versandkarton, von Carrier-Tarifanbietern für Volumengewicht-Preise genutzt — Zoll bei imperial, Zentimeter bei metrisch. Wirksam nur mit allen drei Werten."- },"storefront_access": {"help": "Store-weite Vorgabe dafür, was anonyme Besucher sehen. Vertriebskanäle können dies überschreiben. Wenn Preise verborgen sind, müssen Gäste sich zum Bezahlen anmelden.","label": "Storefront-Zugriff",@@ -1321,6 +1400,67 @@}}},+ "delivery_profiles": {+ "add_cta": "Profil hinzufügen",+ "add_dialog_title": "Neues Lieferprofil",+ "all_locations": "Alle Lagerorte",+ "capabilities": {+ "digital": "Digital",+ "pickup": "Abholung",+ "ships": "Versand"+ },+ "create_description": "Fassen Sie Produkte mit gleichem Versand zusammen — mit eigenen Lagerorten, Zonen und Versandarten.",+ "create_label": "Profil erstellen",+ "default_badge": "Standard",+ "default_confirm": {+ "message": "Produkte ohne eigenes Profil werden künftig über „{{name}}“ versendet.",+ "title": "Als Standardprofil festlegen"+ },+ "delete_confirm": {+ "message": "„{{name}}“ löschen? Die zugehörigen Zonen und Versandarten werden mitgelöscht.",+ "title": "Versandprofil löschen"+ },+ "detail": {+ "add_digital_method": "Digitale Methode hinzufügen",+ "add_method": "Versandart hinzufügen",+ "collect_from": "Abholen bei",+ "collect_from_hint": "Standorte, an denen abgeholt werden kann. Änderungen gelten sofort.",+ "delete_label": "Profil löschen",+ "digital_empty": "Noch keine digitale Liefermethode.",+ "digital_hint": "Wird ohne Versand oder Abholung geliefert.",+ "digital_title": "Digitale Lieferung",+ "general_title": "Allgemein",+ "hidden_badge": "Ausgeblendet",+ "load_failed_title": "Dieses Versandprofil konnte nicht geladen werden",+ "no_methods": "Hier gibt es noch keine Versandarten.",+ "no_stock_locations": "Noch keine Standorte — legen Sie einen unter Einstellungen → Standorte an.",+ "no_zone_hint": "Diese Versandarten gelten überall, wohin dieses Profil reicht.",+ "no_zone_title": "Keine Zonenbeschränkung",+ "no_zones": "Noch keine Zonen — legen Sie eine an, um Versandarten anzubieten.",+ "offer_pickup": "Abholung anbieten",+ "origins_title": "Versand ab",+ "pickup_empty": "Noch keine Abholmethode — auf diesem Profil ist keine Abholung möglich.",+ "pickup_hint": "Kundinnen und Kunden holen diese Bestellungen persönlich ab. Abholung hat kein Ziel, daher gelten keine Zonen.",+ "pickup_title": "Abholung",+ "zones_title": "Zonen und Versandarten"+ },+ "empty": "Noch keine Lieferprofile.",+ "is_default_hint": "Produkte ohne eigenes Profil werden über dieses Profil versendet.",+ "kind_immutable_hint": "Die Art wird beim Erstellen des Profils festgelegt.",+ "kinds": {+ "digital": "Digital",+ "shipping": "Versand"+ },+ "locations_count": "{{count}} Lagerorte",+ "make_default": "Als Standard festlegen",+ "messages": {+ "created": "Versandprofil erstellt",+ "deleted": "Versandprofil gelöscht",+ "updated": "Versandprofil aktualisiert"+ },+ "search_placeholder": "Lieferprofile suchen…",+ "selected_locations": "Ausgewählte Lagerorte"+ },"gift_cards": {"batch_autocomplete": {"empty": "Keine passenden Chargen",@@ -1418,6 +1558,50 @@},"wizard_title": "Import"},+ "integrations": {+ "active_toggle": {+ "help": "Die Aktivierung prüft die Verbindung und stellt die Integration den Anbietern zur Verfügung.",+ "label": "Aktiv"+ },+ "configure_cta": "Konfigurieren",+ "connect_cta": "Verbinden",+ "connect_description": "Geben Sie die Zugangsdaten für diesen Anbieter ein. Speichern legt sie ab; das Aktivieren prüft die Verbindung.",+ "description": "Verbinden Sie Anbieterdienste mit diesem Shop. Zugangsdaten werden pro Shop gespeichert und von Versand-, Steuer- und anderen Anbietern genutzt.",+ "disconnect": "Trennen",+ "disconnect_confirm": {+ "message": "{{name}} trennen? Die gespeicherten Zugangsdaten werden gelöscht und Anbieter, die sie nutzen, funktionieren nicht mehr.",+ "title": "Integration trennen"+ },+ "edit_description": "Zugangsdaten oder Aktivierung ändern. Geheime Werte sind maskiert; unverändert lassen, um das gespeicherte Geheimnis zu behalten.",+ "empty": {+ "description": "Integrationen werden mit Anbieter-Erweiterungen ausgeliefert. Installieren Sie ein Anbieter-Gem, und die Integrationen erscheinen hier.",+ "title": "Keine Integrationen installiert"+ },+ "groups": {+ "other": "Sonstige",+ "shipping": "Versand",+ "tax": "Steuern"+ },+ "messages": {+ "connected": "Integration verbunden",+ "disconnected": "Integration getrennt",+ "updated": "Integration aktualisiert"+ },+ "status": {+ "active": "Aktiv",+ "connected_inactive": "Verbunden (inaktiv)",+ "not_connected": "Nicht verbunden"+ },+ "test": {+ "failure": "Verbindung fehlgeschlagen.",+ "label": "Verbindung",+ "run": "Verbindung testen",+ "success": "Verbindung erfolgreich.",+ "testing": "Wird getestet…"+ },+ "title": "Integrationen",+ "view_cta": "Ansehen"+ },"invitation": {"accepting": "Wird angenommen…","could_not_accept": "Einladung konnte nicht angenommen werden",@@ -2360,11 +2544,11 @@"search_placeholder": "Lagerstandorte suchen…"},"store": {+ "default_package_description": "Der Karton, in dem Sie üblicherweise versenden. Carrier-Tarifanbieter addieren sein Gewicht zu jedem Paket und nutzen seine Abmessungen für Volumengewicht-Preise.","subtitle": "Allgemeine Konfiguration und shopweite Standardwerte.",+ "tab_default_package": "Standardpaket","tab_general": "Allgemein","tab_standards": "Standards und Formate",- "tab_default_package": "Standardpaket",- "default_package_description": "Der Karton, in dem Sie üblicherweise versenden. Carrier-Tarifanbieter addieren sein Gewicht zu jedem Paket und nutzen seine Abmessungen für Volumengewicht-Preise.","tab_storefront_access": "Storefront-Zugriff","title": "Shop-Einstellungen"},@@ -2681,6 +2865,8 @@},"create_description": "Produkte gruppieren und festlegen, wie sie geliefert werden können.","create_label": "Produkttyp erstellen",+ "custom_delivery_profile": "Benutzerdefiniert",+ "default_delivery_profile": "Standardprofil des Shops","delete_confirm": {"message": "Möchten Sie „{{name}}“ wirklich löschen? Typen, die noch von Produkten verwendet werden, können nicht gelöscht werden.","title": "Produkttyp löschen"@@ -2823,6 +3009,11 @@},"variants": {"add_option": "Option hinzufügen",+ "bulk_edit": {+ "grid_aria": "Tabelle zur Massenbearbeitung der Varianten",+ "title": "Varianten massenbearbeiten",+ "trigger": "Massenbearbeitung"+ },"create_option_type": "Neuen Optionstyp erstellen","create_option_type_title": "Neuer Optionstyp","create_value": "Neuer Wert",@@ -2847,12 +3038,7 @@"tax_category_placeholder": "Vom Produkt übernehmen"},"title": "Varianten",- "variant_label": "Variante",- "bulk_edit": {- "trigger": "Massenbearbeitung",- "title": "Varianten massenbearbeiten",- "grid_aria": "Tabelle zur Massenbearbeitung der Varianten"- }+ "variant_label": "Variante"}},"promotions": {@@ -3202,12 +3388,11 @@"allowed_origins": "Zugelassene Ursprünge","api_keys": "API-Schlüssel","channels": "Verkaufskanäle",- "integrations": "Integrationen","custom_field_definitions": "Benutzerdefinierte Felder",- "delivery_methods": "Versandarten",- "delivery_zones": "Lieferzonen",+ "delivery_profiles": "Lieferprofile","emails": "E-Mails","imports": "Importe",+ "integrations": "Integrationen","markets": "Märkte","payment_methods": "Zahlungsmethoden","product_types": "Produkttypen",@@ -3384,50 +3569,6 @@"saved": "Übersetzungen gespeichert","source": "Quelle","title": "Übersetzungen"- },- "integrations": {- "title": "Integrationen",- "description": "Verbinden Sie Anbieterdienste mit diesem Shop. Zugangsdaten werden pro Shop gespeichert und von Versand-, Steuer- und anderen Anbietern genutzt.",- "empty": {- "title": "Keine Integrationen installiert",- "description": "Integrationen werden mit Anbieter-Erweiterungen ausgeliefert. Installieren Sie ein Anbieter-Gem, und die Integrationen erscheinen hier."- },- "status": {- "active": "Aktiv",- "connected_inactive": "Verbunden (inaktiv)",- "not_connected": "Nicht verbunden"- },- "connect_cta": "Verbinden",- "configure_cta": "Konfigurieren",- "view_cta": "Ansehen",- "connect_description": "Geben Sie die Zugangsdaten für diesen Anbieter ein. Speichern legt sie ab; das Aktivieren prüft die Verbindung.",- "edit_description": "Zugangsdaten oder Aktivierung ändern. Geheime Werte sind maskiert; unverändert lassen, um das gespeicherte Geheimnis zu behalten.",- "active_toggle": {- "label": "Aktiv",- "help": "Die Aktivierung prüft die Verbindung und stellt die Integration den Anbietern zur Verfügung."- },- "test": {- "label": "Verbindung",- "run": "Verbindung testen",- "testing": "Wird getestet…",- "success": "Verbindung erfolgreich.",- "failure": "Verbindung fehlgeschlagen."- },- "disconnect": "Trennen",- "disconnect_confirm": {- "title": "Integration trennen",- "message": "{{name}} trennen? Die gespeicherten Zugangsdaten werden gelöscht und Anbieter, die sie nutzen, funktionieren nicht mehr."- },- "messages": {- "connected": "Integration verbunden",- "updated": "Integration aktualisiert",- "disconnected": "Integration getrennt"- },- "groups": {- "shipping": "Versand",- "tax": "Steuern",- "other": "Sonstige"- }}}}diff --git a/packages/dashboard/src/locales/en.json b/packages/dashboard/src/locales/en.jsonindex 323bdf3864..8e88096888 100644--- a/packages/dashboard/src/locales/en.json+++ b/packages/dashboard/src/locales/en.json@@ -468,54 +468,92 @@}},"delivery_methods": {- "add_cta": "Add delivery method","add_sheet_title": "New delivery method",+ "cards": {+ "general": "General",+ "pricing": "Pricing",+ "providers": "Providers",+ "zone": "Zone"+ },+ "carrier_services": {+ "add_service": "Add service",+ "all_hint": "Every service the carrier returns is offered, named by the carrier.",+ "carrier": "Carrier",+ "catalog_unavailable": "Could not list this carrier’s services ({{message}}). Enter carrier and service identifiers manually, or leave empty to offer everything the carrier quotes.",+ "choose_specific": "Choose specific services",+ "edit_service": "Edit {{service}}",+ "label": "Carrier services",+ "narrowed_hint": "Only the {{count}} selected services are offered.",+ "offer_all": "Offer all services",+ "service": "Service"+ },+ "collection_locations": {+ "all": "All pickup-enabled locations",+ "none_enabled": "No location accepts pickup yet — enable one on the delivery profile.",+ "specific": "Specific locations",+ "title": "Collection locations"+ },"conditions": {"add": "Add condition",- "empty": "No conditions — this method is offered whenever its zones match.",+ "empty": "No conditions — this method is offered wherever it applies.","title": "Conditions"},- "create_description": "Configure how orders reach customers: shipping, digital delivery or pickup.",+ "connect_provider_hint": "{{name}} can quote live carrier rates — connect it to enable.","create_label": "Create delivery method","delete_confirm": {"message": "Delete \"{{name}}\"? Storefronts will stop offering it immediately.","title": "Delete delivery method"},- "edit_description": "Update this delivery method’s configuration.",+ "detail": {},"edit_sheet_title": "Edit delivery method",- "empty": "No delivery methods yet.",- "fulfillment_types": {- "digital": "Digital",- "local_delivery": "Local delivery",- "pickup": "Pickup",- "pickup_point": "Pickup point",- "shipping": "Shipping"- },+ "free": "Free","messages": {"created": "Delivery method created","deleted": "Delivery method deleted","updated": "Delivery method updated"},- "no_zones_hint": "No delivery zones defined yet — the method applies everywhere.",- "pickup_locations_hint": "No selection means every pickup-enabled stock location is offered.",- "search_placeholder": "Search delivery methods…",- "connect_provider_hint": "{{name}} can quote live carrier rates — connect it to enable.",- "carrier_services": {- "label": "Carrier services",- "all_hint": "Every service the carrier returns is offered, named by the carrier.",- "narrowed_hint": "Only the {{count}} selected services are offered.",- "add_service": "Add service",- "carrier": "Carrier",- "service": "Service",- "custom_label": "Custom label for {{service}}",- "catalog_unavailable": "Could not list this carrier’s services ({{message}}). Enter carrier and service identifiers manually, or leave empty to offer everything the carrier quotes."+ "no_zone_restriction": "No restriction",+ "pricing": {+ "amount_in_currency": "Amount in {{currency}}",+ "currency_amounts_help": "Currencies left blank are not offered this delivery method."+ },+ "provider_needs_connection": "Connect {{name}} to use it",+ "rule_summary": {+ "separator": " · ",+ "total_between": "{{min}}–{{max}}",+ "total_max": "Under {{max}}",+ "total_min": "{{min}} and up",+ "weight_between": "{{min}}–{{max}}{{unit}}",+ "weight_max": "Under {{max}}{{unit}}",+ "weight_min": "{{min}}{{unit}} and up"+ }+ },+ "delivery_origin_groups": {+ "delete_confirm": {+ "message": "Delete \"{{name}}\"? Move its zones and methods to another group first.",+ "title": "Delete origin group"},- "provider_needs_connection": "Connect {{name}} to use it"+ "edit_description": "Rename this group or change which locations it ships from.",+ "edit_title": "Edit origin group",+ "messages": {+ "created": "Origin group created",+ "deleted": "Origin group deleted",+ "updated": "Origin group updated"+ },+ "no_locations_hint": "Select at least one location, or choose all locations.",+ "ships_from": "Ships from: {{locations}}",+ "ships_from_all": "Ships from all locations",+ "ships_from_label": "Ships from",+ "split_cta": "Split shipping origins",+ "split_description": "Ship the same products from a second warehouse with its own zones and rates.",+ "split_title": "Split shipping origins"},"delivery_zones": {+ "add_countries_in_markets": "Add more countries in Markets","add_cta": "Add delivery zone",- "add_member": "Add member",+ "add_postal_rule": "Add rule","add_sheet_title": "New delivery zone",+ "all_states": "All states","create_description": "Group countries, states or postal codes into an area served by delivery methods.","create_label": "Create delivery zone","delete_confirm": {@@ -524,26 +562,34 @@},"edit_description": "Members below replace the zone’s full member list on save.","edit_sheet_title": "Edit delivery zone",- "empty": "No delivery zones yet.","from_placeholder": "From",- "member_types": {- "country": "Country",- "postal_code": "Postal code",- "state": "State"- },- "members_column": "Members",- "members_count": "{{count}} members",+ "in_another_zone": "In another zone",+ "member_separator": ", ",+ "members_more_one": "{{count}} more",+ "members_more_other": "{{count}} more","messages": {"created": "Delivery zone created","deleted": "Delivery zone deleted","updated": "Delivery zone updated"},- "no_members_hint": "No members yet — add countries, states or postal code rules.",+ "no_postal_rules_hint": "No postal code rules yet.",+ "no_regions_found": "No countries match your search.",+ "no_states": "This country has no states.",+ "not_in_any_market": "Not in any market",+ "postal_rules_count_one": "{{count}} rule",+ "postal_rules_count_other": "{{count}} rules",+ "postal_rules_title": "Postal code rules","prefix_placeholder": "Prefix",- "search_placeholder": "Search delivery zones…",+ "region_search_placeholder": "Search countries and regions to ship to",+ "regions_title": "Countries and regions",+ "remove_postal_rule": "Remove rule","select_country": "Select country",- "state_placeholder": "State code or name",- "to_placeholder": "To"+ "selection_summary": "{{countries}} countries, {{states}} states, {{rules}} postal code rules",+ "states_selected_one": "{{count}} state",+ "states_selected_other": "{{count}} states",+ "states_summary": "{{selected}} of {{total}} states",+ "to_placeholder": "To",+ "toggle_states": "Show states of {{country}}"},"errors": {"forbidden_description": "You don’t have permission to view this page.",@@ -592,6 +638,13 @@"help": "Exactly one channel per store is the default. Used as the fallback when no channel is selected and as the auto-publish target for new products.","label": "Default channel"},+ "fulfillment_locations": {+ "all": "All locations",+ "help": "Which warehouses and pickup counters fulfill orders placed on this sales channel.",+ "label": "Fulfillment locations",+ "none_selected_hint": "Pick at least one location, or choose \"All locations\".",+ "selected": "Selected locations"+ },"guest_checkout": {"help": "Whether shoppers can check out without an account on this channel. Leave blank to inherit the store setting.","inherit": "Inherit from store",@@ -711,22 +764,27 @@"code": {"label": "Code"},- "delivery_zones": {- "label": "Delivery zones"+ "delivery_zone": {+ "help": "Where this method is offered. Without a zone it applies wherever the profile reaches.",+ "label": "Delivery zone"},"fulfillment_provider": {"help": "How fulfillments for this method are dispatched and tracked.","label": "Fulfillment provider"},- "fulfillment_type": {- "label": "Fulfillment type"+ "markup_flat": {+ "label": "Markup (flat)"+ },+ "markup_percent": {+ "help": "Handling fee added on top of carrier rates. Per-service values override these defaults.",+ "label": "Markup %"},"rate_provider": {- "label": "Rate provider",- "help": "Where this method's prices come from. The built-in provider prices with the calculator below; carrier providers quote live rates."+ "help": "Where this method's prices come from. The built-in provider prices with the calculator below; carrier providers quote live rates.",+ "label": "Rate provider"},- "pickup_locations": {- "label": "Pickup locations"+ "service_label": {+ "label": "Custom label"},"storefront_visible": {"help": "Customers can select this method at checkout."@@ -742,16 +800,33 @@},"transit_days_min": {"label": "Transit days (min)"+ }+ },+ "delivery_origin_group": {+ "name": {+ "help": "Leave blank to call this group \"All locations\".",+ "label": "Name"+ }+ },+ "delivery_profile": {+ "capabilities": {+ "label": "Capabilities"},- "markup_percent": {- "label": "Markup %",- "help": "Handling fee added on top of carrier rates. Per-service values override these defaults."+ "kind": {+ "help": "Decides which fulfillment providers this profile’s methods can use.",+ "label": "Kind"},- "markup_flat": {- "label": "Markup (flat)"+ "methods_count": {+ "label": "Methods"},- "service_label": {- "label": "Custom label"+ "origins": {+ "label": "Ships from"+ },+ "products_count": {+ "label": "Products"+ },+ "zones_count": {+ "label": "Zones"}},"gift_card": {@@ -984,6 +1059,10 @@"discontinue_on": {"label": "Discontinue on"},+ "delivery_profile_id": {+ "help": "Decides which zones and delivery methods reach this product.",+ "label": "Shipping profile"+ },"make_active_at": {"label": "Make active at"},@@ -1021,9 +1100,9 @@"label": "Custom fields","required": "Required"},- "fulfillment_types": {- "help": "How products of this type can be delivered — shipping, store pickup, pickup point, or digital.",- "label": "Fulfillment types"+ "delivery_profile_id": {+ "help": "Stamped onto products created with this type. Changing it never moves products that already carry the type.",+ "label": "Shipping profile template"},"name": {"placeholder": "e.g. T-Shirt"@@ -1188,6 +1267,17 @@"label": "Admin language","placeholder": "Use the default language"},+ "preferred_default_package_dimensions": {+ "height": "Height",+ "help": "The box you usually ship in, used by carrier rate providers for dimensional-weight pricing — inches for imperial, centimeters for metric. All three are needed to take effect.",+ "label": "Default package dimensions",+ "length": "Length",+ "width": "Width"+ },+ "preferred_default_package_weight": {+ "help": "Packaging weight (box and filler) added to every package's contents when calculating delivery rates. Set to 0 to disable.",+ "label": "Default package weight"+ },"preferred_send_consumer_transactional_emails": {"help": "When off, no order confirmation, shipping, or refund emails are sent.","label": "Send transactional emails to customers"@@ -1202,17 +1292,6 @@"preferred_weight_unit": {"label": "Weight unit"},- "preferred_default_package_weight": {- "label": "Default package weight",- "help": "Packaging weight (box and filler) added to every package's contents when calculating delivery rates. Set to 0 to disable."- },- "preferred_default_package_dimensions": {- "label": "Default package dimensions",- "length": "Length",- "width": "Width",- "height": "Height",- "help": "The box you usually ship in, used by carrier rate providers for dimensional-weight pricing — inches for imperial, centimeters for metric. All three are needed to take effect."- },"storefront_access": {"help": "Store-wide default for what anonymous visitors can see. Channels can override this. When prices are hidden, guests must sign in to check out.","label": "Storefront access",@@ -1321,6 +1400,67 @@}}},+ "delivery_profiles": {+ "add_cta": "Add profile",+ "add_dialog_title": "New delivery profile",+ "all_locations": "All locations",+ "capabilities": {+ "digital": "Digital",+ "pickup": "Pickup",+ "ships": "Ships"+ },+ "create_description": "Group products that ship the same way, with their own locations, zones and delivery methods.",+ "create_label": "Create profile",+ "default_badge": "Default",+ "default_confirm": {+ "message": "Products without a profile of their own will start shipping on “{{name}}”.",+ "title": "Make this the default profile"+ },+ "delete_confirm": {+ "message": "Delete “{{name}}”? Its zones and delivery methods go with it.",+ "title": "Delete shipping profile"+ },+ "detail": {+ "add_digital_method": "Add digital method",+ "add_method": "Add method",+ "collect_from": "Collect from",+ "collect_from_hint": "Locations customers can collect from. Changes take effect immediately.",+ "delete_label": "Delete profile",+ "digital_empty": "No digital delivery method yet.",+ "digital_hint": "Delivered without shipping or collection.",+ "digital_title": "Digital delivery",+ "general_title": "General",+ "hidden_badge": "Hidden",+ "load_failed_title": "Could not load this shipping profile",+ "no_methods": "No delivery methods here yet.",+ "no_stock_locations": "No locations yet — add one under Settings → Locations.",+ "no_zone_hint": "These methods are offered wherever this profile reaches.",+ "no_zone_title": "No zone restriction",+ "no_zones": "No zones yet — add one to start offering delivery methods.",+ "offer_pickup": "Offer pickup",+ "origins_title": "Ships from",+ "pickup_empty": "No pickup method yet — customers cannot collect orders on this profile.",+ "pickup_hint": "Customers collect these orders in person. Pickup has no destination, so zones do not apply.",+ "pickup_title": "Pickup",+ "zones_title": "Zones and delivery methods"+ },+ "empty": "No delivery profiles yet.",+ "is_default_hint": "Products without a profile of their own ship on this one.",+ "kind_immutable_hint": "The kind is fixed when the profile is created.",+ "kinds": {+ "digital": "Digital",+ "shipping": "Shipping"+ },+ "locations_count": "{{count}} locations",+ "make_default": "Make default",+ "messages": {+ "created": "Shipping profile created",+ "deleted": "Shipping profile deleted",+ "updated": "Shipping profile updated"+ },+ "search_placeholder": "Search delivery profiles…",+ "selected_locations": "Selected locations"+ },"gift_cards": {"batch_autocomplete": {"empty": "No batches match",@@ -1418,6 +1558,50 @@},"wizard_title": "Import"},+ "integrations": {+ "active_toggle": {+ "help": "Activation verifies the connection and makes the integration available to providers.",+ "label": "Active"+ },+ "configure_cta": "Configure",+ "connect_cta": "Connect",+ "connect_description": "Enter the credentials for this provider. Saving stores them; switching it active verifies the connection.",+ "description": "Connect provider services to this store. Credentials are stored per store and used by delivery, tax and other providers.",+ "disconnect": "Disconnect",+ "disconnect_confirm": {+ "message": "Disconnect {{name}}? Its stored credentials are deleted and providers using it stop working.",+ "title": "Disconnect integration"+ },+ "edit_description": "Update credentials or activation. Secret values are masked; leave them unchanged to keep the stored secret.",+ "empty": {+ "description": "Integrations ship with provider extensions. Install a provider gem and its integrations appear here.",+ "title": "No integrations installed"+ },+ "groups": {+ "other": "Other",+ "shipping": "Shipping",+ "tax": "Tax"+ },+ "messages": {+ "connected": "Integration connected",+ "disconnected": "Integration disconnected",+ "updated": "Integration updated"+ },+ "status": {+ "active": "Active",+ "connected_inactive": "Connected (inactive)",+ "not_connected": "Not connected"+ },+ "test": {+ "failure": "Connection failed.",+ "label": "Connection",+ "run": "Test connection",+ "success": "Connection successful.",+ "testing": "Testing…"+ },+ "title": "Integrations",+ "view_cta": "View"+ },"invitation": {"accepting": "Accepting…","could_not_accept": "Could not accept invitation",@@ -2360,11 +2544,11 @@"search_placeholder": "Search stock locations…"},"store": {+ "default_package_description": "The box you usually ship in. Carrier rate providers add its weight to every package and use its dimensions for dimensional-weight pricing.","subtitle": "General configuration and store-wide defaults.",+ "tab_default_package": "Default package","tab_general": "General","tab_standards": "Standards and formats",- "tab_default_package": "Default package",- "default_package_description": "The box you usually ship in. Carrier rate providers add its weight to every package and use its dimensions for dimensional-weight pricing.","tab_storefront_access": "Storefront access","title": "Store settings"},@@ -2681,6 +2865,8 @@},"create_description": "Group products and define how they can be delivered.","create_label": "Create product type",+ "custom_delivery_profile": "Custom",+ "default_delivery_profile": "Store default profile","delete_confirm": {"message": "Are you sure you want to delete “{{name}}”? Types still used by products cannot be deleted.","title": "Delete product type"@@ -2823,6 +3009,11 @@},"variants": {"add_option": "Add option",+ "bulk_edit": {+ "grid_aria": "Variant bulk edit spreadsheet",+ "title": "Bulk edit variants",+ "trigger": "Bulk edit"+ },"create_option_type": "Create new option type","create_option_type_title": "New option type","create_value": "New value",@@ -2847,12 +3038,7 @@"tax_category_placeholder": "Inherit from product"},"title": "Variants",- "variant_label": "Variant",- "bulk_edit": {- "trigger": "Bulk edit",- "title": "Bulk edit variants",- "grid_aria": "Variant bulk edit spreadsheet"- }+ "variant_label": "Variant"}},"promotions": {@@ -3202,12 +3388,11 @@"allowed_origins": "Allowed origins","api_keys": "API keys","channels": "Sales channels",- "integrations": "Integrations","custom_field_definitions": "Custom fields",- "delivery_methods": "Delivery methods",- "delivery_zones": "Delivery zones",+ "delivery_profiles": "Delivery profiles","emails": "Emails","imports": "Imports",+ "integrations": "Integrations","markets": "Markets","payment_methods": "Payment methods","product_types": "Product types",@@ -3384,50 +3569,6 @@"saved": "Translations saved","source": "Source","title": "Translations"- },- "integrations": {- "title": "Integrations",- "description": "Connect provider services to this store. Credentials are stored per store and used by delivery, tax and other providers.",- "empty": {- "title": "No integrations installed",- "description": "Integrations ship with provider extensions. Install a provider gem and its integrations appear here."- },- "status": {- "active": "Active",- "connected_inactive": "Connected (inactive)",- "not_connected": "Not connected"- },- "connect_cta": "Connect",- "configure_cta": "Configure",- "view_cta": "View",- "connect_description": "Enter the credentials for this provider. Saving stores them; switching it active verifies the connection.",- "edit_description": "Update credentials or activation. Secret values are masked; leave them unchanged to keep the stored secret.",- "active_toggle": {- "label": "Active",- "help": "Activation verifies the connection and makes the integration available to providers."- },- "test": {- "label": "Connection",- "run": "Test connection",- "testing": "Testing…",- "success": "Connection successful.",- "failure": "Connection failed."- },- "disconnect": "Disconnect",- "disconnect_confirm": {- "title": "Disconnect integration",- "message": "Disconnect {{name}}? Its stored credentials are deleted and providers using it stop working."- },- "messages": {- "connected": "Integration connected",- "updated": "Integration updated",- "disconnected": "Integration disconnected"- },- "groups": {- "shipping": "Shipping",- "tax": "Tax",- "other": "Other"- }}}}diff --git a/packages/dashboard/src/locales/fr.json b/packages/dashboard/src/locales/fr.jsonindex 600224e938..075998440b 100644--- a/packages/dashboard/src/locales/fr.json+++ b/packages/dashboard/src/locales/fr.json@@ -468,54 +468,92 @@}},"delivery_methods": {- "add_cta": "Ajouter une méthode","add_sheet_title": "Nouvelle méthode de livraison",+ "cards": {+ "general": "Général",+ "pricing": "Tarification",+ "providers": "Prestataires",+ "zone": "Zone"+ },+ "carrier_services": {+ "add_service": "Ajouter un service",+ "all_hint": "Tous les services renvoyés par le transporteur sont proposés, nommés par le transporteur.",+ "carrier": "Transporteur",+ "catalog_unavailable": "Impossible de lister les services de ce transporteur ({{message}}). Saisissez les identifiants manuellement, ou laissez vide pour proposer tout ce que le transporteur cote.",+ "choose_specific": "Choisir des services précis",+ "edit_service": "Modifier {{service}}",+ "label": "Services transporteur",+ "narrowed_hint": "Seuls les {{count}} services sélectionnés sont proposés.",+ "offer_all": "Proposer tous les services",+ "service": "Service"+ },+ "collection_locations": {+ "all": "Tous les emplacements proposant le retrait",+ "none_enabled": "Aucun emplacement n’accepte le retrait — activez-en un sur le profil de livraison.",+ "specific": "Emplacements spécifiques",+ "title": "Emplacements de retrait"+ },"conditions": {"add": "Ajouter une condition",- "empty": "Aucune condition — la méthode est proposée dès que ses zones correspondent.",+ "empty": "Aucune condition — cette méthode est proposée partout où elle s'applique.","title": "Conditions"},- "create_description": "Configurez comment les commandes parviennent aux clients : expédition, numérique ou retrait.",+ "connect_provider_hint": "{{name}} peut proposer des tarifs transporteur en direct — connectez-le pour l’activer.","create_label": "Créer la méthode","delete_confirm": {"message": "Supprimer « {{name}} » ? Les boutiques cesseront de la proposer immédiatement.","title": "Supprimer la méthode"},- "edit_description": "Mettre à jour la configuration de cette méthode de livraison.",- "edit_sheet_title": "Modifier la méthode",- "empty": "Aucune méthode de livraison.",- "fulfillment_types": {- "digital": "Numérique",- "local_delivery": "Livraison locale",- "pickup": "Retrait",- "pickup_point": "Point relais",- "shipping": "Expédition"- },+ "detail": {},+ "edit_sheet_title": "Modifier la méthode de livraison",+ "free": "Gratuit","messages": {"created": "Méthode de livraison créée","deleted": "Méthode de livraison supprimée","updated": "Méthode de livraison mise à jour"},- "no_zones_hint": "Aucune zone définie — la méthode s’applique partout.",- "pickup_locations_hint": "Sans sélection, tous les entrepôts avec retrait activé sont proposés.",- "search_placeholder": "Rechercher des méthodes…",- "connect_provider_hint": "{{name}} peut proposer des tarifs transporteur en direct — connectez-le pour l’activer.",- "carrier_services": {- "label": "Services transporteur",- "all_hint": "Tous les services renvoyés par le transporteur sont proposés, nommés par le transporteur.",- "narrowed_hint": "Seuls les {{count}} services sélectionnés sont proposés.",- "add_service": "Ajouter un service",- "carrier": "Transporteur",- "service": "Service",- "custom_label": "Libellé personnalisé pour {{service}}",- "catalog_unavailable": "Impossible de lister les services de ce transporteur ({{message}}). Saisissez les identifiants manuellement, ou laissez vide pour proposer tout ce que le transporteur cote."+ "no_zone_restriction": "Aucune restriction",+ "pricing": {+ "amount_in_currency": "Montant en {{currency}}",+ "currency_amounts_help": "Les devises laissées vides ne se voient pas proposer cette méthode de livraison."+ },+ "provider_needs_connection": "Connectez {{name}} pour l’utiliser",+ "rule_summary": {+ "separator": " · ",+ "total_between": "{{min}}–{{max}}",+ "total_max": "Moins de {{max}}",+ "total_min": "À partir de {{min}}",+ "weight_between": "{{min}}–{{max}} {{unit}}",+ "weight_max": "Moins de {{max}} {{unit}}",+ "weight_min": "À partir de {{min}} {{unit}}"+ }+ },+ "delivery_origin_groups": {+ "delete_confirm": {+ "message": "Supprimer « {{name}} » ? Déplacez d'abord ses zones et méthodes vers un autre groupe.",+ "title": "Supprimer le groupe d'origine"},- "provider_needs_connection": "Connectez {{name}} pour l’utiliser"+ "edit_description": "Renommez ce groupe ou modifiez les emplacements depuis lesquels il expédie.",+ "edit_title": "Modifier le groupe d'origine",+ "messages": {+ "created": "Groupe d'origine créé",+ "deleted": "Groupe d'origine supprimé",+ "updated": "Groupe d'origine mis à jour"+ },+ "no_locations_hint": "Sélectionnez au moins un emplacement, ou choisissez tous les emplacements.",+ "ships_from": "Expédié depuis : {{locations}}",+ "ships_from_all": "Expédié depuis tous les emplacements",+ "ships_from_label": "Expédié depuis",+ "split_cta": "Séparer les origines d'expédition",+ "split_description": "Expédiez les mêmes produits depuis un second entrepôt avec ses propres zones et tarifs.",+ "split_title": "Séparer les origines d'expédition"},"delivery_zones": {+ "add_countries_in_markets": "Ajouter d’autres pays dans Marchés","add_cta": "Ajouter une zone",- "add_member": "Ajouter un membre",+ "add_postal_rule": "Ajouter une règle","add_sheet_title": "Nouvelle zone de livraison",+ "all_states": "Toutes les régions","create_description": "Regroupez pays, états ou codes postaux en une zone desservie.","create_label": "Créer la zone","delete_confirm": {@@ -524,26 +562,34 @@},"edit_description": "Les membres ci-dessous remplacent la liste complète à l’enregistrement.","edit_sheet_title": "Modifier la zone",- "empty": "Aucune zone de livraison.","from_placeholder": "De",- "member_types": {- "country": "Pays",- "postal_code": "Code postal",- "state": "État"- },- "members_column": "Membres",- "members_count": "{{count}} membres",+ "in_another_zone": "Dans une autre zone",+ "member_separator": ", ",+ "members_more_one": "{{count}} autre",+ "members_more_other": "{{count}} autres","messages": {"created": "Zone de livraison créée","deleted": "Zone de livraison supprimée","updated": "Zone de livraison mise à jour"},- "no_members_hint": "Aucun membre — ajoutez des pays, états ou règles de code postal.",+ "no_postal_rules_hint": "Aucune règle de code postal pour le moment.",+ "no_regions_found": "Aucun pays ne correspond à votre recherche.",+ "no_states": "Ce pays n’a pas de régions.",+ "not_in_any_market": "Dans aucun marché",+ "postal_rules_count_one": "{{count}} règle",+ "postal_rules_count_other": "{{count}} règles",+ "postal_rules_title": "Règles de code postal","prefix_placeholder": "Préfixe",- "search_placeholder": "Rechercher des zones…",+ "region_search_placeholder": "Rechercher des pays et régions à livrer",+ "regions_title": "Pays et régions",+ "remove_postal_rule": "Supprimer la règle","select_country": "Choisir un pays",- "state_placeholder": "Code ou nom de l’état",- "to_placeholder": "À"+ "selection_summary": "{{countries}} pays, {{states}} régions, {{rules}} règles de code postal",+ "states_selected_one": "{{count}} région",+ "states_selected_other": "{{count}} régions",+ "states_summary": "{{selected}} régions sur {{total}}",+ "to_placeholder": "À",+ "toggle_states": "Afficher les régions de {{country}}"},"errors": {"forbidden_description": "Vous n’avez pas la permission de voir cette page.",@@ -592,6 +638,13 @@"help": "Exactement un canal par boutique est défini par défaut. Utilisé comme solution de repli lorsqu'aucun canal n'est sélectionné et comme cible de publication automatique pour les nouveaux produits.","label": "Canal par défaut"},+ "fulfillment_locations": {+ "all": "Tous les sites",+ "help": "Quels entrepôts et points de retrait traitent les commandes passées sur ce canal de vente.",+ "label": "Sites d'expédition",+ "none_selected_hint": "Choisissez au moins un site, ou sélectionnez « Tous les sites ».",+ "selected": "Sites sélectionnés"+ },"guest_checkout": {"help": "Indique si les clients peuvent commander sans compte sur ce canal. Laisser vide pour hériter du paramètre de la boutique.","inherit": "Hériter de la boutique",@@ -711,22 +764,27 @@"code": {"label": "Code"},- "delivery_zones": {- "label": "Zones de livraison"+ "delivery_zone": {+ "help": "Où cette méthode est proposée. Sans zone, elle s’applique partout où le profil s’étend.",+ "label": "Zone de livraison"},"fulfillment_provider": {"help": "Comment les expéditions de cette méthode sont traitées et suivies.","label": "Fournisseur d'expédition"},- "fulfillment_type": {- "label": "Type de traitement"+ "markup_flat": {+ "label": "Majoration (fixe)"+ },+ "markup_percent": {+ "help": "Frais de traitement ajoutés aux tarifs transporteur. Les valeurs par service remplacent ces valeurs par défaut.",+ "label": "Majoration %"},"rate_provider": {- "label": "Fournisseur de tarifs",- "help": "D'où proviennent les prix de cette méthode. Le fournisseur intégré calcule avec le calculateur ci-dessous ; les transporteurs fournissent des tarifs en temps réel."+ "help": "D'où proviennent les prix de cette méthode. Le fournisseur intégré calcule avec le calculateur ci-dessous ; les transporteurs fournissent des tarifs en temps réel.",+ "label": "Fournisseur de tarifs"},- "pickup_locations": {- "label": "Points de retrait"+ "service_label": {+ "label": "Libellé personnalisé"},"storefront_visible": {"help": "Les clients peuvent choisir cette méthode au paiement."@@ -742,16 +800,33 @@},"transit_days_min": {"label": "Délai (jours min)"+ }+ },+ "delivery_origin_group": {+ "name": {+ "help": "Laissez vide pour nommer ce groupe « Tous les emplacements ».",+ "label": "Nom"+ }+ },+ "delivery_profile": {+ "capabilities": {+ "label": "Capacités"},- "markup_percent": {- "label": "Majoration %",- "help": "Frais de traitement ajoutés aux tarifs transporteur. Les valeurs par service remplacent ces valeurs par défaut."+ "kind": {+ "help": "Détermine les prestataires de traitement utilisables par les méthodes de ce profil.",+ "label": "Type"},- "markup_flat": {- "label": "Majoration (fixe)"+ "methods_count": {+ "label": "Méthodes"},- "service_label": {- "label": "Libellé personnalisé"+ "origins": {+ "label": "Expédié depuis"+ },+ "products_count": {+ "label": "Produits"+ },+ "zones_count": {+ "label": "Zones"}},"gift_card": {@@ -984,6 +1059,10 @@"discontinue_on": {"label": "Arrêter le"},+ "delivery_profile_id": {+ "help": "Détermine les zones et méthodes de livraison qui atteignent ce produit.",+ "label": "Profil d’expédition"+ },"make_active_at": {"label": "Activer le"},@@ -1021,9 +1100,9 @@"label": "Champs personnalisés","required": "Obligatoire"},- "fulfillment_types": {- "help": "Comment les produits de ce type peuvent être livrés — expédition, retrait en magasin, point relais ou numérique.",- "label": "Modes d'expédition"+ "delivery_profile_id": {+ "help": "Appliqué aux produits créés avec ce type. Les produits existants ne sont jamais modifiés.",+ "label": "Modèle de profil d’expédition"},"name": {"placeholder": "p. ex. T-Shirt"@@ -1188,6 +1267,17 @@"label": "Langue de l'administration","placeholder": "Utiliser la langue par défaut"},+ "preferred_default_package_dimensions": {+ "height": "Hauteur",+ "help": "Le carton habituel d'expédition, utilisé par les transporteurs pour le poids volumétrique — pouces en impérial, centimètres en métrique. Les trois valeurs sont requises.",+ "label": "Dimensions de colis par défaut",+ "length": "Longueur",+ "width": "Largeur"+ },+ "preferred_default_package_weight": {+ "help": "Poids d'emballage (carton et calage) ajouté au contenu de chaque colis lors du calcul des tarifs de livraison. 0 pour désactiver.",+ "label": "Poids de colis par défaut"+ },"preferred_send_consumer_transactional_emails": {"help": "Si désactivé, aucun e-mail de confirmation de commande, d'expédition ou de remboursement n'est envoyé.","label": "Envoyer les e-mails transactionnels aux clients"@@ -1202,17 +1292,6 @@"preferred_weight_unit": {"label": "Unité de poids"},- "preferred_default_package_weight": {- "label": "Poids de colis par défaut",- "help": "Poids d'emballage (carton et calage) ajouté au contenu de chaque colis lors du calcul des tarifs de livraison. 0 pour désactiver."- },- "preferred_default_package_dimensions": {- "label": "Dimensions de colis par défaut",- "length": "Longueur",- "width": "Largeur",- "height": "Hauteur",- "help": "Le carton habituel d'expédition, utilisé par les transporteurs pour le poids volumétrique — pouces en impérial, centimètres en métrique. Les trois valeurs sont requises."- },"storefront_access": {"help": "Valeur par défaut à l'échelle de la boutique pour ce que les visiteurs anonymes peuvent voir. Les canaux peuvent la remplacer. Lorsque les prix sont masqués, les invités doivent se connecter pour passer à la caisse.","label": "Accès à la vitrine",@@ -1321,6 +1400,67 @@}}},+ "delivery_profiles": {+ "add_cta": "Ajouter un profil",+ "add_dialog_title": "Nouveau profil de livraison",+ "all_locations": "Tous les emplacements",+ "capabilities": {+ "digital": "Numérique",+ "pickup": "Retrait",+ "ships": "Expédition"+ },+ "create_description": "Regroupez les produits expédiés de la même façon, avec leurs propres emplacements, zones et méthodes de livraison.",+ "create_label": "Créer le profil",+ "default_badge": "Par défaut",+ "default_confirm": {+ "message": "Les produits sans profil propre seront désormais expédiés avec « {{name}} ».",+ "title": "Définir comme profil par défaut"+ },+ "delete_confirm": {+ "message": "Supprimer « {{name}} » ? Ses zones et méthodes de livraison seront supprimées avec lui.",+ "title": "Supprimer le profil d’expédition"+ },+ "detail": {+ "add_digital_method": "Ajouter une méthode numérique",+ "add_method": "Ajouter une méthode",+ "collect_from": "Retrait depuis",+ "collect_from_hint": "Emplacements où les clients peuvent retirer leur commande. Les modifications prennent effet immédiatement.",+ "delete_label": "Supprimer le profil",+ "digital_empty": "Aucune méthode de livraison numérique.",+ "digital_hint": "Livré sans expédition ni retrait.",+ "digital_title": "Livraison numérique",+ "general_title": "Général",+ "hidden_badge": "Masquée",+ "load_failed_title": "Impossible de charger ce profil d’expédition",+ "no_methods": "Aucune méthode de livraison ici pour le moment.",+ "no_stock_locations": "Aucun emplacement — ajoutez-en un dans Paramètres → Emplacements.",+ "no_zone_hint": "Ces méthodes sont proposées partout où ce profil s’applique.",+ "no_zone_title": "Aucune restriction de zone",+ "no_zones": "Aucune zone pour le moment — ajoutez-en une pour proposer des méthodes de livraison.",+ "offer_pickup": "Proposer le retrait",+ "origins_title": "Expédié depuis",+ "pickup_empty": "Aucune méthode de retrait — les clients ne peuvent pas retirer de commandes sur ce profil.",+ "pickup_hint": "Les clients retirent ces commandes en personne. Le retrait n’a pas de destination, les zones ne s’appliquent donc pas.",+ "pickup_title": "Retrait",+ "zones_title": "Zones et méthodes de livraison"+ },+ "empty": "Aucun profil de livraison pour le moment.",+ "is_default_hint": "Les produits sans profil propre sont expédiés avec celui-ci.",+ "kind_immutable_hint": "Le type est fixé à la création du profil.",+ "kinds": {+ "digital": "Numérique",+ "shipping": "Expédition"+ },+ "locations_count": "{{count}} emplacements",+ "make_default": "Définir par défaut",+ "messages": {+ "created": "Profil d’expédition créé",+ "deleted": "Profil d’expédition supprimé",+ "updated": "Profil d’expédition mis à jour"+ },+ "search_placeholder": "Rechercher des profils de livraison…",+ "selected_locations": "Emplacements sélectionnés"+ },"gift_cards": {"batch_autocomplete": {"empty": "Aucun lot correspondant",@@ -1418,6 +1558,50 @@},"wizard_title": "Import"},+ "integrations": {+ "active_toggle": {+ "help": "L'activation vérifie la connexion et rend l'intégration disponible pour les fournisseurs.",+ "label": "Active"+ },+ "configure_cta": "Configurer",+ "connect_cta": "Connecter",+ "connect_description": "Saisissez les identifiants de ce fournisseur. L'enregistrement les stocke ; l'activation vérifie la connexion.",+ "description": "Connectez des services fournisseurs à cette boutique. Les identifiants sont stockés par boutique et utilisés par les fournisseurs de livraison, de taxes et autres.",+ "disconnect": "Déconnecter",+ "disconnect_confirm": {+ "message": "Déconnecter {{name}} ? Ses identifiants stockés seront supprimés et les fournisseurs qui les utilisent cesseront de fonctionner.",+ "title": "Déconnecter l'intégration"+ },+ "edit_description": "Modifiez les identifiants ou l'activation. Les valeurs secrètes sont masquées ; laissez-les inchangées pour conserver le secret stocké.",+ "empty": {+ "description": "Les intégrations sont fournies par les extensions. Installez une gem fournisseur et ses intégrations apparaîtront ici.",+ "title": "Aucune intégration installée"+ },+ "groups": {+ "other": "Autres",+ "shipping": "Livraison",+ "tax": "Taxes"+ },+ "messages": {+ "connected": "Intégration connectée",+ "disconnected": "Intégration déconnectée",+ "updated": "Intégration mise à jour"+ },+ "status": {+ "active": "Active",+ "connected_inactive": "Connectée (inactive)",+ "not_connected": "Non connectée"+ },+ "test": {+ "failure": "Échec de la connexion.",+ "label": "Connexion",+ "run": "Tester la connexion",+ "success": "Connexion réussie.",+ "testing": "Test en cours…"+ },+ "title": "Intégrations",+ "view_cta": "Voir"+ },"invitation": {"accepting": "Acceptation…","could_not_accept": "Impossible d'accepter l'invitation",@@ -2360,11 +2544,11 @@"search_placeholder": "Rechercher des emplacements de stock…"},"store": {+ "default_package_description": "Le carton habituel d'expédition. Les transporteurs ajoutent son poids à chaque colis et utilisent ses dimensions pour le poids volumétrique.","subtitle": "Configuration générale et valeurs par défaut à l'échelle de la boutique.",+ "tab_default_package": "Colis par défaut","tab_general": "Général","tab_standards": "Normes et formats",- "tab_default_package": "Colis par défaut",- "default_package_description": "Le carton habituel d'expédition. Les transporteurs ajoutent son poids à chaque colis et utilisent ses dimensions pour le poids volumétrique.","tab_storefront_access": "Accès à la vitrine","title": "Paramètres de la boutique"},@@ -2681,6 +2865,8 @@},"create_description": "Regroupez les produits et définissez leurs modes de livraison.","create_label": "Créer le type de produit",+ "custom_delivery_profile": "Personnalisé",+ "default_delivery_profile": "Profil par défaut de la boutique","delete_confirm": {"message": "Voulez-vous vraiment supprimer « {{name}} » ? Les types encore utilisés par des produits ne peuvent pas être supprimés.","title": "Supprimer le type de produit"@@ -2823,6 +3009,11 @@},"variants": {"add_option": "Ajouter une option",+ "bulk_edit": {+ "grid_aria": "Tableau d'édition groupée des variantes",+ "title": "Modifier les variantes en masse",+ "trigger": "Édition groupée"+ },"create_option_type": "Créer un nouveau type d'option","create_option_type_title": "Nouveau type d'option","create_value": "Nouvelle valeur",@@ -2847,12 +3038,7 @@"tax_category_placeholder": "Hériter du produit"},"title": "Variantes",- "variant_label": "Variante",- "bulk_edit": {- "trigger": "Édition groupée",- "title": "Modifier les variantes en masse",- "grid_aria": "Tableau d'édition groupée des variantes"- }+ "variant_label": "Variante"}},"promotions": {@@ -3202,12 +3388,11 @@"allowed_origins": "Origines autorisées","api_keys": "Clés API","channels": "Canaux de vente",- "integrations": "Intégrations","custom_field_definitions": "Champs personnalisés",- "delivery_methods": "Méthodes de livraison",- "delivery_zones": "Zones de livraison",+ "delivery_profiles": "Profils de livraison","emails": "E-mails","imports": "Imports",+ "integrations": "Intégrations","markets": "Marchés","payment_methods": "Modes de paiement","product_types": "Types de produit",@@ -3384,50 +3569,6 @@"saved": "Traductions enregistrées","source": "Source","title": "Traductions"- },- "integrations": {- "title": "Intégrations",- "description": "Connectez des services fournisseurs à cette boutique. Les identifiants sont stockés par boutique et utilisés par les fournisseurs de livraison, de taxes et autres.",- "empty": {- "title": "Aucune intégration installée",- "description": "Les intégrations sont fournies par les extensions. Installez une gem fournisseur et ses intégrations apparaîtront ici."- },- "status": {- "active": "Active",- "connected_inactive": "Connectée (inactive)",- "not_connected": "Non connectée"- },- "connect_cta": "Connecter",- "configure_cta": "Configurer",- "view_cta": "Voir",- "connect_description": "Saisissez les identifiants de ce fournisseur. L'enregistrement les stocke ; l'activation vérifie la connexion.",- "edit_description": "Modifiez les identifiants ou l'activation. Les valeurs secrètes sont masquées ; laissez-les inchangées pour conserver le secret stocké.",- "active_toggle": {- "label": "Active",- "help": "L'activation vérifie la connexion et rend l'intégration disponible pour les fournisseurs."- },- "test": {- "label": "Connexion",- "run": "Tester la connexion",- "testing": "Test en cours…",- "success": "Connexion réussie.",- "failure": "Échec de la connexion."- },- "disconnect": "Déconnecter",- "disconnect_confirm": {- "title": "Déconnecter l'intégration",- "message": "Déconnecter {{name}} ? Ses identifiants stockés seront supprimés et les fournisseurs qui les utilisent cesseront de fonctionner."- },- "messages": {- "connected": "Intégration connectée",- "updated": "Intégration mise à jour",- "disconnected": "Intégration déconnectée"- },- "groups": {- "shipping": "Livraison",- "tax": "Taxes",- "other": "Autres"- }}}}diff --git a/packages/dashboard/src/locales/pl.json b/packages/dashboard/src/locales/pl.jsonindex 3592ad6970..601511726e 100644--- a/packages/dashboard/src/locales/pl.json+++ b/packages/dashboard/src/locales/pl.json@@ -476,54 +476,92 @@}},"delivery_methods": {- "add_cta": "Dodaj metodę dostawy","add_sheet_title": "Nowa metoda dostawy",+ "cards": {+ "general": "Ogólne",+ "pricing": "Ceny",+ "providers": "Dostawcy",+ "zone": "Strefa"+ },+ "carrier_services": {+ "add_service": "Dodaj usługę",+ "all_hint": "Oferowane są wszystkie usługi zwracane przez przewoźnika, z nazwami przewoźnika.",+ "carrier": "Przewoźnik",+ "catalog_unavailable": "Nie udało się pobrać usług tego przewoźnika ({{message}}). Wpisz identyfikatory przewoźnika i usługi ręcznie albo zostaw puste, aby oferować wszystko, co wycenia przewoźnik.",+ "choose_specific": "Wybierz konkretne usługi",+ "edit_service": "Edytuj {{service}}",+ "label": "Usługi przewoźnika",+ "narrowed_hint": "Oferowane są tylko wybrane usługi ({{count}}).",+ "offer_all": "Oferuj wszystkie usługi",+ "service": "Usługa"+ },+ "collection_locations": {+ "all": "Wszystkie lokalizacje z odbiorem",+ "none_enabled": "Żadna lokalizacja nie obsługuje odbioru — włącz jedną w profilu dostawy.",+ "specific": "Wybrane lokalizacje",+ "title": "Lokalizacje odbioru"+ },"conditions": {"add": "Dodaj warunek",- "empty": "Brak warunków — metoda jest oferowana, gdy pasują jej strefy.",+ "empty": "Brak warunków — ta metoda jest oferowana wszędzie tam, gdzie obowiązuje.","title": "Warunki"},- "create_description": "Skonfiguruj, jak zamówienia trafiają do klientów: wysyłka, dostawa cyfrowa lub odbiór.",+ "connect_provider_hint": "{{name}} może podawać stawki przewoźników na żywo — połącz, aby włączyć.","create_label": "Utwórz metodę dostawy","delete_confirm": {"message": "Usunąć „{{name}}”? Sklepy natychmiast przestaną ją oferować.","title": "Usuń metodę dostawy"},- "edit_description": "Zaktualizuj konfigurację tej metody dostawy.",+ "detail": {},"edit_sheet_title": "Edytuj metodę dostawy",- "empty": "Brak metod dostawy.",- "fulfillment_types": {- "digital": "Cyfrowa",- "local_delivery": "Dostawa lokalna",- "pickup": "Odbiór",- "pickup_point": "Punkt odbioru",- "shipping": "Wysyłka"- },+ "free": "Za darmo","messages": {"created": "Utworzono metodę dostawy","deleted": "Usunięto metodę dostawy","updated": "Zaktualizowano metodę dostawy"},- "no_zones_hint": "Brak stref dostawy — metoda obowiązuje wszędzie.",- "pickup_locations_hint": "Brak wyboru oznacza, że oferowane są wszystkie lokalizacje z włączonym odbiorem.",- "search_placeholder": "Szukaj metod dostawy…",- "connect_provider_hint": "{{name}} może podawać stawki przewoźników na żywo — połącz, aby włączyć.",- "carrier_services": {- "label": "Usługi przewoźnika",- "all_hint": "Oferowane są wszystkie usługi zwracane przez przewoźnika, z nazwami przewoźnika.",- "narrowed_hint": "Oferowane są tylko wybrane usługi ({{count}}).",- "add_service": "Dodaj usługę",- "carrier": "Przewoźnik",- "service": "Usługa",- "custom_label": "Własna etykieta dla {{service}}",- "catalog_unavailable": "Nie udało się pobrać usług tego przewoźnika ({{message}}). Wpisz identyfikatory przewoźnika i usługi ręcznie albo zostaw puste, aby oferować wszystko, co wycenia przewoźnik."+ "no_zone_restriction": "Bez ograniczeń",+ "pricing": {+ "amount_in_currency": "Kwota w {{currency}}",+ "currency_amounts_help": "Waluty bez kwoty nie mają oferowanej tej metody dostawy."+ },+ "provider_needs_connection": "Połącz {{name}}, aby użyć",+ "rule_summary": {+ "separator": " · ",+ "total_between": "{{min}}–{{max}}",+ "total_max": "Poniżej {{max}}",+ "total_min": "Od {{min}}",+ "weight_between": "{{min}}–{{max}} {{unit}}",+ "weight_max": "Poniżej {{max}} {{unit}}",+ "weight_min": "Od {{min}} {{unit}}"+ }+ },+ "delivery_origin_groups": {+ "delete_confirm": {+ "message": "Usunąć „{{name}}”? Najpierw przenieś jej strefy i metody do innej grupy.",+ "title": "Usuń grupę miejsc wysyłki"},- "provider_needs_connection": "Połącz {{name}}, aby użyć"+ "edit_description": "Zmień nazwę tej grupy lub to, z których lokalizacji wysyła.",+ "edit_title": "Edytuj grupę miejsc wysyłki",+ "messages": {+ "created": "Grupa miejsc wysyłki utworzona",+ "deleted": "Grupa miejsc wysyłki usunięta",+ "updated": "Grupa miejsc wysyłki zaktualizowana"+ },+ "no_locations_hint": "Wybierz co najmniej jedną lokalizację lub zaznacz wszystkie lokalizacje.",+ "ships_from": "Wysyłka z: {{locations}}",+ "ships_from_all": "Wysyłka ze wszystkich lokalizacji",+ "ships_from_label": "Wysyłka z",+ "split_cta": "Podziel miejsca wysyłki",+ "split_description": "Wysyłaj te same produkty z drugiego magazynu z własnymi strefami i stawkami.",+ "split_title": "Podziel miejsca wysyłki"},"delivery_zones": {+ "add_countries_in_markets": "Dodaj więcej krajów w sekcji Rynki","add_cta": "Dodaj strefę dostawy",- "add_member": "Dodaj członka",+ "add_postal_rule": "Dodaj regułę","add_sheet_title": "Nowa strefa dostawy",+ "all_states": "Wszystkie regiony","create_description": "Pogrupuj kraje, regiony lub kody pocztowe w obszar obsługiwany przez metody dostawy.","create_label": "Utwórz strefę dostawy","delete_confirm": {@@ -532,26 +570,40 @@},"edit_description": "Poniżsi członkowie zastąpią przy zapisie pełną listę strefy.","edit_sheet_title": "Edytuj strefę dostawy",- "empty": "Brak stref dostawy.","from_placeholder": "Od",- "member_types": {- "country": "Kraj",- "postal_code": "Kod pocztowy",- "state": "Region"- },- "members_column": "Członkowie",- "members_count": "{{count}} członków",+ "in_another_zone": "W innej strefie",+ "member_separator": ", ",+ "members_more_few": "jeszcze {{count}}",+ "members_more_many": "jeszcze {{count}}",+ "members_more_one": "jeszcze {{count}}",+ "members_more_other": "jeszcze {{count}}","messages": {"created": "Utworzono strefę dostawy","deleted": "Usunięto strefę dostawy","updated": "Zaktualizowano strefę dostawy"},- "no_members_hint": "Brak członków — dodaj kraje, regiony lub reguły kodów pocztowych.",+ "no_postal_rules_hint": "Brak reguł kodów pocztowych.",+ "no_regions_found": "Żaden kraj nie pasuje do wyszukiwania.",+ "no_states": "Ten kraj nie ma regionów.",+ "not_in_any_market": "Poza wszystkimi rynkami",+ "postal_rules_count_few": "{{count}} reguły",+ "postal_rules_count_many": "{{count}} reguł",+ "postal_rules_count_one": "{{count}} reguła",+ "postal_rules_count_other": "{{count}} reguły",+ "postal_rules_title": "Reguły kodów pocztowych","prefix_placeholder": "Prefiks",- "search_placeholder": "Szukaj stref dostawy…",+ "region_search_placeholder": "Szukaj krajów i regionów do wysyłki",+ "regions_title": "Kraje i regiony",+ "remove_postal_rule": "Usuń regułę","select_country": "Wybierz kraj",- "state_placeholder": "Kod lub nazwa regionu",- "to_placeholder": "Do"+ "selection_summary": "Kraje: {{countries}}, regiony: {{states}}, reguły kodów pocztowych: {{rules}}",+ "states_selected_few": "{{count}} regiony",+ "states_selected_many": "{{count}} regionów",+ "states_selected_one": "{{count}} region",+ "states_selected_other": "{{count}} regionu",+ "states_summary": "{{selected}} z {{total}} regionów",+ "to_placeholder": "Do",+ "toggle_states": "Pokaż regiony kraju {{country}}"},"errors": {"forbidden_description": "Nie masz uprawnień do wyświetlenia tej strony.",@@ -600,6 +652,13 @@"help": "Dokładnie jeden kanał na sklep jest domyślny. Używany jako rozwiązanie zastępcze, gdy nie wybrano żadnego kanału, oraz jako cel automatycznej publikacji nowych produktów.","label": "Kanał domyślny"},+ "fulfillment_locations": {+ "all": "Wszystkie lokalizacje",+ "help": "Które magazyny i punkty odbioru realizują zamówienia z tego kanału sprzedaży.",+ "label": "Lokalizacje realizacji",+ "none_selected_hint": "Wybierz co najmniej jedną lokalizację lub opcję „Wszystkie lokalizacje”.",+ "selected": "Wybrane lokalizacje"+ },"guest_checkout": {"help": "Czy klienci mogą składać zamówienia bez konta w tym kanale. Pozostaw puste, aby dziedziczyć ustawienie sklepu.","inherit": "Dziedzicz ze sklepu",@@ -719,22 +778,27 @@"code": {"label": "Kod"},- "delivery_zones": {- "label": "Strefy dostawy"+ "delivery_zone": {+ "help": "Gdzie ta metoda jest oferowana. Bez strefy obowiązuje wszędzie, gdzie sięga profil.",+ "label": "Strefa dostawy"},"fulfillment_provider": {"help": "Jak realizacje tej metody są przetwarzane i śledzone.","label": "Dostawca realizacji"},- "fulfillment_type": {- "label": "Typ realizacji"+ "markup_flat": {+ "label": "Narzut (kwotowy)"+ },+ "markup_percent": {+ "help": "Opłata manipulacyjna doliczana do stawek przewoźnika. Wartości per usługa nadpisują te domyślne.",+ "label": "Narzut %"},"rate_provider": {- "label": "Dostawca stawek",- "help": "Skąd pochodzą ceny tej metody. Wbudowany dostawca liczy według kalkulatora poniżej; dostawcy przewoźników podają stawki na żywo."+ "help": "Skąd pochodzą ceny tej metody. Wbudowany dostawca liczy według kalkulatora poniżej; dostawcy przewoźników podają stawki na żywo.",+ "label": "Dostawca stawek"},- "pickup_locations": {- "label": "Punkty odbioru"+ "service_label": {+ "label": "Własna etykieta"},"storefront_visible": {"help": "Klienci mogą wybrać tę metodę przy kasie."@@ -750,16 +814,33 @@},"transit_days_min": {"label": "Dni dostawy (min)"+ }+ },+ "delivery_origin_group": {+ "name": {+ "help": "Pozostaw puste, aby nazwać tę grupę „Wszystkie lokalizacje”.",+ "label": "Nazwa"+ }+ },+ "delivery_profile": {+ "capabilities": {+ "label": "Możliwości"},- "markup_percent": {- "label": "Narzut %",- "help": "Opłata manipulacyjna doliczana do stawek przewoźnika. Wartości per usługa nadpisują te domyślne."+ "kind": {+ "help": "Decyduje, z których dostawców realizacji mogą korzystać metody tego profilu.",+ "label": "Rodzaj"},- "markup_flat": {- "label": "Narzut (kwotowy)"+ "methods_count": {+ "label": "Metody"},- "service_label": {- "label": "Własna etykieta"+ "origins": {+ "label": "Wysyłka z"+ },+ "products_count": {+ "label": "Produkty"+ },+ "zones_count": {+ "label": "Strefy"}},"gift_card": {@@ -992,6 +1073,10 @@"discontinue_on": {"label": "Wycofaj z dniem"},+ "delivery_profile_id": {+ "help": "Decyduje, które strefy i metody dostawy obejmują ten produkt.",+ "label": "Profil wysyłki"+ },"make_active_at": {"label": "Aktywuj o"},@@ -1029,9 +1114,9 @@"label": "Pola niestandardowe","required": "Wymagane"},- "fulfillment_types": {- "help": "Jak produkty tego typu mogą być dostarczane — wysyłka, odbiór w sklepie, punkt odbioru lub cyfrowo.",- "label": "Sposoby realizacji"+ "delivery_profile_id": {+ "help": "Przypisywany produktom tworzonym z tym typem. Istniejące produkty pozostają bez zmian.",+ "label": "Szablon profilu wysyłki"},"name": {"placeholder": "np. T-Shirt"@@ -1196,6 +1281,17 @@"label": "Język panelu administracyjnego","placeholder": "Użyj języka domyślnego"},+ "preferred_default_package_dimensions": {+ "height": "Wysokość",+ "help": "Karton, w którym zwykle wysyłasz, używany przez przewoźników do wyceny wagi wymiarowej — cale dla systemu imperialnego, centymetry dla metrycznego. Działa dopiero po podaniu wszystkich trzech.",+ "label": "Domyślne wymiary paczki",+ "length": "Długość",+ "width": "Szerokość"+ },+ "preferred_default_package_weight": {+ "help": "Waga opakowania (karton i wypełnienie) dodawana do zawartości każdej paczki przy wyliczaniu stawek dostawy. 0 wyłącza.",+ "label": "Domyślna waga paczki"+ },"preferred_send_consumer_transactional_emails": {"help": "Gdy wyłączone, nie są wysyłane żadne wiadomości z potwierdzeniem zamówienia, wysyłki ani zwrotu.","label": "Wysyłaj wiadomości transakcyjne do klientów"@@ -1210,17 +1306,6 @@"preferred_weight_unit": {"label": "Jednostka wagi"},- "preferred_default_package_weight": {- "label": "Domyślna waga paczki",- "help": "Waga opakowania (karton i wypełnienie) dodawana do zawartości każdej paczki przy wyliczaniu stawek dostawy. 0 wyłącza."- },- "preferred_default_package_dimensions": {- "label": "Domyślne wymiary paczki",- "length": "Długość",- "width": "Szerokość",- "height": "Wysokość",- "help": "Karton, w którym zwykle wysyłasz, używany przez przewoźników do wyceny wagi wymiarowej — cale dla systemu imperialnego, centymetry dla metrycznego. Działa dopiero po podaniu wszystkich trzech."- },"storefront_access": {"help": "Domyślne ustawienie dla całego sklepu określające, co widzą anonimowi odwiedzający. Kanały mogą je nadpisać. Gdy ceny są ukryte, goście muszą się zalogować, aby sfinalizować zakup.","label": "Dostęp do sklepu",@@ -1329,6 +1414,67 @@}}},+ "delivery_profiles": {+ "add_cta": "Dodaj profil",+ "add_dialog_title": "Nowy profil dostawy",+ "all_locations": "Wszystkie lokalizacje",+ "capabilities": {+ "digital": "Cyfrowa",+ "pickup": "Odbiór",+ "ships": "Wysyłka"+ },+ "create_description": "Zgrupuj produkty wysyłane w ten sam sposób, z własnymi lokalizacjami, strefami i metodami dostawy.",+ "create_label": "Utwórz profil",+ "default_badge": "Domyślny",+ "default_confirm": {+ "message": "Produkty bez własnego profilu będą wysyłane według profilu „{{name}}”.",+ "title": "Ustaw jako profil domyślny"+ },+ "delete_confirm": {+ "message": "Usunąć „{{name}}”? Jego strefy i metody dostawy zostaną usunięte razem z nim.",+ "title": "Usuń profil wysyłki"+ },+ "detail": {+ "add_digital_method": "Dodaj metodę cyfrową",+ "add_method": "Dodaj metodę",+ "collect_from": "Odbiór z",+ "collect_from_hint": "Lokalizacje, z których klienci mogą odbierać zamówienia. Zmiany działają natychmiast.",+ "delete_label": "Usuń profil",+ "digital_empty": "Brak metody dostawy cyfrowej.",+ "digital_hint": "Dostarczane bez wysyłki i odbioru.",+ "digital_title": "Dostawa cyfrowa",+ "general_title": "Ogólne",+ "hidden_badge": "Ukryta",+ "load_failed_title": "Nie udało się wczytać tego profilu wysyłki",+ "no_methods": "Brak metod dostawy w tym miejscu.",+ "no_stock_locations": "Brak lokalizacji — dodaj jedną w Ustawienia → Lokalizacje.",+ "no_zone_hint": "Te metody są oferowane wszędzie, gdzie sięga ten profil.",+ "no_zone_title": "Bez ograniczenia strefy",+ "no_zones": "Brak stref — dodaj jedną, aby oferować metody dostawy.",+ "offer_pickup": "Zaoferuj odbiór",+ "origins_title": "Wysyłka z",+ "pickup_empty": "Brak metody odbioru — klienci nie mogą odbierać zamówień w tym profilu.",+ "pickup_hint": "Klienci odbierają te zamówienia osobiście. Odbiór nie ma miejsca docelowego, więc strefy nie mają zastosowania.",+ "pickup_title": "Odbiór osobisty",+ "zones_title": "Strefy i metody dostawy"+ },+ "empty": "Brak profili dostawy.",+ "is_default_hint": "Produkty bez własnego profilu są wysyłane według tego profilu.",+ "kind_immutable_hint": "Rodzaj jest ustalany przy tworzeniu profilu.",+ "kinds": {+ "digital": "Cyfrowa",+ "shipping": "Wysyłka"+ },+ "locations_count": "Lokalizacje: {{count}}",+ "make_default": "Ustaw jako domyślny",+ "messages": {+ "created": "Utworzono profil wysyłki",+ "deleted": "Usunięto profil wysyłki",+ "updated": "Zaktualizowano profil wysyłki"+ },+ "search_placeholder": "Szukaj profili dostawy…",+ "selected_locations": "Wybrane lokalizacje"+ },"gift_cards": {"batch_autocomplete": {"empty": "Brak pasujących partii",@@ -1426,6 +1572,50 @@},"wizard_title": "Import"},+ "integrations": {+ "active_toggle": {+ "help": "Aktywacja weryfikuje połączenie i udostępnia integrację dostawcom.",+ "label": "Aktywna"+ },+ "configure_cta": "Konfiguruj",+ "connect_cta": "Połącz",+ "connect_description": "Wprowadź dane dostępowe tego dostawcy. Zapis je przechowuje; aktywacja weryfikuje połączenie.",+ "description": "Połącz usługi dostawców z tym sklepem. Dane dostępowe są przechowywane per sklep i używane przez dostawców dostaw, podatków i innych.",+ "disconnect": "Rozłącz",+ "disconnect_confirm": {+ "message": "Rozłączyć {{name}}? Zapisane dane dostępowe zostaną usunięte, a korzystający z nich dostawcy przestaną działać.",+ "title": "Rozłącz integrację"+ },+ "edit_description": "Zmień dane dostępowe lub aktywację. Wartości tajne są maskowane; pozostaw je bez zmian, aby zachować zapisany sekret.",+ "empty": {+ "description": "Integracje pochodzą z rozszerzeń dostawców. Zainstaluj gem dostawcy, a jego integracje pojawią się tutaj.",+ "title": "Brak zainstalowanych integracji"+ },+ "groups": {+ "other": "Inne",+ "shipping": "Dostawa",+ "tax": "Podatki"+ },+ "messages": {+ "connected": "Integracja połączona",+ "disconnected": "Integracja rozłączona",+ "updated": "Integracja zaktualizowana"+ },+ "status": {+ "active": "Aktywna",+ "connected_inactive": "Połączona (nieaktywna)",+ "not_connected": "Niepołączona"+ },+ "test": {+ "failure": "Połączenie nieudane.",+ "label": "Połączenie",+ "run": "Testuj połączenie",+ "success": "Połączenie udane.",+ "testing": "Testowanie…"+ },+ "title": "Integracje",+ "view_cta": "Zobacz"+ },"invitation": {"accepting": "Akceptowanie…","could_not_accept": "Nie udało się zaakceptować zaproszenia",@@ -2386,11 +2576,11 @@"search_placeholder": "Szukaj lokalizacji magazynowych…"},"store": {+ "default_package_description": "Karton, w którym zwykle wysyłasz. Dostawcy stawek przewoźników dodają jego wagę do każdej paczki i używają wymiarów do wyceny wagi wymiarowej.","subtitle": "Ogólna konfiguracja i domyślne ustawienia dla całego sklepu.",+ "tab_default_package": "Domyślna paczka","tab_general": "Ogólne","tab_standards": "Standardy i formaty",- "tab_default_package": "Domyślna paczka",- "default_package_description": "Karton, w którym zwykle wysyłasz. Dostawcy stawek przewoźników dodają jego wagę do każdej paczki i używają wymiarów do wyceny wagi wymiarowej.","tab_storefront_access": "Dostęp do sklepu","title": "Ustawienia sklepu"},@@ -2717,6 +2907,8 @@},"create_description": "Grupuj produkty i określ, jak mogą być dostarczane.","create_label": "Utwórz typ produktu",+ "custom_delivery_profile": "Własny",+ "default_delivery_profile": "Domyślny profil sklepu","delete_confirm": {"message": "Czy na pewno usunąć „{{name}}”? Typów używanych przez produkty nie można usunąć.","title": "Usuń typ produktu"@@ -2863,6 +3055,11 @@},"variants": {"add_option": "Dodaj opcję",+ "bulk_edit": {+ "grid_aria": "Arkusz zbiorczej edycji wariantów",+ "title": "Edytuj warianty zbiorczo",+ "trigger": "Edycja zbiorcza"+ },"create_option_type": "Utwórz nowy typ opcji","create_option_type_title": "Nowy typ opcji","create_value": "Nowa wartość",@@ -2889,12 +3086,7 @@"tax_category_placeholder": "Dziedzicz z produktu"},"title": "Warianty",- "variant_label": "Wariant",- "bulk_edit": {- "trigger": "Edycja zbiorcza",- "title": "Edytuj warianty zbiorczo",- "grid_aria": "Arkusz zbiorczej edycji wariantów"- }+ "variant_label": "Wariant"}},"promotions": {@@ -3244,12 +3436,11 @@"allowed_origins": "Dozwolone źródła","api_keys": "Klucze API","channels": "Kanały sprzedaży",- "integrations": "Integracje","custom_field_definitions": "Pola niestandardowe",- "delivery_methods": "Metody dostawy",- "delivery_zones": "Strefy dostawy",+ "delivery_profiles": "Profile dostawy","emails": "Wiadomości e-mail","imports": "Importy",+ "integrations": "Integracje","markets": "Rynki","payment_methods": "Metody płatności","product_types": "Typy produktów",@@ -3426,50 +3617,6 @@"saved": "Tłumaczenia zapisane","source": "Źródło","title": "Tłumaczenia"- },- "integrations": {- "title": "Integracje",- "description": "Połącz usługi dostawców z tym sklepem. Dane dostępowe są przechowywane per sklep i używane przez dostawców dostaw, podatków i innych.",- "empty": {- "title": "Brak zainstalowanych integracji",- "description": "Integracje pochodzą z rozszerzeń dostawców. Zainstaluj gem dostawcy, a jego integracje pojawią się tutaj."- },- "status": {- "active": "Aktywna",- "connected_inactive": "Połączona (nieaktywna)",- "not_connected": "Niepołączona"- },- "connect_cta": "Połącz",- "configure_cta": "Konfiguruj",- "view_cta": "Zobacz",- "connect_description": "Wprowadź dane dostępowe tego dostawcy. Zapis je przechowuje; aktywacja weryfikuje połączenie.",- "edit_description": "Zmień dane dostępowe lub aktywację. Wartości tajne są maskowane; pozostaw je bez zmian, aby zachować zapisany sekret.",- "active_toggle": {- "label": "Aktywna",- "help": "Aktywacja weryfikuje połączenie i udostępnia integrację dostawcom."- },- "test": {- "label": "Połączenie",- "run": "Testuj połączenie",- "testing": "Testowanie…",- "success": "Połączenie udane.",- "failure": "Połączenie nieudane."- },- "disconnect": "Rozłącz",- "disconnect_confirm": {- "title": "Rozłącz integrację",- "message": "Rozłączyć {{name}}? Zapisane dane dostępowe zostaną usunięte, a korzystający z nich dostawcy przestaną działać."- },- "messages": {- "connected": "Integracja połączona",- "updated": "Integracja zaktualizowana",- "disconnected": "Integracja rozłączona"- },- "groups": {- "shipping": "Dostawa",- "tax": "Podatki",- "other": "Inne"- }}}}diff --git a/packages/dashboard/src/locales/zh-CN.json b/packages/dashboard/src/locales/zh-CN.jsonindex ead45bff32..60bdcb68c7 100644--- a/packages/dashboard/src/locales/zh-CN.json+++ b/packages/dashboard/src/locales/zh-CN.json@@ -468,54 +468,92 @@}},"delivery_methods": {- "add_cta": "添加配送方式","add_sheet_title": "新建配送方式",+ "cards": {+ "general": "基本信息",+ "pricing": "价格",+ "providers": "服务商",+ "zone": "区域"+ },+ "carrier_services": {+ "add_service": "添加服务",+ "all_hint": "提供承运商返回的所有服务,名称由承运商提供。",+ "carrier": "承运商",+ "catalog_unavailable": "无法获取该承运商的服务列表({{message}})。请手动填写承运商与服务标识,或留空以提供承运商报价的全部服务。",+ "choose_specific": "选择特定服务",+ "edit_service": "编辑 {{service}}",+ "label": "承运商服务",+ "narrowed_hint": "仅提供所选的 {{count}} 项服务。",+ "offer_all": "提供全部服务",+ "service": "服务"+ },+ "collection_locations": {+ "all": "所有已开启自提的地点",+ "none_enabled": "尚无地点支持自提,请在配送方案中启用一个地点。",+ "specific": "指定地点",+ "title": "自提地点"+ },"conditions": {"add": "添加条件",- "empty": "无条件——只要区域匹配即提供该方式。",+ "empty": "无条件 — 此配送方式在其适用范围内始终提供。","title": "条件"},- "create_description": "配置订单送达客户的方式:物流、数字交付或自提。",+ "connect_provider_hint": "{{name}} 可提供实时承运商运费 — 连接后即可启用。","create_label": "创建配送方式","delete_confirm": {"message": "删除“{{name}}”?店面将立即停止提供该方式。","title": "删除配送方式"},- "edit_description": "更新该配送方式的配置。",+ "detail": {},"edit_sheet_title": "编辑配送方式",- "empty": "暂无配送方式。",- "fulfillment_types": {- "digital": "数字",- "local_delivery": "同城配送",- "pickup": "自提",- "pickup_point": "自提点",- "shipping": "物流"- },+ "free": "免费","messages": {"created": "配送方式已创建","deleted": "配送方式已删除","updated": "配送方式已更新"},- "no_zones_hint": "尚未定义配送区域——该方式适用于所有地区。",- "pickup_locations_hint": "未选择时,将提供所有启用自提的库存地点。",- "search_placeholder": "搜索配送方式…",- "connect_provider_hint": "{{name}} 可提供实时承运商运费 — 连接后即可启用。",- "carrier_services": {- "label": "承运商服务",- "all_hint": "提供承运商返回的所有服务,名称由承运商提供。",- "narrowed_hint": "仅提供所选的 {{count}} 项服务。",- "add_service": "添加服务",- "carrier": "承运商",- "service": "服务",- "custom_label": "{{service}} 的自定义名称",- "catalog_unavailable": "无法获取该承运商的服务列表({{message}})。请手动填写承运商与服务标识,或留空以提供承运商报价的全部服务。"+ "no_zone_restriction": "不限制",+ "pricing": {+ "amount_in_currency": "{{currency}} 金额",+ "currency_amounts_help": "未填写金额的币种将不会提供该配送方式。"},- "provider_needs_connection": "连接 {{name}} 后即可使用"+ "provider_needs_connection": "连接 {{name}} 后即可使用",+ "rule_summary": {+ "separator": " · ",+ "total_between": "{{min}}–{{max}}",+ "total_max": "低于 {{max}}",+ "total_min": "{{min}} 及以上",+ "weight_between": "{{min}}–{{max}} {{unit}}",+ "weight_max": "低于 {{max}} {{unit}}",+ "weight_min": "{{min}} {{unit}} 及以上"+ }+ },+ "delivery_origin_groups": {+ "delete_confirm": {+ "message": "确定删除“{{name}}”?请先将其区域和配送方式移至其他分组。",+ "title": "删除发货地分组"+ },+ "edit_description": "重命名该分组,或更改其发货的库存地点。",+ "edit_title": "编辑发货地分组",+ "messages": {+ "created": "发货地分组已创建",+ "deleted": "发货地分组已删除",+ "updated": "发货地分组已更新"+ },+ "no_locations_hint": "请至少选择一个地点,或选择所有地点。",+ "ships_from": "发货地:{{locations}}",+ "ships_from_all": "从所有地点发货",+ "ships_from_label": "发货地",+ "split_cta": "拆分发货地",+ "split_description": "从第二个仓库发运相同的商品,并为其设置独立的区域和费率。",+ "split_title": "拆分发货地"},"delivery_zones": {+ "add_countries_in_markets": "在“市场”中添加更多国家","add_cta": "添加配送区域",- "add_member": "添加成员",+ "add_postal_rule": "添加规则","add_sheet_title": "新建配送区域",+ "all_states": "全部省/州","create_description": "将国家、省份或邮编组合为配送服务区域。","create_label": "创建配送区域","delete_confirm": {@@ -524,26 +562,31 @@},"edit_description": "保存时下方成员将替换该区域的全部成员。","edit_sheet_title": "编辑配送区域",- "empty": "暂无配送区域。","from_placeholder": "起",- "member_types": {- "country": "国家",- "postal_code": "邮政编码",- "state": "省/州"- },- "members_column": "成员",- "members_count": "{{count}} 个成员",+ "in_another_zone": "已属于其他区域",+ "member_separator": "、",+ "members_more_other": "另外 {{count}} 个","messages": {"created": "配送区域已创建","deleted": "配送区域已删除","updated": "配送区域已更新"},- "no_members_hint": "暂无成员——请添加国家、省份或邮编规则。",+ "no_postal_rules_hint": "暂无邮政编码规则。",+ "no_regions_found": "没有符合搜索条件的国家。",+ "no_states": "该国家没有省/州。",+ "not_in_any_market": "不属于任何市场",+ "postal_rules_count_other": "{{count}} 条规则",+ "postal_rules_title": "邮政编码规则","prefix_placeholder": "前缀",- "search_placeholder": "搜索配送区域…",+ "region_search_placeholder": "搜索要配送的国家和地区",+ "regions_title": "国家和地区",+ "remove_postal_rule": "删除规则","select_country": "选择国家",- "state_placeholder": "省份代码或名称",- "to_placeholder": "止"+ "selection_summary": "{{countries}} 个国家、{{states}} 个省/州、{{rules}} 条邮政编码规则",+ "states_selected_other": "{{count}} 个省/州",+ "states_summary": "{{total}} 个省/州中已选 {{selected}} 个",+ "to_placeholder": "止",+ "toggle_states": "显示 {{country}} 的省/州"},"errors": {"forbidden_description": "您没有权限查看此页面。",@@ -592,6 +635,13 @@"help": "每个商店有且仅有一个默认渠道。在未选择渠道时用作回退,并作为新产品的自动发布目标。","label": "默认渠道"},+ "fulfillment_locations": {+ "all": "所有地点",+ "help": "哪些仓库和自提点负责履行此销售渠道的订单。",+ "label": "履约地点",+ "none_selected_hint": "请至少选择一个地点,或选择“所有地点”。",+ "selected": "选定地点"+ },"guest_checkout": {"help": "顾客是否可以在此渠道中无需账户即可结账。留空则继承店铺设置。","inherit": "继承店铺设置",@@ -711,22 +761,27 @@"code": {"label": "代码"},- "delivery_zones": {+ "delivery_zone": {+ "help": "此配送方式的适用范围。不设区域时,在配置方案覆盖的所有地区均可用。","label": "配送区域"},"fulfillment_provider": {"help": "此配送方式的履约如何发运与跟踪。","label": "履约服务商"},- "fulfillment_type": {- "label": "履约类型"+ "markup_flat": {+ "label": "加价(固定)"+ },+ "markup_percent": {+ "help": "在承运商运费基础上加收的手续费。按服务设置的值会覆盖这些默认值。",+ "label": "加价 %"},"rate_provider": {- "label": "费率提供方",- "help": "此方式的价格来源。内置提供方使用下方的计算器;承运商提供方提供实时费率。"+ "help": "此方式的价格来源。内置提供方使用下方的计算器;承运商提供方提供实时费率。",+ "label": "费率提供方"},- "pickup_locations": {- "label": "自提地点"+ "service_label": {+ "label": "自定义名称"},"storefront_visible": {"help": "客户可在结账时选择该方式。"@@ -742,16 +797,33 @@},"transit_days_min": {"label": "运输天数(最少)"+ }+ },+ "delivery_origin_group": {+ "name": {+ "help": "留空则该分组显示为“所有地点”。",+ "label": "名称"+ }+ },+ "delivery_profile": {+ "capabilities": {+ "label": "能力"},- "markup_percent": {- "label": "加价 %",- "help": "在承运商运费基础上加收的手续费。按服务设置的值会覆盖这些默认值。"+ "kind": {+ "help": "决定此配置方案的配送方式可以使用哪些履约服务商。",+ "label": "类型"},- "markup_flat": {- "label": "加价(固定)"+ "methods_count": {+ "label": "配送方式"},- "service_label": {- "label": "自定义名称"+ "origins": {+ "label": "发货地点"+ },+ "products_count": {+ "label": "商品"+ },+ "zones_count": {+ "label": "区域"}},"gift_card": {@@ -984,6 +1056,10 @@"discontinue_on": {"label": "下架日期"},+ "delivery_profile_id": {+ "help": "决定哪些区域和配送方式适用于该商品。",+ "label": "配送配置方案"+ },"make_active_at": {"label": "激活日期"},@@ -1021,9 +1097,9 @@"label": "自定义字段","required": "必填"},- "fulfillment_types": {- "help": "此类型商品的交付方式 — 配送、到店自提、自提点或数字交付。",- "label": "履约方式"+ "delivery_profile_id": {+ "help": "应用于以此类型创建的商品。修改它不会影响已有商品。",+ "label": "配送配置方案模板"},"name": {"placeholder": "例如:T恤"@@ -1188,6 +1264,17 @@"label": "后台语言","placeholder": "使用默认语言"},+ "preferred_default_package_dimensions": {+ "height": "高",+ "help": "常用的发货纸箱尺寸,承运商费率提供方据此计算体积重量——英制为英寸,公制为厘米。三项都填写后才生效。",+ "label": "默认包裹尺寸",+ "length": "长",+ "width": "宽"+ },+ "preferred_default_package_weight": {+ "help": "计算配送费率时加到每个包裹内容上的包装重量(纸箱与填充物)。设为 0 可停用。",+ "label": "默认包裹重量"+ },"preferred_send_consumer_transactional_emails": {"help": "关闭后,将不会发送订单确认、发货或退款邮件。","label": "向客户发送交易类邮件"@@ -1202,17 +1289,6 @@"preferred_weight_unit": {"label": "重量单位"},- "preferred_default_package_weight": {- "label": "默认包裹重量",- "help": "计算配送费率时加到每个包裹内容上的包装重量(纸箱与填充物)。设为 0 可停用。"- },- "preferred_default_package_dimensions": {- "label": "默认包裹尺寸",- "length": "长",- "width": "宽",- "height": "高",- "help": "常用的发货纸箱尺寸,承运商费率提供方据此计算体积重量——英制为英寸,公制为厘米。三项都填写后才生效。"- },"storefront_access": {"help": "店铺范围内的默认设置,控制匿名访客可以看到的内容。渠道可以覆盖此设置。隐藏价格时,访客须登录后才能结账。","label": "店铺访问权限",@@ -1321,6 +1397,67 @@}}},+ "delivery_profiles": {+ "add_cta": "添加配置方案",+ "add_dialog_title": "新建配送方案",+ "all_locations": "所有地点",+ "capabilities": {+ "digital": "数字交付",+ "pickup": "自提",+ "ships": "配送"+ },+ "create_description": "将配送方式相同的商品归为一组,并为其设置独立的发货地点、区域和配送方式。",+ "create_label": "创建配置方案",+ "default_badge": "默认",+ "default_confirm": {+ "message": "未单独指定配置方案的商品今后将使用“{{name}}”配送。",+ "title": "设为默认配置方案"+ },+ "delete_confirm": {+ "message": "确定删除“{{name}}”吗?其区域和配送方式将一并删除。",+ "title": "删除配送配置方案"+ },+ "detail": {+ "add_digital_method": "添加数字交付方式",+ "add_method": "添加配送方式",+ "collect_from": "自提地点",+ "collect_from_hint": "顾客可以前往自提的地点。更改立即生效。",+ "delete_label": "删除配置方案",+ "digital_empty": "尚无数字交付方式。",+ "digital_hint": "无需配送或自提即可交付。",+ "digital_title": "数字交付",+ "general_title": "基本信息",+ "hidden_badge": "已隐藏",+ "load_failed_title": "无法加载此配送配置方案",+ "no_methods": "此处暂无配送方式。",+ "no_stock_locations": "尚无地点,请在“设置 → 地点”中添加。",+ "no_zone_hint": "这些配送方式在此配置方案覆盖的所有地区均可用。",+ "no_zone_title": "不限区域",+ "no_zones": "暂无区域 — 添加一个即可开始提供配送方式。",+ "offer_pickup": "提供自提",+ "origins_title": "发货地点",+ "pickup_empty": "尚无自提方式,顾客无法在此方案中自提订单。",+ "pickup_hint": "顾客亲自领取这些订单。自提没有配送目的地,因此不适用区域。",+ "pickup_title": "到店自提",+ "zones_title": "区域与配送方式"+ },+ "empty": "尚无配送方案。",+ "is_default_hint": "未单独指定配置方案的商品将使用此方案配送。",+ "kind_immutable_hint": "类型在创建配置方案时确定,之后不可更改。",+ "kinds": {+ "digital": "数字交付",+ "shipping": "实物配送"+ },+ "locations_count": "{{count}} 个地点",+ "make_default": "设为默认",+ "messages": {+ "created": "配送配置方案已创建",+ "deleted": "配送配置方案已删除",+ "updated": "配送配置方案已更新"+ },+ "search_placeholder": "搜索配送方案…",+ "selected_locations": "选定地点"+ },"gift_cards": {"batch_autocomplete": {"empty": "无匹配的批次",@@ -1418,6 +1555,50 @@},"wizard_title": "导入"},+ "integrations": {+ "active_toggle": {+ "help": "启用会验证连接,并使该集成可供提供方使用。",+ "label": "启用"+ },+ "configure_cta": "配置",+ "connect_cta": "连接",+ "connect_description": "输入此提供方的凭据。保存即存储;启用时会验证连接。",+ "description": "将服务提供方连接到此商店。凭据按商店存储,供配送、税务及其他提供方使用。",+ "disconnect": "断开连接",+ "disconnect_confirm": {+ "message": "断开 {{name}}?其存储的凭据将被删除,使用它的提供方将停止工作。",+ "title": "断开集成"+ },+ "edit_description": "更新凭据或启用状态。机密值已被遮盖;保持不变即可保留已存储的机密。",+ "empty": {+ "description": "集成随提供方扩展一起提供。安装提供方 gem 后,其集成将显示在此处。",+ "title": "未安装任何集成"+ },+ "groups": {+ "other": "其他",+ "shipping": "配送",+ "tax": "税务"+ },+ "messages": {+ "connected": "集成已连接",+ "disconnected": "集成已断开",+ "updated": "集成已更新"+ },+ "status": {+ "active": "已启用",+ "connected_inactive": "已连接(未启用)",+ "not_connected": "未连接"+ },+ "test": {+ "failure": "连接失败。",+ "label": "连接",+ "run": "测试连接",+ "success": "连接成功。",+ "testing": "正在测试…"+ },+ "title": "集成",+ "view_cta": "查看"+ },"invitation": {"accepting": "正在接受…","could_not_accept": "无法接受邀请",@@ -2360,11 +2541,11 @@"search_placeholder": "搜索库存位置…"},"store": {+ "default_package_description": "常用的发货纸箱。承运商费率提供方会将其重量加到每个包裹上,并使用其尺寸计算体积重量。","subtitle": "通用配置与店铺级默认设置。",+ "tab_default_package": "默认包裹","tab_general": "通用","tab_standards": "标准与格式",- "tab_default_package": "默认包裹",- "default_package_description": "常用的发货纸箱。承运商费率提供方会将其重量加到每个包裹上,并使用其尺寸计算体积重量。","tab_storefront_access": "店铺访问权限","title": "店铺设置"},@@ -2681,6 +2862,8 @@},"create_description": "将商品分组并定义其交付方式。","create_label": "创建商品类型",+ "custom_delivery_profile": "自定义",+ "default_delivery_profile": "店铺默认配置方案","delete_confirm": {"message": "确定要删除“{{name}}”吗?仍被商品使用的类型无法删除。","title": "删除商品类型"@@ -2823,6 +3006,11 @@},"variants": {"add_option": "添加选项",+ "bulk_edit": {+ "grid_aria": "变体批量编辑表格",+ "title": "批量编辑变体",+ "trigger": "批量编辑"+ },"create_option_type": "新建选项类型","create_option_type_title": "新选项类型","create_value": "新值",@@ -2847,12 +3035,7 @@"tax_category_placeholder": "继承自商品"},"title": "变体",- "variant_label": "变体",- "bulk_edit": {- "trigger": "批量编辑",- "title": "批量编辑变体",- "grid_aria": "变体批量编辑表格"- }+ "variant_label": "变体"}},"promotions": {@@ -3202,12 +3385,11 @@"allowed_origins": "允许的来源","api_keys": "API 密钥","channels": "销售渠道",- "integrations": "集成","custom_field_definitions": "自定义字段",- "delivery_methods": "配送方式",- "delivery_zones": "配送区域",+ "delivery_profiles": "配送方案","emails": "邮件","imports": "导入",+ "integrations": "集成","markets": "市场","payment_methods": "支付方式","product_types": "商品类型",@@ -3384,50 +3566,6 @@"saved": "翻译已保存","source": "源","title": "翻译"- },- "integrations": {- "title": "集成",- "description": "将服务提供方连接到此商店。凭据按商店存储,供配送、税务及其他提供方使用。",- "empty": {- "title": "未安装任何集成",- "description": "集成随提供方扩展一起提供。安装提供方 gem 后,其集成将显示在此处。"- },- "status": {- "active": "已启用",- "connected_inactive": "已连接(未启用)",- "not_connected": "未连接"- },- "connect_cta": "连接",- "configure_cta": "配置",- "view_cta": "查看",- "connect_description": "输入此提供方的凭据。保存即存储;启用时会验证连接。",- "edit_description": "更新凭据或启用状态。机密值已被遮盖;保持不变即可保留已存储的机密。",- "active_toggle": {- "label": "启用",- "help": "启用会验证连接,并使该集成可供提供方使用。"- },- "test": {- "label": "连接",- "run": "测试连接",- "testing": "正在测试…",- "success": "连接成功。",- "failure": "连接失败。"- },- "disconnect": "断开连接",- "disconnect_confirm": {- "title": "断开集成",- "message": "断开 {{name}}?其存储的凭据将被删除,使用它的提供方将停止工作。"- },- "messages": {- "connected": "集成已连接",- "updated": "集成已更新",- "disconnected": "集成已断开"- },- "groups": {- "shipping": "配送",- "tax": "税务",- "other": "其他"- }}}}diff --git a/packages/dashboard/src/nav/settings.ts b/packages/dashboard/src/nav/settings.tsindex 025c020998..5216507e5a 100644--- a/packages/dashboard/src/nav/settings.ts+++ b/packages/dashboard/src/nav/settings.ts@@ -5,7 +5,6 @@ import {GlobeLockIcon,KeyRoundIcon,MailIcon,- MapIcon,PercentIcon,PlugIcon,RadioTowerIcon,@@ -114,23 +113,13 @@ settingsNav.add({})settingsNav.add({- key: 'settings.delivery-methods',- labelKey: 'admin.settings_nav.items.delivery_methods',- path: '/delivery-methods',+ key: 'settings.delivery-profiles',+ labelKey: 'admin.settings_nav.items.delivery_profiles',+ path: '/delivery-profiles',icon: TruckIcon,group: 'fulfillment',position: 80,- subject: Subject.DeliveryMethod,-})--settingsNav.add({- key: 'settings.delivery-zones',- labelKey: 'admin.settings_nav.items.delivery_zones',- path: '/delivery-zones',- icon: MapIcon,- group: 'fulfillment',- position: 90,- subject: Subject.DeliveryZone,+ subject: Subject.DeliveryProfile,})settingsNav.add({diff --git a/packages/dashboard/src/routeTree.gen.ts b/packages/dashboard/src/routeTree.gen.tsindex 534e8ff751..a72318e050 100644--- a/packages/dashboard/src/routeTree.gen.ts+++ b/packages/dashboard/src/routeTree.gen.ts@@ -39,8 +39,6 @@ import { Route as SettingsPaymentMethodsRouteImport } from './routes/_authenticaimport { Route as SettingsMarketsRouteImport } from './routes/_authenticated/$storeId/settings/markets'import { Route as SettingsIntegrationsRouteImport } from './routes/_authenticated/$storeId/settings/integrations'import { Route as SettingsEmailsRouteImport } from './routes/_authenticated/$storeId/settings/emails'-import { Route as SettingsDeliveryZonesRouteImport } from './routes/_authenticated/$storeId/settings/delivery-zones'-import { Route as SettingsDeliveryMethodsRouteImport } from './routes/_authenticated/$storeId/settings/delivery-methods'import { Route as SettingsCustomFieldDefinitionsRouteImport } from './routes/_authenticated/$storeId/settings/custom-field-definitions'import { Route as SettingsChannelsRouteImport } from './routes/_authenticated/$storeId/settings/channels'import { Route as SettingsApiKeysRouteImport } from './routes/_authenticated/$storeId/settings/api-keys'@@ -59,6 +57,7 @@ import { Route as CustomersGroupsRouteImport } from './routes/_authenticated/$stimport { Route as CustomersCustomerIdRouteImport } from './routes/_authenticated/$storeId/customers/$customerId'import { Route as SettingsWebhooksIndexRouteImport } from './routes/_authenticated/$storeId/settings/webhooks/index'import { Route as SettingsImportsIndexRouteImport } from './routes/_authenticated/$storeId/settings/imports/index'+import { Route as SettingsDeliveryProfilesIndexRouteImport } from './routes/_authenticated/$storeId/settings/delivery-profiles/index'import { Route as ProductsPriceListsIndexRouteImport } from './routes/_authenticated/$storeId/products/price-lists/index'import { Route as ProductsCollectionsIndexRouteImport } from './routes/_authenticated/$storeId/products/collections/index'import { Route as ProductsCategoriesIndexRouteImport } from './routes/_authenticated/$storeId/products/categories/index'@@ -68,7 +67,10 @@ import { Route as ProductsCollectionsNewRouteImport } from './routes/_authenticaimport { Route as ProductsCollectionsCollectionIdRouteImport } from './routes/_authenticated/$storeId/products/collections/$collectionId'import { Route as ProductsCategoriesNewRouteImport } from './routes/_authenticated/$storeId/products/categories/new'import { Route as ProductsCategoriesCategoryIdRouteImport } from './routes/_authenticated/$storeId/products/categories/$categoryId'+import { Route as SettingsDeliveryProfilesProfileIdIndexRouteImport } from './routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/index'import { Route as ProductsPriceListsPriceListIdIndexRouteImport } from './routes/_authenticated/$storeId/products/price-lists/$priceListId/index'+import { Route as SettingsDeliveryProfilesProfileIdMethodsNewRouteImport } from './routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new'+import { Route as SettingsDeliveryProfilesProfileIdMethodsMethodIdRouteImport } from './routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'const resetPasswordRoute = resetPasswordRouteImport.update({id: '/reset-password',@@ -220,16 +222,6 @@ const SettingsEmailsRoute = SettingsEmailsRouteImport.update({path: '/emails',getParentRoute: () => SettingsRoute,} as any)-const SettingsDeliveryZonesRoute = SettingsDeliveryZonesRouteImport.update({- id: '/delivery-zones',- path: '/delivery-zones',- getParentRoute: () => SettingsRoute,-} as any)-const SettingsDeliveryMethodsRoute = SettingsDeliveryMethodsRouteImport.update({- id: '/delivery-methods',- path: '/delivery-methods',- getParentRoute: () => SettingsRoute,-} as any)const SettingsCustomFieldDefinitionsRoute =SettingsCustomFieldDefinitionsRouteImport.update({id: '/custom-field-definitions',@@ -321,6 +313,12 @@ const SettingsImportsIndexRoute = SettingsImportsIndexRouteImport.update({path: '/imports/',getParentRoute: () => SettingsRoute,} as any)+const SettingsDeliveryProfilesIndexRoute =+ SettingsDeliveryProfilesIndexRouteImport.update({+ id: '/delivery-profiles/',+ path: '/delivery-profiles/',+ getParentRoute: () => SettingsRoute,+ } as any)const ProductsPriceListsIndexRoute = ProductsPriceListsIndexRouteImport.update({id: '/products/price-lists/',path: '/products/price-lists/',@@ -370,12 +368,30 @@ const ProductsCategoriesCategoryIdRoute =path: '/products/categories/$categoryId',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const SettingsDeliveryProfilesProfileIdIndexRoute =+ SettingsDeliveryProfilesProfileIdIndexRouteImport.update({+ id: '/delivery-profiles/$profileId/',+ path: '/delivery-profiles/$profileId/',+ getParentRoute: () => SettingsRoute,+ } as any)const ProductsPriceListsPriceListIdIndexRoute =ProductsPriceListsPriceListIdIndexRouteImport.update({id: '/products/price-lists/$priceListId/',path: '/products/price-lists/$priceListId/',getParentRoute: () => authenticatedStoreIdRoute,} as any)+const SettingsDeliveryProfilesProfileIdMethodsNewRoute =+ SettingsDeliveryProfilesProfileIdMethodsNewRouteImport.update({+ id: '/delivery-profiles/$profileId/methods/new',+ path: '/delivery-profiles/$profileId/methods/new',+ getParentRoute: () => SettingsRoute,+ } as any)+const SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute =+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRouteImport.update({+ id: '/delivery-profiles/$profileId/methods/$methodId',+ path: '/delivery-profiles/$profileId/methods/$methodId',+ getParentRoute: () => SettingsRoute,+ } as any)export interface FileRoutesByFullPath {'/': typeof authenticatedIndexRoute@@ -407,8 +423,6 @@ export interface FileRoutesByFullPath {'/$storeId/settings/api-keys': typeof SettingsApiKeysRoute'/$storeId/settings/channels': typeof SettingsChannelsRoute'/$storeId/settings/custom-field-definitions': typeof SettingsCustomFieldDefinitionsRoute- '/$storeId/settings/delivery-methods': typeof SettingsDeliveryMethodsRoute- '/$storeId/settings/delivery-zones': typeof SettingsDeliveryZonesRoute'/$storeId/settings/emails': typeof SettingsEmailsRoute'/$storeId/settings/integrations': typeof SettingsIntegrationsRoute'/$storeId/settings/markets': typeof SettingsMarketsRoute@@ -434,9 +448,13 @@ export interface FileRoutesByFullPath {'/$storeId/products/categories/': typeof ProductsCategoriesIndexRoute'/$storeId/products/collections/': typeof ProductsCollectionsIndexRoute'/$storeId/products/price-lists/': typeof ProductsPriceListsIndexRoute+ '/$storeId/settings/delivery-profiles/': typeof SettingsDeliveryProfilesIndexRoute'/$storeId/settings/imports/': typeof SettingsImportsIndexRoute'/$storeId/settings/webhooks/': typeof SettingsWebhooksIndexRoute'/$storeId/products/price-lists/$priceListId/': typeof ProductsPriceListsPriceListIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId/': typeof SettingsDeliveryProfilesProfileIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/new': typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}export interface FileRoutesByTo {'/forgot-password': typeof forgotPasswordRoute@@ -466,8 +484,6 @@ export interface FileRoutesByTo {'/$storeId/settings/api-keys': typeof SettingsApiKeysRoute'/$storeId/settings/channels': typeof SettingsChannelsRoute'/$storeId/settings/custom-field-definitions': typeof SettingsCustomFieldDefinitionsRoute- '/$storeId/settings/delivery-methods': typeof SettingsDeliveryMethodsRoute- '/$storeId/settings/delivery-zones': typeof SettingsDeliveryZonesRoute'/$storeId/settings/emails': typeof SettingsEmailsRoute'/$storeId/settings/integrations': typeof SettingsIntegrationsRoute'/$storeId/settings/markets': typeof SettingsMarketsRoute@@ -493,9 +509,13 @@ export interface FileRoutesByTo {'/$storeId/products/categories': typeof ProductsCategoriesIndexRoute'/$storeId/products/collections': typeof ProductsCollectionsIndexRoute'/$storeId/products/price-lists': typeof ProductsPriceListsIndexRoute+ '/$storeId/settings/delivery-profiles': typeof SettingsDeliveryProfilesIndexRoute'/$storeId/settings/imports': typeof SettingsImportsIndexRoute'/$storeId/settings/webhooks': typeof SettingsWebhooksIndexRoute'/$storeId/products/price-lists/$priceListId': typeof ProductsPriceListsPriceListIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId': typeof SettingsDeliveryProfilesProfileIdIndexRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ '/$storeId/settings/delivery-profiles/$profileId/methods/new': typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}export interface FileRoutesById {__root__: typeof rootRouteImport@@ -529,8 +549,6 @@ export interface FileRoutesById {'/_authenticated/$storeId/settings/api-keys': typeof SettingsApiKeysRoute'/_authenticated/$storeId/settings/channels': typeof SettingsChannelsRoute'/_authenticated/$storeId/settings/custom-field-definitions': typeof SettingsCustomFieldDefinitionsRoute- '/_authenticated/$storeId/settings/delivery-methods': typeof SettingsDeliveryMethodsRoute- '/_authenticated/$storeId/settings/delivery-zones': typeof SettingsDeliveryZonesRoute'/_authenticated/$storeId/settings/emails': typeof SettingsEmailsRoute'/_authenticated/$storeId/settings/integrations': typeof SettingsIntegrationsRoute'/_authenticated/$storeId/settings/markets': typeof SettingsMarketsRoute@@ -556,9 +574,13 @@ export interface FileRoutesById {'/_authenticated/$storeId/products/categories/': typeof ProductsCategoriesIndexRoute'/_authenticated/$storeId/products/collections/': typeof ProductsCollectionsIndexRoute'/_authenticated/$storeId/products/price-lists/': typeof ProductsPriceListsIndexRoute+ '/_authenticated/$storeId/settings/delivery-profiles/': typeof SettingsDeliveryProfilesIndexRoute'/_authenticated/$storeId/settings/imports/': typeof SettingsImportsIndexRoute'/_authenticated/$storeId/settings/webhooks/': typeof SettingsWebhooksIndexRoute'/_authenticated/$storeId/products/price-lists/$priceListId/': typeof ProductsPriceListsPriceListIdIndexRoute+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/': typeof SettingsDeliveryProfilesProfileIdIndexRoute+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new': typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}export interface FileRouteTypes {fileRoutesByFullPath: FileRoutesByFullPath@@ -592,8 +614,6 @@ export interface FileRouteTypes {| '/$storeId/settings/api-keys'| '/$storeId/settings/channels'| '/$storeId/settings/custom-field-definitions'- | '/$storeId/settings/delivery-methods'- | '/$storeId/settings/delivery-zones'| '/$storeId/settings/emails'| '/$storeId/settings/integrations'| '/$storeId/settings/markets'@@ -619,9 +639,13 @@ export interface FileRouteTypes {| '/$storeId/products/categories/'| '/$storeId/products/collections/'| '/$storeId/products/price-lists/'+ | '/$storeId/settings/delivery-profiles/'| '/$storeId/settings/imports/'| '/$storeId/settings/webhooks/'| '/$storeId/products/price-lists/$priceListId/'+ | '/$storeId/settings/delivery-profiles/$profileId/'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/new'fileRoutesByTo: FileRoutesByToto:| '/forgot-password'@@ -651,8 +675,6 @@ export interface FileRouteTypes {| '/$storeId/settings/api-keys'| '/$storeId/settings/channels'| '/$storeId/settings/custom-field-definitions'- | '/$storeId/settings/delivery-methods'- | '/$storeId/settings/delivery-zones'| '/$storeId/settings/emails'| '/$storeId/settings/integrations'| '/$storeId/settings/markets'@@ -678,9 +700,13 @@ export interface FileRouteTypes {| '/$storeId/products/categories'| '/$storeId/products/collections'| '/$storeId/products/price-lists'+ | '/$storeId/settings/delivery-profiles'| '/$storeId/settings/imports'| '/$storeId/settings/webhooks'| '/$storeId/products/price-lists/$priceListId'+ | '/$storeId/settings/delivery-profiles/$profileId'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ | '/$storeId/settings/delivery-profiles/$profileId/methods/new'id:| '__root__'| '/_authenticated'@@ -713,8 +739,6 @@ export interface FileRouteTypes {| '/_authenticated/$storeId/settings/api-keys'| '/_authenticated/$storeId/settings/channels'| '/_authenticated/$storeId/settings/custom-field-definitions'- | '/_authenticated/$storeId/settings/delivery-methods'- | '/_authenticated/$storeId/settings/delivery-zones'| '/_authenticated/$storeId/settings/emails'| '/_authenticated/$storeId/settings/integrations'| '/_authenticated/$storeId/settings/markets'@@ -740,9 +764,13 @@ export interface FileRouteTypes {| '/_authenticated/$storeId/products/categories/'| '/_authenticated/$storeId/products/collections/'| '/_authenticated/$storeId/products/price-lists/'+ | '/_authenticated/$storeId/settings/delivery-profiles/'| '/_authenticated/$storeId/settings/imports/'| '/_authenticated/$storeId/settings/webhooks/'| '/_authenticated/$storeId/products/price-lists/$priceListId/'+ | '/_authenticated/$storeId/settings/delivery-profiles/$profileId/'+ | '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ | '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new'fileRoutesById: FileRoutesById}export interface RootRouteChildren {@@ -965,20 +993,6 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof SettingsEmailsRouteImportparentRoute: typeof SettingsRoute}- '/_authenticated/$storeId/settings/delivery-zones': {- id: '/_authenticated/$storeId/settings/delivery-zones'- path: '/delivery-zones'- fullPath: '/$storeId/settings/delivery-zones'- preLoaderRoute: typeof SettingsDeliveryZonesRouteImport- parentRoute: typeof SettingsRoute- }- '/_authenticated/$storeId/settings/delivery-methods': {- id: '/_authenticated/$storeId/settings/delivery-methods'- path: '/delivery-methods'- fullPath: '/$storeId/settings/delivery-methods'- preLoaderRoute: typeof SettingsDeliveryMethodsRouteImport- parentRoute: typeof SettingsRoute- }'/_authenticated/$storeId/settings/custom-field-definitions': {id: '/_authenticated/$storeId/settings/custom-field-definitions'path: '/custom-field-definitions'@@ -1105,6 +1119,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof SettingsImportsIndexRouteImportparentRoute: typeof SettingsRoute}+ '/_authenticated/$storeId/settings/delivery-profiles/': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/'+ path: '/delivery-profiles'+ fullPath: '/$storeId/settings/delivery-profiles/'+ preLoaderRoute: typeof SettingsDeliveryProfilesIndexRouteImport+ parentRoute: typeof SettingsRoute+ }'/_authenticated/$storeId/products/price-lists/': {id: '/_authenticated/$storeId/products/price-lists/'path: '/products/price-lists'@@ -1168,6 +1189,13 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof ProductsCategoriesCategoryIdRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/$profileId/'+ path: '/delivery-profiles/$profileId'+ fullPath: '/$storeId/settings/delivery-profiles/$profileId/'+ preLoaderRoute: typeof SettingsDeliveryProfilesProfileIdIndexRouteImport+ parentRoute: typeof SettingsRoute+ }'/_authenticated/$storeId/products/price-lists/$priceListId/': {id: '/_authenticated/$storeId/products/price-lists/$priceListId/'path: '/products/price-lists/$priceListId'@@ -1175,6 +1203,20 @@ declare module '@tanstack/react-router' {preLoaderRoute: typeof ProductsPriceListsPriceListIdIndexRouteImportparentRoute: typeof authenticatedStoreIdRoute}+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new'+ path: '/delivery-profiles/$profileId/methods/new'+ fullPath: '/$storeId/settings/delivery-profiles/$profileId/methods/new'+ preLoaderRoute: typeof SettingsDeliveryProfilesProfileIdMethodsNewRouteImport+ parentRoute: typeof SettingsRoute+ }+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId': {+ id: '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ path: '/delivery-profiles/$profileId/methods/$methodId'+ fullPath: '/$storeId/settings/delivery-profiles/$profileId/methods/$methodId'+ preLoaderRoute: typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRouteImport+ parentRoute: typeof SettingsRoute+ }}}@@ -1183,8 +1225,6 @@ interface SettingsRouteChildren {SettingsApiKeysRoute: typeof SettingsApiKeysRouteSettingsChannelsRoute: typeof SettingsChannelsRouteSettingsCustomFieldDefinitionsRoute: typeof SettingsCustomFieldDefinitionsRoute- SettingsDeliveryMethodsRoute: typeof SettingsDeliveryMethodsRoute- SettingsDeliveryZonesRoute: typeof SettingsDeliveryZonesRouteSettingsEmailsRoute: typeof SettingsEmailsRouteSettingsIntegrationsRoute: typeof SettingsIntegrationsRouteSettingsMarketsRoute: typeof SettingsMarketsRoute@@ -1198,8 +1238,12 @@ interface SettingsRouteChildren {SettingsTaxCategoriesRoute: typeof SettingsTaxCategoriesRouteSettingsIndexRoute: typeof SettingsIndexRouteSettingsWebhooksWebhookEndpointIdRoute: typeof SettingsWebhooksWebhookEndpointIdRoute+ SettingsDeliveryProfilesIndexRoute: typeof SettingsDeliveryProfilesIndexRouteSettingsImportsIndexRoute: typeof SettingsImportsIndexRouteSettingsWebhooksIndexRoute: typeof SettingsWebhooksIndexRoute+ SettingsDeliveryProfilesProfileIdIndexRoute: typeof SettingsDeliveryProfilesProfileIdIndexRoute+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute: typeof SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute+ SettingsDeliveryProfilesProfileIdMethodsNewRoute: typeof SettingsDeliveryProfilesProfileIdMethodsNewRoute}const SettingsRouteChildren: SettingsRouteChildren = {@@ -1207,8 +1251,6 @@ const SettingsRouteChildren: SettingsRouteChildren = {SettingsApiKeysRoute: SettingsApiKeysRoute,SettingsChannelsRoute: SettingsChannelsRoute,SettingsCustomFieldDefinitionsRoute: SettingsCustomFieldDefinitionsRoute,- SettingsDeliveryMethodsRoute: SettingsDeliveryMethodsRoute,- SettingsDeliveryZonesRoute: SettingsDeliveryZonesRoute,SettingsEmailsRoute: SettingsEmailsRoute,SettingsIntegrationsRoute: SettingsIntegrationsRoute,SettingsMarketsRoute: SettingsMarketsRoute,@@ -1223,8 +1265,15 @@ const SettingsRouteChildren: SettingsRouteChildren = {SettingsIndexRoute: SettingsIndexRoute,SettingsWebhooksWebhookEndpointIdRoute:SettingsWebhooksWebhookEndpointIdRoute,+ SettingsDeliveryProfilesIndexRoute: SettingsDeliveryProfilesIndexRoute,SettingsImportsIndexRoute: SettingsImportsIndexRoute,SettingsWebhooksIndexRoute: SettingsWebhooksIndexRoute,+ SettingsDeliveryProfilesProfileIdIndexRoute:+ SettingsDeliveryProfilesProfileIdIndexRoute,+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute:+ SettingsDeliveryProfilesProfileIdMethodsMethodIdRoute,+ SettingsDeliveryProfilesProfileIdMethodsNewRoute:+ SettingsDeliveryProfilesProfileIdMethodsNewRoute,}const SettingsRouteWithChildren = SettingsRoute._addFileChildren(diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/products/$productId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/products/$productId.tsxindex 6002019645..7cdbb11844 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/products/$productId.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/products/$productId.tsx@@ -145,6 +145,7 @@ function productToFormValues(tags: product.tags ?? [],tax_category_id: product.tax_category_id ?? null,product_type_id: product.product_type_id ?? null,+ delivery_profile_id: product.delivery_profile_id ?? null,meta_title: product.meta_title ?? '',meta_description: product.meta_description ?? '',slug: product.slug ?? '',diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/channels.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/channels.tsxindex 155f03b6a0..90faa53b0b 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/channels.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/channels.tsx@@ -35,17 +35,19 @@ import {} from '@spree/dashboard-ui'import { createFileRoute, useNavigate } from '@tanstack/react-router'import { PlusIcon } from 'lucide-react'-import { useEffect } from 'react'+import { useEffect, useState } from 'react'import { Controller, type UseFormReturn, useForm } from 'react-hook-form'import { useTranslation } from 'react-i18next'import { z } from 'zod/v4'import { OrderRoutingRulesSection } from '../../../../components/spree/order-routing-rules-section'+import { StockLocationScopeField } from '../../../../components/spree/shipping/stock-location-scope-field'import {useChannel,useCreateChannel,useDeleteChannel,useUpdateChannel,} from '../../../../hooks/use-channels'+import { useStockLocations } from '../../../../hooks/use-stock-locations'import {CHANNEL_DEFAULTS,type ChannelFormValues,@@ -266,6 +268,7 @@ function EditChannelSheet({preferred_storefront_access: channel.preferred_storefront_access ?? '',preferred_guest_checkout:channel.preferred_guest_checkout == null ? '' : String(channel.preferred_guest_checkout),+ stock_location_ids: channel.stock_location_ids ?? [],})}}, [channel, form])@@ -478,6 +481,67 @@ function ChannelFormFields({ form }: { form: UseFormReturn<ChannelFormValues> })scope="admin.fields.channel.guest_checkout"values={GUEST_CHECKOUT_VALUES}/>++ <FulfillmentLocationsField form={form} /></FieldGroup>)}++/**+ * Which warehouses and counters fulfill this channel's orders. Narrowing is+ * the exception — a channel serves every location of the store until the+ * merchant says otherwise, which is how the API reads an empty array.+ */+function FulfillmentLocationsField({ form }: { form: UseFormReturn<ChannelFormValues> }) {+ const { t } = useTranslation()+ const { data: stockLocations } = useStockLocations()++ const selectedIds = form.watch('stock_location_ids') ?? []+ const locations = stockLocations?.data ?? []++ // The radio reads the field rather than holding a second source of truth, so+ // a saved channel reopens on the branch it was left in.+ const [scope, setScope] = useState<'all' | 'selected'>(+ selectedIds.length > 0 ? 'selected' : 'all',+ )+ useEffect(() => {+ if (selectedIds.length > 0) setScope('selected')+ }, [selectedIds.length])++ return (+ <>+ <Field>+ <FieldLabel>{t('admin.fields.channel.fulfillment_locations.label')}</FieldLabel>+ <span className="text-xs text-muted-foreground">+ {t('admin.fields.channel.fulfillment_locations.help')}+ </span>+ <Controller+ name="stock_location_ids"+ control={form.control}+ render={({ field }) => (+ <StockLocationScopeField+ idPrefix="channel-locations"+ scope={scope}+ onScopeChange={(next) => {+ setScope(next)+ if (next === 'all') field.onChange([])+ }}+ locations={locations}+ selectedIds={field.value ?? []}+ onSelectedIdsChange={field.onChange}+ allLabel={t('admin.fields.channel.fulfillment_locations.all')}+ selectedLabel={t('admin.fields.channel.fulfillment_locations.selected')}+ emptyLabel={t('admin.delivery_profiles.detail.no_stock_locations')}+ />+ )}+ />+ </Field>++ {scope === 'selected' && selectedIds.length === 0 && (+ <p className="text-muted-foreground text-xs">+ {t('admin.fields.channel.fulfillment_locations.none_selected_hint')}+ </p>+ )}+ </>+ )+}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-methods.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-methods.tsxdeleted file mode 100644index 0d751dc58c..0000000000--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-methods.tsx+++ /dev/null@@ -1,1249 +0,0 @@-import { zodResolver } from '@hookform/resolvers/zod'-import type {- DeliveryMethod,- DeliveryRateProviderCatalogEntry,- IntegrationTypeDefinition,- PreferenceField,- Product,-} from '@spree/admin-sdk'-import {- adminClient,- Can,- mapSpreeErrorsToForm,- PreferencesForm,- ResourceMultiAutocomplete,- ResourceTable,- resourceSearchSchema,- Subject,- usePermissions,- useResourceKey,-} from '@spree/dashboard-core'-import {- Button,- Checkbox,- DropdownMenu,- DropdownMenuContent,- DropdownMenuItem,- DropdownMenuTrigger,- Field,- FieldError,- FieldGroup,- FieldLabel,- Input,- RowActions,- Select,- SelectContent,- SelectItem,- SelectTrigger,- SelectValue,- Sheet,- SheetContent,- SheetDescription,- SheetFooter,- SheetHeader,- SheetTitle,- Switch,- useConfirm,- useRowClickBridge,-} from '@spree/dashboard-ui'-import { useQueryClient } from '@tanstack/react-query'-import { createFileRoute, useNavigate } from '@tanstack/react-router'-import { PlusIcon, Trash2Icon } from 'lucide-react'-import { useEffect, useMemo, useState } from 'react'-import { Controller, type UseFormReturn, useFieldArray, useForm } from 'react-hook-form'-import { useTranslation } from 'react-i18next'-import { z } from 'zod/v4'-import { ConfigureIntegrationSheet } from '../../../../components/spree/integrations/configure-integration-sheet'-import {- useCreateDeliveryMethod,- useDeleteDeliveryMethod,- useDeliveryCalculators,- useDeliveryMethod,- useDeliveryMethodRules,- useDeliveryMethodRuleTypes,- useDeliveryRateProviders,- useFulfillmentProviders,- useUpdateDeliveryMethod,-} from '../../../../hooks/use-delivery-methods'-import { useDeliveryZones } from '../../../../hooks/use-delivery-zones'-import { useIntegrations, useIntegrationTypes } from '../../../../hooks/use-integrations'-import { productAutocompleteProps } from '../../../../hooks/use-products'-import { useStockLocations } from '../../../../hooks/use-stock-locations'-import { useTaxCategories } from '../../../../hooks/use-tax-categories'-import {- DELIVERY_METHOD_DEFAULTS,- type DeliveryMethodFormValues,- deliveryMethodFormSchema,- deliveryMethodValuesToParams,- FULFILLMENT_TYPES,-} from '../../../../schemas/delivery-method'-import '../../../../tables/delivery-methods'--/** One entry from the delivery-method-rule discovery endpoint. */-type DeliveryMethodRuleType = Awaited<- ReturnType<typeof adminClient.deliveryMethods.ruleTypes>->['data'][number]--/** API decimals arrive as strings ("0.0"); show blank instead of a noisy zero. */-function decimalToForm(value: string | null | undefined) {- if (value === null || value === undefined || value === '') return ''- return Number(value) === 0 ? '' : String(value)-}--/** Whether a rule kind is configured with a product list rather than preferences. */-function takesProducts(ruleTypes: DeliveryMethodRuleType[] | undefined, type: string) {- return (- ruleTypes?.find((candidate) => candidate.type === type)?.association_fields ?? []- ).includes('product_ids')-}--const deliveryMethodsSearchSchema = resourceSearchSchema.extend({- edit: z.string().optional(),- new: z.coerce.boolean().optional(),-})--export const Route = createFileRoute('/_authenticated/$storeId/settings/delivery-methods')({- validateSearch: deliveryMethodsSearchSchema,- component: DeliveryMethodsPage,-})--function DeliveryMethodsPage() {- const { t } = useTranslation()- const search = Route.useSearch() as z.infer<typeof deliveryMethodsSearchSchema>- const navigate = useNavigate()- const confirm = useConfirm()- const deleteMutation = useDeleteDeliveryMethod()- const { permissions } = usePermissions()-- const editId = search.edit- const isCreating = !!search.new-- const closeSheet = () =>- navigate({- search: (prev: Record<string, unknown>) => {- const { edit: _e, new: _n, ...rest } = prev- return rest as never- },- })-- const openCreate = () =>- navigate({ search: (prev: Record<string, unknown>) => ({ ...prev, new: true }) as never })-- const openEdit = (id: string) =>- navigate({ search: (prev: Record<string, unknown>) => ({ ...prev, edit: id }) as never })-- useRowClickBridge('data-delivery-method-id', openEdit)-- async function handleDelete(deliveryMethod: DeliveryMethod) {- const ok = await confirm({- title: t('admin.delivery_methods.delete_confirm.title'),- message: t('admin.delivery_methods.delete_confirm.message', {- name: deliveryMethod.name ?? '',- }),- variant: 'destructive',- confirmLabel: t('admin.actions.delete'),- })- if (!ok) return- await deleteMutation.mutateAsync(deliveryMethod.id).catch(() => undefined)- }-- return (- <>- <ResourceTable<DeliveryMethod>- tableKey="delivery-methods"- queryKey="delivery-methods"- queryFn={(params) => adminClient.deliveryMethods.list(params)}- searchParams={search}- rowActions={(deliveryMethod) => (- <RowActions- actions={[- { key: 'edit', onSelect: () => openEdit(deliveryMethod.id) },- {- key: 'delete',- destructive: true,- visible: permissions.can('destroy', Subject.DeliveryMethod),- disabled: deleteMutation.isPending,- onSelect: () => handleDelete(deliveryMethod),- },- ]}- />- )}- actions={- <Can I="create" a={Subject.DeliveryMethod}>- <Button size="sm" className="h-[2.125rem]" onClick={openCreate}>- <PlusIcon className="size-4" />- {t('admin.delivery_methods.add_cta')}- </Button>- </Can>- }- />-- {isCreating && <CreateDeliveryMethodSheet open onOpenChange={(o) => !o && closeSheet()} />}- {editId && (- <EditDeliveryMethodSheet id={editId} open onOpenChange={(o) => !o && closeSheet()} />- )}- </>- )-}--function CreateDeliveryMethodSheet({- open,- onOpenChange,-}: {- open: boolean- onOpenChange: (open: boolean) => void-}) {- const { t } = useTranslation()- const createMutation = useCreateDeliveryMethod()- const form = useForm<DeliveryMethodFormValues>({- // eslint-disable-next-line @typescript-eslint/no-explicit-any- resolver: zodResolver(deliveryMethodFormSchema) as any,- defaultValues: DELIVERY_METHOD_DEFAULTS,- })-- async function onSubmit(values: DeliveryMethodFormValues) {- try {- await createMutation.mutateAsync(deliveryMethodValuesToParams(values))- form.reset(DELIVERY_METHOD_DEFAULTS)- onOpenChange(false)- } catch (err) {- if (!mapSpreeErrorsToForm(err, form.setError)) throw err- }- }-- return (- <Sheet- open={open}- onOpenChange={(next) => {- if (!next) form.reset(DELIVERY_METHOD_DEFAULTS)- onOpenChange(next)- }}- >- <SheetContent>- <SheetHeader>- <SheetTitle>{t('admin.delivery_methods.add_sheet_title')}</SheetTitle>- <SheetDescription>{t('admin.delivery_methods.create_description')}</SheetDescription>- </SheetHeader>- <form onSubmit={form.handleSubmit(onSubmit)} className="flex min-h-0 flex-1 flex-col">- <div className="flex min-h-0 flex-1 flex-col overflow-y-auto">- <div className="flex flex-col gap-4 p-4">- <DeliveryMethodFormFields form={form} />- </div>- <ConditionsSection form={form} />- </div>- <SheetFooter>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => onOpenChange(false)}- disabled={form.formState.isSubmitting}- >- {t('admin.actions.cancel')}- </Button>- <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>- {form.formState.isSubmitting- ? t('admin.actions.creating')- : t('admin.delivery_methods.create_label')}- </Button>- </SheetFooter>- </form>- </SheetContent>- </Sheet>- )-}--function EditDeliveryMethodSheet({- id,- open,- onOpenChange,-}: {- id: string- open: boolean- onOpenChange: (open: boolean) => void-}) {- const { t } = useTranslation()- const { data: deliveryMethod, isLoading: methodLoading } = useDeliveryMethod(id)- const { data: rules, isLoading: rulesLoading } = useDeliveryMethodRules(id)- const { data: ruleTypes, isLoading: ruleTypesLoading } = useDeliveryMethodRuleTypes()- const updateMutation = useUpdateDeliveryMethod(id)- // Saving sends the full rule set for reconciliation, so the form must not be- // reachable until the existing rules have loaded — otherwise a quick save- // would submit an empty set and delete them all. Rule types are needed too,- // since they decide which rules carry a product list.- const isLoading = methodLoading || rulesLoading || ruleTypesLoading-- const form = useForm<DeliveryMethodFormValues>({- // eslint-disable-next-line @typescript-eslint/no-explicit-any- resolver: zodResolver(deliveryMethodFormSchema) as any,- defaultValues: DELIVERY_METHOD_DEFAULTS,- })-- useEffect(() => {- // Wait for rules too — seeding the form before they arrive would reset- // again once they land, discarding anything already edited.- if (deliveryMethod && rules && ruleTypes) {- form.reset({- name: deliveryMethod.name,- admin_name: deliveryMethod.admin_name ?? '',- code: deliveryMethod.code ?? '',- fulfillment_type:- (deliveryMethod.fulfillment_type as DeliveryMethodFormValues['fulfillment_type']) ??- 'shipping',- fulfillment_provider:- deliveryMethod.fulfillment_provider ?? DELIVERY_METHOD_DEFAULTS.fulfillment_provider,- rate_provider: deliveryMethod.rate_provider ?? DELIVERY_METHOD_DEFAULTS.rate_provider,- storefront_visible: deliveryMethod.storefront_visible,- tracking_url: deliveryMethod.tracking_url ?? '',- estimated_transit_business_days_min:- deliveryMethod.estimated_transit_business_days_min?.toString() ?? '',- estimated_transit_business_days_max:- deliveryMethod.estimated_transit_business_days_max?.toString() ?? '',- tax_category_id: deliveryMethod.tax_category_id ?? '',- calculator_type: deliveryMethod.calculator_type ?? '',- calculator_preferences:- (deliveryMethod.calculator_preferences as Record<string, unknown>) ?? {},- delivery_zone_ids: deliveryMethod.delivery_zone_ids ?? [],- stock_location_ids: deliveryMethod.stock_location_ids ?? [],- markup_flat: decimalToForm(deliveryMethod.markup_flat),- markup_percent: decimalToForm(deliveryMethod.markup_percent),- services: (deliveryMethod.services ?? []).map((row) => ({- id: row.id,- carrier: row.carrier,- service: row.service,- label: row.label ?? '',- markup_flat: decimalToForm(row.markup_flat),- markup_percent: decimalToForm(row.markup_percent),- })),- rules: (rules?.data ?? []).map((rule) => ({- id: rule.id,- type: rule.type,- preferences: rule.preferences as Record<string, unknown>,- product_ids: rule.product_ids,- takes_products: takesProducts(ruleTypes?.data, rule.type),- })),- })- }- }, [deliveryMethod, rules, ruleTypes, form])-- async function onSubmit(values: DeliveryMethodFormValues) {- try {- await updateMutation.mutateAsync(deliveryMethodValuesToParams(values))- form.reset(values)- onOpenChange(false)- } catch (err) {- if (!mapSpreeErrorsToForm(err, form.setError)) throw err- }- }-- return (- <Sheet open={open} onOpenChange={onOpenChange}>- <SheetContent>- <SheetHeader>- <SheetTitle>- {deliveryMethod?.name ?? t('admin.delivery_methods.edit_sheet_title')}- </SheetTitle>- <SheetDescription>{t('admin.delivery_methods.edit_description')}</SheetDescription>- </SheetHeader>- {isLoading ? (- <div className="p-4 text-sm text-muted-foreground">{t('admin.common.loading')}</div>- ) : (- <form onSubmit={form.handleSubmit(onSubmit)} className="flex min-h-0 flex-1 flex-col">- <div className="flex min-h-0 flex-1 flex-col overflow-y-auto">- <div className="flex flex-col gap-4 p-4">- <DeliveryMethodFormFields form={form} />- </div>- <ConditionsSection form={form} />- </div>- <SheetFooter>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => onOpenChange(false)}- disabled={form.formState.isSubmitting}- >- {t('admin.actions.cancel')}- </Button>- <Button- type="submit"- size="sm"- disabled={form.formState.isSubmitting || !form.formState.isDirty}- >- {form.formState.isSubmitting ? t('admin.actions.saving') : t('admin.actions.save')}- </Button>- </SheetFooter>- </form>- )}- </SheetContent>- </Sheet>- )-}--// ----------------------------------------------------------------------------// Conditions (eligibility rules) — held in form state, saved with the sheet-// -----------------------------------------------------------------------------function ConditionsSection({ form }: { form: UseFormReturn<DeliveryMethodFormValues> }) {- const { t } = useTranslation()- const { data: ruleTypes } = useDeliveryMethodRuleTypes()- const rulesArray = useFieldArray({ control: form.control, name: 'rules', keyName: '_key' })-- const existingTypes = new Set(rulesArray.fields.map((rule) => rule.type))- const availableTypes = (ruleTypes?.data ?? []).filter((type) => !existingTypes.has(type.type))-- return (- <div className="flex flex-col gap-3 border-t p-4">- <div className="flex items-center justify-between">- <span className="font-medium text-sm">{t('admin.delivery_methods.conditions.title')}</span>- {availableTypes.length > 0 && (- <DropdownMenu>- <DropdownMenuTrigger- render={- <Button type="button" variant="outline" size="sm">- <PlusIcon className="size-4" />- {t('admin.delivery_methods.conditions.add')}- </Button>- }- />- <DropdownMenuContent align="end">- {availableTypes.map((type) => (- <DropdownMenuItem- key={type.type}- onClick={() =>- rulesArray.append({- type: type.type,- preferences: {},- product_ids: [],- takes_products: type.association_fields.includes('product_ids'),- })- }- >- {type.name}- </DropdownMenuItem>- ))}- </DropdownMenuContent>- </DropdownMenu>- )}- </div>-- {rulesArray.fields.length === 0 && (- <p className="text-muted-foreground text-sm">- {t('admin.delivery_methods.conditions.empty')}- </p>- )}-- {rulesArray.fields.map((field, index) => (- <ConditionRuleRow- key={field._key}- form={form}- index={index}- ruleType={(ruleTypes?.data ?? []).find((candidate) => candidate.type === field.type)}- fallbackLabel={field.type}- onRemove={() => rulesArray.remove(index)}- />- ))}- </div>- )-}--function ConditionRuleRow({- form,- index,- ruleType,- fallbackLabel,- onRemove,-}: {- form: UseFormReturn<DeliveryMethodFormValues>- index: number- ruleType?: DeliveryMethodRuleType- fallbackLabel: string- onRemove: () => void-}) {- const { t } = useTranslation()- // Rules that take a product list get a picker; every other kind renders its- // preference schema. Driven by the discovery endpoint, so a plugin rule with- // the same shape works without a change here.- const productBacked = ruleType?.association_fields?.includes('product_ids') ?? false- const label = ruleType?.name ?? fallbackLabel- const schema = ruleType?.preference_schema ?? []-- return (- <div className="flex flex-col gap-2 rounded-md border p-3">- <div className="flex items-center justify-between">- <span className="text-sm">{label}</span>- <Button- type="button"- variant="ghost"- size="icon-sm"- onClick={onRemove}- aria-label={t('admin.actions.delete')}- >- <Trash2Icon className="size-4" />- </Button>- </div>- {productBacked ? (- <Controller- control={form.control}- name={`rules.${index}.product_ids`}- render={({ field }) => (- <ResourceMultiAutocomplete<Product>- {...productAutocompleteProps('delivery-method-rule-products')}- value={field.value}- onChange={field.onChange}- />- )}- />- ) : (- <Controller- control={form.control}- name={`rules.${index}.preferences`}- render={({ field }) => (- <PreferencesForm schema={schema} values={field.value} onChange={field.onChange} />- )}- />- )}- </div>- )-}--function ProviderSelectField({- form,- name,- label,- help,- options,-}: {- form: UseFormReturn<DeliveryMethodFormValues>- name: 'fulfillment_provider' | 'rate_provider'- label: string- help: string- options: { value: string; label: string; disabled?: boolean }[]-}) {- return (- <Field>- <FieldLabel>{label}</FieldLabel>- <Controller- name={name}- control={form.control}- render={({ field }) => (- <Select items={options} value={field.value || ''} onValueChange={field.onChange}>- <SelectTrigger>- <SelectValue />- </SelectTrigger>- <SelectContent>- {options.map((option) => (- <SelectItem key={option.value} value={option.value} disabled={option.disabled}>- {option.label}- </SelectItem>- ))}- </SelectContent>- </Select>- )}- />- <span className="text-muted-foreground text-xs">{help}</span>- </Field>- )-}--function DeliveryMethodFormFields({ form }: { form: UseFormReturn<DeliveryMethodFormValues> }) {- const { t } = useTranslation()- const { errors } = form.formState- const { data: calculators } = useDeliveryCalculators()- const { data: fulfillmentProviders } = useFulfillmentProviders()- const { data: rateProviders } = useDeliveryRateProviders()- const { data: zones } = useDeliveryZones()- const { data: stockLocations } = useStockLocations()- const { data: taxCategories } = useTaxCategories()-- const fulfillmentType = form.watch('fulfillment_type')- const calculatorType = form.watch('calculator_type')- const fulfillmentProvider = form.watch('fulfillment_provider')- const rateProvider = form.watch('rate_provider')-- const calculatorOptions = (calculators?.data ?? []).map((calculator) => ({- value: calculator.type,- label: calculator.name,- }))-- // An unconnected carrier provider stays listed but unselectable, with a- // connect prompt below — hiding it would leave the merchant wondering- // where their carrier went.- const providerOptions = (fulfillmentProviders?.data ?? []).map((provider) => ({- value: provider.type,- label: provider.available- ? provider.name- : t('admin.delivery_methods.provider_needs_connection', { name: provider.name }),- disabled: !provider.available,- }))-- const defaultRateProvider = rateProviders?.default ?? ''- const availableRateProviders = useMemo(- () => (rateProviders?.data ?? []).filter((provider) => provider.available),- [rateProviders],- )- // Every installed shipping integration that isn't connected yet, straight- // from the integrations registry — a carrier gem is offered here even- // before it registers a provider, so the merchant never has to discover- // Settings → Integrations on their own.- const { data: integrationTypes } = useIntegrationTypes()- const { data: connectedIntegrations } = useIntegrations()- const connectableIntegrations = useMemo(() => {- const connected = new Set(- (connectedIntegrations?.data ?? []).filter((row) => row.active).map((row) => row.type),- )- return (integrationTypes?.data ?? []).filter(- (type) => type.group === 'shipping' && !connected.has(type.type),- )- }, [integrationTypes, connectedIntegrations])- const rateProviderOptions = (rateProviders?.data ?? []).map((provider) => ({- value: provider.type,- label: provider.available- ? provider.name- : t('admin.delivery_methods.provider_needs_connection', { name: provider.name }),- disabled: !provider.available,- }))- const [connectingType, setConnectingType] = useState<IntegrationTypeDefinition | null>(null)- // Set when a connect finishes, so the effect below can select the- // providers that integration unlocks once the refreshed lists arrive.- const [justConnected, setJustConnected] = useState<string | null>(null)- const queryClient = useQueryClient()- const rateProvidersKey = useResourceKey('delivery-methods', 'rate-providers')- const fulfillmentProvidersKey = useResourceKey('delivery-methods', 'fulfillment-providers')- const integrationsKey = useResourceKey('integrations')-- // Providers declare which fulfillment types they handle, so the type field- // offers only what the chosen providers can actually deliver — an empty- // declaration means "any type" (Manual, Internal). Picking a provider- // narrows the type rather than the other way around.- const selectedFulfillmentProvider = useMemo(- () => (fulfillmentProviders?.data ?? []).find((p) => p.type === fulfillmentProvider),- [fulfillmentProviders, fulfillmentProvider],- )- // Connecting an integration from this form is an act of intent: select- // the providers it unlocks once the refreshed lists arrive, so the- // merchant does not have to find and set them by hand afterwards.- useEffect(() => {- if (!justConnected) return-- const unlockedRateProvider = (rateProviders?.data ?? []).find(- (provider) => provider.integration_type === justConnected && provider.available,- )- const unlockedFulfillmentProvider = (fulfillmentProviders?.data ?? []).find(- (provider) => provider.integration_type === justConnected && provider.available,- )- if (!unlockedRateProvider && !unlockedFulfillmentProvider) return-- if (unlockedRateProvider) {- form.setValue('rate_provider', unlockedRateProvider.type, { shouldDirty: true })- }- if (unlockedFulfillmentProvider) {- form.setValue('fulfillment_provider', unlockedFulfillmentProvider.type, { shouldDirty: true })- }- setJustConnected(null)- }, [justConnected, rateProviders, fulfillmentProviders, form])-- const selectedRateProvider = useMemo(- () => availableRateProviders.find((p) => p.type === (rateProvider || defaultRateProvider)),- [availableRateProviders, rateProvider, defaultRateProvider],- )-- const registeredFulfillmentTypes = fulfillmentProviders?.fulfillment_types ?? FULFILLMENT_TYPES- const fulfillmentTypeOptions = useMemo(() => {- const handled = [- selectedFulfillmentProvider?.fulfillment_types,- selectedRateProvider?.fulfillment_types,- ].filter((types): types is string[] => !!types && types.length > 0)-- const available = registeredFulfillmentTypes.filter((value) =>- handled.every((types) => types.includes(value)),- )-- return (available.length > 0 ? available : registeredFulfillmentTypes).map((value) => ({- value,- label: t(`admin.delivery_methods.fulfillment_types.${value}`, { defaultValue: value }),- }))- }, [selectedFulfillmentProvider, selectedRateProvider, registeredFulfillmentTypes, t])-- // Carrier providers quote live rates, so the calculator's amount is never- // read — the field is hidden rather than offering pricing that does nothing.- // (The record still carries a calculator: the Estimator consults its- // `available?`, which the API fills in with a free-rate default.)- const usesCalculator = selectedRateProvider?.uses_calculator ?? true-- // Steer the provider as the type changes. A provider declaring no types- // (Manual) handles anything, so it never becomes invalid — but a type with- // a dedicated provider should land on it, since picking Pickup and leaving- // Manual is almost never what the merchant means. Only moves off a- // generalist, so an explicit choice is never overwritten.- useEffect(() => {- if (!fulfillmentType) return- const handled = selectedFulfillmentProvider?.fulfillment_types ?? []- if (handled.includes(fulfillmentType)) return-- const specialist = (fulfillmentProviders?.data ?? []).find(- (provider) => provider.available && provider.fulfillment_types.includes(fulfillmentType),- )- if (specialist) form.setValue('fulfillment_provider', specialist.type, { shouldDirty: true })- }, [fulfillmentType, selectedFulfillmentProvider, fulfillmentProviders, form])-- // Keep the type valid as providers change: an EasyPost method cannot stay- // `digital`. Only steers when the current value is no longer offered.- useEffect(() => {- if (fulfillmentTypeOptions.length === 0) return- if (fulfillmentTypeOptions.some((option) => option.value === fulfillmentType)) return-- form.setValue(- 'fulfillment_type',- fulfillmentTypeOptions[0].value as DeliveryMethodFormValues['fulfillment_type'],- )- }, [fulfillmentTypeOptions, fulfillmentType, form])-- // The select displayed the server default while submitting a blank value —- // harmless (blank resolves to Internal) but the shown and saved values- // disagreed. Seed it once the default is known, leaving a touched field or- // a loaded record alone.- const rateProviderDirty = !!form.formState.dirtyFields.rate_provider- useEffect(() => {- if (!defaultRateProvider || rateProvider || rateProviderDirty) return-- form.setValue('rate_provider', defaultRateProvider)- }, [defaultRateProvider, rateProvider, rateProviderDirty, form])-- const selectedCalculator = (calculators?.data ?? []).find((c) => c.type === calculatorType)- const preferenceSchema = (selectedCalculator?.preference_schema ?? []) as PreferenceField[]-- const taxCategoryOptions = [- { value: '', label: t('admin.common.none') },- ...(taxCategories?.data ?? []).map((tc) => ({ value: tc.id, label: tc.name })),- ]-- return (- <FieldGroup>- {errors.root?.message && (- <p className="text-sm text-destructive" role="alert">- {errors.root.message}- </p>- )}- <Field>- <FieldLabel htmlFor="name">{t('admin.fields.name.label')}</FieldLabel>- <Input- id="name"- autoFocus- aria-invalid={!!errors.name || undefined}- {...form.register('name')}- />- <FieldError errors={[errors.name]} />- </Field>-- <div className="grid grid-cols-2 gap-3">- <Field>- <FieldLabel htmlFor="admin_name">- {t('admin.fields.delivery_method.admin_name.label')}- </FieldLabel>- <Input id="admin_name" {...form.register('admin_name')} />- </Field>- <Field>- <FieldLabel htmlFor="code">{t('admin.fields.delivery_method.code.label')}</FieldLabel>- <Input id="code" {...form.register('code')} />- </Field>- </div>-- {/* Both provider fields render only when there is a real choice: with a- single registered provider the default applies and the field stays- hidden (for rate providers, until a carrier integration is- installed pricing is simply the calculator below). */}- <ProviderSelectField- form={form}- name="fulfillment_provider"- label={t('admin.fields.delivery_method.fulfillment_provider.label')}- help={t('admin.fields.delivery_method.fulfillment_provider.help')}- options={providerOptions}- />-- <ProviderSelectField- form={form}- name="rate_provider"- label={t('admin.fields.delivery_method.rate_provider.label')}- help={t('admin.fields.delivery_method.rate_provider.help')}- options={rateProviderOptions}- />-- {connectableIntegrations.map((integrationType) => (- <div- key={integrationType.type}- className="flex items-center justify-between gap-3 rounded-md border border-dashed p-3"- >- <span className="text-sm text-muted-foreground">- {t('admin.delivery_methods.connect_provider_hint', { name: integrationType.name })}- </span>- <Can I="create" a={Subject.Integration}>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => setConnectingType(integrationType)}- >- {t('admin.integrations.connect_cta')}- </Button>- </Can>- </div>- ))}-- {connectingType && (- <ConfigureIntegrationSheet- type={connectingType}- open- onOpenChange={(next) => {- if (next) return- setJustConnected(connectingType.type)- setConnectingType(null)- // Provider lists are cached for half an hour — a fresh connect- // must surface the provider in both selects immediately.- queryClient.invalidateQueries({ queryKey: rateProvidersKey })- queryClient.invalidateQueries({ queryKey: fulfillmentProvidersKey })- queryClient.invalidateQueries({ queryKey: integrationsKey })- }}- />- )}-- <Field>- <FieldLabel>{t('admin.fields.delivery_method.fulfillment_type.label')}</FieldLabel>- <Controller- name="fulfillment_type"- control={form.control}- render={({ field }) => (- <Select- items={fulfillmentTypeOptions}- value={field.value}- onValueChange={field.onChange}- >- <SelectTrigger>- <SelectValue />- </SelectTrigger>- <SelectContent>- {fulfillmentTypeOptions.map((option) => (- <SelectItem key={option.value} value={option.value}>- {option.label}- </SelectItem>- ))}- </SelectContent>- </Select>- )}- />- </Field>-- {fulfillmentType === 'pickup' && (- <Field>- <FieldLabel>{t('admin.fields.delivery_method.pickup_locations.label')}</FieldLabel>- <Controller- name="stock_location_ids"- control={form.control}- render={({ field }) => (- <div className="flex flex-col gap-2">- <span className="text-muted-foreground text-xs">- {t('admin.delivery_methods.pickup_locations_hint')}- </span>- {(stockLocations?.data ?? []).map((location) => {- const checked = field.value.includes(location.id)- return (- <label- key={location.id}- htmlFor={`pickup-location-${location.id}`}- className="flex items-center gap-2 text-sm"- >- <Checkbox- id={`pickup-location-${location.id}`}- checked={checked}- onCheckedChange={(next) => {- field.onChange(- next- ? [...field.value, location.id]- : field.value.filter(- (locationId: string) => locationId !== location.id,- ),- )- }}- />- {location.name}- </label>- )- })}- </div>- )}- />- </Field>- )}-- {fulfillmentType === 'shipping' && usesCalculator && (- <>- <Field>- <FieldLabel>{t('admin.fields.delivery_method.calculator.label')}</FieldLabel>- <Controller- name="calculator_type"- control={form.control}- render={({ field }) => (- <Select- items={calculatorOptions}- value={field.value ?? ''}- onValueChange={field.onChange}- >- <SelectTrigger>- <SelectValue />- </SelectTrigger>- <SelectContent>- {calculatorOptions.map((option) => (- <SelectItem key={option.value} value={option.value}>- {option.label}- </SelectItem>- ))}- </SelectContent>- </Select>- )}- />- </Field>-- <Controller- name="calculator_preferences"- control={form.control}- render={({ field }) => (- <PreferencesForm- schema={preferenceSchema}- values={(field.value ?? {}) as Record<string, unknown>}- onChange={field.onChange}- />- )}- />-- <Field>- <FieldLabel>{t('admin.fields.delivery_method.delivery_zones.label')}</FieldLabel>- <Controller- name="delivery_zone_ids"- control={form.control}- render={({ field }) => (- <div className="flex flex-col gap-2">- {(zones?.data ?? []).length === 0 && (- <span className="text-xs text-muted-foreground">- {t('admin.delivery_methods.no_zones_hint')}- </span>- )}- {(zones?.data ?? []).map((zone) => {- const checked = field.value.includes(zone.id)- return (- <label- key={zone.id}- htmlFor={`delivery-zone-${zone.id}`}- className="flex items-center gap-2 text-sm"- >- <Checkbox- id={`delivery-zone-${zone.id}`}- checked={checked}- onCheckedChange={(next) => {- field.onChange(- next- ? [...field.value, zone.id]- : field.value.filter((zoneId: string) => zoneId !== zone.id),- )- }}- />- {zone.name}- </label>- )- })}- </div>- )}- />- </Field>- </>- )}-- {fulfillmentType === 'shipping' && !usesCalculator && (- <CarrierServicesSection- form={form}- catalog={selectedRateProvider?.service_catalog ?? []}- catalogError={selectedRateProvider?.service_catalog_error ?? null}- />- )}-- <div className="grid grid-cols-2 gap-3">- <Field>- <FieldLabel htmlFor="estimated_transit_business_days_min">- {t('admin.fields.delivery_method.transit_days_min.label')}- </FieldLabel>- <Input- id="estimated_transit_business_days_min"- type="number"- min="1"- {...form.register('estimated_transit_business_days_min')}- />- </Field>- <Field>- <FieldLabel htmlFor="estimated_transit_business_days_max">- {t('admin.fields.delivery_method.transit_days_max.label')}- </FieldLabel>- <Input- id="estimated_transit_business_days_max"- type="number"- min="1"- {...form.register('estimated_transit_business_days_max')}- />- </Field>- </div>-- <Field>- <FieldLabel>{t('admin.fields.delivery_method.tax_category.label')}</FieldLabel>- <Controller- name="tax_category_id"- control={form.control}- render={({ field }) => (- <Select- items={taxCategoryOptions}- value={field.value ?? ''}- onValueChange={field.onChange}- >- <SelectTrigger>- <SelectValue />- </SelectTrigger>- <SelectContent>- {taxCategoryOptions.map((option) => (- <SelectItem key={option.value} value={option.value}>- {option.label}- </SelectItem>- ))}- </SelectContent>- </Select>- )}- />- </Field>-- <Field>- <FieldLabel htmlFor="tracking_url">- {t('admin.fields.delivery_method.tracking_url.label')}- </FieldLabel>- <Input- id="tracking_url"- placeholder="https://carrier.example/track?num=:tracking"- {...form.register('tracking_url')}- />- </Field>-- <Field>- <div className="flex items-start justify-between gap-4">- <div className="flex flex-col">- <FieldLabel htmlFor="storefront_visible" className="cursor-pointer">- {t('admin.fields.storefront_visible.label')}- </FieldLabel>- <span className="text-xs text-muted-foreground">- {t('admin.fields.delivery_method.storefront_visible.help')}- </span>- </div>- <Controller- name="storefront_visible"- control={form.control}- render={({ field }) => (- <Switch- id="storefront_visible"- checked={!!field.value}- onCheckedChange={field.onChange}- />- )}- />- </div>- </Field>- </FieldGroup>- )-}--// ----------------------------------------------------------------------------// Carrier services — which provider services this method offers, with-// per-service label + markup overrides. No rows = everything the carrier-// returns, named by the carrier.-// -----------------------------------------------------------------------------function CarrierServicesSection({- form,- catalog,- catalogError,-}: {- form: UseFormReturn<DeliveryMethodFormValues>- catalog: DeliveryRateProviderCatalogEntry[]- /** Why the carrier's service list is missing, when it is. */- catalogError: string | null-}) {- const { t } = useTranslation()- const servicesArray = useFieldArray({ control: form.control, name: 'services', keyName: '_key' })- const rows = form.watch('services') ?? []-- const rowIndex = (entry: DeliveryRateProviderCatalogEntry) =>- rows.findIndex((row) => row.carrier === entry.carrier && row.service === entry.service)-- const toggleEntry = (entry: DeliveryRateProviderCatalogEntry, next: boolean) => {- const index = rowIndex(entry)- if (next && index === -1) {- servicesArray.append({- carrier: entry.carrier,- service: entry.service,- label: '',- markup_flat: '',- markup_percent: '',- })- } else if (!next && index >= 0) {- servicesArray.remove(index)- }- }-- return (- <div className="flex flex-col gap-3 rounded-md border p-3">- <div className="flex flex-col">- <span className="font-medium text-sm">- {t('admin.delivery_methods.carrier_services.label')}- </span>- <span className="text-xs text-muted-foreground">- {rows.length === 0- ? t('admin.delivery_methods.carrier_services.all_hint')- : t('admin.delivery_methods.carrier_services.narrowed_hint', { count: rows.length })}- </span>- </div>-- {catalogError && (- <p className="rounded-md bg-muted p-2 text-xs text-muted-foreground">- {t('admin.delivery_methods.carrier_services.catalog_unavailable', {- message: catalogError,- })}- </p>- )}-- <div className="grid grid-cols-2 gap-3">- <Field>- <FieldLabel htmlFor="markup_percent">- {t('admin.fields.delivery_method.markup_percent.label')}- </FieldLabel>- <Input- id="markup_percent"- type="number"- step="0.01"- min="0"- placeholder="0"- {...form.register('markup_percent')}- />- </Field>- <Field>- <FieldLabel htmlFor="markup_flat">- {t('admin.fields.delivery_method.markup_flat.label')}- </FieldLabel>- <Input- id="markup_flat"- type="number"- step="0.01"- min="0"- placeholder="0"- {...form.register('markup_flat')}- />- </Field>- </div>- <span className="text-xs text-muted-foreground">- {t('admin.fields.delivery_method.markup_percent.help')}- </span>-- {catalog.length > 0 ? (- <div className="flex flex-col gap-1">- {catalog.map((entry) => {- const index = rowIndex(entry)- const checked = index >= 0- const key = `${entry.carrier}/${entry.service}`- return (- <div key={key} className="flex flex-col gap-2 py-1">- <label htmlFor={`service-${key}`} className="flex items-center gap-2 text-sm">- <Checkbox- id={`service-${key}`}- checked={checked}- onCheckedChange={(next) => toggleEntry(entry, !!next)}- />- {entry.label}- </label>- {checked && (- <div className="ml-6 grid grid-cols-3 gap-2">- <Input- aria-label={t('admin.delivery_methods.carrier_services.custom_label', {- service: entry.label,- })}- placeholder={entry.label}- {...form.register(`services.${index}.label`)}- />- <Input- aria-label={t('admin.fields.delivery_method.markup_percent.label')}- type="number"- step="0.01"- min="0"- placeholder={t('admin.fields.delivery_method.markup_percent.label')}- {...form.register(`services.${index}.markup_percent`)}- />- <Input- aria-label={t('admin.fields.delivery_method.markup_flat.label')}- type="number"- step="0.01"- min="0"- placeholder={t('admin.fields.delivery_method.markup_flat.label')}- {...form.register(`services.${index}.markup_flat`)}- />- </div>- )}- </div>- )- })}- </div>- ) : (- <div className="flex flex-col gap-2">- {servicesArray.fields.map((row, index) => (- <div key={row._key} className="grid grid-cols-[1fr_1fr_1fr_auto] gap-2">- <Input- aria-label={t('admin.delivery_methods.carrier_services.carrier')}- placeholder={t('admin.delivery_methods.carrier_services.carrier')}- {...form.register(`services.${index}.carrier`)}- />- <Input- aria-label={t('admin.delivery_methods.carrier_services.service')}- placeholder={t('admin.delivery_methods.carrier_services.service')}- {...form.register(`services.${index}.service`)}- />- <Input- aria-label={t('admin.delivery_methods.carrier_services.custom_label', {- service: '',- })}- placeholder={t('admin.fields.delivery_method.service_label.label')}- {...form.register(`services.${index}.label`)}- />- <Button- type="button"- variant="ghost"- size="icon-sm"- aria-label={t('admin.actions.remove')}- onClick={() => servicesArray.remove(index)}- >- <Trash2Icon className="size-4" />- </Button>- </div>- ))}- <Button- type="button"- variant="outline"- size="sm"- className="self-start"- onClick={() =>- servicesArray.append({- carrier: '',- service: '',- label: '',- markup_flat: '',- markup_percent: '',- })- }- >- <PlusIcon className="size-4" />- {t('admin.delivery_methods.carrier_services.add_service')}- </Button>- </div>- )}- </div>- )-}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/index.tsxnew file mode 100644index 0000000000..0889a962e9--- /dev/null+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/index.tsx@@ -0,0 +1,1097 @@+import { zodResolver } from '@hookform/resolvers/zod'+import type {+ DeliveryMethod,+ DeliveryOriginGroup,+ DeliveryProfile,+ DeliveryZone,+ DeliveryZoneMember,+} from '@spree/admin-sdk'+import {+ Can,+ mapSpreeErrorsToForm,+ PageHeader,+ Subject,+ usePermissions,+ useStore,+} from '@spree/dashboard-core'+import {+ Badge,+ Button,+ Card,+ CardContent,+ CardHeader,+ CardTitle,+ Checkbox,+ ErrorState,+ Field,+ FieldError,+ FieldLabel,+ Input,+ ResourceLayout,+ RowActions,+ Tooltip,+ TooltipContent,+ TooltipTrigger,+ useConfirm,+} from '@spree/dashboard-ui'+import { createFileRoute, useNavigate } from '@tanstack/react-router'+import {+ GlobeIcon,+ MapIcon,+ PlusIcon,+ SplitIcon,+ StoreIcon,+ TruckIcon,+ WarehouseIcon,+ ZapIcon,+} from 'lucide-react'+import { useMemo, useState } from 'react'+import { Controller, useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import { z } from 'zod/v4'+import { DeliveryMethodSheet } from '../../../../../../components/spree/shipping/delivery-method-sheet'+import { DeliveryOriginGroupDialog } from '../../../../../../components/spree/shipping/delivery-origin-group-dialog'+import { DeliveryZoneSheet } from '../../../../../../components/spree/shipping/delivery-zone-sheet'+import { StockLocationScopeField } from '../../../../../../components/spree/shipping/stock-location-scope-field'+import {+ useAllDeliveryMethods,+ useDeleteDeliveryMethod,+ useDeliveryRateProviders,+} from '../../../../../../hooks/use-delivery-methods'+import { useDeleteDeliveryOriginGroup } from '../../../../../../hooks/use-delivery-origin-groups'+import {+ useDeleteDeliveryProfile,+ useDeliveryProfile,+ useUpdateDeliveryProfile,+} from '../../../../../../hooks/use-delivery-profiles'+import {+ useDeleteDeliveryZone,+ useProfileDeliveryZones,+} from '../../../../../../hooks/use-delivery-zones'+import {+ useStockLocations,+ useUpdateStockLocationById,+} from '../../../../../../hooks/use-stock-locations'+import {+ flatAmount,+ formatAmount,+ summarizeRules,+} from '../../../../../../lib/delivery-method-summary'+import {+ type DeliveryProfileGeneralValues,+ type DeliveryProfileLocationsValues,+ deliveryProfileGeneralSchema,+ deliveryProfileLocationsSchema,+ deliveryProfileLocationsToParams,+} from '../../../../../../schemas/delivery-profile'++/**+ * The method sheet is driven from the URL so a deep link opens it over a live+ * profile page: `method` is either a method's ID or `new`, and `zone`, `group`+ * and `provider` preselect what a new method is being created for.+ */+const profileDetailSearchSchema = z.object({+ method: z.string().optional(),+ zone: z.string().optional(),+ group: z.string().optional(),+ provider: z.enum(['pickup', 'digital']).optional(),+})++type ProfileDetailSearch = z.infer<typeof profileDetailSearchSchema>++export const Route = createFileRoute(+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/',+)({+ validateSearch: profileDetailSearchSchema,+ component: DeliveryProfileDetailPage,+})++/** Opens the method sheet for an existing method, or for a new one. */+function useMethodSheetNavigation() {+ const navigate = useNavigate()++ const openMethod = (methodId: string) =>+ navigate({+ search: (prev: Record<string, unknown>) => {+ const { zone: _z, group: _g, provider: _p, ...rest } = prev+ return { ...rest, method: methodId } as never+ },+ })++ const openNewMethod = (options: { zone?: string; group?: string; provider?: string } = {}) =>+ navigate({+ search: (prev: Record<string, unknown>) =>+ ({+ ...prev,+ method: 'new',+ ...(options.zone ? { zone: options.zone } : { zone: undefined }),+ ...(options.group ? { group: options.group } : { group: undefined }),+ ...(options.provider ? { provider: options.provider } : { provider: undefined }),+ }) as never,+ })++ const closeMethodSheet = () =>+ navigate({+ search: (prev: Record<string, unknown>) => {+ const { method: _m, zone: _z, group: _g, provider: _p, ...rest } = prev+ return rest as never+ },+ })++ return { openMethod, openNewMethod, closeMethodSheet }+}++function DeliveryProfileDetailPage() {+ const { t } = useTranslation()+ const { profileId } = Route.useParams()+ const { data: profile, isLoading, error, refetch } = useDeliveryProfile(profileId)++ if (isLoading) {+ return <p className="text-muted-foreground">{t('admin.common.loading')}</p>+ }+ if (error || !profile) {+ return (+ <ErrorState+ title={t('admin.delivery_profiles.detail.load_failed_title')}+ description={error instanceof Error ? error.message : undefined}+ onRetry={() => refetch()}+ />+ )+ }+ return <DeliveryProfileDetailBody profile={profile} />+}++function DeliveryProfileDetailBody({ profile }: { profile: DeliveryProfile }) {+ const { t } = useTranslation()+ const { storeId } = Route.useParams()+ const navigate = useNavigate()+ const confirm = useConfirm()+ const deleteMutation = useDeleteDeliveryProfile()++ async function handleDelete() {+ const ok = await confirm({+ title: t('admin.delivery_profiles.delete_confirm.title'),+ message: t('admin.delivery_profiles.delete_confirm.message', { name: profile.name }),+ variant: 'destructive',+ confirmLabel: t('admin.actions.delete'),+ })+ if (!ok) return+ await deleteMutation.mutateAsync(profile.id)+ navigate({ to: '/$storeId/settings/delivery-profiles', params: { storeId } })+ }++ return (+ <ResourceLayout+ header={+ <PageHeader+ title={profile.name}+ backTo="settings/delivery-profiles"+ resource={{ id: profile.id }}+ onDelete={profile.default ? undefined : handleDelete}+ deleteLabel={t('admin.delivery_profiles.detail.delete_label')}+ />+ }+ main={<ZonesAndMethodsSection profile={profile} />}+ sidebar={+ <>+ <GeneralCard profile={profile} />+ <OriginsCard profile={profile} />+ </>+ }+ />+ )+}++// ---------------------------------------------------------------------------+// General — name, kind, and promotion to store default+// ---------------------------------------------------------------------------++function GeneralCard({ profile }: { profile: DeliveryProfile }) {+ const { t } = useTranslation()+ const confirm = useConfirm()+ const updateMutation = useUpdateDeliveryProfile(profile.id)++ const form = useForm<DeliveryProfileGeneralValues>({+ resolver: zodResolver(deliveryProfileGeneralSchema),+ defaultValues: { name: profile.name },+ values: { name: profile.name },+ resetOptions: { keepDirtyValues: true },+ })++ async function onSubmit(values: DeliveryProfileGeneralValues) {+ try {+ await updateMutation.mutateAsync({ name: values.name })+ form.reset(values)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ async function handleMakeDefault() {+ const ok = await confirm({+ title: t('admin.delivery_profiles.default_confirm.title'),+ message: t('admin.delivery_profiles.default_confirm.message', { name: profile.name }),+ confirmLabel: t('admin.delivery_profiles.make_default'),+ })+ if (!ok) return+ await updateMutation.mutateAsync({ default: true }).catch(() => undefined)+ }++ const { errors } = form.formState++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_profiles.detail.general_title')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ {errors.root?.message && (+ <p className="text-sm text-destructive" role="alert">+ {errors.root.message}+ </p>+ )}+ <Field>+ <FieldLabel htmlFor="profile-name">{t('admin.fields.name.label')}</FieldLabel>+ <Input+ id="profile-name"+ aria-invalid={!!errors.name || undefined}+ {...form.register('name')}+ />+ <FieldError errors={[errors.name]} />+ </Field>++ <Field>+ <FieldLabel>{t('admin.fields.delivery_profile.kind.label')}</FieldLabel>+ <div>+ <Badge variant="outline">+ {t(`admin.delivery_profiles.kinds.${profile.kind}`, {+ defaultValue: profile.kind,+ })}+ </Badge>+ </div>+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_profiles.kind_immutable_hint')}+ </span>+ </Field>++ <Field>+ <FieldLabel>{t('admin.delivery_profiles.default_badge')}</FieldLabel>+ {profile.default ? (+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_profiles.is_default_hint')}+ </span>+ ) : (+ <Can I="update" a={Subject.DeliveryProfile}>+ <Button+ type="button"+ variant="outline"+ size="sm"+ className="self-start"+ onClick={handleMakeDefault}+ disabled={updateMutation.isPending}+ >+ {t('admin.delivery_profiles.make_default')}+ </Button>+ </Can>+ )}+ </Field>++ <Can I="update" a={Subject.DeliveryProfile}>+ <Button+ type="button"+ size="sm"+ className="self-start"+ onClick={form.handleSubmit(onSubmit)}+ disabled={form.formState.isSubmitting || !form.formState.isDirty}+ >+ {form.formState.isSubmitting ? t('admin.actions.saving') : t('admin.actions.save')}+ </Button>+ </Can>+ </CardContent>+ </Card>+ )+}++// ---------------------------------------------------------------------------+// Origins — which stock locations this profile ships from+// ---------------------------------------------------------------------------++function OriginsCard({ profile }: { profile: DeliveryProfile }) {+ const { t } = useTranslation()+ const updateMutation = useUpdateDeliveryProfile(profile.id)+ const { data: stockLocations } = useStockLocations()++ const initial: DeliveryProfileLocationsValues = {+ scope: profile.stock_location_ids.length === 0 ? 'all' : 'selected',+ stock_location_ids: profile.stock_location_ids,+ }++ const form = useForm<DeliveryProfileLocationsValues>({+ resolver: zodResolver(deliveryProfileLocationsSchema),+ defaultValues: initial,+ values: initial,+ resetOptions: { keepDirtyValues: true },+ })++ const scope = form.watch('scope')++ async function onSubmit(values: DeliveryProfileLocationsValues) {+ try {+ await updateMutation.mutateAsync(deliveryProfileLocationsToParams(values))+ form.reset(values)+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ return (+ <Card>+ <CardHeader>+ <CardTitle>{t('admin.delivery_profiles.detail.origins_title')}</CardTitle>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ <Controller+ name="stock_location_ids"+ control={form.control}+ render={({ field }) => (+ <StockLocationScopeField+ idPrefix="origins"+ scope={scope}+ onScopeChange={(next) => {+ form.setValue('scope', next, { shouldDirty: true })+ if (next === 'all') field.onChange([])+ }}+ locations={stockLocations?.data ?? []}+ selectedIds={field.value}+ onSelectedIdsChange={field.onChange}+ allLabel={t('admin.delivery_profiles.all_locations')}+ selectedLabel={t('admin.delivery_profiles.selected_locations')}+ emptyLabel={t('admin.delivery_profiles.detail.no_stock_locations')}+ />+ )}+ />++ <Can I="update" a={Subject.DeliveryProfile}>+ <Button+ type="button"+ size="sm"+ className="self-start"+ onClick={form.handleSubmit(onSubmit)}+ disabled={form.formState.isSubmitting || !form.formState.isDirty}+ >+ {form.formState.isSubmitting ? t('admin.actions.saving') : t('admin.actions.save')}+ </Button>+ </Can>+ </CardContent>+ </Card>+ )+}++// ---------------------------------------------------------------------------+// Methods, split by how they reach the customer. Zones are a destination+// concept, so only address-shipping methods are filed under them; pickup and+// digital methods get their own cards, with no zone language at all.+// ---------------------------------------------------------------------------++function ZonesAndMethodsSection({ profile }: { profile: DeliveryProfile }) {+ const { t } = useTranslation()+ const { data: zones, isLoading: zonesLoading } = useProfileDeliveryZones(profile.id)+ const { data: allMethods, isLoading: methodsLoading } = useAllDeliveryMethods()+ const [zoneSheet, setZoneSheet] = useState<{ zoneId?: string; groupId?: string } | null>(null)+ const [splitting, setSplitting] = useState(false)++ const methods = (allMethods ?? []).filter((method) => method.delivery_profile_id === profile.id)+ const pickupMethods = methods.filter((method) => method.pickup || method.pickup_point)+ const digitalMethods = methods.filter((method) => method.digital)+ const shippingMethods = methods.filter(+ (method) => !method.digital && !method.pickup && !method.pickup_point,+ )++ const groups = [...(profile.origin_groups ?? [])].sort(+ (a, b) => (a.position ?? 0) - (b.position ?? 0),+ )+ // Until a profile is split, the origin-group layer is invisible: one group+ // means one flat list of zones, exactly as before groups existed.+ const split = groups.length > 1++ if (zonesLoading || methodsLoading) {+ return <p className="text-muted-foreground">{t('admin.common.loading')}</p>+ }++ // A digital profile has no destination and no counter, so zones would be+ // meaningless there — it gets the digital card alone. The method sheet still+ // rides along, since digital methods are edited through it too.+ if (profile.digital) {+ return (+ <>+ <DigitalMethodsCard methods={digitalMethods} />+ <MethodSheetOutlet profile={profile} zones={zones ?? []} />+ </>+ )+ }++ return (+ <>+ <div className="flex items-center justify-between">+ <h2 className="font-medium text-base">{t('admin.delivery_profiles.detail.zones_title')}</h2>+ <div className="flex items-center gap-2">+ <Can I="update" a={Subject.DeliveryProfile}>+ <Button type="button" variant="ghost" size="sm" onClick={() => setSplitting(true)}>+ <SplitIcon className="size-4" />+ {t('admin.delivery_origin_groups.split_cta')}+ </Button>+ </Can>+ {!split && (+ <Can I="create" a={Subject.DeliveryZone}>+ <Button type="button" variant="outline" size="sm" onClick={() => setZoneSheet({})}>+ <PlusIcon className="size-4" />+ {t('admin.delivery_zones.add_cta')}+ </Button>+ </Can>+ )}+ </div>+ </div>++ {split ? (+ groups.map((group) => (+ <OriginGroupSection+ key={group.id}+ profile={profile}+ group={group}+ zones={(zones ?? []).filter((zone) => zone.delivery_origin_group_id === group.id)}+ methods={shippingMethods.filter(+ (method) => method.delivery_origin_group_id === group.id,+ )}+ onAddZone={() => setZoneSheet({ groupId: group.id })}+ onEditZone={(zoneId) => setZoneSheet({ zoneId })}+ />+ ))+ ) : (+ <FlatZoneList+ zones={zones ?? []}+ methods={shippingMethods}+ onEditZone={(zoneId) => setZoneSheet({ zoneId })}+ />+ )}++ <PickupCard methods={pickupMethods} />++ {digitalMethods.length > 0 && <DigitalMethodsCard methods={digitalMethods} />}++ {zoneSheet && (+ <DeliveryZoneSheet+ deliveryProfileId={profile.id}+ deliveryOriginGroupId={zoneSheet.groupId}+ zoneId={zoneSheet.zoneId}+ siblingZones={zones ?? []}+ open+ onOpenChange={(open) => !open && setZoneSheet(null)}+ />+ )}++ {splitting && (+ <DeliveryOriginGroupDialog+ deliveryProfileId={profile.id}+ open+ onOpenChange={(open) => !open && setSplitting(false)}+ />+ )}++ <MethodSheetOutlet profile={profile} zones={zones ?? []} />+ </>+ )+}++/**+ * Renders the method sheet whenever the URL asks for one. Kept apart from the+ * page body so the profile stays mounted underneath: opening a method is a+ * search-param change, not a navigation away.+ */+function MethodSheetOutlet({+ profile,+ zones,+}: {+ profile: DeliveryProfile+ zones: DeliveryZone[]+}) {+ const search = Route.useSearch() as ProfileDetailSearch+ const { closeMethodSheet } = useMethodSheetNavigation()++ if (!search.method) return null++ const creating = search.method === 'new'++ return (+ <DeliveryMethodSheet+ // Remounting on the method being edited drops the previous record's+ // form state, which a shared instance would otherwise carry over.+ key={search.method}+ profile={profile}+ zones={zones}+ methodId={creating ? undefined : search.method}+ zoneId={creating ? search.zone : undefined}+ originGroupId={creating ? search.group : undefined}+ provider={creating ? search.provider : undefined}+ open+ onOpenChange={(open) => !open && closeMethodSheet()}+ />+ )+}++/**+ * The zones of one profile with no origin-group framing at all — what a+ * merchant who never split their origins sees, and what they return to after+ * deleting the second group.+ */+function FlatZoneList({+ zones,+ methods,+ onEditZone,+}: {+ zones: DeliveryZone[]+ methods: DeliveryMethod[]+ onEditZone: (zoneId: string) => void+}) {+ const { t } = useTranslation()+ const unrestricted = methods.filter((method) => !method.delivery_zone_id)++ return (+ <>+ {zones.map((zone) => (+ <ZoneCard+ key={zone.id}+ zone={zone}+ methods={methods.filter((method) => method.delivery_zone_id === zone.id)}+ onEdit={() => onEditZone(zone.id)}+ />+ ))}++ {unrestricted.length > 0 && <UnrestrictedMethodsCard methods={unrestricted} />}++ {zones.length === 0 && unrestricted.length === 0 && (+ <Card>+ <CardContent className="py-8 text-center text-muted-foreground text-sm">+ {t('admin.delivery_profiles.detail.no_zones')}+ </CardContent>+ </Card>+ )}+ </>+ )+}++/**+ * One origin group of a split profile: the warehouses it ships from, and the+ * zones and methods priced from them. Same cards as the flat rendering, under+ * a header that names the origin.+ */+function OriginGroupSection({+ profile,+ group,+ zones,+ methods,+ onAddZone,+ onEditZone,+}: {+ profile: DeliveryProfile+ group: DeliveryProfile['origin_groups'][number]+ zones: DeliveryZone[]+ methods: DeliveryMethod[]+ onAddZone: () => void+ onEditZone: (zoneId: string) => void+}) {+ const { t } = useTranslation()+ const confirm = useConfirm()+ const { permissions } = usePermissions()+ const { data: stockLocations } = useStockLocations()+ const deleteMutation = useDeleteDeliveryOriginGroup(profile.id)+ const [editing, setEditing] = useState(false)++ const unrestricted = methods.filter((method) => !method.delivery_zone_id)+ const locationNames = (stockLocations?.data ?? [])+ .filter((location) => group.stock_location_ids.includes(location.id))+ .map((location) => location.name)++ async function handleDelete() {+ const ok = await confirm({+ title: t('admin.delivery_origin_groups.delete_confirm.title'),+ message: t('admin.delivery_origin_groups.delete_confirm.message', {+ name: group.name ?? t('admin.delivery_profiles.all_locations'),+ }),+ variant: 'destructive',+ confirmLabel: t('admin.actions.delete'),+ })+ if (!ok) return+ // A group still holding zones or methods is refused with a 422 the+ // mutation surfaces as a toast, which is the message the merchant needs.+ await deleteMutation.mutateAsync(group.id).catch(() => undefined)+ }++ return (+ <section className="flex flex-col gap-4 rounded-lg border p-4">+ <div className="flex items-start justify-between gap-2">+ <div className="flex flex-col gap-1">+ <div className="flex items-center gap-2">+ <WarehouseIcon className="size-4 text-muted-foreground" />+ <span className="font-medium text-sm">+ {group.name || t('admin.delivery_profiles.all_locations')}+ </span>+ </div>+ <span className="text-muted-foreground text-xs">+ {locationNames.length > 0+ ? t('admin.delivery_origin_groups.ships_from', {+ locations: locationNames.join(', '),+ })+ : t('admin.delivery_origin_groups.ships_from_all')}+ </span>+ </div>+ <div className="flex items-center gap-2">+ <Can I="create" a={Subject.DeliveryZone}>+ <Button type="button" variant="outline" size="sm" onClick={onAddZone}>+ <PlusIcon className="size-4" />+ {t('admin.delivery_zones.add_cta')}+ </Button>+ </Can>+ <RowActions+ actions={[+ {+ key: 'edit',+ visible: permissions.can('update', Subject.DeliveryProfile),+ onSelect: () => setEditing(true),+ },+ {+ key: 'delete',+ destructive: true,+ visible: permissions.can('update', Subject.DeliveryProfile),+ disabled: deleteMutation.isPending,+ onSelect: handleDelete,+ },+ ]}+ />+ </div>+ </div>++ {zones.map((zone) => (+ <ZoneCard+ key={zone.id}+ zone={zone}+ methods={methods.filter((method) => method.delivery_zone_id === zone.id)}+ onEdit={() => onEditZone(zone.id)}+ originGroupId={group.id}+ />+ ))}++ {unrestricted.length > 0 && <UnrestrictedMethodsCard methods={unrestricted} />}++ {zones.length === 0 && unrestricted.length === 0 && (+ <p className="py-4 text-center text-muted-foreground text-sm">+ {t('admin.delivery_profiles.detail.no_zones')}+ </p>+ )}++ {editing && (+ <DeliveryOriginGroupDialog+ deliveryProfileId={profile.id}+ group={group as DeliveryOriginGroup}+ open+ onOpenChange={(open) => !open && setEditing(false)}+ />+ )}+ </section>+ )+}++// ---------------------------------------------------------------------------+// Pickup — the methods customers collect in person, and which counters they+// can collect from.+// ---------------------------------------------------------------------------++function PickupCard({ methods }: { methods: DeliveryMethod[] }) {+ const { t } = useTranslation()+ const { openNewMethod } = useMethodSheetNavigation()++ return (+ <Card>+ <CardHeader>+ <CardTitle className="flex items-center gap-2">+ <StoreIcon className="size-4 text-muted-foreground" />+ {t('admin.delivery_profiles.detail.pickup_title')}+ </CardTitle>+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_profiles.detail.pickup_hint')}+ </span>+ </CardHeader>+ <CardContent className="flex flex-col gap-4">+ {methods.length > 0 ? (+ <MethodList methods={methods} icon={StoreIcon} />+ ) : (+ <div className="flex flex-col items-start gap-2">+ <p className="text-muted-foreground text-sm">+ {t('admin.delivery_profiles.detail.pickup_empty')}+ </p>+ <Can I="create" a={Subject.DeliveryMethod}>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => openNewMethod({ provider: 'pickup' })}+ >+ <PlusIcon className="size-4" />+ {t('admin.delivery_profiles.detail.offer_pickup')}+ </Button>+ </Can>+ </div>+ )}++ <PickupLocationsBlock />+ </CardContent>+ </Card>+ )+}++/**+ * Every stock location of the store, each a counter customers can collect+ * from. Toggling writes straight through — the surrounding page is a set of+ * saved forms, so the helper line says these changes are immediate.+ */+function PickupLocationsBlock() {+ const { t } = useTranslation()+ const { data: stockLocations, isLoading } = useStockLocations()+ const updateMutation = useUpdateStockLocationById()++ const locations = stockLocations?.data ?? []++ return (+ <div className="flex flex-col gap-2 border-t pt-4">+ <span className="font-medium text-sm">+ {t('admin.delivery_profiles.detail.collect_from')}+ </span>+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_profiles.detail.collect_from_hint')}+ </span>++ {isLoading ? (+ <p className="text-muted-foreground text-sm">{t('admin.common.loading')}</p>+ ) : locations.length === 0 ? (+ <p className="text-muted-foreground text-sm">+ {t('admin.delivery_profiles.detail.no_stock_locations')}+ </p>+ ) : (+ <div className="flex flex-col gap-2">+ {locations.map((location) => (+ <label+ key={location.id}+ htmlFor={`pickup-location-${location.id}`}+ className="flex items-center gap-2 text-sm"+ >+ <Checkbox+ id={`pickup-location-${location.id}`}+ checked={location.pickup_enabled}+ disabled={updateMutation.isPending}+ onCheckedChange={(next) =>+ updateMutation+ .mutateAsync({+ id: location.id,+ params: { pickup_enabled: !!next },+ })+ .catch(() => undefined)+ }+ />+ {location.name}+ </label>+ ))}+ </div>+ )}+ </div>+ )+}++// ---------------------------------------------------------------------------+// Digital — delivered without a destination of any kind+// ---------------------------------------------------------------------------++function DigitalMethodsCard({ methods }: { methods: DeliveryMethod[] }) {+ const { t } = useTranslation()+ const { openNewMethod } = useMethodSheetNavigation()++ return (+ <Card>+ <CardHeader>+ <CardTitle className="flex items-center gap-2">+ <ZapIcon className="size-4 text-muted-foreground" />+ {t('admin.delivery_profiles.detail.digital_title')}+ </CardTitle>+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_profiles.detail.digital_hint')}+ </span>+ </CardHeader>+ <CardContent>+ {methods.length > 0 ? (+ <MethodList methods={methods} icon={ZapIcon} />+ ) : (+ <div className="flex flex-col items-start gap-2">+ <p className="text-muted-foreground text-sm">+ {t('admin.delivery_profiles.detail.digital_empty')}+ </p>+ <Can I="create" a={Subject.DeliveryMethod}>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => openNewMethod({ provider: 'digital' })}+ >+ <PlusIcon className="size-4" />+ {t('admin.delivery_profiles.detail.add_digital_method')}+ </Button>+ </Can>+ </div>+ )}+ </CardContent>+ </Card>+ )+}++function ZoneCard({+ zone,+ methods,+ onEdit,+ originGroupId,+}: {+ zone: DeliveryZone+ methods: DeliveryMethod[]+ onEdit: () => void+ /** Set only on a split profile, so a new method lands in the right group. */+ originGroupId?: string+}) {+ const { t } = useTranslation()+ const { openNewMethod } = useMethodSheetNavigation()+ const confirm = useConfirm()+ const deleteMutation = useDeleteDeliveryZone()+ const { permissions } = usePermissions()++ async function handleDelete() {+ const ok = await confirm({+ title: t('admin.delivery_zones.delete_confirm.title'),+ message: t('admin.delivery_zones.delete_confirm.message', { name: zone.name }),+ variant: 'destructive',+ confirmLabel: t('admin.actions.delete'),+ })+ if (!ok) return+ await deleteMutation.mutateAsync(zone.id).catch(() => undefined)+ }++ return (+ <Card>+ <CardHeader className="flex flex-row items-start justify-between gap-2">+ <div className="flex flex-col gap-1">+ <CardTitle className="flex items-center gap-2">+ <MapIcon className="size-4 text-muted-foreground" />+ {zone.name}+ </CardTitle>+ <ZoneMembersSummary zone={zone} />+ </div>+ <div className="flex items-center gap-2">+ <Can I="create" a={Subject.DeliveryMethod}>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={() => openNewMethod({ zone: zone.id, group: originGroupId })}+ >+ <PlusIcon className="size-4" />+ {t('admin.delivery_profiles.detail.add_method')}+ </Button>+ </Can>+ <RowActions+ actions={[+ { key: 'edit', onSelect: onEdit },+ {+ key: 'delete',+ destructive: true,+ visible: permissions.can('destroy', Subject.DeliveryZone),+ disabled: deleteMutation.isPending,+ onSelect: handleDelete,+ },+ ]}+ />+ </div>+ </CardHeader>+ <CardContent>+ <MethodList methods={methods} />+ </CardContent>+ </Card>+ )+}++function UnrestrictedMethodsCard({ methods }: { methods: DeliveryMethod[] }) {+ const { t } = useTranslation()++ return (+ <Card>+ <CardHeader>+ <CardTitle className="flex items-center gap-2">+ <GlobeIcon className="size-4 text-muted-foreground" />+ {t('admin.delivery_profiles.detail.no_zone_title')}+ </CardTitle>+ <span className="text-muted-foreground text-xs">+ {t('admin.delivery_profiles.detail.no_zone_hint')}+ </span>+ </CardHeader>+ <CardContent>+ <MethodList methods={methods} />+ </CardContent>+ </Card>+ )+}++/**+ * Names the places a zone covers: the first few members, then the rest behind+ * a tooltip. Countries come first because they are how merchants think about+ * a zone; states and postal-code rules follow when a zone is finer-grained.+ */+function ZoneMembersSummary({ zone }: { zone: DeliveryZone }) {+ const { t } = useTranslation()++ const names = useMemo(() => {+ const members = zone.members ?? []+ const label = (member: DeliveryZoneMember): string | null => {+ if (member.member_type === 'country') return member.country_name ?? member.country_iso+ if (member.member_type === 'state') return member.state_name ?? member.state_abbr+ if (member.postal_code_prefix) return `${member.postal_code_prefix}*`+ if (member.postal_code_from && member.postal_code_to) {+ return `${member.postal_code_from}–${member.postal_code_to}`+ }+ return member.postal_code_from ?? member.postal_code_to+ }++ const order = { country: 0, state: 1 } as Record<string, number>+ return [...members]+ .sort((a, b) => (order[a.member_type] ?? 2) - (order[b.member_type] ?? 2))+ .map(label)+ .filter((name): name is string => !!name)+ }, [zone.members])++ if (names.length === 0) return null++ const shown = names.slice(0, 3)+ const remaining = names.slice(3)++ return (+ <span className="text-muted-foreground text-xs">+ {shown.join(t('admin.delivery_zones.member_separator'))}+ {remaining.length > 0 && (+ <>+ {t('admin.delivery_zones.member_separator')}+ <Tooltip>+ <TooltipTrigger asChild>+ <button type="button" className="underline decoration-dotted underline-offset-2">+ {t('admin.delivery_zones.members_more', { count: remaining.length })}+ </button>+ </TooltipTrigger>+ <TooltipContent className="max-w-xs">+ {remaining.join(t('admin.delivery_zones.member_separator'))}+ </TooltipContent>+ </Tooltip>+ </>+ )}+ </span>+ )+}++function MethodList({+ methods,+ icon: Icon = TruckIcon,+}: {+ methods: DeliveryMethod[]+ icon?: typeof TruckIcon+}) {+ const { t, i18n } = useTranslation()+ const { store, defaultCurrency } = useStore()+ const { openMethod } = useMethodSheetNavigation()+ const confirm = useConfirm()+ const deleteMutation = useDeleteDeliveryMethod()+ const { permissions } = usePermissions()+ const { data: rateProviders } = useDeliveryRateProviders()++ async function handleDelete(method: DeliveryMethod) {+ const ok = await confirm({+ title: t('admin.delivery_methods.delete_confirm.title'),+ message: t('admin.delivery_methods.delete_confirm.message', { name: method.name }),+ variant: 'destructive',+ confirmLabel: t('admin.actions.delete'),+ })+ if (!ok) return+ await deleteMutation.mutateAsync(method.id).catch(() => undefined)+ }++ if (methods.length === 0) {+ return (+ <p className="text-muted-foreground text-sm">+ {t('admin.delivery_profiles.detail.no_methods')}+ </p>+ )+ }++ return (+ <div className="flex flex-col divide-y">+ {methods.map((method) => {+ const rateProvider = (rateProviders?.data ?? []).find(+ (provider) => provider.type === method.rate_provider,+ )+ // A carrier quotes each shipment live, so there is no one price to+ // show — the carrier's name is the honest answer. Everything else is+ // priced up front: an amount, or free when there is none.+ const carrierPriced = rateProvider?.uses_calculator === false+ const amount = flatAmount(method.calculator_preferences)+ const price = carrierPriced+ ? rateProvider.name+ : amount === null || amount === 0+ ? t('admin.delivery_methods.free')+ : formatAmount(amount, defaultCurrency, i18n.language)++ const ruleSummary = summarizeRules(method.rules, {+ t,+ currency: defaultCurrency,+ weightUnit: store?.preferred_weight_unit ?? 'lb',+ locale: i18n.language,+ })++ return (+ <div key={method.id} className="flex items-center justify-between gap-2 py-2">+ <button+ type="button"+ className="flex flex-1 items-center gap-2 text-left"+ onClick={() => openMethod(method.id)}+ >+ <Icon className="size-4 shrink-0 text-muted-foreground" />+ <span className="flex flex-col">+ <span className="text-sm">{method.name}</span>+ {ruleSummary && (+ <span className="text-muted-foreground text-xs">{ruleSummary}</span>+ )}+ </span>+ </button>+ {!method.storefront_visible && (+ <Badge variant="outline">{t('admin.delivery_profiles.detail.hidden_badge')}</Badge>+ )}+ <span className="shrink-0 text-sm tabular-nums">{price}</span>+ <RowActions+ actions={[+ {+ key: 'edit',+ onSelect: () => openMethod(method.id),+ },+ {+ key: 'delete',+ destructive: true,+ visible: permissions.can('destroy', Subject.DeliveryMethod),+ disabled: deleteMutation.isPending,+ onSelect: () => handleDelete(method),+ },+ ]}+ />+ </div>+ )+ })}+ </div>+ )+}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId.tsxnew file mode 100644index 0000000000..ae85f985a6--- /dev/null+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId.tsx@@ -0,0 +1,19 @@+import { createFileRoute, redirect } from '@tanstack/react-router'++/**+ * The method form moved into a sheet on the profile page, so this URL only+ * survives for the links and bookmarks that still point at it: it forwards to+ * the profile with that method's sheet open.+ */+export const Route = createFileRoute(+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/$methodId',+)({+ beforeLoad: ({ params }) => {+ throw redirect({+ to: '/$storeId/settings/delivery-profiles/$profileId',+ params: { storeId: params.storeId, profileId: params.profileId },+ search: { method: params.methodId },+ replace: true,+ })+ },+})diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new.tsxnew file mode 100644index 0000000000..ce2c177b97--- /dev/null+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new.tsx@@ -0,0 +1,38 @@+import { createFileRoute, redirect } from '@tanstack/react-router'+import { z } from 'zod/v4'++/**+ * `zone` preselects the zone the merchant clicked "Add method" inside;+ * `group` files the method under the origin group they added it from, which+ * matters only once a profile has been split into several; `provider`+ * preselects the kind of fulfillment they asked for.+ */+const newMethodSearchSchema = z.object({+ zone: z.string().optional(),+ group: z.string().optional(),+ provider: z.enum(['pickup', 'digital']).optional(),+})++/**+ * The method form moved into a sheet on the profile page, so this URL only+ * survives for the links and bookmarks that still point at it: it forwards to+ * the profile with the sheet open, carrying the preselection across.+ */+export const Route = createFileRoute(+ '/_authenticated/$storeId/settings/delivery-profiles/$profileId/methods/new',+)({+ validateSearch: newMethodSearchSchema,+ beforeLoad: ({ params, search }) => {+ throw redirect({+ to: '/$storeId/settings/delivery-profiles/$profileId',+ params: { storeId: params.storeId, profileId: params.profileId },+ search: {+ method: 'new',+ ...(search.zone ? { zone: search.zone } : {}),+ ...(search.group ? { group: search.group } : {}),+ ...(search.provider ? { provider: search.provider } : {}),+ },+ replace: true,+ })+ },+})diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/index.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/index.tsxnew file mode 100644index 0000000000..ebd11ee8b6--- /dev/null+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-profiles/index.tsx@@ -0,0 +1,319 @@+import { zodResolver } from '@hookform/resolvers/zod'+import type { DeliveryProfile } from '@spree/admin-sdk'+import {+ adminClient,+ Can,+ mapSpreeErrorsToForm,+ ResourceTable,+ resourceSearchSchema,+ Subject,+ usePermissions,+} from '@spree/dashboard-core'+import {+ Button,+ Checkbox,+ Dialog,+ DialogBody,+ DialogContent,+ DialogDescription,+ DialogFooter,+ DialogHeader,+ DialogTitle,+ Field,+ FieldError,+ FieldGroup,+ FieldLabel,+ Input,+ RadioGroup,+ RadioGroupItem,+ RowActions,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,+ useConfirm,+ useRowClickBridge,+} from '@spree/dashboard-ui'+import { createFileRoute, useNavigate } from '@tanstack/react-router'+import { PlusIcon } from 'lucide-react'+import { Controller, useForm } from 'react-hook-form'+import { useTranslation } from 'react-i18next'+import { z } from 'zod/v4'+import {+ useCreateDeliveryProfile,+ useDeleteDeliveryProfile,+ useDeliveryProfileKinds,+} from '../../../../../hooks/use-delivery-profiles'+import { useStockLocations } from '../../../../../hooks/use-stock-locations'+import {+ DELIVERY_PROFILE_CREATE_DEFAULTS,+ type DeliveryProfileCreateValues,+ deliveryProfileCreateSchema,+} from '../../../../../schemas/delivery-profile'+import '../../../../../tables/delivery-profiles'++const shippingSearchSchema = resourceSearchSchema.extend({+ new: z.coerce.boolean().optional(),+})++export const Route = createFileRoute('/_authenticated/$storeId/settings/delivery-profiles/')({+ validateSearch: shippingSearchSchema,+ component: ShippingPage,+})++function ShippingPage() {+ const { t } = useTranslation()+ const { storeId } = Route.useParams()+ const search = Route.useSearch() as z.infer<typeof shippingSearchSchema>+ const navigate = useNavigate()+ const confirm = useConfirm()+ const deleteMutation = useDeleteDeliveryProfile()+ const { permissions } = usePermissions()++ const isCreating = !!search.new++ const closeDialog = () =>+ navigate({+ search: (prev: Record<string, unknown>) => {+ const { new: _n, ...rest } = prev+ return rest as never+ },+ })++ const openCreate = () =>+ navigate({ search: (prev: Record<string, unknown>) => ({ ...prev, new: true }) as never })++ const openProfile = (profileId: string) =>+ navigate({+ to: '/$storeId/settings/delivery-profiles/$profileId',+ params: { storeId, profileId },+ })++ useRowClickBridge('data-delivery-profile-id', openProfile)++ async function handleDelete(profile: DeliveryProfile) {+ const ok = await confirm({+ title: t('admin.delivery_profiles.delete_confirm.title'),+ message: t('admin.delivery_profiles.delete_confirm.message', { name: profile.name ?? '' }),+ variant: 'destructive',+ confirmLabel: t('admin.actions.delete'),+ })+ if (!ok) return+ await deleteMutation.mutateAsync(profile.id).catch(() => undefined)+ }++ return (+ <>+ <ResourceTable<DeliveryProfile>+ tableKey="delivery-profiles"+ queryKey="delivery-profiles"+ queryFn={(params) => adminClient.deliveryProfiles.list(params)}+ searchParams={search}+ rowActions={(profile) => (+ <RowActions+ actions={[+ { key: 'edit', onSelect: () => openProfile(profile.id) },+ {+ key: 'delete',+ destructive: true,+ // The store default profile is what every unassigned product+ // falls back to, so the server refuses to delete it — don't+ // offer an action that can only fail.+ visible: !profile.default && permissions.can('destroy', Subject.DeliveryProfile),+ disabled: deleteMutation.isPending,+ onSelect: () => handleDelete(profile),+ },+ ]}+ />+ )}+ actions={+ <Can I="create" a={Subject.DeliveryProfile}>+ <Button size="sm" className="h-[2.125rem]" onClick={openCreate}>+ <PlusIcon className="size-4" />+ {t('admin.delivery_profiles.add_cta')}+ </Button>+ </Can>+ }+ />++ {isCreating && <CreateProfileDialog onClose={closeDialog} />}+ </>+ )+}++function CreateProfileDialog({ onClose }: { onClose: () => void }) {+ const { t } = useTranslation()+ const { storeId } = Route.useParams()+ const navigate = useNavigate()+ const createMutation = useCreateDeliveryProfile()+ const { data: kinds } = useDeliveryProfileKinds()+ const { data: stockLocations } = useStockLocations()++ const form = useForm<DeliveryProfileCreateValues>({+ resolver: zodResolver(deliveryProfileCreateSchema),+ defaultValues: DELIVERY_PROFILE_CREATE_DEFAULTS,+ })++ const originsScope = form.watch('origins_scope')++ const kindOptions = (kinds?.data ?? []).map((entry) => ({+ value: entry.kind,+ label: t(`admin.delivery_profiles.kinds.${entry.kind}`, { defaultValue: entry.kind }),+ }))++ async function onSubmit(values: DeliveryProfileCreateValues) {+ try {+ const profile = await createMutation.mutateAsync({+ name: values.name,+ kind: values.kind,+ // Empty means every location, including ones added later.+ stock_location_ids: values.origins_scope === 'all' ? [] : values.stock_location_ids,+ })+ onClose()+ // A new profile is empty: send the merchant straight to it, where the+ // zones and methods that make it useful get added.+ navigate({+ to: '/$storeId/settings/delivery-profiles/$profileId',+ params: { storeId, profileId: profile.id },+ })+ } catch (err) {+ if (!mapSpreeErrorsToForm(err, form.setError)) throw err+ }+ }++ const { errors } = form.formState++ return (+ <Dialog open onOpenChange={(open) => !open && onClose()}>+ <DialogContent>+ <DialogHeader>+ <DialogTitle>{t('admin.delivery_profiles.add_dialog_title')}</DialogTitle>+ <DialogDescription>{t('admin.delivery_profiles.create_description')}</DialogDescription>+ </DialogHeader>+ <form onSubmit={form.handleSubmit(onSubmit)}>+ <DialogBody>+ <FieldGroup>+ {errors.root?.message && (+ <p className="text-sm text-destructive" role="alert">+ {errors.root.message}+ </p>+ )}+ <Field>+ <FieldLabel htmlFor="name">{t('admin.fields.name.label')}</FieldLabel>+ <Input+ id="name"+ autoFocus+ aria-invalid={!!errors.name || undefined}+ {...form.register('name')}+ />+ <FieldError errors={[errors.name]} />+ </Field>++ <Field>+ <FieldLabel>{t('admin.fields.delivery_profile.kind.label')}</FieldLabel>+ <Controller+ name="kind"+ control={form.control}+ render={({ field }) => (+ <Select items={kindOptions} value={field.value} onValueChange={field.onChange}>+ <SelectTrigger>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {kindOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>+ )}+ />+ <span className="text-muted-foreground text-xs">+ {t('admin.fields.delivery_profile.kind.help')}+ </span>+ </Field>++ <Field>+ <FieldLabel>{t('admin.fields.delivery_profile.origins.label')}</FieldLabel>+ {/* "All locations" is an empty set, not every box ticked —+ naming locations freezes the profile to today's list and+ silently excludes any warehouse added later. */}+ <Controller+ name="origins_scope"+ control={form.control}+ render={({ field }) => (+ <RadioGroup value={field.value} onValueChange={field.onChange}>+ <label+ htmlFor="create-profile-origins-all"+ className="flex items-center gap-2 text-sm"+ >+ <RadioGroupItem id="create-profile-origins-all" value="all" />+ {t('admin.delivery_profiles.all_locations')}+ </label>+ <label+ htmlFor="create-profile-origins-selected"+ className="flex items-center gap-2 text-sm"+ >+ <RadioGroupItem id="create-profile-origins-selected" value="selected" />+ {t('admin.delivery_profiles.selected_locations')}+ </label>+ </RadioGroup>+ )}+ />++ {originsScope === 'selected' && (+ <Controller+ name="stock_location_ids"+ control={form.control}+ render={({ field }) => (+ <div className="flex flex-col gap-2">+ {(stockLocations?.data ?? []).map((location) => (+ <label+ key={location.id}+ htmlFor={`create-profile-location-${location.id}`}+ className="flex items-center gap-2 text-sm"+ >+ <Checkbox+ id={`create-profile-location-${location.id}`}+ checked={field.value.includes(location.id)}+ onCheckedChange={(next) =>+ field.onChange(+ next+ ? [...field.value, location.id]+ : field.value.filter((id: string) => id !== location.id),+ )+ }+ />+ {location.name}+ </label>+ ))}+ </div>+ )}+ />+ )}+ </Field>+ </FieldGroup>+ </DialogBody>+ <DialogFooter>+ <Button+ type="button"+ variant="outline"+ size="sm"+ onClick={onClose}+ disabled={form.formState.isSubmitting}+ >+ {t('admin.actions.cancel')}+ </Button>+ <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>+ {form.formState.isSubmitting+ ? t('admin.actions.creating')+ : t('admin.delivery_profiles.create_label')}+ </Button>+ </DialogFooter>+ </form>+ </DialogContent>+ </Dialog>+ )+}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-zones.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-zones.tsxdeleted file mode 100644index a4a89d075c..0000000000--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/delivery-zones.tsx+++ /dev/null@@ -1,449 +0,0 @@-import { zodResolver } from '@hookform/resolvers/zod'-import type { DeliveryZone } from '@spree/admin-sdk'-import {- adminClient,- Can,- mapSpreeErrorsToForm,- ResourceTable,- resourceSearchSchema,- Subject,- usePermissions,-} from '@spree/dashboard-core'-import {- Button,- Field,- FieldError,- FieldGroup,- FieldLabel,- Input,- RowActions,- Select,- SelectContent,- SelectItem,- SelectTrigger,- SelectValue,- Sheet,- SheetContent,- SheetDescription,- SheetFooter,- SheetHeader,- SheetTitle,- Textarea,- useConfirm,- useRowClickBridge,-} from '@spree/dashboard-ui'-import { useQuery } from '@tanstack/react-query'-import { createFileRoute, useNavigate } from '@tanstack/react-router'-import { PlusIcon, Trash2Icon } from 'lucide-react'-import { useEffect } from 'react'-import { Controller, type UseFormReturn, useFieldArray, useForm } from 'react-hook-form'-import { useTranslation } from 'react-i18next'-import { z } from 'zod/v4'-import {- useCreateDeliveryZone,- useDeleteDeliveryZone,- useDeliveryZone,- useUpdateDeliveryZone,-} from '../../../../hooks/use-delivery-zones'-import {- DELIVERY_ZONE_DEFAULTS,- type DeliveryZoneFormValues,- deliveryZoneFormSchema,- deliveryZoneValuesToParams,- MEMBER_TYPES,-} from '../../../../schemas/delivery-zone'-import '../../../../tables/delivery-zones'--const deliveryZonesSearchSchema = resourceSearchSchema.extend({- edit: z.string().optional(),- new: z.coerce.boolean().optional(),-})--export const Route = createFileRoute('/_authenticated/$storeId/settings/delivery-zones')({- validateSearch: deliveryZonesSearchSchema,- component: DeliveryZonesPage,-})--function DeliveryZonesPage() {- const { t } = useTranslation()- const search = Route.useSearch() as z.infer<typeof deliveryZonesSearchSchema>- const navigate = useNavigate()- const confirm = useConfirm()- const deleteMutation = useDeleteDeliveryZone()- const { permissions } = usePermissions()-- const editId = search.edit- const isCreating = !!search.new-- const closeSheet = () =>- navigate({- search: (prev: Record<string, unknown>) => {- const { edit: _e, new: _n, ...rest } = prev- return rest as never- },- })-- const openCreate = () =>- navigate({ search: (prev: Record<string, unknown>) => ({ ...prev, new: true }) as never })-- const openEdit = (id: string) =>- navigate({ search: (prev: Record<string, unknown>) => ({ ...prev, edit: id }) as never })-- useRowClickBridge('data-delivery-zone-id', openEdit)-- async function handleDelete(zone: DeliveryZone) {- const ok = await confirm({- title: t('admin.delivery_zones.delete_confirm.title'),- message: t('admin.delivery_zones.delete_confirm.message', { name: zone.name ?? '' }),- variant: 'destructive',- confirmLabel: t('admin.actions.delete'),- })- if (!ok) return- await deleteMutation.mutateAsync(zone.id).catch(() => undefined)- }-- return (- <>- <ResourceTable<DeliveryZone>- tableKey="delivery-zones"- queryKey="delivery-zones"- queryFn={(params) => adminClient.deliveryZones.list({ ...params, expand: ['members'] })}- searchParams={search}- rowActions={(zone) => (- <RowActions- actions={[- { key: 'edit', onSelect: () => openEdit(zone.id) },- {- key: 'delete',- destructive: true,- visible: permissions.can('destroy', Subject.DeliveryZone),- disabled: deleteMutation.isPending,- onSelect: () => handleDelete(zone),- },- ]}- />- )}- actions={- <Can I="create" a={Subject.DeliveryZone}>- <Button size="sm" className="h-[2.125rem]" onClick={openCreate}>- <PlusIcon className="size-4" />- {t('admin.delivery_zones.add_cta')}- </Button>- </Can>- }- />-- {isCreating && <CreateDeliveryZoneSheet open onOpenChange={(o) => !o && closeSheet()} />}- {editId && (- <EditDeliveryZoneSheet id={editId} open onOpenChange={(o) => !o && closeSheet()} />- )}- </>- )-}--function CreateDeliveryZoneSheet({- open,- onOpenChange,-}: {- open: boolean- onOpenChange: (open: boolean) => void-}) {- const { t } = useTranslation()- const createMutation = useCreateDeliveryZone()- const form = useForm<DeliveryZoneFormValues>({- // eslint-disable-next-line @typescript-eslint/no-explicit-any- resolver: zodResolver(deliveryZoneFormSchema) as any,- defaultValues: DELIVERY_ZONE_DEFAULTS,- })-- async function onSubmit(values: DeliveryZoneFormValues) {- try {- await createMutation.mutateAsync(deliveryZoneValuesToParams(values))- form.reset(DELIVERY_ZONE_DEFAULTS)- onOpenChange(false)- } catch (err) {- if (!mapSpreeErrorsToForm(err, form.setError)) throw err- }- }-- return (- <Sheet- open={open}- onOpenChange={(next) => {- if (!next) form.reset(DELIVERY_ZONE_DEFAULTS)- onOpenChange(next)- }}- >- <SheetContent>- <SheetHeader>- <SheetTitle>{t('admin.delivery_zones.add_sheet_title')}</SheetTitle>- <SheetDescription>{t('admin.delivery_zones.create_description')}</SheetDescription>- </SheetHeader>- <form onSubmit={form.handleSubmit(onSubmit)} className="flex min-h-0 flex-1 flex-col">- <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">- <DeliveryZoneFormFields form={form} />- </div>- <SheetFooter>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => onOpenChange(false)}- disabled={form.formState.isSubmitting}- >- {t('admin.actions.cancel')}- </Button>- <Button type="submit" size="sm" disabled={form.formState.isSubmitting}>- {form.formState.isSubmitting- ? t('admin.actions.creating')- : t('admin.delivery_zones.create_label')}- </Button>- </SheetFooter>- </form>- </SheetContent>- </Sheet>- )-}--function EditDeliveryZoneSheet({- id,- open,- onOpenChange,-}: {- id: string- open: boolean- onOpenChange: (open: boolean) => void-}) {- const { t } = useTranslation()- const { data: zone, isLoading } = useDeliveryZone(id)- const updateMutation = useUpdateDeliveryZone(id)-- const form = useForm<DeliveryZoneFormValues>({- // eslint-disable-next-line @typescript-eslint/no-explicit-any- resolver: zodResolver(deliveryZoneFormSchema) as any,- defaultValues: DELIVERY_ZONE_DEFAULTS,- })-- useEffect(() => {- if (zone) {- form.reset({- name: zone.name,- description: zone.description ?? '',- members: (zone.members ?? []).map((member) => ({- member_type:- member.member_type as DeliveryZoneFormValues['members'][number]['member_type'],- country_iso: member.country_iso ?? '',- state_abbr: member.state_abbr ?? '',- postal_code_prefix: member.postal_code_prefix ?? '',- postal_code_from: member.postal_code_from ?? '',- postal_code_to: member.postal_code_to ?? '',- })),- })- }- }, [zone, form])-- async function onSubmit(values: DeliveryZoneFormValues) {- try {- await updateMutation.mutateAsync(deliveryZoneValuesToParams(values))- form.reset(values)- onOpenChange(false)- } catch (err) {- if (!mapSpreeErrorsToForm(err, form.setError)) throw err- }- }-- return (- <Sheet open={open} onOpenChange={onOpenChange}>- <SheetContent>- <SheetHeader>- <SheetTitle>{zone?.name ?? t('admin.delivery_zones.edit_sheet_title')}</SheetTitle>- <SheetDescription>{t('admin.delivery_zones.edit_description')}</SheetDescription>- </SheetHeader>- {isLoading ? (- <div className="p-4 text-sm text-muted-foreground">{t('admin.common.loading')}</div>- ) : (- <form onSubmit={form.handleSubmit(onSubmit)} className="flex min-h-0 flex-1 flex-col">- <div className="flex flex-1 flex-col gap-4 overflow-y-auto p-4">- <DeliveryZoneFormFields form={form} />- </div>- <SheetFooter>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => onOpenChange(false)}- disabled={form.formState.isSubmitting}- >- {t('admin.actions.cancel')}- </Button>- <Button- type="submit"- size="sm"- disabled={form.formState.isSubmitting || !form.formState.isDirty}- >- {form.formState.isSubmitting ? t('admin.actions.saving') : t('admin.actions.save')}- </Button>- </SheetFooter>- </form>- )}- </SheetContent>- </Sheet>- )-}--function DeliveryZoneFormFields({ form }: { form: UseFormReturn<DeliveryZoneFormValues> }) {- const { t } = useTranslation()- const { errors } = form.formState- const membersArray = useFieldArray({ control: form.control, name: 'members' })-- const { data: countries } = useQuery({- queryKey: ['countries'],- queryFn: () => adminClient.countries.list({ limit: 300 }),- staleTime: 1000 * 60 * 60,- })-- const countryOptions = (countries?.data ?? []).map((country) => ({- value: country.iso,- label: country.name,- }))-- const memberTypeOptions = MEMBER_TYPES.map((value) => ({- value,- label: t(`admin.delivery_zones.member_types.${value}`),- }))-- return (- <FieldGroup>- {errors.root?.message && (- <p className="text-sm text-destructive" role="alert">- {errors.root.message}- </p>- )}- <Field>- <FieldLabel htmlFor="name">{t('admin.fields.name.label')}</FieldLabel>- <Input- id="name"- autoFocus- aria-invalid={!!errors.name || undefined}- {...form.register('name')}- />- <FieldError errors={[errors.name]} />- </Field>-- <Field>- <FieldLabel htmlFor="description">{t('admin.fields.description.label')}</FieldLabel>- <Textarea id="description" rows={2} {...form.register('description')} />- </Field>-- <div className="flex items-center justify-between">- <FieldLabel>{t('admin.delivery_zones.members_column')}</FieldLabel>- <Button- type="button"- variant="outline"- size="sm"- onClick={() => membersArray.append({ member_type: 'country', country_iso: '' })}- >- <PlusIcon className="size-4" />- {t('admin.delivery_zones.add_member')}- </Button>- </div>-- {membersArray.fields.length === 0 && (- <p className="text-sm text-muted-foreground">{t('admin.delivery_zones.no_members_hint')}</p>- )}-- {membersArray.fields.map((member, index) => {- const memberType = form.watch(`members.${index}.member_type`)- return (- <div key={member.id} className="flex flex-col gap-2 rounded-md border p-3">- <div className="flex items-center gap-2">- <Controller- name={`members.${index}.member_type`}- control={form.control}- render={({ field }) => (- <Select- items={memberTypeOptions}- value={field.value}- onValueChange={field.onChange}- >- <SelectTrigger className="flex-1">- <SelectValue />- </SelectTrigger>- <SelectContent>- {memberTypeOptions.map((option) => (- <SelectItem key={option.value} value={option.value}>- {option.label}- </SelectItem>- ))}- </SelectContent>- </Select>- )}- />- <Button- type="button"- variant="ghost"- size="icon-sm"- onClick={() => membersArray.remove(index)}- aria-label={t('admin.actions.delete')}- >- <Trash2Icon className="size-4" />- </Button>- </div>-- <Controller- name={`members.${index}.country_iso`}- control={form.control}- render={({ field }) => (- <Select- items={countryOptions}- value={field.value ?? ''}- onValueChange={field.onChange}- >- <SelectTrigger>- <SelectValue>- {(value) =>- countryOptions.find((option) => option.value === value)?.label ??- t('admin.delivery_zones.select_country')- }- </SelectValue>- </SelectTrigger>- <SelectContent>- {countryOptions.map((option) => (- <SelectItem key={option.value} value={option.value}>- {option.label}- </SelectItem>- ))}- </SelectContent>- </Select>- )}- />-- {memberType === 'state' && (- <Input- placeholder={t('admin.delivery_zones.state_placeholder')}- {...form.register(`members.${index}.state_abbr`)}- />- )}-- {memberType === 'postal_code' && (- <div className="grid grid-cols-3 gap-2">- <Input- placeholder={t('admin.delivery_zones.prefix_placeholder')}- {...form.register(`members.${index}.postal_code_prefix`)}- />- <Input- placeholder={t('admin.delivery_zones.from_placeholder')}- {...form.register(`members.${index}.postal_code_from`)}- />- <Input- placeholder={t('admin.delivery_zones.to_placeholder')}- {...form.register(`members.${index}.postal_code_to`)}- />- </div>- )}- </div>- )- })}- </FieldGroup>- )-}diff --git a/packages/dashboard/src/routes/_authenticated/$storeId/settings/product-types.tsx b/packages/dashboard/src/routes/_authenticated/$storeId/settings/product-types.tsxindex dd8a467e9c..4c684c02ab 100644--- a/packages/dashboard/src/routes/_authenticated/$storeId/settings/product-types.tsx+++ b/packages/dashboard/src/routes/_authenticated/$storeId/settings/product-types.tsx@@ -38,6 +38,11 @@ import {FieldLabel,Input,RowActions,+ Select,+ SelectContent,+ SelectItem,+ SelectTrigger,+ SelectValue,Sheet,SheetContent,SheetDescription,@@ -54,7 +59,7 @@ import { Controller, type UseFormReturn, useFieldArray, useForm } from 'react-hoimport { useTranslation } from 'react-i18next'import { z } from 'zod/v4'import { categoryAutocompleteProps } from '../../../../hooks/use-categories'-import { useFulfillmentProviders } from '../../../../hooks/use-delivery-methods'+import { useDeliveryProfiles } from '../../../../hooks/use-delivery-profiles'import { optionTypeAutocompleteProps } from '../../../../hooks/use-option-types'import {useApplyProductTypeToProducts,@@ -63,12 +68,12 @@ import {useProductType,useUpdateProductType,} from '../../../../hooks/use-product-types'-import { FULFILLMENT_TYPES } from '../../../../schemas/delivery-method'import '../../../../tables/product-types'const productTypeFormSchema = z.object({name: z.string().min(1),- fulfillment_types: z.array(z.string()).min(1),+ // Empty means products created with this type stay on the store default.+ delivery_profile_id: z.string(),option_type_ids: z.array(z.string()),category_ids: z.array(z.string()),custom_field_definitions: z.array(@@ -83,7 +88,7 @@ type ProductTypeFormValues = z.infer<typeof productTypeFormSchema>const PRODUCT_TYPE_DEFAULTS: ProductTypeFormValues = {name: '',- fulfillment_types: ['shipping'],+ delivery_profile_id: '',option_type_ids: [],category_ids: [],custom_field_definitions: [],@@ -93,6 +98,7 @@ const PRODUCT_TYPE_DEFAULTS: ProductTypeFormValues = {function withSortOrder(values: ProductTypeFormValues) {return {...values,+ delivery_profile_id: values.delivery_profile_id || null,custom_field_definitions: values.custom_field_definitions.map((row, index) => ({...row,sort_order: index,@@ -274,7 +280,7 @@ function EditProductTypeSheet({if (productType) {form.reset({name: productType.name,- fulfillment_types: productType.fulfillment_types ?? ['shipping'],+ delivery_profile_id: productType.delivery_profile_id ?? '',option_type_ids: productType.option_type_ids ?? [],category_ids: productType.category_ids ?? [],custom_field_definitions: (productType.custom_field_definitions ?? []).map(@@ -387,10 +393,14 @@ function ApplyToProductsSection({function ProductTypeFormFields({ form }: { form: UseFormReturn<ProductTypeFormValues> }) {const { t } = useTranslation()const { errors } = form.formState- const { data: fulfillmentProviders } = useFulfillmentProviders()- // Registry-driven: extension-registered types appear without a dashboard- // change; the shipped const only covers the pre-fetch render.- const registeredFulfillmentTypes = fulfillmentProviders?.fulfillment_types ?? FULFILLMENT_TYPES+ const { data: deliveryProfiles } = useDeliveryProfiles()+ const profileOptions = [+ { value: '', label: t('admin.product_types.default_delivery_profile') },+ ...(deliveryProfiles?.data ?? []).map((profile) => ({+ value: profile.id,+ label: profile.name,+ })),+ ]return (<FieldGroup>@@ -412,44 +422,28 @@ function ProductTypeFormFields({ form }: { form: UseFormReturn<ProductTypeFormVa</Field><Field>- <FieldLabel>{t('admin.fields.product_type.fulfillment_types.label')}</FieldLabel>+ <FieldLabel>{t('admin.fields.product_type.delivery_profile_id.label')}</FieldLabel><span className="text-muted-foreground text-xs">- {t('admin.fields.product_type.fulfillment_types.help')}+ {t('admin.fields.product_type.delivery_profile_id.help')}</span><Controller- name="fulfillment_types"+ name="delivery_profile_id"control={form.control}render={({ field }) => (- <div className="flex flex-col gap-2">- {registeredFulfillmentTypes.map((fulfillmentType) => {- const checked = field.value.includes(fulfillmentType)- return (- <label- key={fulfillmentType}- htmlFor={`fulfillment-type-${fulfillmentType}`}- className="flex items-center gap-2 text-sm"- >- <Checkbox- id={`fulfillment-type-${fulfillmentType}`}- checked={checked}- onCheckedChange={(next) => {- field.onChange(- next- ? [...field.value, fulfillmentType]- : field.value.filter((value) => value !== fulfillmentType),- )- }}- />- {t(`admin.delivery_methods.fulfillment_types.${fulfillmentType}`, {- defaultValue: fulfillmentType,- })}- </label>- )- })}- </div>+ <Select items={profileOptions} value={field.value} onValueChange={field.onChange}>+ <SelectTrigger>+ <SelectValue />+ </SelectTrigger>+ <SelectContent>+ {profileOptions.map((option) => (+ <SelectItem key={option.value} value={option.value}>+ {option.label}+ </SelectItem>+ ))}+ </SelectContent>+ </Select>)}/>- <FieldError errors={[errors.fulfillment_types]} /></Field><Field>diff --git a/packages/dashboard/src/schemas/channel.ts b/packages/dashboard/src/schemas/channel.tsindex d4709aeb86..77c0449bfa 100644--- a/packages/dashboard/src/schemas/channel.ts+++ b/packages/dashboard/src/schemas/channel.ts@@ -34,6 +34,9 @@ export const channelFormSchema = z.object({preferred_order_routing_strategy: z.string(),preferred_storefront_access: z.string(),preferred_guest_checkout: z.string(),+ // Empty means every location of the store serves this channel, which is how+ // the API reads an empty array.+ stock_location_ids: z.array(z.string()),})export type ChannelFormValues = z.infer<typeof channelFormSchema>@@ -46,6 +49,7 @@ export const CHANNEL_DEFAULTS: ChannelFormValues = {preferred_order_routing_strategy: '',preferred_storefront_access: '',preferred_guest_checkout: '',+ stock_location_ids: [],}export function channelValuesToParams(@@ -61,5 +65,8 @@ export function channelValuesToParams(// '' → inherit (null); otherwise an explicit boolean.preferred_guest_checkout:v.preferred_guest_checkout === '' ? null : v.preferred_guest_checkout === 'true',+ // Replace-set: an empty array clears the narrowing, so every location+ // serves the channel again.+ stock_location_ids: v.stock_location_ids,}}diff --git a/packages/dashboard/src/schemas/delivery-method.ts b/packages/dashboard/src/schemas/delivery-method.tsindex 9029cb137e..fdacee9e2a 100644--- a/packages/dashboard/src/schemas/delivery-method.ts+++ b/packages/dashboard/src/schemas/delivery-method.ts@@ -1,7 +1,5 @@import { z } from 'zod/v4'-export const FULFILLMENT_TYPES = ['shipping', 'digital', 'pickup'] as const-/*** One eligibility rule as held in form state. `id` is absent for rules added* in this editing session. `takes_products` comes from the rule-type discovery@@ -38,7 +36,6 @@ export const deliveryMethodFormSchema = z.object({name: z.string().min(1),admin_name: z.string().optional(),code: z.string().optional(),- fulfillment_type: z.enum(FULFILLMENT_TYPES),fulfillment_provider: z.string(),// Empty string means the built-in Internal provider (calculator-priced).rate_provider: z.string(),@@ -49,7 +46,9 @@ export const deliveryMethodFormSchema = z.object({tax_category_id: z.string().optional(),calculator_type: z.string().optional(),calculator_preferences: z.record(z.string(), z.unknown()).optional(),- delivery_zone_ids: z.array(z.string()),+ // Empty string means no destination restriction — the method serves+ // everywhere its profile reaches.+ delivery_zone_id: z.string(),stock_location_ids: z.array(z.string()),rules: z.array(deliveryMethodRuleSchema),markup_flat: z.string().optional(),@@ -63,7 +62,6 @@ export const DELIVERY_METHOD_DEFAULTS: DeliveryMethodFormValues = {name: '',admin_name: '',code: '',- fulfillment_type: 'shipping',fulfillment_provider: 'Spree::FulfillmentProvider::Manual',rate_provider: '',storefront_visible: true,@@ -73,7 +71,7 @@ export const DELIVERY_METHOD_DEFAULTS: DeliveryMethodFormValues = {tax_category_id: '',calculator_type: '',calculator_preferences: {},- delivery_zone_ids: [],+ delivery_zone_id: '',stock_location_ids: [],rules: [],markup_flat: '',@@ -86,7 +84,6 @@ export function deliveryMethodValuesToParams(values: DeliveryMethodFormValues) {name: values.name,admin_name: values.admin_name || null,code: values.code || null,- fulfillment_type: values.fulfillment_type,fulfillment_provider: values.fulfillment_provider,rate_provider: values.rate_provider || null,storefront_visible: values.storefront_visible,@@ -102,9 +99,9 @@ export function deliveryMethodValuesToParams(values: DeliveryMethodFormValues) {...(values.calculator_preferences && Object.keys(values.calculator_preferences).length > 0? { calculator_preferences: values.calculator_preferences }: {}),- delivery_zone_ids: values.delivery_zone_ids,+ delivery_zone_id: values.delivery_zone_id || null,stock_location_ids: values.stock_location_ids,- // Rules ride along with the method so one request saves the whole sheet.+ // Rules ride along with the method so one request saves the whole page.// Omitting `id` marks a rule as new; dropping one from the array deletes// it. `product_ids` is always sent for association-backed rules — omitting// an emptied array would read as "leave unchanged" and silently keep thediff --git a/packages/dashboard/src/schemas/delivery-origin-group.ts b/packages/dashboard/src/schemas/delivery-origin-group.tsnew file mode 100644index 0000000000..b92af0ff02--- /dev/null+++ b/packages/dashboard/src/schemas/delivery-origin-group.ts@@ -0,0 +1,25 @@+import { z } from 'zod/v4'++/**+ * One origin group of a delivery profile. An empty name is the nameless+ * default group, which the UI renders as "All locations"; an empty+ * `stock_location_ids` means the group ships from every store location.+ */+export const deliveryOriginGroupFormSchema = z.object({+ name: z.string(),+ stock_location_ids: z.array(z.string()),+})++export type DeliveryOriginGroupFormValues = z.infer<typeof deliveryOriginGroupFormSchema>++export const DELIVERY_ORIGIN_GROUP_DEFAULTS: DeliveryOriginGroupFormValues = {+ name: '',+ stock_location_ids: [],+}++export function deliveryOriginGroupValuesToParams(values: DeliveryOriginGroupFormValues) {+ return {+ name: values.name.trim() || null,+ stock_location_ids: values.stock_location_ids,+ }+}diff --git a/packages/dashboard/src/schemas/delivery-profile.ts b/packages/dashboard/src/schemas/delivery-profile.tsnew file mode 100644index 0000000000..ed64913cdc--- /dev/null+++ b/packages/dashboard/src/schemas/delivery-profile.ts@@ -0,0 +1,44 @@+import { z } from 'zod/v4'++/**+ * Creating a profile: the kind is fixed at creation because it decides which+ * fulfillment providers the profile's methods may use.+ */+export const deliveryProfileCreateSchema = z.object({+ name: z.string().min(1),+ kind: z.string().min(1),+ /** Display-only, mirroring the detail page: "all" sends an empty id list. */+ origins_scope: z.enum(['all', 'selected']),+ stock_location_ids: z.array(z.string()),+})++export type DeliveryProfileCreateValues = z.infer<typeof deliveryProfileCreateSchema>++export const DELIVERY_PROFILE_CREATE_DEFAULTS: DeliveryProfileCreateValues = {+ name: '',+ kind: 'shipping',+ origins_scope: 'all',+ stock_location_ids: [],+}++/** The general card on the profile detail page — kind is read-only once set. */+export const deliveryProfileGeneralSchema = z.object({+ name: z.string().min(1),+})++export type DeliveryProfileGeneralValues = z.infer<typeof deliveryProfileGeneralSchema>++/**+ * Origins card. `scope` is display-only state: "all" clears the id list, so+ * an empty list still means every store location on the wire.+ */+export const deliveryProfileLocationsSchema = z.object({+ scope: z.enum(['all', 'selected']),+ stock_location_ids: z.array(z.string()),+})++export type DeliveryProfileLocationsValues = z.infer<typeof deliveryProfileLocationsSchema>++export function deliveryProfileLocationsToParams(values: DeliveryProfileLocationsValues) {+ return { stock_location_ids: values.scope === 'all' ? [] : values.stock_location_ids }+}diff --git a/packages/dashboard/src/schemas/delivery-zone.ts b/packages/dashboard/src/schemas/delivery-zone.tsindex 2b9c4b55a1..ef1514c220 100644--- a/packages/dashboard/src/schemas/delivery-zone.ts+++ b/packages/dashboard/src/schemas/delivery-zone.ts@@ -26,10 +26,21 @@ export const DELIVERY_ZONE_DEFAULTS: DeliveryZoneFormValues = {members: [],}-export function deliveryZoneValuesToParams(values: DeliveryZoneFormValues) {+/**+ * A zone belongs to the profile it was created in, and to one origin group+ * within it; both ids are only sent on create, since a zone never moves+ * between profiles or groups.+ */+export function deliveryZoneValuesToParams(+ values: DeliveryZoneFormValues,+ deliveryProfileId?: string,+ deliveryOriginGroupId?: string,+) {return {name: values.name,description: values.description || null,+ ...(deliveryProfileId ? { delivery_profile_id: deliveryProfileId } : {}),+ ...(deliveryOriginGroupId ? { delivery_origin_group_id: deliveryOriginGroupId } : {}),members: values.members.map((member) => ({member_type: member.member_type,...(member.country_iso ? { country_iso: member.country_iso } : {}),diff --git a/packages/dashboard/src/schemas/product.ts b/packages/dashboard/src/schemas/product.tsindex f56f069587..5e773d00e7 100644--- a/packages/dashboard/src/schemas/product.ts+++ b/packages/dashboard/src/schemas/product.ts@@ -109,9 +109,13 @@ export const productFormSchema = z.object({// Taxtax_category_id: z.string().nullable().optional(),- // Product type — drives fulfillment eligibility (shipping/pickup/digital)+ // Product type — a creation-time template for the product's associationsproduct_type_id: z.string().nullable().optional(),+ // Fulfillment profile — decides which zones and delivery methods reach this+ // product; null falls back to the store default profile.+ delivery_profile_id: z.string().nullable().optional(),+// SEOmeta_title: z.string().optional(),meta_description: z.string().optional(),@@ -154,6 +158,7 @@ export function newProductFormDefaults(): ProductFormValues {tags: [],tax_category_id: null,product_type_id: null,+ delivery_profile_id: null,meta_title: '',meta_description: '',slug: '',diff --git a/packages/dashboard/src/tables/delivery-methods.tsx b/packages/dashboard/src/tables/delivery-methods.tsxdeleted file mode 100644index 1bc6ee1fc2..0000000000--- a/packages/dashboard/src/tables/delivery-methods.tsx+++ /dev/null@@ -1,55 +0,0 @@-import type { DeliveryMethod } from '@spree/admin-sdk'-import { defineTable } from '@spree/dashboard-core'-import { ActiveBadge, Badge, ResourceNameCell } from '@spree/dashboard-ui'-import i18n from 'i18next'-import { TruckIcon } from 'lucide-react'--defineTable<DeliveryMethod>('delivery-methods', {- title: i18n.t('admin.settings_nav.items.delivery_methods'),- searchParam: 'name_cont',- searchPlaceholder: i18n.t('admin.delivery_methods.search_placeholder'),- defaultSort: { field: 'name', direction: 'asc' },- emptyIcon: <TruckIcon className="size-8 text-muted-foreground" />,- emptyMessage: i18n.t('admin.delivery_methods.empty'),- columns: [- {- key: 'name',- label: i18n.t('admin.fields.name.label'),- sortable: true,- filterable: true,- default: true,- render: (dm) => (- <ResourceNameCell- id={dm.id}- dataAttr="data-delivery-method-id"- name={dm.name}- secondary={dm.admin_name}- />- ),- },- {- key: 'fulfillment_type',- label: i18n.t('admin.fields.delivery_method.fulfillment_type.label'),- default: true,- render: (dm) => (- <Badge variant="outline">- {i18n.t(`admin.delivery_methods.fulfillment_types.${dm.fulfillment_type}`, {- defaultValue: dm.fulfillment_type,- })}- </Badge>- ),- },- {- key: 'storefront_visible',- label: i18n.t('admin.fields.storefront_visible.label'),- default: true,- render: (dm) => (- <ActiveBadge- active={dm.storefront_visible}- activeLabel={i18n.t('admin.fields.storefront_visible.label')}- dashWhenInactive- />- ),- },- ],-})diff --git a/packages/dashboard/src/tables/delivery-profiles.tsx b/packages/dashboard/src/tables/delivery-profiles.tsxnew file mode 100644index 0000000000..debdb47a86--- /dev/null+++ b/packages/dashboard/src/tables/delivery-profiles.tsx@@ -0,0 +1,88 @@+import type { DeliveryProfile } from '@spree/admin-sdk'+import { defineTable } from '@spree/dashboard-core'+import { Badge, ResourceNameCell } from '@spree/dashboard-ui'+import i18n from 'i18next'+import { TruckIcon } from 'lucide-react'++defineTable<DeliveryProfile>('delivery-profiles', {+ title: i18n.t('admin.settings_nav.items.shipping'),+ searchParam: 'name_cont',+ searchPlaceholder: i18n.t('admin.delivery_profiles.search_placeholder'),+ defaultSort: { field: 'position', direction: 'asc' },+ emptyIcon: <TruckIcon className="size-8 text-muted-foreground" />,+ emptyMessage: i18n.t('admin.delivery_profiles.empty'),+ columns: [+ {+ key: 'name',+ label: i18n.t('admin.fields.name.label'),+ sortable: true,+ filterable: true,+ default: true,+ render: (profile) => (+ <div className="flex items-center gap-2">+ <ResourceNameCell+ id={profile.id}+ dataAttr="data-delivery-profile-id"+ name={profile.name}+ />+ {profile.default && (+ <Badge variant="secondary">{i18n.t('admin.delivery_profiles.default_badge')}</Badge>+ )}+ </div>+ ),+ },+ {+ key: 'kind',+ label: i18n.t('admin.fields.delivery_profile.capabilities.label'),+ default: true,+ // What the profile can actually do reads better than its kind: a+ // physical profile may ship, offer pickup, or both.+ render: (profile) =>+ profile.digital ? (+ <Badge variant="outline">{i18n.t('admin.delivery_profiles.capabilities.digital')}</Badge>+ ) : (+ <div className="flex items-center gap-1">+ {profile.offers_shipping && (+ <Badge variant="outline">+ {i18n.t('admin.delivery_profiles.capabilities.ships')}+ </Badge>+ )}+ {profile.offers_pickup && (+ <Badge variant="outline">+ {i18n.t('admin.delivery_profiles.capabilities.pickup')}+ </Badge>+ )}+ </div>+ ),+ },+ {+ key: 'stock_location_ids',+ label: i18n.t('admin.fields.delivery_profile.origins.label'),+ default: true,+ render: (profile) =>+ profile.stock_location_ids.length === 0+ ? i18n.t('admin.delivery_profiles.all_locations')+ : i18n.t('admin.delivery_profiles.locations_count', {+ count: profile.stock_location_ids.length,+ }),+ },+ {+ key: 'products_count',+ label: i18n.t('admin.fields.delivery_profile.products_count.label'),+ default: true,+ render: (profile) => profile.products_count,+ },+ {+ key: 'delivery_zones_count',+ label: i18n.t('admin.fields.delivery_profile.zones_count.label'),+ default: true,+ render: (profile) => profile.delivery_zones_count,+ },+ {+ key: 'delivery_methods_count',+ label: i18n.t('admin.fields.delivery_profile.methods_count.label'),+ default: true,+ render: (profile) => profile.delivery_methods_count,+ },+ ],+})diff --git a/packages/dashboard/src/tables/delivery-zones.tsx b/packages/dashboard/src/tables/delivery-zones.tsxdeleted file mode 100644index 95b3a095f5..0000000000--- a/packages/dashboard/src/tables/delivery-zones.tsx+++ /dev/null@@ -1,38 +0,0 @@-import type { DeliveryZone } from '@spree/admin-sdk'-import { defineTable } from '@spree/dashboard-core'-import { ResourceNameCell } from '@spree/dashboard-ui'-import i18n from 'i18next'-import { MapIcon } from 'lucide-react'--defineTable<DeliveryZone>('delivery-zones', {- title: i18n.t('admin.settings_nav.items.delivery_zones'),- searchParam: 'name_cont',- searchPlaceholder: i18n.t('admin.delivery_zones.search_placeholder'),- defaultSort: { field: 'name', direction: 'asc' },- emptyIcon: <MapIcon className="size-8 text-muted-foreground" />,- emptyMessage: i18n.t('admin.delivery_zones.empty'),- columns: [- {- key: 'name',- label: i18n.t('admin.fields.name.label'),- sortable: true,- filterable: true,- default: true,- render: (zone) => (- <ResourceNameCell- id={zone.id}- dataAttr="data-delivery-zone-id"- name={zone.name}- secondary={zone.description}- />- ),- },- {- key: 'members',- label: i18n.t('admin.delivery_zones.members_column'),- default: true,- render: (zone) =>- i18n.t('admin.delivery_zones.members_count', { count: zone.members?.length ?? 0 }),- },- ],-})diff --git a/packages/dashboard/src/tables/product-types.tsx b/packages/dashboard/src/tables/product-types.tsxindex 0d685d87f2..39b9b3692e 100644--- a/packages/dashboard/src/tables/product-types.tsx+++ b/packages/dashboard/src/tables/product-types.tsx@@ -27,20 +27,15 @@ defineTable<ProductType>('product-types', {),},{- key: 'fulfillment_types',- label: i18n.t('admin.fields.product_type.fulfillment_types.label'),+ key: 'delivery_profile_id',+ label: i18n.t('admin.fields.product_type.delivery_profile_id.label'),default: true,- render: (productType) => (- <div className="flex flex-wrap gap-1">- {(productType.fulfillment_types ?? []).map((fulfillmentType) => (- <Badge key={fulfillmentType} variant="secondary">- {i18n.t(`admin.delivery_methods.fulfillment_types.${fulfillmentType}`, {- defaultValue: fulfillmentType,- })}- </Badge>- ))}- </div>- ),+ render: (productType) =>+ productType.delivery_profile_id ? (+ <Badge variant="secondary">{i18n.t('admin.product_types.custom_delivery_profile')}</Badge>+ ) : (+ '—'+ ),},{key: 'products_count',diff --git a/packages/sdk/src/types/generated/DeliveryMethod.ts b/packages/sdk/src/types/generated/DeliveryMethod.tsindex dcccda99e5..e414f4961c 100644--- a/packages/sdk/src/types/generated/DeliveryMethod.ts+++ b/packages/sdk/src/types/generated/DeliveryMethod.ts@@ -1,4 +1,4 @@-// Typelizer digest 5646780f39aad6c6b74f3bae591bf8cd+// Typelizer digest 84d8eb60e62f1c55cc1ecab8cf897bb5//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -6,9 +6,11 @@ interface DeliveryMethod {id: string;name: string;code: string | null;- fulfillment_type: string;estimated_transit_business_days_min: number | null;estimated_transit_business_days_max: number | null;+ digital: boolean;+ pickup: boolean;+ pickup_point: boolean;}export default DeliveryMethod;diff --git a/packages/sdk/src/types/generated/DeliveryZoneMember.ts b/packages/sdk/src/types/generated/DeliveryZoneMember.tsindex cbfd584a78..d21dbc69a4 100644--- a/packages/sdk/src/types/generated/DeliveryZoneMember.ts+++ b/packages/sdk/src/types/generated/DeliveryZoneMember.ts@@ -1,4 +1,4 @@-// Typelizer digest 8049b869db0751c4b93919393de54931+// Typelizer digest 203bc8a66690b720535ba7c0daf3d92c//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -9,6 +9,7 @@ interface DeliveryZoneMember {postal_code_from: string | null;postal_code_to: string | null;country_iso: string | null;+ country_name: string | null;state_abbr: string | null;state_name: string | null;}diff --git a/packages/sdk/src/types/generated/StockLocation.ts b/packages/sdk/src/types/generated/StockLocation.tsindex 53ee543cdf..c6c6b8bd50 100644--- a/packages/sdk/src/types/generated/StockLocation.ts+++ b/packages/sdk/src/types/generated/StockLocation.ts@@ -1,4 +1,4 @@-// Typelizer digest 48a5f240452a4f27ae495a03fe3f8bbb+// Typelizer digest a8fe6b6b591ad8afe9d22f2e924d5995//// DO NOT MODIFY: This file was automatically generated by Typelizer.@@ -12,6 +12,8 @@ interface StockLocation {country_iso: string | null;country_name: string | null;state_text: string | null;+ pickup_ready_in_minutes: number | null;+ pickup_instructions: string | null;}export default StockLocation;diff --git a/packages/sdk/src/zod/generated/DeliveryMethod.ts b/packages/sdk/src/zod/generated/DeliveryMethod.tsindex fbdaa41698..966bb8cb92 100644--- a/packages/sdk/src/zod/generated/DeliveryMethod.ts+++ b/packages/sdk/src/zod/generated/DeliveryMethod.ts@@ -5,9 +5,11 @@ export const DeliveryMethodSchema = z.object({id: z.string(),name: z.string(),code: z.string().nullable(),- fulfillment_type: z.string(),estimated_transit_business_days_min: z.number().nullable(),estimated_transit_business_days_max: z.number().nullable(),+ digital: z.boolean(),+ pickup: z.boolean(),+ pickup_point: z.boolean(),});export type DeliveryMethod = z.infer<typeof DeliveryMethodSchema>;diff --git a/packages/sdk/src/zod/generated/DeliveryZoneMember.ts b/packages/sdk/src/zod/generated/DeliveryZoneMember.tsindex f4ddf015b4..a2d24991e8 100644--- a/packages/sdk/src/zod/generated/DeliveryZoneMember.ts+++ b/packages/sdk/src/zod/generated/DeliveryZoneMember.ts@@ -8,6 +8,7 @@ export const DeliveryZoneMemberSchema = z.object({postal_code_from: z.string().nullable(),postal_code_to: z.string().nullable(),country_iso: z.string().nullable(),+ country_name: z.string().nullable(),state_abbr: z.string().nullable(),state_name: z.string().nullable(),});diff --git a/packages/sdk/src/zod/generated/StockLocation.ts b/packages/sdk/src/zod/generated/StockLocation.tsindex 231e6831aa..51cf8beb65 100644--- a/packages/sdk/src/zod/generated/StockLocation.ts+++ b/packages/sdk/src/zod/generated/StockLocation.ts@@ -11,6 +11,8 @@ export const StockLocationSchema = z.object({country_iso: z.string().nullable(),country_name: z.string().nullable(),state_text: z.string().nullable(),+ pickup_ready_in_minutes: z.number().nullable(),+ pickup_instructions: z.string().nullable(),});export type StockLocation = z.infer<typeof StockLocationSchema>;diff --git a/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rbindex a6952c9c29..3fdbd2e90a 100644--- a/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/channels_controller.rb@@ -29,6 +29,27 @@ module Spreerender json: { product_count: removed }end+ def create+ @resource = model_class.new(assignable_params.merge(store: current_store))+ authorize_resource!(@resource, :create)++ if @resource.save+ render json: serialize_resource(@resource), status: :created+ else+ render_validation_error(@resource.errors)+ end+ end++ def update+ @resource.assign_attributes(assignable_params)++ if @resource.save+ render json: serialize_resource(@resource)+ else+ render_validation_error(@resource.errors)+ end+ end+protecteddef model_class@@ -45,7 +66,23 @@ module Spreedef permitted_paramsparams.permit(:name, :code, :active, :default, :preferred_order_routing_strategy,- :preferred_storefront_access, :preferred_guest_checkout)+ :preferred_storefront_access, :preferred_guest_checkout,+ stock_location_ids: [])+ end++ # `stock_location_ids` replaces the channel's fulfillment-origin+ # allowlist; empty clears it (= every location). Store-scoped+ # resolution: a foreign location 404s.+ def assignable_params+ attributes = permitted_params.except(:stock_location_ids)++ if params.key?(:stock_location_ids)+ attributes[:stock_locations] = Array(params[:stock_location_ids]).map do |id|+ current_store.stock_locations.accessible_by(current_ability, :show).find_by_prefix_id!(id)+ end+ end++ attributesendprivatediff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rbindex f90b0e0057..5a82777689 100644--- a/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_methods_controller.rb@@ -23,10 +23,9 @@ module Spreeend# GET /api/v3/admin/delivery_methods/fulfillment_providers- # Registered FulfillmentProvider strategies plus the registered- # fulfillment-type vocabulary (Spree.fulfillment_types — the strict- # set both DeliveryMethod and ProductType validate against), so- # admin UIs render both lists from the registry, not JS constants.+ # Registered FulfillmentProvider strategies with their class+ # predicates, so admin UIs render capability hints from the+ # registry, not JS constants.def fulfillment_providersauthorize! :create, model_class@@ -37,12 +36,14 @@ module Spreeintegration_class: provider_class.integration_class,integration_type: integration_api_type(provider_class),available: provider_class.available_for_store?(current_store),- fulfillment_types: provider_class.fulfillment_types,+ digital: provider_class.digital?,+ pickup: provider_class.pickup?,+ pickup_point: provider_class.pickup_point?,requires_address: provider_class.new.requires_address?}end- render json: { data: data, fulfillment_types: Spree.fulfillment_types }+ render json: { data: data }end# GET /api/v3/admin/delivery_methods/rate_providers@@ -65,7 +66,7 @@ module Spreeintegration_class: provider_class.integration_class,integration_type: integration_api_type(provider_class),available: provider_class.available_for_store?(current_store),- fulfillment_types: provider_class.fulfillment_types,+ requires_address: provider_class.requires_address?,uses_calculator: provider_class.uses_calculator?,service_catalog: catalog.services,# Present when the provider could not list services (e.g. a@@ -125,11 +126,12 @@ module Spree# sheet in one round-trip.def permitted_paramsparams.permit(- :name, :admin_name, :code, :fulfillment_type, :fulfillment_provider,+ :name, :admin_name, :code, :fulfillment_provider,:pickup_point_provider, :rate_provider, :storefront_visible, :tracking_url,:estimated_transit_business_days_min, :estimated_transit_business_days_max,:tax_category_id, :calculator_type, :markup_flat, :markup_percent,- delivery_zone_ids: [], stock_location_ids: [], calculator_preferences: {},+ :delivery_profile_id, :delivery_origin_group_id, :delivery_zone_id,+ stock_location_ids: [], calculator_preferences: {},rules: rule_attributes,services: [:id, :carrier, :service, :label, :markup_flat, :markup_percent, :position])@@ -149,19 +151,25 @@ module Spreeenddef collection_includes- [:calculator, :tax_category, :delivery_zones]+ [:calculator, :tax_category, :delivery_zone, :delivery_profile, :delivery_method_rules]endprivate# Resolves prefixed-ID params to records; calculator handled separately.def assignable_params- attributes = permitted_params.except(:tax_category_id, :delivery_zone_ids, :stock_location_ids, :calculator_type, :calculator_preferences)+ attributes = permitted_params.except(:tax_category_id, :delivery_profile_id, :delivery_origin_group_id, :delivery_zone_id, :stock_location_ids, :calculator_type, :calculator_preferences)if params.key?(:tax_category_id)attributes[:tax_category] = params[:tax_category_id].present? ? Spree::TaxCategory.accessible_by(current_ability, :show).find_by_prefix_id!(params[:tax_category_id]) : nilend- if params.key?(:delivery_zone_ids)- attributes[:delivery_zones] = Array(params[:delivery_zone_ids]).map { |id| current_store.delivery_zones.accessible_by(current_ability, :show).find_by_prefix_id!(id) }+ if params.key?(:delivery_profile_id)+ attributes[:delivery_profile] = current_store.delivery_profiles.accessible_by(current_ability, :show).find_by_prefix_id!(params[:delivery_profile_id])+ end+ if params.key?(:delivery_origin_group_id) && params[:delivery_origin_group_id].present?+ attributes[:delivery_origin_group] = current_store.delivery_origin_groups.accessible_by(current_ability, :show).find_by_prefix_id!(params[:delivery_origin_group_id])+ end+ if params.key?(:delivery_zone_id)+ attributes[:delivery_zone] = params[:delivery_zone_id].present? ? current_store.delivery_zones.accessible_by(current_ability, :show).find_by_prefix_id!(params[:delivery_zone_id]) : nilendif params.key?(:stock_location_ids)attributes[:pickup_locations] = Array(params[:stock_location_ids]).map { |id| current_store.stock_locations.accessible_by(current_ability, :show).find_by_prefix_id!(id) }diff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles/origin_groups_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles/origin_groups_controller.rbnew file mode 100644index 0000000000..8d3402ffc4--- /dev/null+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles/origin_groups_controller.rb@@ -0,0 +1,80 @@+module Spree+ module Api+ module V3+ module Admin+ module DeliveryProfiles+ # Origin groups of one delivery profile. `stock_location_ids`+ # replaces the group's full membership; empty means every store+ # location. The last group cannot be deleted, nor can one that+ # still holds zones or methods.+ class OriginGroupsController < ResourceController+ scoped_resource :settings++ def create+ @resource = scope.new(assignable_params)+ authorize_resource!(@resource, :create)++ if @resource.save+ render json: serialize_resource(@resource), status: :created+ else+ render_validation_error(@resource.errors)+ end+ end++ def update+ @resource.assign_attributes(assignable_params)++ if @resource.save+ render json: serialize_resource(@resource)+ else+ render_validation_error(@resource.errors)+ end+ end++ protected++ def model_class+ Spree::DeliveryOriginGroup+ end++ def serializer_class+ Spree.api.admin_delivery_origin_group_serializer+ end++ def scope+ parent_profile.delivery_origin_groups+ end++ def permitted_params+ params.permit(:name, :position, stock_location_ids: [])+ end++ def collection_includes+ [:stock_locations]+ end++ private++ def parent_profile+ @parent_profile ||= current_store.delivery_profiles.+ accessible_by(current_ability, :show).+ find_by_prefix_id!(params[:delivery_profile_id])+ end++ def assignable_params+ attributes = permitted_params.except(:stock_location_ids)++ if params.key?(:stock_location_ids)+ attributes[:stock_locations] = Array(params[:stock_location_ids]).map do |id|+ current_store.stock_locations.accessible_by(current_ability, :show).find_by_prefix_id!(id)+ end+ end++ attributes+ end+ end+ end+ end+ end+ end+enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rbnew file mode 100644index 0000000000..26574f3821--- /dev/null+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_profiles_controller.rb@@ -0,0 +1,103 @@+module Spree+ module Api+ module V3+ module Admin+ # Fulfillment profiles — the grouping that decides how a set of+ # products ships (origins, zones, methods). Stock-location membership+ # is managed atomically through the profile: `stock_location_ids`+ # replaces the full set; an empty array means every store location.+ class DeliveryProfilesController < ResourceController+ scoped_resource :settings++ # GET /api/v3/admin/delivery_profiles/kinds+ # Registered profile kinds, so admin UIs offer extension-added+ # kinds without hardcoding the built-ins.+ def kinds+ authorize! :create, model_class++ data = Spree.delivery_profile_types.map do |profile_class|+ {+ type: profile_class.to_s,+ kind: profile_class.name.demodulize.underscore+ }+ end++ render json: { data: data }+ end++ def create+ @resource = model_class.new(assignable_params)+ authorize_resource!(@resource, :create)++ if @resource.save+ apply_default_group_locations(@resource)+ render json: serialize_resource(@resource), status: :created+ else+ render_validation_error(@resource.errors)+ end+ end++ def update+ @resource.assign_attributes(assignable_params)++ if @resource.save+ apply_default_group_locations(@resource)+ render json: serialize_resource(@resource)+ else+ render_validation_error(@resource.errors)+ end+ end++ protected++ def model_class+ Spree::DeliveryProfile+ end++ def serializer_class+ Spree.api.admin_delivery_profile_serializer+ end++ def permitted_params+ params.permit(:name, :default, :position, :kind, stock_location_ids: [])+ end++ def collection_includes+ [delivery_origin_groups: :stock_locations]+ end++ private++ def assignable_params+ attributes = permitted_params.except(:kind, :stock_location_ids)++ if @resource.nil?+ attributes[:type] = params.key?(:kind) ? resolve_kind(params[:kind]).to_s : Spree::DeliveryProfiles::Shipping.to_s+ end++ attributes+ end++ # The profile-level shorthand writes the default origin group's+ # membership — one call keeps working for single-group stores;+ # multi-group stores manage members through the nested endpoint.+ def apply_default_group_locations(profile)+ return unless params.key?(:stock_location_ids)++ locations = Array(params[:stock_location_ids]).map do |id|+ current_store.stock_locations.accessible_by(current_ability, :show).find_by_prefix_id!(id)+ end+ profile.default_origin_group&.stock_locations = locations+ end++ # The wire kind (`shipping`, `digital`) resolves against the+ # registry; an unknown kind is a client error, not a constantize.+ def resolve_kind(kind)+ Spree.delivery_profile_types.find { |klass| klass.name.demodulize.underscore == kind.to_s } ||+ raise(ActiveRecord::RecordNotFound)+ end+ end+ end+ end+ end+enddiff --git a/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rbindex 2b4dda86bf..4b36d138dc 100644--- a/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/delivery_zones_controller.rb@@ -51,7 +51,7 @@ module Spreedef permitted_paramsparams.permit(- :name, :description,+ :name, :description, :delivery_profile_id, :delivery_origin_group_id,members: [:member_type, :country_iso, :state_abbr, :postal_code_prefix, :postal_code_from, :postal_code_to])end@@ -62,8 +62,17 @@ module Spreeprivate+ # A zone always lives inside a profile; absent an explicit one it+ # joins the store default.def zone_params- permitted_params.except(:members)+ attributes = permitted_params.except(:members, :delivery_profile_id, :delivery_origin_group_id)+ if params.key?(:delivery_profile_id) && params[:delivery_profile_id].present?+ attributes[:delivery_profile] = current_store.delivery_profiles.accessible_by(current_ability, :show).find_by_prefix_id!(params[:delivery_profile_id])+ end+ if params.key?(:delivery_origin_group_id) && params[:delivery_origin_group_id].present?+ attributes[:delivery_origin_group] = current_store.delivery_origin_groups.accessible_by(current_ability, :show).find_by_prefix_id!(params[:delivery_origin_group_id])+ end+ attributesenddef build_members(zone)diff --git a/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rbindex 17c2d614b0..0708709486 100644--- a/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/product_types_controller.rb@@ -52,14 +52,26 @@ module Spreedef permitted_paramsattrs = params.permit(:name,- fulfillment_types: [],+ :delivery_profile_id,option_type_ids: [],category_ids: [],custom_field_definitions: [:id, :required, :sort_order])+ attrs = scope_delivery_profile(attrs)scope_category_ids(attrs)end+ # The template profile must belong to this store — a cross-store id+ # 404s instead of silently linking.+ def scope_delivery_profile(attrs)+ return attrs unless params.key?(:delivery_profile_id)++ attrs[:delivery_profile] = if params[:delivery_profile_id].present?+ current_store.delivery_profiles.accessible_by(current_ability, :show).find_by_prefix_id!(params[:delivery_profile_id])+ end+ attrs.except(:delivery_profile_id)+ end+# `category_ids=` resolves prefixed ids with no store scoping, so a# type in this store could otherwise be pointed at another store's# categories. Mirrors ProductsController#apply_categories.diff --git a/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb b/spree/api/app/controllers/spree/api/v3/admin/products_controller.rbindex bd78868c33..d8c5763473 100644--- a/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/admin/products_controller.rb@@ -168,8 +168,8 @@ module Spreeparams.permit(:name, :description, :slug, :status,:meta_title, :meta_description, :meta_keywords,- :tax_category_id, :product_type_id,- :promotionable, :digital,+ :tax_category_id, :product_type_id, :delivery_profile_id,+ :promotionable,tags: [],category_ids: [],# Manual collection membership only — the model setter ignoresdiff --git a/spree/api/app/controllers/spree/api/v3/store/delivery_methods_controller.rb b/spree/api/app/controllers/spree/api/v3/store/delivery_methods_controller.rbindex 9d37fdd50e..6901d2b81f 100644--- a/spree/api/app/controllers/spree/api/v3/store/delivery_methods_controller.rb+++ b/spree/api/app/controllers/spree/api/v3/store/delivery_methods_controller.rb@@ -12,6 +12,11 @@ module Spree# stock (package-scoped availability).def pickup_locationslocations = find_resource.available_pickup_locations+ # A channel-bound cart only collects from counters its channel is+ # served by (docs/plans/6.0-channel-delivery.md).+ if pickup_cart&.channel+ locations = locations.merge(pickup_cart.channel.served_stock_locations)+ endlocations = locations.select { |location| covers_cart?(location, pickup_cart) } if pickup_cartrender json: { data: locations.map { |location| Spree.api.stock_location_serializer.new(location, params: serializer_params).to_h } }@@ -46,10 +51,25 @@ module Spreedef scopescope = current_store.delivery_methods.storefront_visible- scope = scope.by_fulfillment_type(params[:fulfillment_type]) if params[:fulfillment_type].present?+ scope = filter_by_kind(scope, params[:fulfillment_type]) if params[:fulfillment_type].present?scopeend+ # Public filter values map onto provider class predicates — the+ # string vocabulary is a wire convenience, not a stored column.+ def filter_by_kind(scope, kind)+ case kind+ when 'digital' then scope.with_provider(:digital?)+ when 'pickup' then scope.with_provider(:pickup?)+ when 'pickup_point' then scope.with_provider(:pickup_point?)+ when 'shipping'+ shipping_providers = Spree.fulfillment_providers.reject { |p| p.digital? || p.pickup? || p.pickup_point? }+ scope.where(fulfillment_provider: shipping_providers.map(&:to_s))+ else+ scope.none+ end+ end+private# Coverage results depend on the cart's contents — the caller must@@ -74,7 +94,7 @@ module Spreereturn true if location.pickup_stock_policy == 'any'cart.line_items.includes(variant: :product).all? do |line_item|- next true unless line_item.variant.product.fulfillment_types.include?('pickup')+ next true if line_item.variant.product.digital?next true unless line_item.variant.should_track_inventory?stock_item = location.stock_item(line_item.variant)diff --git a/spree/api/app/serializers/spree/api/v3/admin/channel_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/channel_serializer.rbindex 53c1696885..e72d147b5e 100644--- a/spree/api/app/serializers/spree/api/v3/admin/channel_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/channel_serializer.rb@@ -6,12 +6,19 @@ module Spreetypelize store_id: :string,preferred_order_routing_strategy: [:string, nullable: true],preferred_storefront_access: [:string, nullable: true],- preferred_guest_checkout: [:boolean, nullable: true]+ preferred_guest_checkout: [:boolean, nullable: true],+ stock_location_ids: [:string, multi: true]attributes :preferred_order_routing_strategy,:preferred_storefront_access,:preferred_guest_checkout,created_at: :iso8601, updated_at: :iso8601++ # Fulfillment-origin allowlist; empty means every store location+ # serves this channel.+ attribute :stock_location_ids do |record|+ record.stock_locations.map(&:prefixed_id)+ endendendenddiff --git a/spree/api/app/serializers/spree/api/v3/admin/delivery_method_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/delivery_method_serializer.rbindex 4a4b47d612..075410cb56 100644--- a/spree/api/app/serializers/spree/api/v3/admin/delivery_method_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/delivery_method_serializer.rb@@ -3,31 +3,45 @@ module Spreemodule V3module Adminclass DeliveryMethodSerializer < V3::DeliveryMethodSerializer- typelize admin_name: [:string, nullable: true], fulfillment_type: :string,+ typelize admin_name: [:string, nullable: true],fulfillment_provider: :string, pickup_point_provider: [:string, nullable: true],rate_provider: [:string, nullable: true],storefront_visible: :boolean, tracking_url: [:string, nullable: true],tax_category_id: [:string, nullable: true],- delivery_zone_ids: [:string, multi: true],+ delivery_profile_id: :string,+ delivery_origin_group_id: [:string, nullable: true],+ delivery_zone_id: [:string, nullable: true],stock_location_ids: [:string, multi: true],calculator_type: [:string, nullable: true],calculator_preferences: ['Record<string, unknown>', nullable: true],markup_flat: [:string, nullable: true],markup_percent: [:string, nullable: true]- attributes :admin_name, :fulfillment_type, :fulfillment_provider, :pickup_point_provider,+ attributes :admin_name, :fulfillment_provider, :pickup_point_provider,:rate_provider, :storefront_visible, :tracking_url,:markup_flat, :markup_percent,created_at: :iso8601, updated_at: :iso8601, deleted_at: :iso8601many :services, resource: proc { Spree.api.admin_delivery_method_service_serializer }+ # Embedded so a list of methods can be summarized by their+ # eligibility without a request per method.+ many :delivery_method_rules, key: :rules, resource: proc { Spree.api.admin_delivery_method_rule_serializer }+attribute :tax_category_id do |record|record.tax_category&.prefixed_idend- attribute :delivery_zone_ids do |record|- record.delivery_zones.map(&:prefixed_id)+ attribute :delivery_profile_id do |record|+ record.delivery_profile&.prefixed_id+ end++ attribute :delivery_origin_group_id do |record|+ record.delivery_origin_group&.prefixed_id+ end++ attribute :delivery_zone_id do |record|+ record.delivery_zone&.prefixed_idendattribute :stock_location_ids do |record|diff --git a/spree/api/app/serializers/spree/api/v3/admin/delivery_origin_group_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/delivery_origin_group_serializer.rbnew file mode 100644index 0000000000..2032786ae6--- /dev/null+++ b/spree/api/app/serializers/spree/api/v3/admin/delivery_origin_group_serializer.rb@@ -0,0 +1,34 @@+module Spree+ module Api+ module V3+ module Admin+ class DeliveryOriginGroupSerializer < BaseSerializer+ typelize name: [:string, nullable: true], position: [:number, nullable: true],+ delivery_profile_id: :string,+ stock_location_ids: [:string, multi: true],+ delivery_zones_count: :number, delivery_methods_count: :number++ attributes :name, :position,+ created_at: :iso8601, updated_at: :iso8601++ attribute :delivery_profile_id do |record|+ record.delivery_profile&.prefixed_id+ end++ # Empty means every store location.+ attribute :stock_location_ids do |record|+ record.stock_locations.map(&:prefixed_id)+ end++ attribute :delivery_zones_count do |record|+ record.delivery_zones.count+ end++ attribute :delivery_methods_count do |record|+ record.delivery_methods.count+ end+ end+ end+ end+ end+enddiff --git a/spree/api/app/serializers/spree/api/v3/admin/delivery_profile_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/delivery_profile_serializer.rbnew file mode 100644index 0000000000..8849c1342f--- /dev/null+++ b/spree/api/app/serializers/spree/api/v3/admin/delivery_profile_serializer.rb@@ -0,0 +1,64 @@+module Spree+ module Api+ module V3+ module Admin+ class DeliveryProfileSerializer < BaseSerializer+ typelize name: :string, default: :boolean, position: [:number, nullable: true],+ kind: :string, digital: :boolean,+ offers_pickup: :boolean, offers_shipping: :boolean,+ stock_location_ids: [:string, multi: true],+ origin_groups: ['Array<{ id: string; name: string | null; position: number | null; stock_location_ids: Array<string> }>'],+ products_count: :number, delivery_methods_count: :number,+ delivery_zones_count: :number++ attributes :name, :default, :position,+ created_at: :iso8601, updated_at: :iso8601++ # The STI class in wire form (`shipping`, `digital`, extension+ # kinds), so clients never parse Ruby class names.+ attribute :kind do |record|+ record.class.name.demodulize.underscore+ end++ attribute :digital, &:digital?++ # Capability badges for admin lists: which products can be collected+ # or shipped is decided by the profile's method set, never declared.+ attribute :offers_pickup, &:offers_pickup?+ attribute :offers_shipping, &:offers_shipping?++ # The default origin group's members — the simple-store surface.+ # Empty means every store location fulfills this profile.+ attribute :stock_location_ids do |record|+ record.default_origin_group&.stock_locations&.map(&:prefixed_id) || []+ end++ # Origin groups partition the profile's fulfillment origins; zones+ # and methods reference one. A null name renders as "All locations".+ attribute :origin_groups do |record|+ record.delivery_origin_groups.map do |group|+ {+ id: group.prefixed_id,+ name: group.name,+ position: group.position,+ stock_location_ids: group.stock_locations.map(&:prefixed_id)+ }+ end+ end++ attribute :products_count do |record|+ record.products.count+ end++ attribute :delivery_methods_count do |record|+ record.delivery_methods.count+ end++ attribute :delivery_zones_count do |record|+ record.delivery_zones.count+ end+ end+ end+ end+ end+enddiff --git a/spree/api/app/serializers/spree/api/v3/admin/delivery_zone_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/delivery_zone_serializer.rbindex 5d66dbc959..6fb1159293 100644--- a/spree/api/app/serializers/spree/api/v3/admin/delivery_zone_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/delivery_zone_serializer.rb@@ -3,10 +3,20 @@ module Spreemodule V3module Adminclass DeliveryZoneSerializer < V3::DeliveryZoneSerializer- typelize delivery_method_ids: [:string, multi: true]+ typelize delivery_method_ids: [:string, multi: true],+ delivery_profile_id: :string,+ delivery_origin_group_id: [:string, nullable: true]attributes created_at: :iso8601, updated_at: :iso8601+ attribute :delivery_profile_id do |record|+ record.delivery_profile&.prefixed_id+ end++ attribute :delivery_origin_group_id do |record|+ record.delivery_origin_group&.prefixed_id+ end+attribute :delivery_method_ids do |record|record.delivery_methods.map(&:prefixed_id)enddiff --git a/spree/api/app/serializers/spree/api/v3/admin/product_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/product_serializer.rbindex 19bbdd0e4f..52f33803d4 100644--- a/spree/api/app/serializers/spree/api/v3/admin/product_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/product_serializer.rb@@ -11,6 +11,7 @@ module Spreetypelize status: :string,tax_category_id: [:string, nullable: true],product_type_id: [:string, nullable: true],+ delivery_profile_id: [:string, nullable: true],price: ['Price', nullable: true],deleted_at: [:string, nullable: true],metadata: 'Record<string, unknown>'@@ -19,6 +20,10 @@ module Spree:metadata, deleted_at: :iso8601,created_at: :iso8601, updated_at: :iso8601+ attribute :delivery_profile_id do |product|+ product.delivery_profile&.prefixed_id+ end+attribute :product_type_id do |product|product.product_type&.prefixed_idenddiff --git a/spree/api/app/serializers/spree/api/v3/admin/product_type_serializer.rb b/spree/api/app/serializers/spree/api/v3/admin/product_type_serializer.rbindex 46a462f750..71f04220ca 100644--- a/spree/api/app/serializers/spree/api/v3/admin/product_type_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/admin/product_type_serializer.rb@@ -5,14 +5,20 @@ module Spreeclass ProductTypeSerializer < V3::ProductTypeSerializerinclude Spree::Api::V3::Admin::Translatable- typelize fulfillment_types: [:string, multi: true],+ typelize delivery_profile_id: [:string, nullable: true],products_count: :number,option_type_ids: [:string, multi: true],category_ids: [:string, multi: true]- attributes :fulfillment_types, :products_count,+ attributes :products_count,created_at: :iso8601, updated_at: :iso8601+ # The creation-time template: stamped onto products at creation,+ # never synced afterwards.+ attribute :delivery_profile_id do |record|+ record.delivery_profile&.prefixed_id+ end+# Prefixed ids of the option types and categories this type seeds onto# new products — the same payload the client sends back on PATCH.attribute :option_type_ids, &:option_type_prefixed_idsdiff --git a/spree/api/app/serializers/spree/api/v3/delivery_method_serializer.rb b/spree/api/app/serializers/spree/api/v3/delivery_method_serializer.rbindex e634f931ee..04291b1640 100644--- a/spree/api/app/serializers/spree/api/v3/delivery_method_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/delivery_method_serializer.rb@@ -2,12 +2,19 @@ module Spreemodule Apimodule V3class DeliveryMethodSerializer < BaseSerializer- typelize name: :string, code: [:string, nullable: true], fulfillment_type: :string,+ typelize name: :string, code: [:string, nullable: true],+ digital: :boolean, pickup: :boolean, pickup_point: :boolean,estimated_transit_business_days_min: [:number, nullable: true],estimated_transit_business_days_max: [:number, nullable: true]- attributes :name, :code, :fulfillment_type,+ attributes :name, :code,:estimated_transit_business_days_min, :estimated_transit_business_days_max++ # Derived from the fulfillment provider class — the storefront needs+ # the delivery kind to render the right checkout affordances.+ attribute :digital, &:digital?+ attribute :pickup, &:pickup?+ attribute :pickup_point, &:pickup_point?endendenddiff --git a/spree/api/app/serializers/spree/api/v3/delivery_zone_member_serializer.rb b/spree/api/app/serializers/spree/api/v3/delivery_zone_member_serializer.rbindex 3c393af4e0..ff86681b84 100644--- a/spree/api/app/serializers/spree/api/v3/delivery_zone_member_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/delivery_zone_member_serializer.rb@@ -3,6 +3,7 @@ module Spreemodule V3class DeliveryZoneMemberSerializer < BaseSerializertypelize member_type: :string, country_iso: [:string, nullable: true],+ country_name: [:string, nullable: true],state_abbr: [:string, nullable: true], state_name: [:string, nullable: true],postal_code_prefix: [:string, nullable: true],postal_code_from: [:string, nullable: true],@@ -14,6 +15,12 @@ module Spreerecord.country&.isoend+ # Admin zone summaries list countries by name; without this every+ # client would have to carry its own ISO-to-name table.+ attribute :country_name do |record|+ record.country&.name+ end+attribute :state_abbr do |record|record.state&.abbrenddiff --git a/spree/api/app/serializers/spree/api/v3/stock_location_serializer.rb b/spree/api/app/serializers/spree/api/v3/stock_location_serializer.rbindex 4bfc6f938b..d3ca18e1cc 100644--- a/spree/api/app/serializers/spree/api/v3/stock_location_serializer.rb+++ b/spree/api/app/serializers/spree/api/v3/stock_location_serializer.rb@@ -5,13 +5,21 @@ module Spreetypelize name: :string, address1: [:string, nullable: true], city: [:string, nullable: true],zipcode: [:string, nullable: true], country_iso: [:string, nullable: true],country_name: [:string, nullable: true], state_abbr: [:string, nullable: true],- state_text: [:string, nullable: true]+ state_text: [:string, nullable: true],+ pickup_ready_in_minutes: [:number, nullable: true],+ pickup_instructions: [:string, nullable: true]attribute :state_abbr do |stock_location|stock_location.state&.abbrendattributes :name, :address1, :city, :zipcode, :country_iso, :country_name, :state_text++ # Collection details the customer needs when choosing a counter: how+ # long until the order is ready, and where to go. This serializer+ # backs the pickup-locations endpoint, so without them the two+ # merchant-configured fields would never reach the buyer.+ attributes :pickup_ready_in_minutes, :pickup_instructionsendendenddiff --git a/spree/api/config/initializers/typelizer.rb b/spree/api/config/initializers/typelizer.rbindex 1c66bff04f..f1245f4509 100644--- a/spree/api/config/initializers/typelizer.rb+++ b/spree/api/config/initializers/typelizer.rb@@ -23,7 +23,7 @@ Rails.application.config.after_initialize do# Serializers that exist only for Admin API or events — no Store API controllerstore_excluded = %w[Asset CartPromotion OrderPromotion- StockItem StockMovement StockTransfer ShippingCategory+ StockItem StockMovement StockTransferReport Export Import ImportRowTaxCategory Exchange ExchangeLineItem].to_setdiff --git a/spree/api/config/routes.rb b/spree/api/config/routes.rbindex 8ce296c414..6f4f273ba3 100644--- a/spree/api/config/routes.rb+++ b/spree/api/config/routes.rb@@ -336,6 +336,14 @@ Spree::Core::Engine.add_routes doendresources :delivery_zones+ resources :delivery_profiles do+ collection do+ get :kinds+ end+ resources :origin_groups, controller: 'delivery_profiles/origin_groups',+ only: [:index, :show, :create, :update, :destroy]+ end+resources :payment_methods docollection doget :typesdiff --git a/spree/api/lib/spree/api/dependencies.rb b/spree/api/lib/spree/api/dependencies.rbindex 786bdf06ce..2666be7419 100644--- a/spree/api/lib/spree/api/dependencies.rb+++ b/spree/api/lib/spree/api/dependencies.rb@@ -99,6 +99,8 @@ module Spreeadmin_tax_line_serializer: 'Spree::Api::V3::Admin::TaxLineSerializer',admin_cart_serializer: 'Spree::Api::V3::Admin::CartSerializer',admin_delivery_zone_serializer: 'Spree::Api::V3::Admin::DeliveryZoneSerializer',+ admin_delivery_profile_serializer: 'Spree::Api::V3::Admin::DeliveryProfileSerializer',+ admin_delivery_origin_group_serializer: 'Spree::Api::V3::Admin::DeliveryOriginGroupSerializer',admin_integration_serializer: 'Spree::Api::V3::Admin::IntegrationSerializer',admin_delivery_method_rule_serializer: 'Spree::Api::V3::Admin::DeliveryMethodRuleSerializer',admin_delivery_zone_member_serializer: 'Spree::Api::V3::Admin::DeliveryZoneMemberSerializer',diff --git a/spree/api/spec/controllers/spree/api/v3/admin/channels_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/channels_controller_spec.rbindex c6ca0beca6..3b5572e528 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/channels_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/channels_controller_spec.rb@@ -307,4 +307,27 @@ RSpec.describe Spree::Api::V3::Admin::ChannelsController, type: :controller doexpect(json_response['error']['code']).to eq('validation_error')endend+ describe 'fulfillment-origin allowlist' do+ let!(:channel) { create(:channel, store: store) }+ let!(:warehouse) { create(:stock_location, store: store, name: 'Channel Warehouse') }++ it 'replaces the allowlist and serializes prefixed ids' do+ patch :update, params: { id: channel.prefixed_id, stock_location_ids: [warehouse.prefixed_id] }, as: :json++ expect(response).to have_http_status(:ok)+ expect(json_response['stock_location_ids']).to eq([warehouse.prefixed_id])++ patch :update, params: { id: channel.prefixed_id, stock_location_ids: [] }, as: :json+ expect(json_response['stock_location_ids']).to eq([])+ end++ it 'rejects a cross-store location with 404' do+ foreign = create(:stock_location, store: create(:store))++ patch :update, params: { id: channel.prefixed_id, stock_location_ids: [foreign.prefixed_id] }, as: :json++ expect(response).to have_http_status(:not_found)+ end+ end+enddiff --git a/spree/api/spec/controllers/spree/api/v3/admin/delivery_method_rules_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/delivery_method_rules_controller_spec.rbindex d7dabde006..d057f6bb31 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/delivery_method_rules_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/delivery_method_rules_controller_spec.rb@@ -12,7 +12,7 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodRulesController, type: :contget :types, params: {}, as: :jsonexpect(response).to have_http_status(:ok)- expect(json_response['data'].map { |row| row['type'] }).to contain_exactly('item_total_rule', 'weight_rule', 'excluded_products_rule')+ expect(json_response['data'].map { |row| row['type'] }).to contain_exactly('item_total_rule', 'weight_rule', 'excluded_products_rule', 'channel_rule')item_total = json_response['data'].find { |row| row['type'] == 'item_total_rule' }expect(item_total['preference_schema'].map { |field| field['key'] }).to contain_exactly('minimum_amount', 'maximum_amount')diff --git a/spree/api/spec/controllers/spree/api/v3/admin/delivery_methods_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/delivery_methods_controller_spec.rbindex 260e63228a..81f4a3447f 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/delivery_methods_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/delivery_methods_controller_spec.rb@@ -16,7 +16,7 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodsController, type: :controllexpect(response).to have_http_status(:ok)data = json_response['data'].find { |row| row['name'] == 'UPS Ground' }expect(data).to be_present- expect(data['fulfillment_type']).to eq('shipping')+ expect(data['delivery_profile_id']).to be_presentexpect(data['calculator_type']).to be_presentendend@@ -34,24 +34,23 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodsController, type: :controllenddescribe 'GET #fulfillment_providers' do- it 'lists registered providers with the fulfillment types they handle' do+ it 'lists registered providers with their class predicates' doget :fulfillment_providers, params: {}, as: :jsonexpect(response).to have_http_status(:ok)pickup = json_response['data'].find { |row| row['type'] == 'Spree::FulfillmentProvider::Pickup' }expect(pickup['name']).to eq('Pickup')- expect(pickup['fulfillment_types']).to eq(['pickup'])+ expect(pickup['pickup']).to be trueexpect(pickup['requires_address']).to be falsemanual = json_response['data'].find { |row| row['type'] == 'Spree::FulfillmentProvider::Manual' }- expect(manual['fulfillment_types']).to eq([])+ expect(manual['digital']).to be false+ expect(manual['pickup']).to be falseexpect(manual['requires_address']).to be true# Providers without credentials are always available; carrier ones are# listed with available: false until their integration is connected.expect(manual['available']).to be trueexpect(manual['integration_class']).to be_nil-- expect(json_response['fulfillment_types']).to eq(Spree.fulfillment_types)endend@@ -134,16 +133,17 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodsController, type: :controlldescribe 'POST #create' dolet!(:zone) { create(:delivery_zone) }- it 'rejects an unregistered fulfillment type with 422' do- post :create, params: { name: 'Typo', fulfillment_type: 'pickpu' }, as: :json+ it 'rejects a cross-store delivery profile with 404' do+ other_store_profile = create(:delivery_profile, store: create(:store))++ post :create, params: { name: 'Sneaky', delivery_profile_id: other_store_profile.prefixed_id }, as: :json- expect(response).to have_http_status(:unprocessable_entity)+ expect(response).to have_http_status(:not_found)endit 'persists the chosen fulfillment provider' dopost :create, params: {name: 'Store pickup',- fulfillment_type: 'pickup',fulfillment_provider: 'Spree::FulfillmentProvider::Pickup'}, as: :json@@ -151,20 +151,20 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodsController, type: :controllexpect(json_response['fulfillment_provider']).to eq('Spree::FulfillmentProvider::Pickup')end- it 'creates a delivery method with calculator and zones' do+ it 'creates a delivery method with calculator and zone' dopost :create, params: {name: 'Express',- fulfillment_type: 'shipping',storefront_visible: true,calculator_type: 'Spree::Calculator::Shipping::FlatRate',calculator_preferences: { amount: 12.5 },- delivery_zone_ids: [zone.prefixed_id]+ delivery_zone_id: zone.prefixed_id}, as: :jsonexpect(response).to have_http_status(:created)expect(json_response['name']).to eq('Express')expect(json_response['calculator_type']).to eq('Spree::Calculator::Shipping::FlatRate')- expect(json_response['delivery_zone_ids']).to eq([zone.prefixed_id])+ expect(json_response['delivery_zone_id']).to eq(zone.prefixed_id)+ expect(json_response['delivery_profile_id']).to be_presentdelivery_method = Spree::DeliveryMethod.find_by_prefix_id(json_response['id'])expect(delivery_method.calculator.preferred_amount).to eq(12.5)@@ -173,12 +173,12 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodsController, type: :controllit 'creates a pickup method without a calculator requirement' dopost :create, params: {name: 'Store pickup',- fulfillment_type: 'pickup',+ fulfillment_provider: 'Spree::FulfillmentProvider::Pickup',calculator_type: 'Spree::Calculator::Shipping::FlatRate'}, as: :jsonexpect(response).to have_http_status(:created)- expect(json_response['fulfillment_type']).to eq('pickup')+ expect(json_response['fulfillment_provider']).to eq('Spree::FulfillmentProvider::Pickup')endit 'assigns configured pickup locations' do@@ -186,7 +186,7 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodsController, type: :controllpost :create, params: {name: 'Counter pickup',- fulfillment_type: 'pickup',+ fulfillment_provider: 'Spree::FulfillmentProvider::Pickup',stock_location_ids: [location.prefixed_id]}, as: :json@@ -197,7 +197,6 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryMethodsController, type: :controllit 'rejects unknown calculator types' dopost :create, params: {name: 'Sneaky',- fulfillment_type: 'shipping',calculator_type: 'Kernel'}, as: :jsondiff --git a/spree/api/spec/controllers/spree/api/v3/admin/delivery_zones_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/delivery_zones_controller_spec.rbindex e7fcb6f60d..791c5abdac 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/delivery_zones_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/delivery_zones_controller_spec.rb@@ -86,4 +86,32 @@ RSpec.describe Spree::Api::V3::Admin::DeliveryZonesController, type: :controllerexpect(Spree::DeliveryZone.exists?(zone.id)).to be(false)endend++ # The edit form replaces the full member set on save, so a GET that omits+ # members would make the very next save wipe them (dashboard bug, 2026-08-09:+ # the edit sheet fetched without expand and Save emptied the zone).+ describe 'member round-trip' do+ it 'returns members on show when expanded, and preserves them when echoed back' do+ zone = create(:delivery_zone, store: store)+ us = Spree::Country.find_by(iso: 'US') || create(:country_us)+ de = Spree::Country.find_by(iso: 'DE') || create(:country, iso: 'DE', name: 'Germany')+ zone.members.create!(member_type: 'country', country: us)+ zone.members.create!(member_type: 'country', country: de)++ get :show, params: { id: zone.prefixed_id, expand: 'members' }, as: :json++ expect(response).to have_http_status(:ok)+ members = json_response['members']+ expect(members.map { |member| member['country_iso'] }).to match_array(%w[US DE])++ patch :update, params: {+ id: zone.prefixed_id,+ members: members.map { |member| { member_type: member['member_type'], country_iso: member['country_iso'] } }+ }, as: :json++ expect(response).to have_http_status(:ok)+ expect(zone.reload.members.count).to eq(2)+ end+ end+enddiff --git a/spree/api/spec/controllers/spree/api/v3/admin/products_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/admin/products_controller_spec.rbindex ebb6388448..0f36699879 100644--- a/spree/api/spec/controllers/spree/api/v3/admin/products_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/admin/products_controller_spec.rb@@ -724,14 +724,13 @@ RSpec.describe Spree::Api::V3::Admin::ProductsController, type: :controller doendit 'assigns a product type by prefixed id and returns it' do- product_type = create(:product_type, store: store, fulfillment_types: %w[shipping pickup])+ product_type = create(:product_type, store: store)patch :update, params: { id: product.prefixed_id, product_type_id: product_type.prefixed_id }, as: :jsonexpect(response).to have_http_status(:ok)expect(json_response['product_type_id']).to eq(product_type.prefixed_id)expect(product.reload.product_type).to eq(product_type)- expect(product.fulfillment_types).to eq(%w[shipping pickup])endit 'clears the product type with null' dodiff --git a/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rbindex fd891b0dd8..a40e7c61ed 100644--- a/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/store/carts_controller_spec.rb@@ -537,8 +537,8 @@ RSpec.describe Spree::Api::V3::Store::CartsController, type: :controller docart.update!(email: '[email protected]', ship_address: address)cart.fulfillments.delete_all# Give the products a fulfillment type no delivery method serves.- unserved_type = create(:product_type, name: 'Pickup Only', fulfillment_types: ['pickup'])- cart.line_items.each { |line_item| line_item.variant.product.update!(product_type: unserved_type) }+ unserved_profile = create(:delivery_profile, store: store, name: "Unserved #{SecureRandom.hex(4)}")+ cart.line_items.each { |line_item| line_item.variant.product.update!(delivery_profile: unserved_profile) }cart.reloadget :show, params: { id: cart.prefixed_id }@@ -637,11 +637,11 @@ RSpec.describe Spree::Api::V3::Store::CartsController, type: :controller docontext 'when a line item cannot be delivered to the address' dolet(:address) { user.addresses.first || create(:address, user: user, country: country, state: us_state) }- let(:unserved_type) { create(:product_type, name: 'Pickup Only', fulfillment_types: ['pickup']) }+ let(:unserved_profile) { create(:delivery_profile, store: store, name: "Unserved #{SecureRandom.hex(4)}") }before doorder.update!(email: '[email protected]')- order.line_items.each { |line_item| line_item.variant.product.update!(product_type: unserved_type) }+ order.line_items.each { |line_item| line_item.variant.product.update!(delivery_profile: unserved_profile) }endit 'returns ok with a delivery_unavailable warning, an unmet delivery requirement, and no fulfillments' dodiff --git a/spree/api/spec/controllers/spree/api/v3/store/delivery_methods_controller_spec.rb b/spree/api/spec/controllers/spree/api/v3/store/delivery_methods_controller_spec.rbindex f89a254372..e8762d461e 100644--- a/spree/api/spec/controllers/spree/api/v3/store/delivery_methods_controller_spec.rb+++ b/spree/api/spec/controllers/spree/api/v3/store/delivery_methods_controller_spec.rb@@ -6,11 +6,7 @@ RSpec.describe Spree::Api::V3::Store::DeliveryMethodsController, type: :controllinclude_context 'API v3 Store'let!(:shipping_method) { create(:shipping_method, name: 'Standard', storefront_visible: true) }- let!(:pickup_method) do- create(:shipping_method, name: 'Store pickup', storefront_visible: true).tap do |dm|- dm.update!(fulfillment_type: 'pickup')- end- end+ let!(:pickup_method) { create(:pickup_delivery_method, name: 'Store pickup', storefront_visible: true) }let!(:hidden_method) { create(:shipping_method, name: 'Internal', storefront_visible: false) }before { request.headers['X-Spree-Api-Key'] = api_key.token }@@ -92,13 +88,8 @@ RSpec.describe Spree::Api::V3::Store::DeliveryMethodsController, type: :controllcontext 'with a cart' dolet(:cart) { create(:cart_with_line_items, store: store, customer: user) }let(:variant) { cart.line_items.first.variant }- let(:pickup_capable_type) { create(:product_type, name: 'Collectable', fulfillment_types: %w[shipping pickup]) }-before dorequest.headers['x-spree-token'] = cart.token- # Coverage only counts pickup-collectable items, so the cart's- # products must support pickup for the stock checks to matter.- cart.line_items.each { |line_item| line_item.variant.product.update!(product_type: pickup_capable_type) }endit 'keeps locations that can fulfill the whole cart from local stock' do@@ -120,8 +111,8 @@ RSpec.describe Spree::Api::V3::Store::DeliveryMethodsController, type: :controllit 'ignores items the counter will never hand over (mixed cart with a tracked digital item)' dopickup_location.stock_item_or_create(variant).set_count_on_hand(10)- digital_type = create(:product_type, name: 'Digital good', fulfillment_types: ['digital'])- digital_product = create(:product, product_type: digital_type, store: store)+ digital_product = create(:digital_product, store: store)+ digital_product.default_variant.update!(track_inventory: true)create(:line_item, cart: cart, order: nil, variant: digital_product.default_variant)get :pickup_locations, params: { id: pickup_method.prefixed_id, cart_id: cart.prefixed_id }, as: :json@@ -155,7 +146,7 @@ RSpec.describe Spree::Api::V3::Store::DeliveryMethodsController, type: :controll# update_columns: 'pickup_point' is deferred to 6.1 and no longer a# registered fulfillment type, but the endpoint still serves rows# carrying it (created before the deferral or via an extension).- pickup_method.update_columns(fulfillment_type: 'pickup_point', pickup_point_provider: 'TestPickupPointProvider')+ pickup_method.update_columns(fulfillment_provider: 'Spree::FulfillmentProvider::PickupPoint', pickup_point_provider: 'TestPickupPointProvider')endit 'returns nearby points' dodiff --git a/spree/api/spec/integration/spree/api/v3/admin/delivery_profiles_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/delivery_profiles_spec.rbnew file mode 100644index 0000000000..10ba99a17c--- /dev/null+++ b/spree/api/spec/integration/spree/api/v3/admin/delivery_profiles_spec.rb@@ -0,0 +1,166 @@+# frozen_string_literal: true++require 'swagger_helper'++RSpec.describe 'Admin Delivery Profiles API', type: :request, swagger_doc: 'api-reference/admin.yaml' do+ include_context 'API v3 Admin'++ let(:Authorization) { "Bearer #{admin_jwt_token}" }+ let(:'x-spree-api-key') { secret_api_key.plaintext_token }+ let(:store) { @default_store }++ path '/api/v3/admin/delivery_profiles' do+ get 'List delivery profiles' do+ tags 'Delivery'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Fulfillment profiles group products with the stock locations, delivery zones and delivery methods that fulfill them. Every store has exactly one default profile.'+ admin_scope :read, :settings++ admin_sdk_example 'delivery-profiles/list'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true++ response '200', 'delivery profiles found' do++ run_test! do |response|+ data = JSON.parse(response.body)['data']+ expect(data.map { |row| row['default'] }).to include(true)+ end+ end+ end++ post 'Create a delivery profile' do+ tags 'Delivery'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Creates a delivery profile. `kind` selects the registered profile kind (shipping, digital, extension kinds); `stock_location_ids` limits fulfillment to those locations — empty means every store location.'+ admin_scope :write, :settings++ admin_sdk_example 'delivery-profiles/create'++ 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: {+ name: { type: :string, example: 'Oversized' },+ kind: { type: :string, example: 'shipping', description: 'Registered profile kind; defaults to shipping.' },+ default: { type: :boolean },+ stock_location_ids: { type: :array, items: { type: :string }, description: 'Empty means every store location.' }+ },+ required: %w[name]+ }++ response '201', 'delivery profile created' do+ let(:body) { { name: "Oversized #{Time.current.to_f}" } }++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['kind']).to eq('shipping')+ expect(data['default']).to be(false)+ end+ end++ response '422', 'validation error' do+ let(:body) { { name: '' } }++ run_test!+ end+ end+ end++ path '/api/v3/admin/delivery_profiles/{delivery_profile_id}/origin_groups' do+ parameter name: :delivery_profile_id, in: :path, type: :string++ post 'Create an origin group' do+ tags 'Delivery'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'Origin groups partition a profile\'s fulfillment origins: zones and methods belong to a group, so the same products can quote different rate tables per warehouse. `stock_location_ids` replaces the full membership; empty means every store location.'+ admin_scope :write, :settings++ admin_sdk_example 'delivery-profiles/origin-groups-create'++ 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: {+ name: { type: :string, nullable: true, example: 'EU warehouse' },+ position: { type: :integer, nullable: true },+ stock_location_ids: { type: :array, items: { type: :string }, description: 'Empty means every store location.' }+ }+ }++ response '201', 'origin group created' do+ let(:delivery_profile_id) { create(:delivery_profile, store: store, name: "Grouped #{Time.current.to_f}").prefixed_id }+ let(:body) { { name: 'EU warehouse', stock_location_ids: [create(:stock_location, store: store).prefixed_id] } }++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['name']).to eq('EU warehouse')+ expect(data['stock_location_ids'].size).to eq(1)+ end+ end+ end+ end++ path '/api/v3/admin/delivery_profiles/{id}' do+ parameter name: :id, in: :path, type: :string++ patch 'Update a delivery profile' do+ tags 'Delivery'+ consumes 'application/json'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ admin_scope :write, :settings++ admin_sdk_example 'delivery-profiles/update'++ 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: {+ name: { type: :string },+ default: { type: :boolean },+ stock_location_ids: { type: :array, items: { type: :string } }+ }+ }++ response '200', 'delivery profile updated' do+ let(:profile) { create(:delivery_profile, store: store, name: "Bulky #{Time.current.to_f}") }+ let(:id) { profile.prefixed_id }+ let(:body) { { stock_location_ids: [create(:stock_location, store: store).prefixed_id] } }++ run_test! do |response|+ data = JSON.parse(response.body)+ expect(data['stock_location_ids'].size).to eq(1)+ end+ end+ end++ delete 'Delete a delivery profile' do+ tags 'Delivery'+ produces 'application/json'+ security [api_key: [], bearer_auth: []]+ description 'The default profile and profiles still referenced by products cannot be deleted.'+ admin_scope :write, :settings++ admin_sdk_example 'delivery-profiles/delete'++ parameter name: 'x-spree-api-key', in: :header, type: :string, required: true+ parameter name: :Authorization, in: :header, type: :string, required: true++ response '204', 'delivery profile deleted' do+ let(:id) { create(:delivery_profile, store: store, name: "Doomed #{Time.current.to_f}").prefixed_id }++ run_test!+ end+ end+ end+enddiff --git a/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rbindex a1dd9123ba..e1b4c8693e 100644--- a/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/delivery_settings_spec.rb@@ -36,7 +36,7 @@ RSpec.describe 'Admin Delivery Settings API', type: :request, swagger_doc: 'api-consumes 'application/json'produces 'application/json'security [api_key: [], bearer_auth: []]- description 'Creates a delivery method. fulfillment_type is one of shipping, digital, pickup.'+ description 'Creates a delivery method inside a delivery profile (defaults to the store default profile). Delivery behavior comes from the fulfillment provider.'admin_scope :write, :settingsadmin_sdk_example 'delivery-methods/create'@@ -49,7 +49,8 @@ RSpec.describe 'Admin Delivery Settings API', type: :request, swagger_doc: 'api-name: { type: :string, example: 'Express' },admin_name: { type: :string, nullable: true },code: { type: :string, nullable: true },- fulfillment_type: { type: :string, enum: %w[shipping digital pickup], example: 'shipping' },+ fulfillment_provider: { type: :string, nullable: true, example: 'Spree::FulfillmentProvider::Manual' },+ delivery_profile_id: { type: :string, nullable: true, example: 'fp_86Rf07xd4z' },storefront_visible: { type: :boolean, example: true },tracking_url: { type: :string, nullable: true },estimated_transit_business_days_min: { type: :integer, nullable: true },@@ -57,7 +58,7 @@ RSpec.describe 'Admin Delivery Settings API', type: :request, swagger_doc: 'api-tax_category_id: { type: :string, nullable: true },calculator_type: { type: :string, example: 'Spree::Calculator::Shipping::FlatRate' },calculator_preferences: { type: :object, example: { amount: 12.5 } },- delivery_zone_ids: { type: :array, items: { type: :string } }+ delivery_zone_id: { type: :string, nullable: true }},required: %w[name]}@@ -66,7 +67,6 @@ RSpec.describe 'Admin Delivery Settings API', type: :request, swagger_doc: 'api-let(:body) do{name: 'Express',- fulfillment_type: 'shipping',storefront_visible: true,calculator_type: 'Spree::Calculator::Shipping::FlatRate',calculator_preferences: { amount: 12.5 }diff --git a/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rbindex 1b87aba985..d91aa25ebc 100644--- a/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/markets_spec.rb@@ -16,7 +16,7 @@ RSpec.describe 'Admin Markets API', type: :request, swagger_doc: 'api-reference/# other countries this spec assigns directly through the API.before do# Delivery methods are worldwide by default; one method covers all countries.- create(:shipping_method) unless Spree::DeliveryMethod.where.missing(:delivery_method_zones).exists?+ create(:shipping_method) unless Spree::DeliveryMethod.where(delivery_zone_id: nil).exists?endpath '/api/v3/admin/markets' dodiff --git a/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rb b/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rbindex ef6ee6c30a..6ed479d2d8 100644--- a/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/admin/product_types_spec.rb@@ -72,11 +72,11 @@ RSpec.describe 'Admin Product Types API', type: :request, swagger_doc: 'api-refetype: :object,properties: {name: { type: :string, example: 'Hoodie' },- fulfillment_types: {- type: :array,- items: { type: :string },- example: ['shipping'],- description: 'How products of this type can be delivered.'+ delivery_profile_id: {+ type: :string,+ nullable: true,+ example: 'fp_86Rf07xd4z',+ description: 'Fulfillment profile stamped onto products created with this type. Null leaves new products on the store default profile.'},option_type_ids: {type: :array,@@ -105,14 +105,14 @@ RSpec.describe 'Admin Product Types API', type: :request, swagger_doc: 'api-referesponse '201', 'product type created' dolet(:'x-spree-api-key') { secret_api_key.plaintext_token }- let(:body) { { name: 'Hoodie', fulfillment_types: ['shipping'] } }+ let(:body) { { name: 'Hoodie' } }schema '$ref' => '#/components/schemas/ProductType'run_test! do |response|data = JSON.parse(response.body)expect(data['name']).to eq('Hoodie')- expect(data['fulfillment_types']).to eq(['shipping'])+ expect(data['delivery_profile_id']).to be_nilendend@@ -183,7 +183,7 @@ RSpec.describe 'Admin Product Types API', type: :request, swagger_doc: 'api-refetype: :object,properties: {name: { type: :string, example: 'Premium T-Shirt' },- fulfillment_types: { type: :array, items: { type: :string } },+ delivery_profile_id: { type: :string, nullable: true },option_type_ids: { type: :array, items: { type: :string } },category_ids: { type: :array, items: { type: :string } },custom_field_definitions: {diff --git a/spree/api/spec/integration/spree/api/v3/store/delivery_methods_spec.rb b/spree/api/spec/integration/spree/api/v3/store/delivery_methods_spec.rbindex 4ea9f3061e..a0a4044b60 100644--- a/spree/api/spec/integration/spree/api/v3/store/delivery_methods_spec.rb+++ b/spree/api/spec/integration/spree/api/v3/store/delivery_methods_spec.rb@@ -23,7 +23,7 @@ RSpec.describe 'Store Delivery Methods API', type: :request, swagger_doc: 'api-rresponse '200', 'delivery methods found' dobefore docreate(:shipping_method, name: 'Standard')- create(:shipping_method, name: 'Store pickup').update!(fulfillment_type: 'pickup')+ create(:pickup_delivery_method, name: 'Store pickup')endlet(:fulfillment_type) { 'pickup' }@@ -51,7 +51,7 @@ RSpec.describe 'Store Delivery Methods API', type: :request, swagger_doc: 'api-rresponse '200', 'pickup locations found' dolet(:pickup_method) do- create(:shipping_method, name: 'Store pickup').tap { |dm| dm.update!(fulfillment_type: 'pickup') }+ create(:pickup_delivery_method, name: 'Store pickup')endlet(:id) { pickup_method.prefixed_id }diff --git a/spree/core/app/models/concerns/spree/calculator/currency_amounts.rb b/spree/core/app/models/concerns/spree/calculator/currency_amounts.rbnew file mode 100644index 0000000000..d299954110--- /dev/null+++ b/spree/core/app/models/concerns/spree/calculator/currency_amounts.rb@@ -0,0 +1,43 @@+module Spree+ class Calculator < Spree.base_class+ # Per-currency amounts for amount-based delivery calculators, mirroring+ # how product prices work: one explicit amount per currency, no FX. The+ # `amounts` hash ({ "USD" => 5.0, "EUR" => 4.0 }) quotes the cart's+ # currency directly, so one method serves every currency it has an+ # amount for — no more method-per-currency duplication.+ #+ # The 5.x single `amount` + `currency` preferences keep working as the+ # fallback for their own currency, so upgraded stores quote unchanged+ # until they fill in the hash.+ module CurrencyAmounts+ extend ActiveSupport::Concern++ included do+ preference :amounts, :hash, default: {}+ end++ # The amount this calculator quotes for a currency: the per-currency+ # hash first, then the legacy single amount when its currency matches.+ #+ # @param currency [String]+ # @return [BigDecimal, nil] nil when the currency has no amount — the+ # method is not offered for that cart+ def amount_for(currency)+ explicit = preferred_amounts&.transform_keys { |key| key.to_s.upcase }&.dig(currency.to_s.upcase)+ return BigDecimal(explicit.to_s) if explicit.present?++ legacy_currency = respond_to?(:preferred_currency) ? preferred_currency : nil+ return preferred_amount if legacy_currency.blank? || legacy_currency.casecmp(currency.to_s).zero?++ nil+ end++ # Whether this calculator can quote the given currency at all — the+ # Estimator's method filter, replacing the old exact-match on the+ # single currency preference.+ def supports_currency?(currency)+ amount_for(currency).present?+ end+ end+ end+enddiff --git a/spree/core/app/models/concerns/spree/purchase/addresses.rb b/spree/core/app/models/concerns/spree/purchase/addresses.rbindex 343e2fe35c..d5db080c23 100644--- a/spree/core/app/models/concerns/spree/purchase/addresses.rb+++ b/spree/core/app/models/concerns/spree/purchase/addresses.rb@@ -54,12 +54,14 @@ module Spreereturn false if preferred_stock_location_id.present?- address_requiring_types = store.delivery_methods.select(&:requires_address?).map(&:fulfillment_type).uniq- return false if address_requiring_types.empty?+ # An address is needed when any item's profile ships to one —+ # answered by the profile kind, resolved once per profile.+ profile_requires_address = Hash.new do |cache, profile|+ cache[profile] = profile.present? && profile.requires_shipping_address?+ endline_items.includes(variant: :product).any? do |line_item|- fulfillment_types = line_item.variant&.product&.fulfillment_types || ['shipping']- (fulfillment_types & address_requiring_types).any?+ profile_requires_address[line_item.variant&.product&.resolved_delivery_profile]endenddiff --git a/spree/core/app/models/spree/calculator/shipping/digital_delivery.rb b/spree/core/app/models/spree/calculator/shipping/digital_delivery.rbindex 238848cb14..a4ed6df2b0 100644--- a/spree/core/app/models/spree/calculator/shipping/digital_delivery.rb+++ b/spree/core/app/models/spree/calculator/shipping/digital_delivery.rb@@ -3,6 +3,8 @@ require_dependency 'spree/shipping_calculator'module Spreemodule Calculator::Shippingclass DigitalDelivery < ShippingCalculator+ include Spree::Calculator::CurrencyAmounts+preference :amount, :decimal, default: 0preference :currency, :string, default: -> { Spree::Store.default.default_currency }@@ -10,8 +12,9 @@ module SpreeSpree.t('digital.digital_delivery')end- def compute_package(_package = nil)- preferred_amount+ def compute_package(package = nil)+ currency = package.respond_to?(:currency) ? package.currency : nil+ currency ? amount_for(currency) : preferred_amountenddef available?(package)diff --git a/spree/core/app/models/spree/calculator/shipping/flat_rate.rb b/spree/core/app/models/spree/calculator/shipping/flat_rate.rbindex 1e6ed1555f..5bc0f57e89 100644--- a/spree/core/app/models/spree/calculator/shipping/flat_rate.rb+++ b/spree/core/app/models/spree/calculator/shipping/flat_rate.rb@@ -3,7 +3,12 @@ require_dependency 'spree/shipping_calculator'module Spreemodule Calculator::Shippingclass FlatRate < ShippingCalculator+ include Spree::Calculator::CurrencyAmounts+preference :amount, :decimal, default: 0+ # @deprecated Together with the single `amount`, superseded by the+ # per-currency `amounts` hash; kept as the fallback for its own+ # currency so upgraded stores quote unchanged.preference :currency, :string, default: -> { Spree::Store.default.default_currency }preference :minimum_item_total, :decimal, default: nil, nullable: true, deprecated: 'Use a Spree::DeliveryMethodRules rule on the delivery method instead; removed in Spree 6.1.'@@ -23,7 +28,7 @@ module Spreereturn nil if preferred_minimum_item_total.present? && preferred_minimum_item_total >= package.item_totalreturn nil if preferred_maximum_item_total.present? && preferred_maximum_item_total < package.item_total- preferred_amount+ amount_for(package.currency)endendenddiff --git a/spree/core/app/models/spree/calculator/shipping/flexi_rate.rb b/spree/core/app/models/spree/calculator/shipping/flexi_rate.rbindex 8cc353b163..e6621c7cdc 100644--- a/spree/core/app/models/spree/calculator/shipping/flexi_rate.rb+++ b/spree/core/app/models/spree/calculator/shipping/flexi_rate.rb@@ -8,6 +8,12 @@ module Spreepreference :max_items, :integer, default: 0preference :currency, :string, default: -> { Spree::Store.default.default_currency }+ # Single-currency amounts: quoting another currency would mislabel+ # the configured numbers, so the method stays hidden there.+ def supports_currency?(currency)+ preferred_currency.blank? || preferred_currency.casecmp(currency.to_s).zero?+ end+def self.descriptionSpree.t(:shipping_flexible_rate)enddiff --git a/spree/core/app/models/spree/calculator/shipping/per_item.rb b/spree/core/app/models/spree/calculator/shipping/per_item.rbindex b7fba7b5f7..5816c63300 100644--- a/spree/core/app/models/spree/calculator/shipping/per_item.rb+++ b/spree/core/app/models/spree/calculator/shipping/per_item.rb@@ -3,6 +3,8 @@ require_dependency 'spree/shipping_calculator'module Spreemodule Calculator::Shippingclass PerItem < ShippingCalculator+ include Spree::Calculator::CurrencyAmounts+preference :amount, :decimal, default: 0preference :currency, :string, default: -> { Spree::Store.default.default_currency }@@ -11,11 +13,14 @@ module Spreeenddef compute_package(package)- compute_from_quantity(package.contents.sum(&:quantity))+ compute_from_quantity(package.contents.sum(&:quantity), currency: package.currency)end- def compute_from_quantity(quantity)- preferred_amount * quantity+ def compute_from_quantity(quantity, currency: nil)+ per_item = currency ? amount_for(currency) : preferred_amount+ return nil if per_item.nil?++ per_item * quantityendendenddiff --git a/spree/core/app/models/spree/calculator/shipping/price_sack.rb b/spree/core/app/models/spree/calculator/shipping/price_sack.rbindex e1f51b131e..70aa315c67 100644--- a/spree/core/app/models/spree/calculator/shipping/price_sack.rb+++ b/spree/core/app/models/spree/calculator/shipping/price_sack.rb@@ -8,6 +8,12 @@ module Spreepreference :discount_amount, :decimal, default: 0preference :currency, :string, default: -> { Spree::Store.default.default_currency }+ # Single-currency amounts: quoting another currency would mislabel+ # the configured numbers, so the method stays hidden there.+ def supports_currency?(currency)+ preferred_currency.blank? || preferred_currency.casecmp(currency.to_s).zero?+ end+def self.descriptionSpree.t(:shipping_price_sack)enddiff --git a/spree/core/app/models/spree/channel.rb b/spree/core/app/models/spree/channel.rbindex 9e44569af9..edb6c660be 100644--- a/spree/core/app/models/spree/channel.rb+++ b/spree/core/app/models/spree/channel.rb@@ -23,6 +23,11 @@ module Spreehas_many :publications, class_name: 'Spree::ProductPublication', dependent: :destroyhas_many :products, through: :publications, class_name: 'Spree::Product'has_many :api_keys, class_name: 'Spree::ApiKey', dependent: :nullify+ # Optional fulfillment-origin allowlist: no rows means every store+ # location serves this channel (docs/plans/6.0-channel-delivery.md).+ has_many :channel_stock_locations, class_name: 'Spree::ChannelStockLocation',+ dependent: :destroy, inverse_of: :channel+ has_many :stock_locations, through: :channel_stock_locations, class_name: 'Spree::StockLocation'attribute :active, :boolean, default: true@@ -123,6 +128,32 @@ module Spree!default? && !api_keys.active.exists?end+ # Whether packages originating from this stock location may serve this+ # channel's carts. No linked locations means every store location.+ #+ # @param stock_location [Spree::StockLocation, nil]+ # @return [Boolean]+ def serves_location?(stock_location)+ return false if stock_location.nil?+ return true if served_stock_location_ids.empty?++ served_stock_location_ids.include?(stock_location.id)+ end++ # @return [Array<Integer>] ids of the locations this channel is limited to+ def served_stock_location_ids+ @served_stock_location_ids ||= channel_stock_locations.map(&:stock_location_id)+ end++ # The locations allowed to fulfill this channel's traffic.+ #+ # @return [ActiveRecord::Relation<Spree::StockLocation>]+ def served_stock_locations+ return store.stock_locations if served_stock_location_ids.empty?++ store.stock_locations.where(id: served_stock_location_ids)+ end+privatedef ensure_not_defaultdiff --git a/spree/core/app/models/spree/channel_stock_location.rb b/spree/core/app/models/spree/channel_stock_location.rbnew file mode 100644index 0000000000..5161d56b19--- /dev/null+++ b/spree/core/app/models/spree/channel_stock_location.rb@@ -0,0 +1,8 @@+module Spree+ class ChannelStockLocation < Spree.base_class+ belongs_to :channel, class_name: 'Spree::Channel', inverse_of: :channel_stock_locations+ belongs_to :stock_location, class_name: 'Spree::StockLocation'++ validates :stock_location_id, uniqueness: { scope: :channel_id }+ end+enddiff --git a/spree/core/app/models/spree/delivery_method.rb b/spree/core/app/models/spree/delivery_method.rbindex 915e67b9d6..5df5081ba4 100644--- a/spree/core/app/models/spree/delivery_method.rb+++ b/spree/core/app/models/spree/delivery_method.rb@@ -46,25 +46,37 @@ module Spreedependent: :destroy, inverse_of: :delivery_methodhas_many :pickup_locations, through: :delivery_method_stock_locations, source: :stock_location- has_many :delivery_method_zones, class_name: 'Spree::DeliveryMethodZone',- foreign_key: 'delivery_method_id'- has_many :delivery_zones, through: :delivery_method_zones, class_name: 'Spree::DeliveryZone'+ # The profile this method belongs to — the sole path a product's package+ # reaches it through. Within the profile the method sits in an origin+ # group (which origins offer it); the optional zone narrows destinations+ # and must share the method's group.+ belongs_to :delivery_profile, class_name: 'Spree::DeliveryProfile', inverse_of: :delivery_methods+ belongs_to :delivery_origin_group, class_name: 'Spree::DeliveryOriginGroup', inverse_of: :delivery_methods+ belongs_to :delivery_zone, class_name: 'Spree::DeliveryZone', optional: truebelongs_to :tax_category, -> { with_deleted }, class_name: 'Spree::TaxCategory', optional: trueattribute :storefront_visible, :boolean, default: true- attribute :fulfillment_type, :string, default: 'shipping'# Every method carries a calculator — the Estimator consults its# `available?` even when a provider sets the price. Methods whose rate# provider quotes live rates (and pickup/digital methods) default to a# free rate, so neither the API nor the dashboard has to send one.before_validation :ensure_calculator, on: :create+ # Mirrors product stamping: a method created without an explicit profile+ # joins the store's default one, landing in the profile's default origin+ # group unless one is named (a zone names one implicitly).+ before_validation :assign_default_delivery_profile, on: :create+ before_validation :assign_default_origin_group, on: :createafter_save :apply_pending_rules, if: :pending_rules?after_save :apply_pending_services, if: :pending_services?attribute :fulfillment_provider, :string, default: 'Spree::FulfillmentProvider::Manual'- scope :by_fulfillment_type, ->(type) { where(fulfillment_type: type) }+ # Methods whose fulfillment provider satisfies the predicate — behavior+ # queries route through provider classes, never string vocabularies.+ scope :with_provider, ->(predicate) {+ where(fulfillment_provider: Spree.fulfillment_providers.select(&predicate).map(&:to_s))+ }# Customer-facing methods vs backoffice-only ones (manual courier entry,# internal freight). The backoffice always sees every method.@@ -74,26 +86,17 @@ module Spree# Legacy association names — removed in 6.1.has_many :shipping_rates, class_name: 'Spree::DeliveryRate', foreign_key: :delivery_method_id, deprecated: truehas_many :shipments, through: :delivery_rates, source: :fulfillment, deprecated: true- has_many :zones, through: :delivery_method_zones, source: :delivery_zone, deprecated: true-- # ShippingCategory eligibility is superseded by fulfillment types- # (ProductType#fulfillment_types); both tables drop in 6.1.- has_many :shipping_method_categories, foreign_key: :shipping_method_id, dependent: :destroy, deprecated: true- has_many :shipping_categories, through: :shipping_method_categories, deprecated: true# Real column, so no ransacker is needed — only the allowlist entry the# Spree::DisplayOn concern used to contribute.- self.whitelisted_ransackable_attributes = %w[storefront_visible fulfillment_type]+ self.whitelisted_ransackable_attributes = %w[storefront_visible]- validates :name, :fulfillment_type, presence: true+ validates :name, presence: truevalidates :storefront_visible, inclusion: { in: [true, false] }- # Strict vocabulary: an unregistered type silently matches no product- # (empty intersection — no error, just missing rates), so typos must- # fail loudly. Validated on change only: rows migrated with tokens not- # yet registered in an initializer stay loadable and savable.- validates :fulfillment_type,- inclusion: { in: -> (_record) { Spree.fulfillment_types } },- if: :fulfillment_type_changed?+ validate :delivery_zone_must_belong_to_profile,+ if: -> { delivery_zone_id_changed? || delivery_profile_id_changed? }+ validate :origin_group_must_match,+ if: -> { delivery_origin_group_id_changed? || delivery_zone_id_changed? || delivery_profile_id_changed? }validates :estimated_transit_business_days_min, numericality: { greater_than_or_equal_to: 1 }, allow_nil: truevalidates :estimated_transit_business_days_max, numericality: { greater_than_or_equal_to: 1 }, allow_nil: true# Same reasoning as fulfillment_type: an unregistered provider is a typo@@ -110,21 +113,24 @@ module Spree# Providers declare the fulfillment types they handle; a mismatch would# only surface at checkout (no rates) or at ship time (no dispatch),# so reject it where the admin can still see why.- validate :providers_must_handle_fulfillment_type,- if: -> { fulfillment_type_changed? || rate_provider_changed? || fulfillment_provider_changed? }+ # The profile kind gates composition (a Digital profile only accepts+ # digital-provider methods), and an address-requiring rate provider (a+ # carrier) can only price methods that ship to an address.+ validate :profile_must_accept_provider,+ if: -> { fulfillment_provider_changed? || delivery_profile_id_changed? }+ validate :rate_provider_must_ship,+ if: -> { rate_provider_changed? || fulfillment_provider_changed? }- scope :digital, -> { by_fulfillment_type('digital') }+ scope :digital, -> { with_provider(:digital?) }scope :search_by_name, ->(query) { where(arel_table[:name].lower.matches("%#{query}%")) }def include?(address)return true unless requires_zone_check?return false unless address- return true if delivery_zones.empty?+ return true if delivery_zone.nil?- delivery_zones.includes(:members).any? do |zone|- zone.include?(address)- end+ delivery_zone.include?(address)end# Zones describe the customer's destination address, so only methods@@ -156,15 +162,38 @@ module Spreeenddef pickup?- fulfillment_type == 'pickup'+ provider_class.pickup?enddef ensure_calculatorself.calculator ||= Spree::Calculator::Shipping::FlatRate.new(preferred_amount: 0)end+ def assign_default_delivery_profile+ self.delivery_profile ||= store&.default_delivery_profile+ end++ # The zone's group wins when a zone is set (they must agree anyway);+ # zoneless methods fall back to the profile's default group.+ def assign_default_origin_group+ self.delivery_origin_group ||= delivery_zone&.delivery_origin_group || delivery_profile&.default_origin_group+ end++ def origin_group_must_match+ if delivery_origin_group.present? && delivery_profile.present? &&+ delivery_origin_group.delivery_profile_id != delivery_profile_id+ errors.add(:delivery_origin_group, :invalid)+ end++ return if delivery_zone.nil? || delivery_origin_group.nil?+ return if delivery_zone.delivery_origin_group_id == delivery_origin_group_id++ errors.add(:delivery_zone, :does_not_belong_to_origin_group,+ message: Spree.t('errors.messages.delivery_zone_not_in_origin_group'))+ end+def pickup_point?- fulfillment_type == 'pickup_point'+ provider_class.pickup_point?end# Whether this method delivers to a customer shipping address —@@ -373,7 +402,7 @@ module Spree## @return [Boolean]def digital?- fulfillment_type == 'digital'+ provider_class.digital?end# @deprecated Use {#storefront_visible}; removed in 6.1.@@ -420,22 +449,36 @@ module Spree# Only meaningful for registered providers — the inclusion validation# already rejects anything else, so an unresolvable name must not raise# here as well.- def providers_must_handle_fulfillment_type- return if fulfillment_type.blank?-- {- rate_provider: rate_provider_class,- fulfillment_provider: provider_class- }.each do |attribute, klass|- handled = klass.fulfillment_types- next if handled.blank? || handled.include?(fulfillment_type)-- errors.add(- attribute,- Spree.t('errors.messages.provider_does_not_handle_fulfillment_type',- provider: klass.provider_name, fulfillment_type: fulfillment_type)- )- end+ def delivery_zone_must_belong_to_profile+ return if delivery_zone.nil?+ return if delivery_zone.delivery_profile_id == delivery_profile_id++ errors.add(:delivery_zone, :does_not_belong_to_profile,+ message: Spree.t('errors.messages.delivery_zone_not_in_profile'))+ end++ def profile_must_accept_provider+ return if delivery_profile.nil?+ return if delivery_profile.accepts_provider?(provider_class)++ errors.add(+ :fulfillment_provider,+ Spree.t('errors.messages.profile_does_not_accept_provider',+ provider: provider_class.provider_name, profile: delivery_profile.name)+ )+ end++ # A carrier quotes real shipments, so it can only price methods whose+ # fulfillment provider ships to an address.+ def rate_provider_must_ship+ return unless rate_provider_class.requires_address?+ return if provider_class.new.requires_address?++ errors.add(+ :rate_provider,+ Spree.t('errors.messages.rate_provider_requires_shipping',+ provider: rate_provider_class.provider_name)+ )enddef rate_provider_must_be_availablediff --git a/spree/core/app/models/spree/delivery_method_rules/channel_rule.rb b/spree/core/app/models/spree/delivery_method_rules/channel_rule.rbnew file mode 100644index 0000000000..f304086733--- /dev/null+++ b/spree/core/app/models/spree/delivery_method_rules/channel_rule.rb@@ -0,0 +1,41 @@+module Spree+ module DeliveryMethodRules+ # Offers the method only to carts on the listed channels, so one profile+ # can price the same goods differently per channel (a wholesale rate+ # beside a retail one) without duplicating products or warehouses.+ #+ # This governs which methods a channel is *offered*, not which origins+ # serve it — that stays on the channel's stock-location allowlist, where+ # quoting and allocation cannot disagree+ # (docs/plans/6.0-channel-delivery.md).+ class ChannelRule < Spree::DeliveryMethodRule+ # Stored as raw IDs. Accepts prefixed IDs (`ch_…`) from API callers and+ # decodes them on write, so eligibility compares against raw+ # `channel_id` rows. The scope confines the existence check to the+ # method's store, so cross-store channel IDs can't sneak in.+ preference :channel_ids, :array, default: [],+ parse_on_set: normalize_id_preference(+ klass: Spree::Channel,+ scope: ->(rule) { rule.store.channels }+ )++ def channels+ return [] if preferred_channel_ids.blank?++ store.channels.where(id: preferred_channel_ids)+ end++ def eligible?(package)+ # An empty preference leaves the method unrestricted, matching the+ # other rules' fail-open convention for half-configured rows.+ return true if preferred_channel_ids.empty?++ channel = package.order&.channel+ return false if channel.nil?++ # Compare as strings to support both integer and UUID primary keys+ preferred_channel_ids.map(&:to_s).include?(channel.id.to_s)+ end+ end+ end+enddiff --git a/spree/core/app/models/spree/delivery_method_zone.rb b/spree/core/app/models/spree/delivery_method_zone.rbdeleted file mode 100644index 14a7a65009..0000000000--- a/spree/core/app/models/spree/delivery_method_zone.rb+++ /dev/null@@ -1,8 +0,0 @@-module Spree- class DeliveryMethodZone < Spree.base_class- belongs_to :delivery_method, -> { with_deleted }, inverse_of: :delivery_method_zones, class_name: 'Spree::DeliveryMethod'- belongs_to :delivery_zone, inverse_of: :delivery_method_zones, class_name: 'Spree::DeliveryZone'-- validates :delivery_method, uniqueness: { scope: :delivery_zone }- end-enddiff --git a/spree/core/app/models/spree/delivery_origin_group.rb b/spree/core/app/models/spree/delivery_origin_group.rbnew file mode 100644index 0000000000..d24de05bd3--- /dev/null+++ b/spree/core/app/models/spree/delivery_origin_group.rb@@ -0,0 +1,62 @@+module Spree+ # Partitions a delivery profile's fulfillment origins: every zone and+ # method belongs to a group, so the same products can quote different+ # rates depending on which warehouse fulfills them. A profile always has+ # at least one group; the auto-created default is nameless with no+ # location members, which means every store location — simple stores+ # never see the layer.+ class DeliveryOriginGroup < Spree.base_class+ has_prefix_id :og++ acts_as_list scope: :delivery_profile++ belongs_to :delivery_profile, class_name: 'Spree::DeliveryProfile', inverse_of: :delivery_origin_groups++ has_many :delivery_origin_group_locations, class_name: 'Spree::DeliveryOriginGroupLocation',+ dependent: :destroy, inverse_of: :delivery_origin_group+ has_many :stock_locations, through: :delivery_origin_group_locations, class_name: 'Spree::StockLocation'+ has_many :delivery_zones, class_name: 'Spree::DeliveryZone', dependent: :restrict_with_error,+ inverse_of: :delivery_origin_group+ has_many :delivery_methods, class_name: 'Spree::DeliveryMethod', dependent: :restrict_with_error,+ inverse_of: :delivery_origin_group++ delegate :store, to: :delivery_profile++ # The last group is load-bearing (zones and methods must live somewhere);+ # others go once nothing hangs off them.+ def can_be_deleted?+ delivery_zones.none? && delivery_methods.none? &&+ delivery_profile.delivery_origin_groups.where.not(id: id).exists?+ end++ # Whether packages originating from this stock location are served by+ # the group's zones and methods. No linked locations means every store+ # location.+ #+ # Allocation asks this once per location per unit, so the membership is+ # read through the loaded association rather than re-queried each call.+ #+ # @param stock_location [Spree::StockLocation, nil]+ # @return [Boolean]+ def covers_location?(stock_location)+ return false if stock_location.nil?+ return true if member_stock_location_ids.empty?++ member_stock_location_ids.include?(stock_location.id)+ end++ # @return [Array<Integer>] ids of the locations this group is limited to+ def member_stock_location_ids+ @member_stock_location_ids ||= delivery_origin_group_locations.map(&:stock_location_id)+ end++ # The locations this group fulfills from.+ #+ # @return [ActiveRecord::Relation<Spree::StockLocation>]+ def fulfillable_stock_locations+ return store.stock_locations if member_stock_location_ids.empty?++ store.stock_locations.where(id: stock_locations.select(:id))+ end+ end+enddiff --git a/spree/core/app/models/spree/delivery_origin_group_location.rb b/spree/core/app/models/spree/delivery_origin_group_location.rbnew file mode 100644index 0000000000..1331753eb4--- /dev/null+++ b/spree/core/app/models/spree/delivery_origin_group_location.rb@@ -0,0 +1,9 @@+module Spree+ class DeliveryOriginGroupLocation < Spree.base_class+ belongs_to :delivery_origin_group, class_name: 'Spree::DeliveryOriginGroup',+ inverse_of: :delivery_origin_group_locations+ belongs_to :stock_location, class_name: 'Spree::StockLocation'++ validates :stock_location_id, uniqueness: { scope: :delivery_origin_group_id }+ end+enddiff --git a/spree/core/app/models/spree/delivery_profile.rb b/spree/core/app/models/spree/delivery_profile.rbnew file mode 100644index 0000000000..02902932ae--- /dev/null+++ b/spree/core/app/models/spree/delivery_profile.rb@@ -0,0 +1,140 @@+module Spree+ # The grouping that decides how a set of products ships: which origins can+ # fulfill them, which destination zones apply, and which delivery methods+ # are offered. Products reference a profile directly (nil = the store's+ # default profile); carts split per profile, and a package's candidate+ # methods are exactly its profile's methods.+ #+ # Formerly Spree::ShippingCategory — the table is renamed in place, so 5.x+ # category assignments become profile assignments (see+ # docs/plans/6.0-delivery-profiles.md).+ class DeliveryProfile < Spree.base_class+ include Spree::SingleStoreResource++ has_prefix_id :fp++ acts_as_list scope: :store++ belongs_to :store, class_name: 'Spree::Store', optional: true++ has_many :products, class_name: 'Spree::Product', dependent: :restrict_with_error, inverse_of: :delivery_profile+ # Origin groups partition the profile's fulfillment origins; zones and+ # methods hang off a group, so per-origin rate tables need no second+ # profile. Every profile has at least one (the nameless default, whose+ # empty membership means every store location).+ has_many :delivery_origin_groups, -> { order(:position) }, class_name: 'Spree::DeliveryOriginGroup',+ dependent: :destroy, inverse_of: :delivery_profile+ has_many :delivery_zones, class_name: 'Spree::DeliveryZone', dependent: :destroy,+ inverse_of: :delivery_profile+ has_many :delivery_methods, class_name: 'Spree::DeliveryMethod', dependent: :destroy,+ inverse_of: :delivery_profile++ after_create :create_default_origin_group++ validates :name, presence: true, uniqueness: { case_sensitive: false, scope: :store_id }++ registers_subclasses_via { Spree.delivery_profile_types }++ # Whether a delivery method using the given fulfillment provider may+ # join this profile — the guard that keeps a Digital profile from+ # quietly gaining a shipping method and reinterpreting its products.+ #+ # @param _provider_class [Class] a Spree::FulfillmentProvider subclass+ # @return [Boolean]+ def accepts_provider?(_provider_class)+ true+ end++ # Whether this profile's products are delivered digitally. Declared by+ # the kind, not derived from the method set — a freshly created profile+ # with no methods yet must already know what it is.+ def digital?+ false+ end++ # Whether checkout must collect a shipping address for this profile's+ # products. Kinds override; the physical default derives from methods'+ # providers (a pickup-only profile needs none).+ def requires_shipping_address?+ delivery_methods.any?(&:requires_address?)+ end++ # Whether this profile's products can be collected at a merchant counter+ # — true when any of its methods hands goods over via a pickup provider.+ def offers_pickup?+ delivery_methods.any?(&:pickup?)+ end++ # Whether this profile's products ship to a customer address.+ def offers_shipping?+ delivery_methods.any?(&:requires_address?)+ end++ before_save :ensure_one_default++ scope :order_default, -> { order(default: :desc, position: :asc) }++ # The profile products fall back to when they reference none. Every+ # store has exactly one.+ #+ # @param store [Spree::Store]+ # @return [Spree::DeliveryProfile, nil]+ def self.default_for(store)+ where(store: store, default: true).first+ end++ # The default profile is load-bearing (products fall back to it); other+ # profiles must be empty of products first.+ def can_be_deleted?+ !default? && products.none?+ end++ # Whether packages originating from this stock location can carry the+ # profile's products — true when any origin group covers it.+ #+ # @param stock_location [Spree::StockLocation, nil]+ # @return [Boolean]+ def covers_location?(stock_location)+ return false if stock_location.nil?++ delivery_origin_groups.any? { |group| group.covers_location?(stock_location) }+ end++ # The locations this profile's products may be allocated from — the+ # union of its origin groups' locations. Any group with no members+ # widens the union to every store location.+ #+ # @return [ActiveRecord::Relation<Spree::StockLocation>]+ def fulfillable_stock_locations+ groups = delivery_origin_groups.includes(:delivery_origin_group_locations)+ # Any group without members widens the union to every store location.+ return store.stock_locations if groups.empty? || groups.any? { |group| group.member_stock_location_ids.empty? }++ store.stock_locations.where(id: groups.flat_map(&:member_stock_location_ids).uniq)+ end++ # The group zones and methods join when none is named — the first by+ # position, which for untouched profiles is the auto-created default.+ #+ # @return [Spree::DeliveryOriginGroup, nil]+ def default_origin_group+ delivery_origin_groups.first+ end++ private++ def create_default_origin_group+ delivery_origin_groups.create!+ end++ # Mirrors StockLocation#ensure_one_default: promoting a profile demotes+ # the previous default; the default flag can never be simply removed.+ def ensure_one_default+ if default?+ Spree::DeliveryProfile.where(store_id: store_id, default: true).where.not(id: id).update_all(default: false)+ elsif default_was && will_save_change_to_default?+ self.default = true+ end+ end+ end+enddiff --git a/spree/core/app/models/spree/delivery_profiles/digital.rb b/spree/core/app/models/spree/delivery_profiles/digital.rbnew file mode 100644index 0000000000..da64592df1--- /dev/null+++ b/spree/core/app/models/spree/delivery_profiles/digital.rb@@ -0,0 +1,20 @@+module Spree+ module DeliveryProfiles+ # Digital goods: products in this profile are delivered digitally and+ # checkout collects no shipping address. Only digital-provider methods+ # may join, so the profile can never quietly reinterpret its products.+ class Digital < Spree::DeliveryProfile+ def accepts_provider?(provider_class)+ provider_class.digital?+ end++ def digital?+ true+ end++ def requires_shipping_address?+ false+ end+ end+ end+enddiff --git a/spree/core/app/models/spree/delivery_profiles/shipping.rb b/spree/core/app/models/spree/delivery_profiles/shipping.rbnew file mode 100644index 0000000000..9718e4fd59--- /dev/null+++ b/spree/core/app/models/spree/delivery_profiles/shipping.rb@@ -0,0 +1,12 @@+module Spree+ module DeliveryProfiles+ # Physical goods — the default profile kind. Accepts any non-digital+ # provider (shipping, pickup, extension mechanics); the store's+ # "General" default profile is one of these.+ class Shipping < Spree::DeliveryProfile+ def accepts_provider?(provider_class)+ !provider_class.digital?+ end+ end+ end+enddiff --git a/spree/core/app/models/spree/delivery_rate_provider/base.rb b/spree/core/app/models/spree/delivery_rate_provider/base.rbindex b1dc7ffb92..93ca9a745f 100644--- a/spree/core/app/models/spree/delivery_rate_provider/base.rb+++ b/spree/core/app/models/spree/delivery_rate_provider/base.rb@@ -35,12 +35,14 @@ module Spreeend# Fulfillment types this provider can quote, so admin UIs narrow the- # type field once a provider is chosen. An empty list means "any- # type" — the Internal (calculator) provider prices anything.+ # Whether this provider quotes real shipments to an address — true+ # for carriers, which therefore can only price methods whose+ # fulfillment provider ships. The Internal (calculator) provider+ # prices anything.#- # @return [Array<String>]- def fulfillment_types- []+ # @return [Boolean]+ def requires_address?+ falseend# Whether the method's calculator decides the price. False fordiff --git a/spree/core/app/models/spree/delivery_rate_provider/estimate.rb b/spree/core/app/models/spree/delivery_rate_provider/estimate.rbindex ea6ce7f0ab..0f8b16e2ed 100644--- a/spree/core/app/models/spree/delivery_rate_provider/estimate.rb+++ b/spree/core/app/models/spree/delivery_rate_provider/estimate.rb@@ -11,6 +11,11 @@ module Spreeinclude ActiveModel::Attributesattribute :cost, :decimal+ # ISO code of the currency the provider quoted in. Nil means the+ # store's own currency (Internal); carrier quotes come back in the+ # carrier account's currency and are dropped when it differs from the+ # cart's — a number in the wrong currency must never reach checkout.+ attribute :currency, :stringattribute :carrier, :stringattribute :service_level, :string# Optional display name; when blank the Estimator derives one fromdiff --git a/spree/core/app/models/spree/delivery_zone.rb b/spree/core/app/models/spree/delivery_zone.rbindex 4b79633321..a7d8d2b16a 100644--- a/spree/core/app/models/spree/delivery_zone.rb+++ b/spree/core/app/models/spree/delivery_zone.rb@@ -9,14 +9,26 @@ module Spreeattribute :metadata, default: -> { {} }belongs_to :store, class_name: 'Spree::Store'+ # Zones are destination sets owned by a delivery profile; within it they+ # hang off an origin group, so the same profile can quote different+ # tables per warehouse. The profile's methods bind to at most one zone.+ belongs_to :delivery_profile, class_name: 'Spree::DeliveryProfile', inverse_of: :delivery_zones+ belongs_to :delivery_origin_group, class_name: 'Spree::DeliveryOriginGroup', inverse_of: :delivery_zoneshas_many :members, class_name: 'Spree::DeliveryZoneMember', dependent: :destroy, inverse_of: :delivery_zone- has_many :delivery_method_zones, class_name: 'Spree::DeliveryMethodZone', dependent: :destroy, inverse_of: :delivery_zone- has_many :delivery_methods, through: :delivery_method_zones, class_name: 'Spree::DeliveryMethod'+ has_many :delivery_methods, class_name: 'Spree::DeliveryMethod', dependent: :nullify, inverse_of: :delivery_zonevalidates :name, presence: true, uniqueness: { scope: [:store_id, *spree_base_uniqueness_scope] }validates :store, presence: true+ # Mirrors DeliveryMethod: a zone created without an explicit profile+ # joins the store's default one, landing in its default origin group+ # unless one is named.+ before_validation :assign_default_delivery_profile, on: :create+ before_validation :assign_default_origin_group, on: :create+ validate :origin_group_must_belong_to_profile,+ if: -> { delivery_origin_group_id_changed? || delivery_profile_id_changed? }+self.whitelisted_ransackable_attributes = %w[name]# @param address [Spree::Address, nil]@@ -26,5 +38,22 @@ module Spreemembers.any? { |member| member.match?(address) }end++ private++ def assign_default_delivery_profile+ self.delivery_profile ||= store&.default_delivery_profile+ end++ def assign_default_origin_group+ self.delivery_origin_group ||= delivery_profile&.default_origin_group+ end++ def origin_group_must_belong_to_profile+ return if delivery_origin_group.nil? || delivery_profile.nil?+ return if delivery_origin_group.delivery_profile_id == delivery_profile_id++ errors.add(:delivery_origin_group, :invalid)+ endendenddiff --git a/spree/core/app/models/spree/fulfillment_profile.rb b/spree/core/app/models/spree/fulfillment_profile.rbdeleted file mode 100644index 982ccd4e21..0000000000--- a/spree/core/app/models/spree/fulfillment_profile.rb+++ /dev/null@@ -1,59 +0,0 @@-module Spree- # The grouping that decides how a set of products ships. Products- # reference a profile directly (nil = the store's default profile); the- # profile owns location groups, whose zones own the delivery methods.- # Carts split per profile, and a package's candidate methods are exactly- # its profile's methods.- class FulfillmentProfile < Spree.base_class- include Spree::SingleStoreResource-- has_prefix_id :fp-- acts_as_list scope: :store-- belongs_to :store, class_name: 'Spree::Store'-- has_many :location_groups, -> { order(:position) }, class_name: 'Spree::FulfillmentLocationGroup',- dependent: :destroy, inverse_of: :fulfillment_profile- has_many :products, class_name: 'Spree::Product', dependent: :nullify, inverse_of: :fulfillment_profile- has_many :delivery_zones, through: :location_groups, class_name: 'Spree::DeliveryZone'- has_many :delivery_methods, through: :location_groups, class_name: 'Spree::DeliveryMethod'-- validates :name, presence: true, uniqueness: { scope: spree_base_uniqueness_scope }-- after_create :ensure_default_location_group-- scope :order_default, -> { order(default: :desc, position: :asc) }-- # Every store has exactly one default profile — the home of products that- # reference none. Undeletable; demoted only by promoting another.- def self.default_for(store)- where(store: store, default: true).first- end-- # The default profile is load-bearing (products fall back to it) and- # other profiles must be empty of products before deletion.- def can_be_deleted?- !default? && products.none?- end-- # The union of the profile's groups' locations — where its products can- # be allocated from. A group with no explicit members means every store- # location, making the whole union the full set.- #- # @return [ActiveRecord::Relation<Spree::StockLocation>]- def fulfillable_stock_locations- groups = location_groups.includes(:stock_locations).to_a- return store.stock_locations.none if groups.empty?- return store.stock_locations if groups.any? { |group| group.stock_locations.empty? }-- store.stock_locations.where(id: groups.flat_map { |group| group.stock_locations.map(&:id) })- end-- private-- def ensure_default_location_group- location_groups.create!(name: nil) if location_groups.empty?- end- end-enddiff --git a/spree/core/app/models/spree/fulfillment_provider/base.rb b/spree/core/app/models/spree/fulfillment_provider/base.rbindex 681a251205..72c9ec4a23 100644--- a/spree/core/app/models/spree/fulfillment_provider/base.rb+++ b/spree/core/app/models/spree/fulfillment_provider/base.rb@@ -6,13 +6,19 @@ module Spree# ShipmentHandler name-constantize mechanism.class Baseclass << self- # Fulfillment types this provider can handle, so admin UIs can offer- # only the providers that fit the chosen type. An empty list means- # "any type".- #- # @return [Array<String>]- def fulfillment_types- []+ # Behavior predicates — the class hierarchy IS the vocabulary.+ # Subclasses override the one that describes their mechanics; admin+ # UIs and profile kinds compose against these, never string lists.+ def digital?+ false+ end++ def pickup?+ false+ end++ def pickup_point?+ falseend# Human-readable name for admin UIs. Provider gems follow the@@ -77,11 +83,15 @@ module Spreetrueend- # Whether the method can serve a package sourced from the given stock- # location. Shipping-like providers dispatch from anywhere; merchant- # pickup overrides this to require an eligible pickup location.- def serves_location?(_delivery_method, _stock_location)- true+ # Whether packages originating from this stock location may use the+ # method — answered by the method's origin group (no group or no+ # members means every location). Pickup overrides with its own policy+ # semantics (pickup-enabled counters, ship-to-store transfers).+ def serves_location?(delivery_method, stock_location)+ group = delivery_method.delivery_origin_group+ return true if group.nil?++ group.covers_location?(stock_location)end# Performs the provider-side dispatch when a fulfillment fulfills.diff --git a/spree/core/app/models/spree/fulfillment_provider/digital.rb b/spree/core/app/models/spree/fulfillment_provider/digital.rbindex 90518406c7..cdc4c252c5 100644--- a/spree/core/app/models/spree/fulfillment_provider/digital.rb+++ b/spree/core/app/models/spree/fulfillment_provider/digital.rb@@ -5,8 +5,8 @@ module Spree# legacy non-idempotent checkout callback that created one link per line# item regardless of quantity.class Digital < Base- def self.fulfillment_types- ['digital']+ def self.digital?+ trueenddef auto_fulfill?diff --git a/spree/core/app/models/spree/fulfillment_provider/pickup.rb b/spree/core/app/models/spree/fulfillment_provider/pickup.rbindex f7abe83bbb..3f0870951e 100644--- a/spree/core/app/models/spree/fulfillment_provider/pickup.rb+++ b/spree/core/app/models/spree/fulfillment_provider/pickup.rb@@ -3,8 +3,8 @@ module Spree# Merchant-location pickup: hand-over is confirmed by staff, no# provider-side mechanics.class Pickup < Base- def self.fulfillment_types- ['pickup']+ def self.pickup?+ trueenddef requires_address?diff --git a/spree/core/app/models/spree/fulfillment_provider/pickup_point.rb b/spree/core/app/models/spree/fulfillment_provider/pickup_point.rbindex 83dde7ee6b..c8b65d43c9 100644--- a/spree/core/app/models/spree/fulfillment_provider/pickup_point.rb+++ b/spree/core/app/models/spree/fulfillment_provider/pickup_point.rb@@ -4,8 +4,8 @@ module Spree# discovery and validation live on the delivery method's# PickupPointProvider; hand-over mechanics default to manual.class PickupPoint < Base- def self.fulfillment_types- ['pickup_point']+ def self.pickup_point?+ trueenddef requires_address?diff --git a/spree/core/app/models/spree/product.rb b/spree/core/app/models/spree/product.rbindex fa8ec92f72..b9b3eb6075 100644--- a/spree/core/app/models/spree/product.rb+++ b/spree/core/app/models/spree/product.rb@@ -130,10 +130,17 @@ module Spreebelongs_to :tax_category, class_name: 'Spree::TaxCategory'belongs_to :product_type, class_name: 'Spree::ProductType', optional: true, counter_cache: :products_count- # Delivery eligibility moved to ProductType#fulfillment_types in 6.0;- # both of these die with spree_shipping_categories in 6.1.- belongs_to :shipping_category, class_name: 'Spree::ShippingCategory', inverse_of: :products, optional: true, deprecated: true- has_many :shipping_methods, through: :shipping_category, class_name: 'Spree::DeliveryMethod', deprecated: true+ # How this product ships: origins, zones and methods all hang off the+ # profile. Required — a product without one could not be fulfilled at+ # all — and auto-assigned on create (type template, else the store's+ # default profile), so callers never have to think about it. The FK is+ # the renamed 5.x shipping_category_id, so migrated catalogs arrive+ # already assigned.+ belongs_to :delivery_profile, class_name: 'Spree::DeliveryProfile', inverse_of: :products++ # Guards every write path (including raw prefixed-id assignment) against+ # linking another store's profile.+ validate :delivery_profile_must_belong_to_store, if: :delivery_profile_id_changed?# Every product has at least one variant. `default_variant` is the "face" of# the product (price display, default add-to-cart, property delegation).@@ -165,6 +172,11 @@ module Spreehas_many :digitals, through: :variantsafter_initialize :assign_default_tax_category+ # The type's profile is a creation-time template: stamped here, never+ # synced afterwards — reassigning the type later leaves the product's+ # profile alone. Falls back to the store's default profile, keeping the+ # required association satisfiable without the caller naming one.+ before_validation :stamp_template_delivery_profile, on: :createafter_create :sync_associations_from_product_typeafter_update :sync_associations_from_product_type, if: :saved_change_to_product_type_id?@@ -642,19 +654,24 @@ module Spree# Check if the product is digital by checking if any of its shipping methods are digital delivery# This is used to determine if the product is digital and should have a digital delivery price- # instead of a physical shipping price+ # instead of a physical shipping price. The profile kind declares it —+ # capabilities are never stated twice.## @return [Boolean]def digital?- @digital ||= fulfillment_types == ['digital']+ # Memoized via nil-check: MemoizedData resets caches by assigning nil.+ return @digital unless @digital.nil?++ @digital = !!resolved_delivery_profile&.digital?end- # The fulfillment types this product may be delivered by, from its- # ProductType; typeless products default to physical shipping.+ # The profile that governs this product. The association is required for+ # new records; the store-default fallback covers rows predating the+ # backfill (never expected in practice, cheap to be safe about).#- # @return [Array<String>]- def fulfillment_types- product_type&.fulfillment_types.presence || ['shipping']+ # @return [Spree::DeliveryProfile, nil]+ def resolved_delivery_profile+ delivery_profile || (store && Spree::DeliveryProfile.default_for(store))enddef auto_match_collections@@ -903,6 +920,20 @@ module Spreeself.tax_category = Spree::TaxCategory.default if new_record? && self[:tax_category_id].blank?end+ def stamp_template_delivery_profile+ return if delivery_profile_id.present?++ self.delivery_profile_id = product_type&.delivery_profile_id ||+ (store && Spree::DeliveryProfile.default_for(store)&.id)+ end++ def delivery_profile_must_belong_to_store+ return if delivery_profile.nil? || store.nil?+ return if delivery_profile.store_id == store_id++ errors.add(:delivery_profile, :invalid)+ end+def run_touch_callbacksrun_callbacks(:touch)enddiff --git a/spree/core/app/models/spree/product_type.rb b/spree/core/app/models/spree/product_type.rbindex 2b742993b0..cab507e342 100644--- a/spree/core/app/models/spree/product_type.rb+++ b/spree/core/app/models/spree/product_type.rb@@ -10,9 +10,12 @@ module SpreeTRANSLATABLE_FIELDS = %i[name].freezetranslates(*TRANSLATABLE_FIELDS, column_fallback: Spree.mobility_column_fallback)- attribute :fulfillment_types, default: -> { ['shipping'] }-belongs_to :store, class_name: 'Spree::Store'+ # Creation-time template only: stamped onto the product when it is+ # created with this type, never managed through it afterwards — the same+ # doctrine as every other type-driven attribute. Nil means the store's+ # default profile.+ belongs_to :delivery_profile, class_name: 'Spree::DeliveryProfile', optional: truehas_many :option_type_product_types, class_name: 'Spree::OptionTypeProductType', dependent: :destroyhas_many :option_types, through: :option_type_product_types, class_name: 'Spree::OptionType'@@ -33,8 +36,6 @@ module Spreevalidates :name, presence: true, uniqueness: { case_sensitive: false, scope: :store_id }validates :store, presence: true- validates :fulfillment_types, presence: true- validate :fulfillment_types_must_be_registered, if: :fulfillment_types_changed?self.whitelisted_ransackable_attributes = %w[name]self.whitelisted_ransackable_associations = %w[option_types]@@ -63,15 +64,6 @@ module Spreecategory_ids.map { |id| Spree::Category.prefixed_id_for(id) }end- # @return [Boolean] true when products of this type are delivered digitally only- def digital?- fulfillment_types == ['digital']- end-- # @return [Boolean] true when products of this type require physical delivery- def requires_shipping?- fulfillment_types.include?('shipping')- endprivate@@ -117,20 +109,5 @@ module Spreeproduct_type_custom_field_definitions.resetend- # Strict vocabulary against Spree.fulfillment_types — an unregistered- # token silently removes the product from every delivery method's- # eligibility, so typos must fail loudly. Change-only, so rows migrated- # ahead of their initializer registration stay loadable and savable.- def fulfillment_types_must_be_registered- unregistered = Array(fulfillment_types).map(&:to_s) - Spree.fulfillment_types- return if unregistered.empty?-- errors.add(- :fulfillment_types,- Spree.t(:unregistered_fulfillment_types, scope: [:errors, :messages],- types: unregistered.join(', '),- default: "contains unregistered fulfillment types: #{unregistered.join(', ')}")- )- endendenddiff --git a/spree/core/app/models/spree/shipping_calculator.rb b/spree/core/app/models/spree/shipping_calculator.rbindex afb4b27afa..3588512d25 100644--- a/spree/core/app/models/spree/shipping_calculator.rb+++ b/spree/core/app/models/spree/shipping_calculator.rb@@ -12,6 +12,13 @@ module Spreetrueend+ # Whether this calculator can quote the given currency. Amount-based+ # calculators override via Calculator::CurrencyAmounts; percent and+ # per-weight math is currency-agnostic and quotes anything.+ def supports_currency?(_currency)+ true+ end+privatedef total(content_items)diff --git a/spree/core/app/models/spree/shipping_category.rb b/spree/core/app/models/spree/shipping_category.rbdeleted file mode 100644index 1993e16b79..0000000000--- a/spree/core/app/models/spree/shipping_category.rb+++ /dev/null@@ -1,19 +0,0 @@-module Spree- class ShippingCategory < Spree.base_class- has_prefix_id :scat-- DIGITAL_NAME = 'Digital'-- include Spree::UniqueName-- with_options inverse_of: :shipping_category do- has_many :products- has_many :shipping_method_categories- end- has_many :shipping_methods, through: :shipping_method_categories, class_name: 'Spree::DeliveryMethod'-- def self.digital- find_by(name: DIGITAL_NAME)- end- end-enddiff --git a/spree/core/app/models/spree/shipping_method_category.rb b/spree/core/app/models/spree/shipping_method_category.rbdeleted file mode 100644index 6b56820ac7..0000000000--- a/spree/core/app/models/spree/shipping_method_category.rb+++ /dev/null@@ -1,8 +0,0 @@-module Spree- class ShippingMethodCategory < Spree.base_class- has_prefix_id :smcat-- belongs_to :shipping_method, class_name: 'Spree::DeliveryMethod'- belongs_to :shipping_category, class_name: 'Spree::ShippingCategory', inverse_of: :shipping_method_categories- end-enddiff --git a/spree/core/app/models/spree/shipping_method_zone.rb b/spree/core/app/models/spree/shipping_method_zone.rbdeleted file mode 100644index 740411fcad..0000000000--- a/spree/core/app/models/spree/shipping_method_zone.rb+++ /dev/null@@ -1,5 +0,0 @@-module Spree- # Constant alias for the legacy Spree::ShippingMethodZone, renamed to- # Spree::DeliveryMethodZone in 6.0. Remove in 6.1.- ShippingMethodZone = DeliveryMethodZone-enddiff --git a/spree/core/app/models/spree/stock/coordinator.rb b/spree/core/app/models/spree/stock/coordinator.rbindex 2e07a51d81..e3341390d9 100644--- a/spree/core/app/models/spree/stock/coordinator.rb+++ b/spree/core/app/models/spree/stock/coordinator.rb@@ -29,7 +29,10 @@ module Spreedef build_packages(packages = [])stock_locations_with_requested_variants.each do |stock_location|- packer = build_packer(stock_location, inventory_units)+ units = allocatable_units_for(stock_location)+ next if units.empty?++ packer = build_packer(stock_location, units)packages += packer.packagesend@@ -43,6 +46,49 @@ module Spreewhere(spree_stock_items: { variant_id: requested_variant_ids }).distinctend+ # An item may only be allocated from locations its delivery profile+ # covers — a profile narrowed to the cold-storage warehouse never packs+ # from anywhere else — intersected with the channel's served set when+ # the order carries one (docs/plans/6.0-channel-delivery.md). Profiles+ # resolve once per order, not per unit.+ def allocatable_units_for(stock_location)+ return [] unless channel_serves?(stock_location)++ inventory_units.select do |unit|+ profile = profile_for(unit)+ profile.nil? || profile.covers_location?(stock_location)+ end+ end++ # A nil channel means unrestricted — key-bound storefront traffic+ # always has one, but admin-created and legacy carts may not.+ def channel_serves?(stock_location)+ return true if order_channel.nil?++ order_channel.serves_location?(stock_location)+ end++ # Memoized so the channel's membership is read once per allocation, not+ # once per candidate location.+ def order_channel+ return @order_channel if defined?(@order_channel)++ @order_channel = order.try(:channel)+ end++ # Allocation asks every profile about every candidate location, so the+ # groups and their membership are loaded once with the profile rather+ # than re-queried per question.+ def profile_for(unit)+ @unit_profiles ||= {}+ product = unit.variant.product+ return @unit_profiles[product.id] if @unit_profiles.key?(product.id)++ profile = product.resolved_delivery_profile+ profile&.delivery_origin_groups&.each(&:member_stock_location_ids)+ @unit_profiles[product.id] = profile+ end+def requested_variant_idsinventory_units.map(&:variant_id).uniqenddiff --git a/spree/core/app/models/spree/stock/estimator.rb b/spree/core/app/models/spree/stock/estimator.rbindex d8fe3fc578..dce970aac7 100644--- a/spree/core/app/models/spree/stock/estimator.rb+++ b/spree/core/app/models/spree/stock/estimator.rb@@ -50,6 +50,12 @@ module Spreeprovider.estimates(package).filter_map do |estimate|next unless delivery_method.offers_service?(estimate)+ # A quote in another currency (a USD carrier account under a EUR+ # cart) is unusable — mislabeling it would misprice checkout.+ if estimate.currency.present? && estimate.currency.casecmp(currency) != 0+ Rails.logger.debug { "Spree::Stock::Estimator: dropping #{delivery_method.name} estimate quoted in #{estimate.currency} for a #{currency} order" }+ next+ endservice_row = delivery_method.service_for(estimate)cost = apply_markup(estimate.cost, delivery_method, service_row, provider)@@ -140,8 +146,7 @@ module Spreedelivery_method.serves_location?(package.stock_location) &&delivery_method.eligible_for_package?(package) &&calculator.available?(package) &&- (calculator.preferences[:currency].blank? ||- calculator.preferences[:currency] == currency)+ calculator.supports_currency?(currency)endenddiff --git a/spree/core/app/models/spree/stock/package.rb b/spree/core/app/models/spree/stock/package.rbindex 45e2d4dec1..3ea036236a 100644--- a/spree/core/app/models/spree/stock/package.rb+++ b/spree/core/app/models/spree/stock/package.rb@@ -104,31 +104,34 @@ module Spreequantity.zero?end+ # Pre-completion packages belong to a cart, where #order walks to nil —+ # the line items carry the purchase currency either way.def currency- order.currency+ order&.currency ||+ contents.filter_map { |item| item.try(:inventory_unit)&.line_item&.currency }.first ||+ Spree::Current.currencyend- # The fulfillment types every item in this package supports — the- # intersection across products (splitters keep packages homogeneous,- # so this is normally one product-type's set).+ # The delivery profile every item in this package belongs to.+ # Splitters keep packages profile-homogeneous, so the first item's+ # profile is the package's.#- # @return [Array<String>]- def fulfillment_types- contents.map { |item| item.variant.product.fulfillment_types }.reduce(:&) || []+ # @return [Spree::DeliveryProfile, nil]+ def delivery_profile+ contents.first&.variant&.product&.resolved_delivery_profileend- # Delivery methods eligible to serve this package: the method's- # fulfillment_type must be supported by every item. Replaces the- # ShippingCategory-based Package#shipping_methods. Per-product- # exclusions are DeliveryMethodRules::ExcludedProductsRule, enforced- # with the other rules in the Estimator's method filter.+ # Delivery methods eligible to serve this package: exactly the+ # package's profile's methods. Per-product exclusions are+ # DeliveryMethodRules::ExcludedProductsRule, enforced with the other+ # rules in the Estimator's method filter.## @return [ActiveRecord::Relation<Spree::DeliveryMethod>]def eligible_delivery_methods- types = fulfillment_types- return Spree::DeliveryMethod.none if types.empty?+ profile = delivery_profile+ return Spree::DeliveryMethod.none if profile.nil?- Spree::DeliveryMethod.by_fulfillment_type(types)+ profile.delivery_methodsend# @deprecated Use {#eligible_delivery_methods}; removed in 6.1.diff --git a/spree/core/app/models/spree/stock/splitter/delivery_profile.rb b/spree/core/app/models/spree/stock/splitter/delivery_profile.rbnew file mode 100644index 0000000000..274898162b--- /dev/null+++ b/spree/core/app/models/spree/stock/splitter/delivery_profile.rb@@ -0,0 +1,28 @@+module Spree+ module Stock+ module Splitter+ # Keeps packages homogeneous by delivery profile, so mixed carts+ # (default-profile goods + oversized + digital) split automatically and+ # each package quotes against exactly its profile's methods.+ class DeliveryProfile < Spree::Stock::Splitter::Base+ def split(packages)+ split_packages = packages.flat_map { |package| split_by_profile(package) }+ return_next(split_packages)+ end++ private++ def split_by_profile(package)+ grouped = package.contents.group_by { |item| profile_id_for(item) }+ grouped.values.map { |contents| build_package(contents) }+ end++ # optimization: save product -> profile correspondence+ def profile_id_for(item)+ @item_profiles ||= {}+ @item_profiles[item.variant.product_id] ||= item.variant.product.resolved_delivery_profile&.id+ end+ end+ end+ end+enddiff --git a/spree/core/app/models/spree/stock/splitter/fulfillment_type.rb b/spree/core/app/models/spree/stock/splitter/fulfillment_type.rbdeleted file mode 100644index d62ff4d9aa..0000000000--- a/spree/core/app/models/spree/stock/splitter/fulfillment_type.rb+++ /dev/null@@ -1,28 +0,0 @@-module Spree- module Stock- module Splitter- # Keeps packages homogeneous by fulfillment-type set, so mixed carts- # (physical + digital, shippable + pickup-only) split automatically.- # Replaces the ShippingCategory and Digital splitters.- class FulfillmentType < Spree::Stock::Splitter::Base- def split(packages)- split_packages = packages.flat_map { |package| split_by_fulfillment_types(package) }- return_next(split_packages)- end-- private-- def split_by_fulfillment_types(package)- grouped = package.contents.group_by { |item| fulfillment_types_for(item) }- grouped.values.map { |contents| build_package(contents) }- end-- # optimization: save product -> fulfillment_types correspondence- def fulfillment_types_for(item)- @item_fulfillment_types ||= {}- @item_fulfillment_types[item.variant.product_id] ||= item.variant.product.fulfillment_types.sort- end- end- end- end-enddiff --git a/spree/core/app/models/spree/store.rb b/spree/core/app/models/spree/store.rbindex 568c6a39b6..42d06e3066 100644--- a/spree/core/app/models/spree/store.rb+++ b/spree/core/app/models/spree/store.rb@@ -135,6 +135,13 @@ module Spreehas_many :delivery_zones, class_name: 'Spree::DeliveryZone', dependent: :destroyhas_many :delivery_methods, class_name: 'Spree::DeliveryMethod', dependent: :nullify+ has_many :delivery_profiles, class_name: 'Spree::DeliveryProfile', dependent: :destroy+ has_many :delivery_origin_groups, through: :delivery_profiles, class_name: 'Spree::DeliveryOriginGroup'++ # @return [Spree::DeliveryProfile, nil]+ def default_delivery_profile+ Spree::DeliveryProfile.default_for(self)+ endhas_many :stock_locations, class_name: 'Spree::StockLocation', dependent: :nullifyhas_many :promotions, class_name: 'Spree::Promotion', dependent: :nullify@@ -199,6 +206,7 @@ module Spreebefore_validation :normalize_preferred_storefront_urlbefore_save :ensure_default_exists_and_is_uniqueafter_create :create_default_policies+ after_create :create_default_delivery_profile## Scopes@@ -348,9 +356,9 @@ module Spree## @return [ActiveRecord::Relation<Spree::Country>]def countries_with_shipping_coverage- return Spree::Country.order(:name) if Spree::DeliveryMethod.where.missing(:delivery_method_zones).exists?+ return Spree::Country.order(:name) if Spree::DeliveryMethod.where(delivery_zone_id: nil).exists?- zone_ids = Spree::DeliveryMethodZone.select(:delivery_zone_id)+ zone_ids = Spree::DeliveryMethod.where.not(delivery_zone_id: nil).select(:delivery_zone_id)members = Spree::DeliveryZoneMember.where(delivery_zone_id: zone_ids)country_ids = members.where(member_type: %w[country postal_code]).select(:country_id)@@ -380,6 +388,12 @@ module Spreeprivate+ # Products without a profile fall back to this one, so it must exist+ # from the store's first moment.+ def create_default_delivery_profile+ Spree::DeliveryProfiles::Shipping.create!(store: self, name: 'General', default: true)+ end+def create_default_policiesSpree::Events.disable do[diff --git a/spree/core/app/models/spree/variant.rb b/spree/core/app/models/spree/variant.rbindex 2d292e2626..d9c5aea124 100644--- a/spree/core/app/models/spree/variant.rb+++ b/spree/core/app/models/spree/variant.rb@@ -685,18 +685,6 @@ module Spreedigitals.any?end- # @deprecated Delivery eligibility comes from {#product_type}; removed in 6.1.- def shipping_category- Spree::Deprecation.warn('Spree::Variant#shipping_category is deprecated and will be removed in Spree 6.1. Use #product_type instead.')- product.shipping_category- end-- # @deprecated Delivery eligibility comes from {#product_type_id}; removed in 6.1.- def shipping_category_id- Spree::Deprecation.warn('Spree::Variant#shipping_category_id is deprecated and will be removed in Spree 6.1. Use #product_type_id instead.')- product.shipping_category_id- end-privatedef pending_options?diff --git a/spree/core/app/services/spree/carts/update.rb b/spree/core/app/services/spree/carts/update.rbindex 1cfb6aa635..fad6e1dc64 100644--- a/spree/core/app/services/spree/carts/update.rb+++ b/spree/core/app/services/spree/carts/update.rb@@ -57,13 +57,21 @@ module Spreeend# Storefront pickup selection: resolves the public prefixed ID (or raw- # ID) against the store's pickup-enabled locations — the eligibility- # rule is enforced here at the API seam, mirroring Orders::Create.+ # ID) against the store's pickup-enabled locations, intersected with+ # the channel's served set — a counter the channel cannot fulfill from+ # 404s exactly like a non-pickup one. Enforced here at the API boundary,+ # mirroring Orders::Create.def assign_preferred_stock_locationvalue = params[:preferred_stock_location_id]- cart.preferred_stock_location_id =- value.blank? ? nil : cart.store.stock_locations.pickup_enabled.find_by_param!(value).id+ if value.blank?+ cart.preferred_stock_location_id = nil+ return+ end++ eligible = cart.store.stock_locations.pickup_enabled+ eligible = eligible.merge(cart.channel.served_stock_locations) if cart.channel+ cart.preferred_stock_location_id = eligible.find_by_param!(value).idenddef assign_address(address_type)diff --git a/spree/core/app/services/spree/seeds/all.rb b/spree/core/app/services/spree/seeds/all.rbindex 82e1bff55c..ac2abf8d89 100644--- a/spree/core/app/services/spree/seeds/all.rb+++ b/spree/core/app/services/spree/seeds/all.rb@@ -17,13 +17,16 @@ module Spree# additional dataStoreCreditCategories.callTaxCategories.call- DigitalDelivery.call# store & stock locationStores.callChannels.callStockLocations.callDeliveryZones.call+ # Store-scoped, so they can only run once a store and its+ # locations exist.+ DigitalDelivery.call+ PickupDelivery.callAdminUser.call# add store resourcesdiff --git a/spree/core/app/services/spree/seeds/delivery_zones.rb b/spree/core/app/services/spree/seeds/delivery_zones.rbindex d853dd29b2..879cd030d3 100644--- a/spree/core/app/services/spree/seeds/delivery_zones.rb+++ b/spree/core/app/services/spree/seeds/delivery_zones.rb@@ -14,13 +14,17 @@ module Spreedomestic_country = store.default_countrynext if domestic_country.nil?+ profile = store.default_delivery_profile || Spree::DeliveryProfiles::Shipping.create!(store: store, name: 'General', default: true)+domestic = store.delivery_zones.where(name: 'Domestic').first_or_create! do |zone|zone.description = domestic_country.name+ zone.delivery_profile = profileenddomestic.members.where(member_type: 'country', country: domestic_country).first_or_create!international = store.delivery_zones.where(name: 'International').first_or_create! do |zone|zone.description = 'Everywhere else'+ zone.delivery_profile = profileendadd_country_members(international, Spree::Country.where.not(id: domestic_country.id))@@ -53,7 +57,8 @@ module Spreedelivery_method.calculator = Spree::Calculator::Shipping::FlatRate.new(preferences: { amount: amount, currency: store.default_currency })- delivery_method.delivery_zones = [zone]+ delivery_method.delivery_profile = zone.delivery_profile+ delivery_method.delivery_zone = zoneendendenddiff --git a/spree/core/app/services/spree/seeds/digital_delivery.rb b/spree/core/app/services/spree/seeds/digital_delivery.rbindex 2ec3bcc077..fc162c3be6 100644--- a/spree/core/app/services/spree/seeds/digital_delivery.rb+++ b/spree/core/app/services/spree/seeds/digital_delivery.rb@@ -12,10 +12,15 @@ module Spreeprivatedef create_for(store)+ # Digital goods are a distinct product set, so they get their own+ # profile; assigning a product to it is what makes it digital.+ profile = Spree::DeliveryProfiles::Digital.find_by(store: store) ||+ Spree::DeliveryProfiles::Digital.create!(store: store, name: I18n.t('spree.seed.delivery_profiles.digital'))+digital_delivery_method = Spree::DeliveryMethod.find_or_initialize_by(name: Spree.t('digital.digital_delivery'), store: store)+ digital_delivery_method.delivery_profile = profiledigital_delivery_method.storefront_visible = true- digital_delivery_method.fulfillment_type = 'digital'digital_delivery_method.fulfillment_provider = 'Spree::FulfillmentProvider::Digital'digital_delivery_method.calculator ||= Spree::Calculator::Shipping::DigitalDelivery.create!digital_delivery_method.save!diff --git a/spree/core/app/services/spree/seeds/pickup_delivery.rb b/spree/core/app/services/spree/seeds/pickup_delivery.rbnew file mode 100644index 0000000000..6b977b8d82--- /dev/null+++ b/spree/core/app/services/spree/seeds/pickup_delivery.rb@@ -0,0 +1,46 @@+module Spree+ module Seeds+ # Collection at a merchant counter. Rides the store's default profile+ # (the same physical goods ship or get collected) with no zone — pickup+ # has no destination, only an origin, and the Pickup provider decides+ # which locations can hand goods over.+ class PickupDelivery+ prepend Spree::ServiceModule::Base++ def call+ Spree::Store.all.find_each do |store|+ create_for(store)+ end+ end++ private++ def create_for(store)+ profile = store.default_delivery_profile+ return if profile.nil?++ # A counter to collect from is what makes pickup real, so the store's+ # default location opens for collection unless one already has.+ if store.stock_locations.where(pickup_enabled: true).none?+ store.stock_locations.find_by(default: true)&.update!(pickup_enabled: true)+ end+ return if store.stock_locations.where(pickup_enabled: true).none?++ delivery_method = Spree::DeliveryMethod.find_or_initialize_by(+ name: Spree.t('pickup.store_pickup'), store: store+ )++ delivery_method.delivery_profile = profile+ delivery_method.storefront_visible = true+ delivery_method.fulfillment_provider = 'Spree::FulfillmentProvider::Pickup'+ delivery_method.calculator ||= Spree::Calculator::Shipping::FlatRate.new(+ preferences: { amount: 0, currency: store.default_currency }+ )+ delivery_method.save!++ # No configured counters means every pickup-enabled location, which+ # is what a fresh store wants; seeding the links would freeze the set.+ end+ end+ end+enddiff --git a/spree/core/app/services/spree/seeds/product_types.rb b/spree/core/app/services/spree/seeds/product_types.rbindex 1718e8ebf5..eb9f84de16 100644--- a/spree/core/app/services/spree/seeds/product_types.rb+++ b/spree/core/app/services/spree/seeds/product_types.rb@@ -5,14 +5,19 @@ module Spreedef callSpree::Store.all.find_each do |store|- Spree::ProductType.where(store: store).find_or_create_by!(name: I18n.t('spree.seed.product_types.default')) do |product_type|- product_type.fulfillment_types = ['shipping']- end+ Spree::ProductType.where(store: store).find_or_create_by!(name: I18n.t('spree.seed.product_types.default'))Spree::ProductType.where(store: store).find_or_create_by!(name: I18n.t('spree.seed.product_types.digital')) do |product_type|- product_type.fulfillment_types = ['digital']+ product_type.delivery_profile = digital_profile_for(store)endendend++ private++ def digital_profile_for(store)+ Spree::DeliveryProfiles::Digital.find_by(store: store) ||+ Spree::DeliveryProfiles::Digital.create!(store: store, name: I18n.t('spree.seed.delivery_profiles.digital'))+ endendendenddiff --git a/spree/core/config/locales/en.yml b/spree/core/config/locales/en.ymlindex 2450cd7bd9..dac31f3ad8 100644--- a/spree/core/config/locales/en.yml+++ b/spree/core/config/locales/en.yml@@ -145,7 +145,6 @@ en:more_than: More thanname: Nameon_hand: On Hand- shipping_category: Shipping Categorytax_category: Tax Categoryspree/product_type:name: Name@@ -236,7 +235,6 @@ en:messages:blank: can't be blankmust_apply_to_products: must be a custom field definition for products- unregistered_fulfillment_types: 'contains unregistered fulfillment types: %{types}'models:spree/allowed_origin:attributes:@@ -343,10 +341,6 @@ en:attributes:amount:greater_than_allowed: is greater than the allowed amount.- spree/shipping_method:- attributes:- base:- required_shipping_category: You must select at least one shipping categoryspree/store:attributes:base:@@ -492,9 +486,6 @@ en:spree/shipment:one: Shipmentother: Shipments- spree/shipping_category:- one: Shipping Category- other: Shipping Categoriesspree/shipping_method:one: Shipping Methodother: Shipping Methods@@ -809,6 +800,9 @@ en:deleted: Deleteddelivery: Deliverydelivery_method_rule_types:+ channel_rule:+ description: Offers the delivery method only on the selected channels+ name: Channelexcluded_products_rule:description: Blocks the delivery method for packages containing the selected productsname: Excluded products@@ -878,6 +872,8 @@ en:cart_currency_mismatch: carts in different currencies cannot be mergedchannel_store_mismatch: must belong to the same storecoupon_code_frozen_after_completion: coupon codes cannot be changed on a completed order — add a manual discount instead+ delivery_zone_not_in_origin_group: must belong to the delivery method's origin group+ delivery_zone_not_in_profile: must belong to the delivery method's delivery profiledelivery_zone_postal_definition_required: postal code member requires a prefix or a from/to rangedelivery_zone_prefix_and_range_exclusive: cannot be combined with a from/to rangedelivery_zone_range_inverted: must be greater than or equal to postal_code_from@@ -902,8 +898,9 @@ en:oidc_missing_code: The identity provider did not return an authorization code.oidc_requires_redirect: This provider requires signing in through its own login page.pickup_point_not_found: pickup point could not be found with this provider+ profile_does_not_accept_provider: "%{provider} deliveries cannot join the %{profile} profile"promotion_discount_not_editable: promotion discounts are managed by recalculation and cannot be edited- provider_does_not_handle_fulfillment_type: "%{provider} does not handle %{fulfillment_type} fulfillments"+ rate_provider_requires_shipping: "%{provider} quotes shipments, so this method must ship to an address"rate_provider_unavailable: is not available for this store — connect its integration firststore_association_can_not_be_changed: The store association can not be changedstore_is_already_set: Store is already set@@ -1279,6 +1276,8 @@ en:description: Webhook endpoints and deliverieslabel: Webhooksphone: Phone+ pickup:+ store_pickup: Store Pickuppolicies: Policiespowered_by: Powered bypre_tax_amount: Pre-Tax Amount@@ -1455,6 +1454,8 @@ en:search_by: 'Search by:'security: Securityseed:+ delivery_profiles:+ digital: Digitalproduct_types:default: Defaultdigital: Digital@@ -1488,8 +1489,6 @@ en:shipped: Shippedshipping: Shippingshipping_address: Shipping Address- shipping_categories: Shipping Categories- shipping_category: Shipping Categoryshipping_flat_rate_per_item: Flat rate per package itemshipping_flat_rate_per_order: Flat rateshipping_flexible_rate: Flexible Rate per package itemdiff --git a/spree/core/db/migrate/20260809150001_promote_shipping_categories_to_delivery_profiles.rb b/spree/core/db/migrate/20260809150001_promote_shipping_categories_to_delivery_profiles.rbnew file mode 100644index 0000000000..25b288e370--- /dev/null+++ b/spree/core/db/migrate/20260809150001_promote_shipping_categories_to_delivery_profiles.rb@@ -0,0 +1,153 @@+class PromoteShippingCategoriesToDeliveryProfiles < ActiveRecord::Migration[8.1]+ # ShippingCategory promoted in place (docs/plans/6.0-delivery-profiles.md):+ # the table and the product foreign key are renamed, so 5.x category+ # assignments become profile assignments without copying. The backfill here+ # is mechanical continuity wiring only — judgement calls (store assignment+ # of formerly-global categories, default flagging, collapsing the method+ # m:n) belong to spree:upgrade:migrate_delivery_profiles.+ def up+ rename_table :spree_shipping_categories, :spree_delivery_profiles+ rename_column :spree_products, :shipping_category_id, :delivery_profile_id++ # Nullable until the upgrade task assigns stores to 5.x rows; tightened+ # in 6.1.+ add_reference :spree_delivery_profiles, :store, index: true+ add_column :spree_delivery_profiles, :default, :boolean, null: false, default: false+ # STI: profile kinds declare behavior (Shipping, Digital, extension+ # kinds) and give seeds a rename-proof handle.+ add_column :spree_delivery_profiles, :type, :string+ add_column :spree_delivery_profiles, :position, :integer, default: 0+ add_index :spree_delivery_profiles, :type++ # Origin groups partition a profile's fulfillment origins: every zone+ # and method belongs to a group, so "same products, different warehouse,+ # different rates" is one profile with two groups. Simple stores keep a+ # single nameless group covering every location and never see the layer.+ create_table :spree_delivery_origin_groups do |t|+ t.references :delivery_profile, null: false, index: true+ t.string :name+ t.integer :position, default: 0+ t.timestamps+ end++ create_table :spree_delivery_origin_group_locations do |t|+ t.references :delivery_origin_group, null: false+ t.references :stock_location, null: false+ t.timestamps+ end+ add_index :spree_delivery_origin_group_locations,+ [:delivery_origin_group_id, :stock_location_id],+ unique: true, name: 'idx_delivery_origin_group_locations_uniqueness'++ add_reference :spree_delivery_zones, :delivery_profile, index: true+ add_reference :spree_delivery_zones, :delivery_origin_group, index: true+ add_reference :spree_delivery_methods, :delivery_profile, index: true+ add_reference :spree_delivery_methods, :delivery_origin_group, index: true+ add_reference :spree_delivery_methods, :delivery_zone, index: true+ add_reference :spree_product_types, :delivery_profile, index: true++ # Behavior routes through provider and profile classes; the string+ # vocabulary goes away entirely.+ remove_column :spree_delivery_methods, :fulfillment_type+ remove_column :spree_product_types, :fulfillment_types++ backfill_store_defaults++ drop_table :spree_delivery_method_zones+ end++ def down+ create_table :spree_delivery_method_zones do |t|+ t.references :delivery_method, null: false+ t.references :delivery_zone, null: false+ t.timestamps+ end+ execute <<~SQL+ INSERT INTO spree_delivery_method_zones (delivery_method_id, delivery_zone_id, created_at, updated_at)+ SELECT id, delivery_zone_id, created_at, updated_at+ FROM spree_delivery_methods WHERE delivery_zone_id IS NOT NULL+ SQL++ if connection.respond_to?(:supports_json?) && connection.supports_json?+ add_column :spree_product_types, :fulfillment_types, :json+ else+ add_column :spree_product_types, :fulfillment_types, :text+ end+ add_column :spree_delivery_methods, :fulfillment_type, :string+ remove_reference :spree_product_types, :delivery_profile+ remove_reference :spree_delivery_methods, :delivery_zone+ remove_reference :spree_delivery_methods, :delivery_origin_group+ remove_reference :spree_delivery_methods, :delivery_profile+ remove_reference :spree_delivery_zones, :delivery_origin_group+ remove_reference :spree_delivery_zones, :delivery_profile+ drop_table :spree_delivery_origin_group_locations+ drop_table :spree_delivery_origin_groups+ remove_column :spree_delivery_profiles, :position+ remove_column :spree_delivery_profiles, :type+ remove_column :spree_delivery_profiles, :default+ remove_reference :spree_delivery_profiles, :store+ rename_column :spree_products, :delivery_profile_id, :shipping_category_id+ rename_table :spree_delivery_profiles, :spree_shipping_categories+ end++ private++ # Anonymous readers — migrations never depend on application models.+ class MigrationStore < ActiveRecord::Base+ self.table_name = 'spree_stores'+ end++ class MigrationProfile < ActiveRecord::Base+ self.table_name = 'spree_delivery_profiles'+ # The table gains an STI `type` column in this very migration. Without+ # disabling inheritance, writing the kind makes Rails try to instantiate+ # the real subclass — which is not a descendant of this reader.+ self.inheritance_column = nil+ end++ class MigrationZone < ActiveRecord::Base+ self.table_name = 'spree_delivery_zones'+ end++ class MigrationProduct < ActiveRecord::Base+ self.table_name = 'spree_products'+ end++ class MigrationMethod < ActiveRecord::Base+ self.table_name = 'spree_delivery_methods'+ end++ class MigrationMethodZone < ActiveRecord::Base+ self.table_name = 'spree_delivery_method_zones'+ end++ class MigrationOriginGroup < ActiveRecord::Base+ self.table_name = 'spree_delivery_origin_groups'+ end++ # Every store needs its default profile, and this branch's existing zones+ # and methods need a home so a migrated development database keeps+ # quoting. 5.x rows (store_id nil) are deliberately untouched here.+ def backfill_store_defaults+ MigrationStore.find_each do |store|+ profile = MigrationProfile.create!(store_id: store.id, name: 'General', default: true, type: 'Spree::DeliveryProfiles::Shipping')+ # The nameless default group: no location members means every store+ # location, so a single-group profile behaves as if the layer weren't+ # there.+ origin_group = MigrationOriginGroup.create!(delivery_profile_id: profile.id, position: 1)++ MigrationZone.where(store_id: store.id).update_all(delivery_profile_id: profile.id, delivery_origin_group_id: origin_group.id)+ # The association is required going forward; this branch's products+ # never carried a category, so they all belong to the default profile.+ MigrationProduct.where(store_id: store.id, delivery_profile_id: nil).update_all(delivery_profile_id: profile.id)++ MigrationMethod.where(store_id: store.id).find_each do |method|+ zone_ids = MigrationMethodZone.where(delivery_method_id: method.id).order(:id).pluck(:delivery_zone_id)+ if zone_ids.size > 1+ say "Delivery method #{method.id} was linked to #{zone_ids.size} zones; keeping the first — recreate the method for the other zones if both were intended."+ end+ method.update_columns(delivery_profile_id: profile.id, delivery_origin_group_id: origin_group.id, delivery_zone_id: zone_ids.first)+ end+ end+ end+enddiff --git a/spree/core/db/migrate/20260809170001_create_spree_channel_stock_locations.rb b/spree/core/db/migrate/20260809170001_create_spree_channel_stock_locations.rbnew file mode 100644index 0000000000..8fbe2539c1--- /dev/null+++ b/spree/core/db/migrate/20260809170001_create_spree_channel_stock_locations.rb@@ -0,0 +1,17 @@+class CreateSpreeChannelStockLocations < ActiveRecord::Migration[8.1]+ # Optional Channel → StockLocation allowlist+ # (docs/plans/6.0-channel-delivery.md): no rows means the channel is served+ # by every store location, so existing stores upgrade with zero behavior+ # change.+ def change+ create_table :spree_channel_stock_locations do |t|+ t.references :channel, null: false+ t.references :stock_location, null: false+ t.timestamps+ end++ add_index :spree_channel_stock_locations,+ [:channel_id, :stock_location_id],+ unique: true, name: 'idx_channel_stock_locations_uniqueness'+ end+enddiff --git a/spree/core/db/sample_data/product_types.rb b/spree/core/db/sample_data/product_types.rbindex d0082305e5..3fcff6ea53 100644--- a/spree/core/db/sample_data/product_types.rb+++ b/spree/core/db/sample_data/product_types.rb@@ -58,7 +58,6 @@ product_types = [product_types.each do |attributes|product_type = store.product_types.find_or_initialize_by(name: attributes[:name])- product_type.fulfillment_types = ['shipping']product_type.save!# Seeded onto products created with this type — every demo product varies by color.diff --git a/spree/core/db/sample_data/shipping_methods.rb b/spree/core/db/sample_data/shipping_methods.rbindex 9555e487c1..0bfb62b40b 100644--- a/spree/core/db/sample_data/shipping_methods.rb+++ b/spree/core/db/sample_data/shipping_methods.rb@@ -26,7 +26,8 @@ delivery_methods.each do |attributes|record.calculator = Spree::Calculator::Shipping::FlatRate.create!(preferences: { amount: attributes[:amount], currency: currency })- record.delivery_zones = [attributes[:zone]]+ record.delivery_profile = attributes[:zone].delivery_profile+ record.delivery_zone = attributes[:zone]record.storefront_visible = trueenddiff --git a/spree/core/lib/spree/core.rb b/spree/core/lib/spree/core.rbindex f82c26b705..87a6191d64 100644--- a/spree/core/lib/spree/core.rb+++ b/spree/core/lib/spree/core.rb@@ -313,13 +313,6 @@ module SpreeRails.application.config.spree.fulfillment_providers = valueend- def self.fulfillment_types- Rails.application.config.spree.fulfillment_types- end-- def self.fulfillment_types=(value)- Rails.application.config.spree.fulfillment_types = value- enddef self.stock_splittersRails.application.config.spree.stock_splitters@@ -348,6 +341,17 @@ module SpreeRails.application.config.spree.delivery_rate_providers = valueend+ # Fulfillment profile kinds selectable when creating a profile.+ #+ # @return [Array<Class>]+ def self.delivery_profile_types+ Rails.application.config.spree.delivery_profile_types+ end++ def self.delivery_profile_types=(value)+ Rails.application.config.spree.delivery_profile_types = value+ end+def self.order_routingRails.application.config.spree.order_routingenddiff --git a/spree/core/lib/spree/core/engine.rb b/spree/core/lib/spree/core/engine.rbindex 0cdbc7160d..b58526b02e 100644--- a/spree/core/lib/spree/core/engine.rb+++ b/spree/core/lib/spree/core/engine.rb@@ -13,10 +13,10 @@ module Spree:tax_provider,:password_validator,:fulfillment_providers,- :fulfillment_types,:stock_splitters,:delivery_method_rules,:delivery_rate_providers,+ :delivery_profile_types,:order_routing,:promotions,:pricing,@@ -125,6 +125,10 @@ module Spreeapp.config.spree.delivery_rate_providers = []end+ initializer 'spree.register.delivery_profile_types', before: :load_config_initializers do |app|+ app.config.spree.delivery_profile_types = []+ end+initializer 'spree.register.custom_fields' do |app|app.config.spree.custom_fields = CustomFieldsEnvironment.newapp.config.spree.custom_fields.types = []@@ -162,7 +166,7 @@ module Spree]Rails.application.config.spree.stock_splitters = [- Spree::Stock::Splitter::FulfillmentType,+ Spree::Stock::Splitter::DeliveryProfile,Spree::Stock::Splitter::Backordered]@@ -191,10 +195,6 @@ module SpreeSpree::FulfillmentProvider::PickupPoint]- # Registered vocabulary — DeliveryMethod and ProductType validate- # against it on change. Extensions append their own- # (e.g. 'same_day_courier') from an initializer.- Rails.application.config.spree.fulfillment_types = %w[shipping pickup digital]# Quoting strategies selectable on a delivery method. Internal prices# through the method's calculator; carrier gems append theirs.@@ -202,6 +202,13 @@ module SpreeSpree::DeliveryRateProvider::Internal]+ # Profile kinds selectable when creating a delivery profile;+ # extension kinds append theirs.+ Rails.application.config.spree.delivery_profile_types.concat [+ Spree::DeliveryProfiles::Shipping,+ Spree::DeliveryProfiles::Digital+ ]+# Selectable order routing strategies. The internal Reducer collaborator# is intentionally NOT listed — it is not a Strategy::Base. Plugins add# their own via this array.@@ -222,7 +229,8 @@ module SpreeRails.application.config.spree.delivery_method_rules.concat [Spree::DeliveryMethodRules::ItemTotalRule,Spree::DeliveryMethodRules::WeightRule,- Spree::DeliveryMethodRules::ExcludedProductsRule+ Spree::DeliveryMethodRules::ExcludedProductsRule,+ Spree::DeliveryMethodRules::ChannelRule]Rails.application.config.spree.calculators.promotion_actions_create_adjustments = [diff --git a/spree/core/lib/spree/core/permission_configuration.rb b/spree/core/lib/spree/core/permission_configuration.rbindex 4a0161530f..7b33ebac84 100644--- a/spree/core/lib/spree/core/permission_configuration.rb+++ b/spree/core/lib/spree/core/permission_configuration.rb@@ -270,7 +270,7 @@ module Spreeregister_resource(:settings, group: :settings, subjects: -> {[Spree::Store, Spree::PaymentMethod, Spree::Gateway, Spree::DeliveryMethod,Spree::DeliveryMethodRule, Spree::DeliveryZone, Spree::DeliveryZoneMember,- Spree::StockLocation, Spree::ShippingCategory, Spree::Zone, Spree::ZoneMember,+ Spree::StockLocation, Spree::DeliveryProfile, Spree::Zone, Spree::ZoneMember,Spree::Market, Spree::TaxCategory, Spree::TaxRate, Spree::AllowedOrigin,Spree::RefundReason, Spree::ReturnReason, Spree::ClaimReason, Spree::Channel,Spree::OrderRoutingRule, Spree::CustomFieldDefinition, Spree::Policy,diff --git a/spree/core/lib/spree/permitted_attributes.rb b/spree/core/lib/spree/permitted_attributes.rbindex 7159962e35..9c85f6c79d 100644--- a/spree/core/lib/spree/permitted_attributes.rb+++ b/spree/core/lib/spree/permitted_attributes.rb@@ -219,9 +219,9 @@ module Spree:preferred_storefront_access, :preferred_guest_checkout]@@shipping_method_attributes = [:name, :admin_name, :code, :tracking_url, :tax_category_id, :storefront_visible,- :fulfillment_type, :fulfillment_provider,+ :fulfillment_provider, :delivery_profile_id, :delivery_zone_id,:estimated_transit_business_days_min, :estimated_transit_business_days_max,- :calculator_type, :preferences, delivery_zone_ids: [], calculator_attributes: {}]+ :calculator_type, :preferences, calculator_attributes: {}]# month / year may be provided by some sources, or others may elect to use one field@@source_attributes = [diff --git a/spree/core/lib/spree/testing_support/factories/delivery_method_factory.rb b/spree/core/lib/spree/testing_support/factories/delivery_method_factory.rbindex 121d0a46b9..c7699711a3 100644--- a/spree/core/lib/spree/testing_support/factories/delivery_method_factory.rb+++ b/spree/core/lib/spree/testing_support/factories/delivery_method_factory.rb@@ -5,6 +5,7 @@ FactoryBot.define doname { 'UPS Ground' }code { 'UPS_GROUND' }store { Spree::Store.find_by(default: true) || association(:store) }+ delivery_profile { store.default_delivery_profile || association(:delivery_profile, store: store) }factory :delivery_method, aliases: [:shipping_method], class: Spree::DeliveryMethod doassociation(:calculator, factory: :shipping_calculator, strategy: :build)@@ -15,15 +16,17 @@ FactoryBot.define doendfactory :digital_delivery_method, aliases: [:digital_shipping_method], class: Spree::DeliveryMethod do- fulfillment_type { 'digital' }fulfillment_provider { 'Spree::FulfillmentProvider::Digital' }+ delivery_profile do+ Spree::DeliveryProfiles::Digital.find_by(store: store) ||+ association(:digital_delivery_profile, store: store)+ endassociation(:calculator, factory: :digital_shipping_calculator, strategy: :build)endfactory :pickup_delivery_method, class: Spree::DeliveryMethod doname { 'Store pickup' }code { 'PICKUP' }- fulfillment_type { 'pickup' }fulfillment_provider { 'Spree::FulfillmentProvider::Pickup' }association(:calculator, factory: :shipping_no_amount_calculator, strategy: :build)end@@ -31,7 +34,6 @@ FactoryBot.define dofactory :pickup_point_delivery_method, class: Spree::DeliveryMethod doname { 'Parcel locker' }code { 'PICKUP_POINT' }- fulfillment_type { 'pickup_point' }fulfillment_provider { 'Spree::FulfillmentProvider::PickupPoint' }association(:calculator, factory: :shipping_no_amount_calculator, strategy: :build)enddiff --git a/spree/core/lib/spree/testing_support/factories/delivery_origin_group_factory.rb b/spree/core/lib/spree/testing_support/factories/delivery_origin_group_factory.rbnew file mode 100644index 0000000000..d0a1f1b06c--- /dev/null+++ b/spree/core/lib/spree/testing_support/factories/delivery_origin_group_factory.rb@@ -0,0 +1,5 @@+FactoryBot.define do+ factory :delivery_origin_group, class: Spree::DeliveryOriginGroup do+ delivery_profile+ end+enddiff --git a/spree/core/lib/spree/testing_support/factories/delivery_profile_factory.rb b/spree/core/lib/spree/testing_support/factories/delivery_profile_factory.rbnew file mode 100644index 0000000000..97a64b50ee--- /dev/null+++ b/spree/core/lib/spree/testing_support/factories/delivery_profile_factory.rb@@ -0,0 +1,9 @@+FactoryBot.define do+ factory :delivery_profile, class: Spree::DeliveryProfiles::Shipping do+ sequence(:name) { |n| "Delivery Profile ##{n}" }+ store { Spree::Store.find_by(default: true) || association(:store) }++ factory :digital_delivery_profile, class: Spree::DeliveryProfiles::Digital do+ end+ end+enddiff --git a/spree/core/lib/spree/testing_support/factories/delivery_zone_factory.rb b/spree/core/lib/spree/testing_support/factories/delivery_zone_factory.rbindex 3b37555942..d5fef3d33a 100644--- a/spree/core/lib/spree/testing_support/factories/delivery_zone_factory.rb+++ b/spree/core/lib/spree/testing_support/factories/delivery_zone_factory.rb@@ -2,6 +2,7 @@ FactoryBot.define dofactory :delivery_zone, class: Spree::DeliveryZone dosequence(:name) { |n| "Delivery Zone ##{n}" }store { Spree::Store.find_by(default: true) || association(:store) }+ delivery_profile { store.default_delivery_profile || association(:delivery_profile, store: store) }description { generate(:random_string) }factory :delivery_zone_with_country dodiff --git a/spree/core/lib/spree/testing_support/factories/line_item_factory.rb b/spree/core/lib/spree/testing_support/factories/line_item_factory.rbindex 4b349e212c..ea04039ad8 100644--- a/spree/core/lib/spree/testing_support/factories/line_item_factory.rb+++ b/spree/core/lib/spree/testing_support/factories/line_item_factory.rb@@ -9,7 +9,11 @@ FactoryBot.define doprice { BigDecimal('10.00') }currency { (order || cart)&.currency }variant do- resolved_product = product || create(:product)+ # The product must live in the owning cart/order's store — a cart can+ # only sell its own store's catalog, and delivery eligibility resolves+ # through the product's store-scoped delivery profile.+ owner_store = (order || cart)&.store+ resolved_product = product || create(:product, store: owner_store || Spree::Store.default)resolved_product.default_variantendenddiff --git a/spree/core/lib/spree/testing_support/factories/market_factory.rb b/spree/core/lib/spree/testing_support/factories/market_factory.rbindex 1be0e90e93..ad5cf9eedf 100644--- a/spree/core/lib/spree/testing_support/factories/market_factory.rb+++ b/spree/core/lib/spree/testing_support/factories/market_factory.rb@@ -9,7 +9,7 @@ FactoryBot.define doafter(:build) do |market|# Delivery methods are worldwide by default (no zones), so serving the# market's countries only requires that a method exists at all.- if market.countries.any? && !Spree::DeliveryMethod.where.missing(:delivery_method_zones).exists?+ if market.countries.any? && !Spree::DeliveryMethod.where(delivery_zone_id: nil).exists?FactoryBot.create(:delivery_method)endenddiff --git a/spree/core/lib/spree/testing_support/factories/product_factory.rb b/spree/core/lib/spree/testing_support/factories/product_factory.rbindex db9e966390..a01aadd9f6 100644--- a/spree/core/lib/spree/testing_support/factories/product_factory.rb+++ b/spree/core/lib/spree/testing_support/factories/product_factory.rb@@ -97,7 +97,10 @@ FactoryBot.define dofactory :digital_product dotrack_inventory { false }- product_type { create(:product_type, name: "Digital #{SecureRandom.hex(4)}", fulfillment_types: ['digital']) }+ delivery_profile do+ Spree::DeliveryProfiles::Digital.find_by(store: store) ||+ create(:digital_delivery_profile, store: store)+ endendendenddiff --git a/spree/core/lib/spree/testing_support/factories/shipping_category_factory.rb b/spree/core/lib/spree/testing_support/factories/shipping_category_factory.rbdeleted file mode 100644index d0ed4f4abd..0000000000--- a/spree/core/lib/spree/testing_support/factories/shipping_category_factory.rb+++ /dev/null@@ -1,9 +0,0 @@-FactoryBot.define do- factory :shipping_category, class: Spree::ShippingCategory do- sequence(:name) { |n| "ShippingCategory #{n}" }- end-- factory :digital_shipping_category, class: Spree::ShippingCategory do- name { 'Digital' }- end-enddiff --git a/spree/core/lib/spree/upgrades/5_6_to_6_0/manifest.yml b/spree/core/lib/spree/upgrades/5_6_to_6_0/manifest.ymlindex d86a1492dc..0a6aae3513 100644--- a/spree/core/lib/spree/upgrades/5_6_to_6_0/manifest.yml+++ b/spree/core/lib/spree/upgrades/5_6_to_6_0/manifest.yml@@ -123,14 +123,14 @@ steps:notes: |Rewrites stored 'Spree::Shipment' class-name strings (state changes,stock movements, legacy adjustments), renames the terminal fulfillment- status 'shipped' -> 'fulfilled', backfills fulfillment_type and the- fulfillment provider on delivery methods (DigitalDelivery calculators- become digital + the Digital provider) and copies the type onto existing- fulfillments, assigns the Digital product type to products in- digital-only shipping categories, and converts display_on into the- storefront_visible boolean. Idempotent — the visibility conversion- clears display_on as it goes, so re-running never overwrites a- visibility change made in the admin after the upgrade.+ status 'shipped' -> 'fulfilled', backfills the fulfillment provider on+ delivery methods (DigitalDelivery calculators become the Digital+ provider) and copies the provider-derived type onto existing+ fulfillments, and converts display_on into the storefront_visible+ boolean. Idempotent — the visibility conversion clears display_on as it+ goes, so re-running never overwrites a visibility change made in the+ admin after the upgrade. Digital shipping categories are handled by+ migrate_delivery_profiles.BREAKING — product CSV: the 'shipping_category' column is gone from bothimport and export, replaced by 'product_type'. Update saved import@@ -139,6 +139,26 @@ steps:eligibility. This task assigns types to existing digital products;new imports must carry 'product_type' themselves.+ - id: migrate_delivery_profiles+ name: "Promote shipping categories to delivery profiles"+ task: "spree:migrate_delivery_profiles"+ notes: |+ The schema migration renames spree_shipping_categories to+ spree_delivery_profiles in place, so 5.x product assignments carry+ over without copying. This task makes the judgement calls: assigns each+ legacy row its store (duplicating rows shared across stores), detects+ digital categories (linked only to Digital-provider methods) as+ Digital-kind profiles, folds categories that don't narrow the store's+ method set into the store default profile, and moves each solely-linked+ delivery method into its category's profile. A method linked to several+ categories stays in the default profile with a loud warning — the+ single-parent model cannot express the old m:n; recreate the method+ inside the other profile if both links were intended. Run after+ migrate_shipping_to_delivery (it reads the backfilled fulfillment+ providers). Idempotent — processed rows gain a store_id and drop out of+ the work set. spree_shipping_method_categories survives to 6.1 as the+ source and rollback reference.+- id: migrate_zones_to_delivery_zonesname: "Convert delivery zones"task: "spree:migrate_zones_to_delivery_zones"diff --git a/spree/core/lib/tasks/delivery_migration.rake b/spree/core/lib/tasks/delivery_migration.rakeindex eba6c614d9..deae3dfd83 100644--- a/spree/core/lib/tasks/delivery_migration.rake+++ b/spree/core/lib/tasks/delivery_migration.rake@@ -40,7 +40,8 @@ namespace :spree docount = Spree::Fulfillment.unscoped.where(status: 'shipped').in_batches(of: batch_size).update_all(status: 'fulfilled')say.call "spree_fulfillments.status: #{count} rows shipped → fulfilled"- # 3. fulfillment_type + provider backfill on delivery methods.+ # 3. Provider backfill on delivery methods. The provider class is the+ # sole carrier of delivery behavior — there is no type string to set.digital_method_ids = Spree::DeliveryMethod.unscoped.joins("INNER JOIN #{Spree::Calculator.table_name} calculators ON calculators.calculable_id = #{Spree::DeliveryMethod.table_name}.id AND calculators.calculable_type IN ('Spree::ShippingMethod', 'Spree::DeliveryMethod')").where("calculators.type LIKE '%DigitalDelivery'").@@ -48,49 +49,40 @@ namespace :spree doif digital_method_ids.any?Spree::DeliveryMethod.unscoped.where(id: digital_method_ids).update_all(- fulfillment_type: 'digital',fulfillment_provider: 'Spree::FulfillmentProvider::Digital')say.call "delivery methods marked digital: #{digital_method_ids.size}"end- Spree::DeliveryMethod.unscoped.where(fulfillment_type: nil).update_all(fulfillment_type: 'shipping')Spree::DeliveryMethod.unscoped.where(fulfillment_provider: nil).update_all(fulfillment_provider: 'Spree::FulfillmentProvider::Manual')# Copy the resolved type onto existing fulfillments from their selected- # delivery rate's method; anything unresolvable defaults to shipping.+ # delivery rate's method's provider; anything unresolvable defaults to+ # shipping. (Digital-category products are converted to Digital-kind+ # profiles by spree:upgrade:migrate_delivery_profiles.)+ provider_fulfillment_type = lambda do |provider_name|+ provider_class = provider_name&.safe_constantize+ if provider_class.nil? then 'shipping'+ elsif provider_class.digital? then 'digital'+ elsif provider_class.pickup_point? then 'pickup_point'+ elsif provider_class.pickup? then 'pickup'+ else 'shipping'+ end+ end+Spree::Fulfillment.unscoped.where(fulfillment_type: nil).in_batches(of: batch_size) do |batch|batch.each do |fulfillment|- method_type = Spree::DeliveryMethod.unscoped.+ provider_name = Spree::DeliveryMethod.unscoped.joins("INNER JOIN #{Spree::DeliveryRate.table_name} rates ON rates.delivery_method_id = #{Spree::DeliveryMethod.table_name}.id").where(rates: { fulfillment_id: fulfillment.id, selected: true }).- pick(:fulfillment_type)- fulfillment.update_columns(fulfillment_type: method_type || 'shipping')+ pick(:fulfillment_provider)+ fulfillment.update_columns(fulfillment_type: provider_fulfillment_type.call(provider_name))endprint '.'endputs- # 4. Digital shipping categories → the Digital product type. Products in a- # category that only digital-delivery methods serve are digital products.- digital_category_ids = Spree::ShippingCategory.- joins("INNER JOIN spree_shipping_method_categories smc ON smc.shipping_category_id = #{Spree::ShippingCategory.table_name}.id").- where(smc: { shipping_method_id: digital_method_ids }).- ids.uniq-- if digital_category_ids.any?- Spree::Store.all.find_each do |store|- product_scope = store.products.where(shipping_category_id: digital_category_ids, product_type_id: nil)- next unless product_scope.exists?-- digital_type = Spree::ProductType.where(store_id: store.id).detect(&:digital?) ||- Spree::ProductType.create!(name: 'Digital', store_id: store.id, fulfillment_types: ['digital'])- count = product_scope.in_batches(of: batch_size).update_all(product_type_id: digital_type.id)- say.call "store #{store.code}: #{count} digital products assigned product type #{digital_type.id}"- end- end-- # 5. display_on → storefront_visible boolean. The new column defaults to+ # 4. display_on → storefront_visible boolean. The new column defaults to# true, so only back_end rows need flipping. Each converted row has its# legacy display_on cleared, which makes the conversion strictly one-shot:# a re-run finds nothing left to convert, so a later admin change to@@ -120,34 +112,22 @@ namespace :spree dodesc 'Convert delivery-referenced legacy Zones into DeliveryZones with typed members'task migrate_zones_to_delivery_zones: :environment do- join_table = Spree::DeliveryMethodZone.table_name-# Rows whose delivery_zone_id predates the rename still point at legacy# spree_zones ids. Run this immediately after db:migrate — before new# DeliveryZones are created — so unmigrated ids are unambiguous.+ #+ # Zones now belong to a delivery profile, so a legacy zone shared by+ # methods in different profiles becomes one DeliveryZone per profile.migrated = {}Spree::DeliveryZone.find_each do |delivery_zone|source_id = delivery_zone.metadata&.dig('migrated_from_zone_id')- migrated[source_id.to_i] = delivery_zone.id if source_id+ migrated[[source_id.to_i, delivery_zone.delivery_profile_id]] = delivery_zone.id if source_idend- referenced_ids = Spree::DeliveryMethodZone.distinct.pluck(:delivery_zone_id).compact+ referenced_ids = Spree::DeliveryMethod.unscoped.distinct.pluck(:delivery_zone_id).compactlegacy_zones = Spree::Zone.where(id: referenced_ids - migrated.values)- legacy_zones.find_each do |zone|- next if migrated.key?(zone.id)-- if Spree::DeliveryZone.exists?(id: zone.id) && !migrated.value?(zone.id)- puts "SKIP zone #{zone.id} (#{zone.name}): a DeliveryZone with the same id already exists — resolve manually"- next- end-- delivery_zone = Spree::DeliveryZone.create!(- name: zone.name,- description: zone.description,- metadata: { 'migrated_from_zone_id' => zone.id }- )-+ copy_members = lambda do |zone, delivery_zone|zone.zone_members.find_each do |member|case member.zoneable_typewhen 'Spree::Country'@@ -159,10 +139,38 @@ namespace :spree dodelivery_zone.members.create!(member_type: 'state', state_id: state.id, country_id: state.country_id)endend+ end- Spree::DeliveryMethodZone.where(delivery_zone_id: zone.id).update_all(delivery_zone_id: delivery_zone.id)- migrated[zone.id] = delivery_zone.id- puts "zone #{zone.id} (#{zone.name}) → delivery zone #{delivery_zone.id} (#{delivery_zone.members.count} members)"+ legacy_zones.find_each do |zone|+ if Spree::DeliveryZone.exists?(id: zone.id) && !migrated.value?(zone.id)+ puts "SKIP zone #{zone.id} (#{zone.name}): a DeliveryZone with the same id already exists — resolve manually"+ next+ end++ methods_by_home = Spree::DeliveryMethod.unscoped.where(delivery_zone_id: zone.id).+ group_by { |method| [method.store_id, method.delivery_profile_id] }++ methods_by_home.each do |(store_id, profile_id), methods|+ profile_id ||= Spree::DeliveryProfile.where(store_id: store_id, default: true).pick(:id)++ delivery_zone_id = migrated[[zone.id, profile_id]] ||= begin+ name = zone.name+ name = "#{zone.name} (#{profile_id})" if Spree::DeliveryZone.exists?(store_id: store_id, name: name)++ delivery_zone = Spree::DeliveryZone.create!(+ name: name,+ description: zone.description,+ store_id: store_id,+ delivery_profile_id: profile_id,+ metadata: { 'migrated_from_zone_id' => zone.id }+ )+ copy_members.call(zone, delivery_zone)+ puts "zone #{zone.id} (#{zone.name}) → delivery zone #{delivery_zone.id} (#{delivery_zone.members.count} members)"+ delivery_zone.id+ end++ Spree::DeliveryMethod.unscoped.where(id: methods.map(&:id)).update_all(delivery_zone_id: delivery_zone_id)+ endendunreferenced = Spree::Zone.where.not(id: referenced_ids).where(kind: 'shipping')diff --git a/spree/core/lib/tasks/delivery_profiles_migration.rake b/spree/core/lib/tasks/delivery_profiles_migration.rakenew file mode 100644index 0000000000..ce86f05c40--- /dev/null+++ b/spree/core/lib/tasks/delivery_profiles_migration.rake@@ -0,0 +1,109 @@+# frozen_string_literal: true++# 5.6 → 6.0: finish promoting shipping categories into delivery profiles+# (docs/plans/6.0-delivery-profiles.md). The schema migration renamed the+# table and the product foreign key, so 5.x rows arrive as store-less,+# kind-less profiles; this task makes the judgement calls the migration+# deliberately left out: store assignment, kind detection, folding+# non-narrowing categories into the store default, and re-homing methods+# from the legacy method↔category m:n (spree_shipping_method_categories,+# which survives to 6.1 as this task's source and rollback reference).+namespace :spree do+ desc 'Assign 5.x shipping-category rows their store, kind and methods as delivery profiles'+ task migrate_delivery_profiles: :environment do+ # The m:n has no model anymore — read it anonymously.+ method_categories = Class.new(ActiveRecord::Base) { self.table_name = 'spree_shipping_method_categories' }+ has_legacy_join = method_categories.table_exists?++ digital_provider = 'Spree::FulfillmentProvider::Digital'++ Spree::DeliveryProfile.where(store_id: nil).find_each do |legacy_profile|+ store_ids = Spree::Product.unscoped.where(delivery_profile_id: legacy_profile.id).+ distinct.pluck(:store_id).compact++ if store_ids.empty?+ puts "profile #{legacy_profile.id} (#{legacy_profile.name}): no products reference it — removed"+ legacy_profile.delete+ next+ end++ # Categories were global; products are single-store. The first store+ # keeps the row, every further store gets its own copy.+ store_ids.each_with_index do |store_id, index|+ store = Spree::Store.find(store_id)+ default_profile = store.default_delivery_profile++ linked_method_ids = if has_legacy_join+ method_categories.where(shipping_category_id: legacy_profile.id).+ pluck(:shipping_method_id)+ else+ []+ end+ category_methods = Spree::DeliveryMethod.unscoped.where(id: linked_method_ids, store_id: store_id)+ store_methods = Spree::DeliveryMethod.unscoped.where(store_id: store_id)++ digital = category_methods.any? && category_methods.where.not(fulfillment_provider: digital_provider).none?+ # A category narrows when its method set differs from the store's+ # full set — only then does it carry information worth keeping.+ narrowing = category_methods.any? && category_methods.count != store_methods.count++ if !digital && !narrowing+ count = Spree::Product.unscoped.where(delivery_profile_id: legacy_profile.id, store_id: store_id).+ update_all(delivery_profile_id: default_profile.id)+ puts "store #{store.code}: category '#{legacy_profile.name}' does not narrow the method set — #{count} products moved to the default profile"+ next+ end++ target = if index.zero?+ legacy_profile+ else+ Spree::DeliveryProfile.new(name: legacy_profile.name)+ end+ target.store_id = store_id+ target.type = digital ? 'Spree::DeliveryProfiles::Digital' : 'Spree::DeliveryProfiles::Shipping'+ target.name = "#{legacy_profile.name} (#{store.code})" if Spree::DeliveryProfile.where(store_id: store_id, name: target.name).where.not(id: target.id).exists?+ target.save!(validate: false)+ # Promoted rows are updates, so the after_create hook never made+ # their default origin group.+ origin_group = target.delivery_origin_groups.first || target.delivery_origin_groups.create!++ unless index.zero?+ Spree::Product.unscoped.where(delivery_profile_id: legacy_profile.id, store_id: store_id).+ update_all(delivery_profile_id: target.id)+ end++ # A method solely linked to this category moves in with it; a method+ # shared across categories cannot be expressed single-parent.+ category_methods.find_each do |method|+ other_links = method_categories.where(shipping_method_id: method.id).+ where.not(shipping_category_id: legacy_profile.id).count+ if other_links.zero?+ method.update_columns(delivery_profile_id: target.id, delivery_origin_group_id: origin_group.id)+ else+ puts "WARNING store #{store.code}: delivery method #{method.id} (#{method.name}) was linked to #{other_links + 1} categories — it stays in the default profile and no longer serves '#{target.name}'. Recreate it inside that profile if intended."+ end+ end++ puts "store #{store.code}: category '#{legacy_profile.name}' → #{digital ? 'digital' : 'shipping'} profile #{target.id} (#{category_methods.count} linked methods)"+ end++ # Fully folded into store defaults? Nothing references the row anymore.+ legacy_profile.reload+ if legacy_profile.store_id.nil? && Spree::Product.unscoped.where(delivery_profile_id: legacy_profile.id).none?+ legacy_profile.delete+ end+ end++ # Any product still pointing nowhere lands on its store's default.+ Spree::Store.all.find_each do |store|+ default_profile = store.default_delivery_profile+ next unless default_profile++ count = Spree::Product.unscoped.where(store_id: store.id, delivery_profile_id: nil).+ update_all(delivery_profile_id: default_profile.id)+ puts "store #{store.code}: #{count} unassigned products moved to the default profile" if count.positive?+ end++ puts 'migrate_delivery_profiles done. spree_shipping_method_categories is kept until 6.1 as the rollback reference.'+ end+enddiff --git a/spree/core/spec/lib/tasks/six_zero_data_migrations_spec.rb b/spree/core/spec/lib/tasks/six_zero_data_migrations_spec.rbindex a01a163184..2d8d286fe5 100644--- a/spree/core/spec/lib/tasks/six_zero_data_migrations_spec.rb+++ b/spree/core/spec/lib/tasks/six_zero_data_migrations_spec.rb@@ -5,6 +5,7 @@ describe '6.0 data migration tasks' dobefore(:all) doRake::Task.define_task(:environment)load Spree::Core::Engine.root.join('lib', 'tasks', 'delivery_migration.rake')+ load Spree::Core::Engine.root.join('lib', 'tasks', 'delivery_profiles_migration.rake')load Spree::Core::Engine.root.join('lib', 'tasks', 'typed_adjustments_migration.rake')load Spree::Core::Engine.root.join('lib', 'tasks', 'carts_migration.rake')load Spree::Core::Engine.root.join('lib', 'tasks', 'products.rake')@@ -56,12 +57,11 @@ describe '6.0 data migration tasks' doSpree::Calculator::Shipping::DigitalDelivery.create!(calculable: digital_method)# A 5.x row as it arrives post-migration: storefront_visible at the# column default, display_on still holding the real value.- digital_method.update_columns(fulfillment_type: nil, fulfillment_provider: nil, storefront_visible: true, storefront_visible: false)+ digital_method.update_columns(fulfillment_provider: nil, storefront_visible: true, display_on: 'back_end')run_task('spree:migrate_shipping_to_delivery')digital_method.reload- expect(digital_method.fulfillment_type).to eq('digital')expect(digital_method.fulfillment_provider).to eq('Spree::FulfillmentProvider::Digital')expect(digital_method.read_attribute(:storefront_visible)).to be(false)end@@ -70,7 +70,7 @@ describe '6.0 data migration tasks' do# re-run cannot undo a visibility change an admin made in the meantime.it 'does not revert a later admin visibility change on re-run' domethod = create(:shipping_method)- method.update_columns(storefront_visible: true, storefront_visible: false)+ method.update_columns(storefront_visible: true, display_on: 'back_end')run_task('spree:migrate_shipping_to_delivery')expect(method.reload.read_attribute(:storefront_visible)).to be(false)@@ -110,6 +110,78 @@ describe '6.0 data migration tasks' doendend+ describe 'spree:migrate_delivery_profiles' do+ # 5.x rows arrive store-less and kind-less; the legacy method↔category+ # m:n is read straight from the surviving table.+ let(:method_categories) { Class.new(ActiveRecord::Base) { self.table_name = 'spree_shipping_method_categories' } }++ def legacy_category!(name)+ profile = Spree::DeliveryProfiles::Shipping.create!(store: store, name: name)+ profile.update_columns(store_id: nil, type: nil)+ profile+ end++ it 'folds a non-narrowing category into the store default profile' do+ category = legacy_category!('Default Category')+ method = create(:shipping_method, store: store)+ method_categories.create!(shipping_method_id: method.id, shipping_category_id: category.id)+ Spree::DeliveryMethod.unscoped.where(store: store).find_each do |delivery_method|+ method_categories.find_or_create_by!(shipping_method_id: delivery_method.id, shipping_category_id: category.id)+ end+ product = create(:product, store: store)+ product.update_columns(delivery_profile_id: category.id)++ run_task('spree:migrate_delivery_profiles')++ expect(product.reload.delivery_profile).to eq(store.default_delivery_profile)+ expect(Spree::DeliveryProfile.exists?(category.id)).to be(false)+ end++ it 'keeps a narrowing category as a profile and moves its solely-linked method in' do+ category = legacy_category!('Oversized')+ oversized_method = create(:shipping_method, store: store, name: 'Freight')+ create(:shipping_method, store: store, name: 'Regular')+ method_categories.create!(shipping_method_id: oversized_method.id, shipping_category_id: category.id)+ product = create(:product, store: store)+ product.update_columns(delivery_profile_id: category.id)++ run_task('spree:migrate_delivery_profiles')++ profile = Spree::DeliveryProfile.find(category.id)+ expect(profile.store).to eq(store)+ expect(profile).to be_a(Spree::DeliveryProfiles::Shipping)+ expect(oversized_method.reload.delivery_profile_id).to eq(profile.id)+ expect(product.reload.delivery_profile_id).to eq(profile.id)+ end++ it 'detects a digital-only category as a Digital profile' do+ category = legacy_category!('Digital Goods')+ digital_method = create(:digital_delivery_method, store: store)+ create(:shipping_method, store: store)+ method_categories.create!(shipping_method_id: digital_method.id, shipping_category_id: category.id)+ product = create(:product, store: store)+ product.update_columns(delivery_profile_id: category.id)++ run_task('spree:migrate_delivery_profiles')++ profile = Spree::DeliveryProfile.find(category.id)+ expect(profile).to be_a(Spree::DeliveryProfiles::Digital)+ expect(product.reload.delivery_profile_id).to eq(profile.id)+ end++ it 'is idempotent' do+ category = legacy_category!('Oversized')+ method = create(:shipping_method, store: store, name: 'Freight')+ create(:shipping_method, store: store, name: 'Regular')+ method_categories.create!(shipping_method_id: method.id, shipping_category_id: category.id)+ product = create(:product, store: store)+ product.update_columns(delivery_profile_id: category.id)++ run_task('spree:migrate_delivery_profiles')+ expect { run_task('spree:migrate_delivery_profiles') }.not_to change(Spree::DeliveryProfile, :count)+ end+ end+describe 'spree:migrate_zones_to_delivery_zones' dolet!(:country) { Spree::Country.find_by(iso: 'US') || create(:country_us) }let!(:zone) do@@ -120,17 +192,19 @@ describe '6.0 data migration tasks' dolet!(:delivery_method) { create(:shipping_method) }before do- Spree::DeliveryMethodZone.create!(delivery_method_id: delivery_method.id, delivery_zone_id: zone.id)+ delivery_method.update_columns(delivery_zone_id: zone.id)end- it 'converts referenced zones into delivery zones and re-points the joins' do+ it 'converts referenced zones into delivery zones and re-points the methods' dorun_task('spree:migrate_zones_to_delivery_zones')delivery_zone = Spree::DeliveryZone.find_by(name: zone.name)expect(delivery_zone).to be_presentexpect(delivery_zone.metadata['migrated_from_zone_id']).to eq(zone.id)+ expect(delivery_zone.store_id).to eq(delivery_method.store_id)+ expect(delivery_zone.delivery_profile_id).to eq(delivery_method.delivery_profile_id)expect(delivery_zone.members.pluck(:member_type, :country_id)).to eq([['country', country.id]])- expect(Spree::DeliveryMethodZone.where(delivery_method_id: delivery_method.id).pluck(:delivery_zone_id)).to eq([delivery_zone.id])+ expect(delivery_method.reload.delivery_zone_id).to eq(delivery_zone.id)endit 'is idempotent' do@@ -184,7 +258,7 @@ describe '6.0 data migration tasks' doexpect(fee.kind).to eq('surcharge')expect(order.reload.attributes.slice('total', 'discount_total', 'additional_tax_total')).to eq(totals_before)- expect(order.metadata['typed_adjustments_frozen']).to be_nil+ expect(order.private_metadata['typed_adjustments_frozen']).to be_nilendit 'freezes orders whose typed sums do not reconcile' do@@ -195,7 +269,7 @@ describe '6.0 data migration tasks' dorun_task('spree:migrate_adjustments_to_typed_rows')- expect(order.reload.metadata['typed_adjustments_frozen']).to eq('totals_do_not_reconcile')+ expect(order.reload.private_metadata['typed_adjustments_frozen']).to eq('totals_do_not_reconcile')endit 'skips orders that already carry typed rows' do@@ -256,7 +330,7 @@ describe '6.0 data migration tasks' dodescribe 'spree:product_types:backfill' doit 'assigns store-less product types to the default store' do- product_type = Spree::ProductType.create!(name: "Orphan #{Time.current.to_f}", fulfillment_types: ['shipping'])+ product_type = Spree::ProductType.create!(name: "Orphan #{Time.current.to_f}")product_type.update_columns(store_id: nil)run_task('spree:product_types:backfill')diff --git a/spree/core/spec/models/concerns/spree/purchase/addresses_spec.rb b/spree/core/spec/models/concerns/spree/purchase/addresses_spec.rbindex b04b75d59b..1eb47cac91 100644--- a/spree/core/spec/models/concerns/spree/purchase/addresses_spec.rb+++ b/spree/core/spec/models/concerns/spree/purchase/addresses_spec.rb@@ -168,9 +168,8 @@ RSpec.shared_examples 'an addresses host' doexpect(record.shipping_address_required?).to be falseend- it 'is false when every item is deliverable only by address-free types' do- digital_type = create(:product_type, fulfillment_types: ['digital'])- product = create(:product, product_type: digital_type, store: store)+ it 'is false when every item belongs to an address-free profile' do+ product = create(:digital_product, store: store)create(:line_item, "#{record.model_name.element}": record, variant: product.default_variant)expect(record.reload.shipping_address_required?).to be falsediff --git a/spree/core/spec/models/spree/calculator/shipping/digital_delivery_spec.rb b/spree/core/spec/models/spree/calculator/shipping/digital_delivery_spec.rbindex b2c16bce87..2bc4fbfa7c 100644--- a/spree/core/spec/models/spree/calculator/shipping/digital_delivery_spec.rb+++ b/spree/core/spec/models/spree/calculator/shipping/digital_delivery_spec.rb@@ -8,16 +8,18 @@ RSpec.describe Spree::Calculator::Shipping::DigitalDelivery doenddescribe '#compute_package' do- it 'ignores the passed in object' do- expect do- subject.compute_package(double)- end.not_to raise_error+ it 'quotes the package currency from the per-currency amounts' do+ subject.preferred_amounts = { 'EUR' => 3.5 }++ expect(subject.compute_package(double(currency: 'EUR'))).to eq(3.5)end- it 'alwayses return the preferred_amount' do- amount_double = double- expect(subject).to receive(:preferred_amount).and_return(amount_double)- expect(subject.compute_package(double)).to eq(amount_double)+ it 'falls back to the legacy single amount for its own currency' do+ subject.preferred_amount = 2+ subject.preferred_currency = 'USD'++ expect(subject.compute_package(double(currency: 'USD'))).to eq(2)+ expect(subject.compute_package(double(currency: 'EUR'))).to be_nilendenddiff --git a/spree/core/spec/models/spree/calculator/shipping/flat_rate_spec.rb b/spree/core/spec/models/spree/calculator/shipping/flat_rate_spec.rbindex ba1ec19ec0..f988bde073 100644--- a/spree/core/spec/models/spree/calculator/shipping/flat_rate_spec.rb+++ b/spree/core/spec/models/spree/calculator/shipping/flat_rate_spec.rb@@ -1,6 +1,35 @@require 'spec_helper'RSpec.describe Spree::Calculator::Shipping::FlatRate, type: :model do+ describe 'per-currency amounts' do+ subject { described_class.new(preferred_amount: 5, preferred_currency: 'USD') }++ let(:usd_package) { double(currency: 'USD', weight: 1, item_total: 50) }+ let(:eur_package) { double(currency: 'EUR', weight: 1, item_total: 50) }++ it 'quotes each currency its own amount and hides currencies without one' do+ subject.preferred_amounts = { 'EUR' => 4 }++ expect(subject.compute_package(usd_package)).to eq(5)+ expect(subject.compute_package(eur_package)).to eq(4)+ expect(subject.supports_currency?('USD')).to be true+ expect(subject.supports_currency?('EUR')).to be true+ expect(subject.supports_currency?('GBP')).to be false+ end++ it 'keeps the legacy single amount+currency pair working unchanged' do+ expect(subject.compute_package(usd_package)).to eq(5)+ expect(subject.supports_currency?('EUR')).to be false+ expect(subject.compute_package(eur_package)).to be_nil+ end++ it 'lets the per-currency hash override the legacy amount for the same currency' do+ subject.preferred_amounts = { 'usd' => 7 }++ expect(subject.compute_package(usd_package)).to eq(7)+ end+ end+let(:variant1) { create(:variant, price: 10, weight: 0.75) }let(:variant2) { create(:variant, price: 15, weight: 2.5) }diff --git a/spree/core/spec/models/spree/channel_spec.rb b/spree/core/spec/models/spree/channel_spec.rbindex c8adb168d8..ffca22fa02 100644--- a/spree/core/spec/models/spree/channel_spec.rb+++ b/spree/core/spec/models/spree/channel_spec.rb@@ -270,4 +270,24 @@ RSpec.describe Spree::Channel, type: :model doexpect(channel.reload.updated_at).to eq(old_updated_at)endend+ describe 'fulfillment-origin allowlist' do+ let(:store) { @default_store }+ let(:channel) { create(:channel, store: store) }+ let(:warehouse) { create(:stock_location, store: store, name: "Warehouse #{SecureRandom.hex(3)}") }+ let(:shop) { create(:stock_location, store: store, name: "Shop #{SecureRandom.hex(3)}") }++ it 'serves every location when no allowlist is set' do+ expect(channel.serves_location?(warehouse)).to be true+ expect(channel.served_stock_locations).to include(warehouse, shop)+ end++ it 'serves only allowlisted locations otherwise' do+ channel.stock_locations = [warehouse]++ expect(channel.serves_location?(warehouse)).to be true+ expect(channel.serves_location?(shop)).to be false+ expect(channel.served_stock_locations).to eq([warehouse])+ end+ end+enddiff --git a/spree/core/spec/models/spree/delivery_method_rule_spec.rb b/spree/core/spec/models/spree/delivery_method_rule_spec.rbindex 1670a8d9f8..a25dc45869 100644--- a/spree/core/spec/models/spree/delivery_method_rule_spec.rb+++ b/spree/core/spec/models/spree/delivery_method_rule_spec.rb@@ -44,6 +44,44 @@ describe Spree::DeliveryMethodRule, type: :model doendend+ describe Spree::DeliveryMethodRules::ChannelRule do+ let(:channel) { create(:channel, store: store) }+ let(:other_channel) { create(:channel, store: store) }+ let(:channel_package) do+ order = create(:order_with_line_items, store: store, channel: channel)+ Spree::Stock::Coordinator.new(order).packages.first+ end++ it 'offers the method only on the listed channels' do+ rule = described_class.new(delivery_method: delivery_method)++ # Unconfigured rules fail open, matching the other rule kinds.+ expect(rule.eligible?(channel_package)).to be(true)++ rule.preferred_channel_ids = [channel.id]+ expect(rule.eligible?(channel_package)).to be(true)++ rule.preferred_channel_ids = [other_channel.id]+ expect(rule.eligible?(channel_package)).to be(false)+ end++ it 'hides a channel-restricted method from carts with no channel' do+ rule = described_class.new(delivery_method: delivery_method)+ rule.preferred_channel_ids = [channel.id]++ expect(rule.eligible?(package)).to be(false)+ end++ it 'decodes prefixed ids and rejects channels of another store' do+ rule = described_class.new(delivery_method: delivery_method)+ rule.preferred_channel_ids = [channel.prefixed_id]+ expect(rule.preferred_channel_ids.map(&:to_s)).to eq([channel.id.to_s])++ foreign = create(:channel, store: create(:store))+ expect { rule.preferred_channel_ids = [foreign.id] }.to raise_error(ActiveRecord::RecordNotFound)+ end+ end+describe Spree::DeliveryMethodRules::WeightRule doit 'bounds by package weight' dorule = described_class.new(delivery_method: delivery_method)@@ -74,7 +112,7 @@ describe Spree::DeliveryMethodRule, type: :model do# Promotion#rules= / PriceList#rules=.describe 'Spree::DeliveryMethod#rules=' doit 'creates rules alongside a new method in one save' do- method = Spree::DeliveryMethod.new(name: 'Express', store: store, fulfillment_type: 'shipping')+ method = Spree::DeliveryMethod.new(name: 'Express', store: store)method.rules = [{ type: 'item_total_rule', preferences: { minimum_amount: 50 } }]method.save!@@ -103,7 +141,7 @@ describe Spree::DeliveryMethodRule, type: :model doit 'assigns products on a brand-new association-backed rule' doproduct = create(:product)- method = Spree::DeliveryMethod.new(name: 'Express', store: store, fulfillment_type: 'shipping')+ method = Spree::DeliveryMethod.new(name: 'Express', store: store)method.rules = [{ type: 'excluded_products_rule', product_ids: [product.id] }]method.save!diff --git a/spree/core/spec/models/spree/delivery_method_spec.rb b/spree/core/spec/models/spree/delivery_method_spec.rbindex 3ce5fb9ab6..9ad89bd547 100644--- a/spree/core/spec/models/spree/delivery_method_spec.rb+++ b/spree/core/spec/models/spree/delivery_method_spec.rb@@ -78,20 +78,15 @@ describe Spree::DeliveryMethod, type: :model doexpect(delivery_method.requires_zone_check?).to be trueend- it 'is decided by the fulfillment provider, not the fulfillment type' do- [- ['digital', 'Spree::FulfillmentProvider::Digital'],- ['pickup', 'Spree::FulfillmentProvider::Pickup']- ].each do |fulfillment_type, provider|- method = create(:delivery_method, fulfillment_type: fulfillment_type, fulfillment_provider: provider)-+ it 'is decided by the fulfillment provider' do+ [create(:digital_delivery_method), create(:pickup_delivery_method)].each do |method|expect(method.requires_address?).to be falseexpect(method.requires_zone_check?).to be falseendend- it 'is true for the Manual provider whatever the fulfillment type' do- method = create(:delivery_method, fulfillment_type: 'pickup')+ it 'is true for the Manual provider' do+ method = create(:delivery_method)expect(method.fulfillment_provider).to eq('Spree::FulfillmentProvider::Manual')expect(method.requires_address?).to be true@@ -177,29 +172,6 @@ describe Spree::DeliveryMethod, type: :model doexpect(subject.errors.messages[:name].size).to eq(1)end- it 'rejects a fulfillment type outside the Spree.fulfillment_types registry' do- method = build(:delivery_method, fulfillment_type: 'pickpu')-- expect(method).not_to be_valid- expect(method.errors[:fulfillment_type]).to be_present- end-- it 'accepts a custom type once registered' do- Spree.fulfillment_types << 'same_day_courier'-- expect(build(:delivery_method, fulfillment_type: 'same_day_courier')).to be_valid- ensure- Spree.fulfillment_types.delete('same_day_courier')- end-- it 'leaves persisted rows with unregistered types loadable and savable' do- method = create(:delivery_method)- method.update_column(:fulfillment_type, 'legacy_freight')-- method.reload.name = 'Renamed'- expect(method.save).to be true- end-it 'defaults to storefront visible and rejects a blank value' doexpect(subject.storefront_visible).to be true@@ -281,43 +253,44 @@ describe Spree::DeliveryMethod, type: :model doendend- describe 'provider / fulfillment type compatibility' do+ describe 'rate provider / fulfillment provider compatibility' dolet(:delivery_method) { create(:delivery_method) }- let(:shipping_only_provider) do+ let(:carrier_provider) doClass.new(Spree::DeliveryRateProvider::Base) do- def self.fulfillment_types = ['shipping']- def self.provider_name = 'ShippingOnly'+ def self.requires_address? = true+ def self.provider_name = 'Carrier'endendbefore do- stub_const('ShippingOnlyRateProvider', shipping_only_provider)- Spree.delivery_rate_providers << shipping_only_provider+ stub_const('CarrierRateProvider', carrier_provider)+ Spree.delivery_rate_providers << carrier_providerend- after { Spree.delivery_rate_providers.delete(shipping_only_provider) }+ after { Spree.delivery_rate_providers.delete(carrier_provider) }- # A carrier that only quotes parcels cannot serve a digital method — the- # mismatch would surface as missing rates at checkout, not at save time.- it 'rejects a provider that does not handle the chosen fulfillment type' do- delivery_method.assign_attributes(rate_provider: 'ShippingOnlyRateProvider', fulfillment_type: 'digital')+ # A carrier quotes parcels to an address, so it cannot price a method+ # whose fulfillment provider never ships one — the mismatch would surface+ # as missing rates at checkout, not at save time.+ it 'rejects a shipment-quoting rate provider when the method does not ship to an address' do+ profile = create(:digital_delivery_profile, store: delivery_method.store)+ method = build(:digital_delivery_method, store: delivery_method.store,+ delivery_profile: profile, rate_provider: 'CarrierRateProvider')- expect(delivery_method).not_to be_valid- expect(delivery_method.errors[:rate_provider].join).to include('ShippingOnly')+ expect(method).not_to be_valid+ expect(method.errors[:rate_provider].join).to include('Carrier')end- it 'accepts a type the provider declares' do- delivery_method.assign_attributes(rate_provider: 'ShippingOnlyRateProvider', fulfillment_type: 'shipping')+ it 'accepts a shipment-quoting rate provider on a shipping method' do+ delivery_method.rate_provider = 'CarrierRateProvider'expect(delivery_method).to be_validend- # An empty declaration means "any type" — Internal and Manual price and- # dispatch anything.- it 'accepts any type for providers that declare none' do- delivery_method.assign_attributes(rate_provider: '', fulfillment_type: 'digital')-- expect(delivery_method).to be_valid+ # Internal prices anything — pickup and digital methods keep their+ # calculators.+ it 'accepts any fulfillment provider for rate providers that do not quote shipments' do+ expect(build(:pickup_delivery_method, rate_provider: '')).to be_validendenddiff --git a/spree/core/spec/models/spree/delivery_profile_spec.rb b/spree/core/spec/models/spree/delivery_profile_spec.rbnew file mode 100644index 0000000000..ade0247603--- /dev/null+++ b/spree/core/spec/models/spree/delivery_profile_spec.rb@@ -0,0 +1,181 @@+require 'spec_helper'++RSpec.describe Spree::DeliveryProfile, type: :model do+ let(:store) { @default_store }++ it 'gives every new store a default profile' do+ new_store = create(:store)++ profile = new_store.default_delivery_profile+ expect(profile).to be_present+ expect(profile.name).to eq('General')+ end++ describe 'default enforcement' do+ it 'demotes the previous default when another is promoted' do+ original = store.default_delivery_profile+ promoted = create(:delivery_profile, store: store, default: true)++ expect(promoted.reload).to be_default+ expect(original.reload).not_to be_default+ end+ end++ describe '#can_be_deleted?' do+ it 'protects the default profile' do+ expect(store.default_delivery_profile.can_be_deleted?).to be false+ end++ it 'protects profiles with products' do+ profile = create(:delivery_profile, store: store)+ create(:product, store: store, delivery_profile: profile)++ expect(profile.can_be_deleted?).to be false+ end++ it 'allows deleting an empty non-default profile' do+ expect(create(:delivery_profile, store: store).can_be_deleted?).to be true+ end+ end++ describe 'product assignment' do+ it 'stamps the type template profile at creation' do+ profile = create(:delivery_profile, store: store)+ product_type = create(:product_type, store: store, delivery_profile: profile)++ product = create(:product, store: store, product_type: product_type)++ expect(product.delivery_profile).to eq(profile)+ end++ it 'falls back to the store default and never syncs from later type changes' do+ product = create(:product, store: store)+ expect(product.delivery_profile).to eq(store.default_delivery_profile)++ profile = create(:delivery_profile, store: store)+ product.update!(product_type: create(:product_type, store: store, delivery_profile: profile))++ expect(product.reload.delivery_profile).to eq(store.default_delivery_profile)+ end+ end++ describe 'kind-declared capabilities' do+ it 'makes products digital through the Digital profile kind' do+ profile = create(:digital_delivery_profile, store: store)+ create(:digital_delivery_method, store: store, delivery_profile: profile)+ product = create(:product, store: store, delivery_profile: profile)++ expect(product.digital?).to be true+ expect(profile.requires_shipping_address?).to be false+ end++ it 'derives the address requirement from providers on physical profiles' do+ profile = create(:delivery_profile, store: store)+ create(:pickup_delivery_method, store: store, delivery_profile: profile)++ expect(profile.requires_shipping_address?).to be false++ create(:delivery_method, store: store, delivery_profile: profile)+ expect(profile.reload.requires_shipping_address?).to be true+ end++ it 'derives pickup and shipping capabilities from the method set' do+ profile = create(:delivery_profile, store: store)++ expect(profile.offers_pickup?).to be false+ expect(profile.offers_shipping?).to be false++ create(:pickup_delivery_method, store: store, delivery_profile: profile)+ expect(profile.reload.offers_pickup?).to be true+ expect(profile.offers_shipping?).to be false++ create(:delivery_method, store: store, delivery_profile: profile)+ expect(profile.reload.offers_shipping?).to be true+ end+ end++ describe 'origin groups' do+ it 'gives every new profile a default nameless group covering all locations' do+ profile = create(:delivery_profile, store: store)+ location = create(:stock_location, store: store)++ group = profile.default_origin_group+ expect(group).to be_present+ expect(group.name).to be_nil+ expect(group.covers_location?(location)).to be true+ expect(profile.covers_location?(location)).to be true+ end++ it 'narrows coverage to the union of group members' do+ profile = create(:delivery_profile, store: store)+ warehouse = create(:stock_location, store: store, name: 'Warehouse A')+ other = create(:stock_location, store: store, name: 'Warehouse B')+ profile.default_origin_group.stock_locations = [warehouse]++ expect(profile.covers_location?(warehouse)).to be true+ expect(profile.covers_location?(other)).to be false+ expect(profile.fulfillable_stock_locations).to eq([warehouse])+ end++ it 'assigns zones and methods to the default group and keeps them consistent' do+ profile = create(:delivery_profile, store: store)+ zone = create(:delivery_zone, store: store, delivery_profile: profile)+ method = create(:delivery_method, store: store, delivery_profile: profile, delivery_zone: zone)++ expect(zone.delivery_origin_group).to eq(profile.default_origin_group)+ expect(method.delivery_origin_group).to eq(profile.default_origin_group)+ end++ it 'rejects a method whose zone lives in a different origin group' do+ profile = create(:delivery_profile, store: store)+ other_group = profile.delivery_origin_groups.create!(name: 'EU warehouse')+ zone = create(:delivery_zone, store: store, delivery_profile: profile, delivery_origin_group: other_group)+ method = build(:delivery_method, store: store, delivery_profile: profile,+ delivery_origin_group: profile.default_origin_group, delivery_zone: zone)++ expect(method).not_to be_valid+ expect(method.errors[:delivery_zone]).to be_present+ end++ it 'only offers a method from origins its group covers' do+ profile = create(:delivery_profile, store: store)+ us_warehouse = create(:stock_location, store: store, name: 'US')+ eu_warehouse = create(:stock_location, store: store, name: 'EU')+ eu_group = profile.delivery_origin_groups.create!(name: 'EU')+ eu_group.stock_locations = [eu_warehouse]+ method = create(:delivery_method, store: store, delivery_profile: profile, delivery_origin_group: eu_group)++ expect(method.serves_location?(eu_warehouse)).to be true+ expect(method.serves_location?(us_warehouse)).to be false+ end++ it 'protects the last origin group from deletion' do+ profile = create(:delivery_profile, store: store)+ only_group = profile.default_origin_group++ expect(only_group.can_be_deleted?).to be false++ second = profile.delivery_origin_groups.create!(name: 'Second')+ expect(second.can_be_deleted?).to be true+ expect(only_group.reload.can_be_deleted?).to be true+ end+ end++ describe 'composition guard' do+ it 'rejects digital methods on a physical profile' do+ profile = create(:delivery_profile, store: store)+ method = build(:digital_delivery_method, store: store, delivery_profile: profile)++ expect(method).not_to be_valid+ expect(method.errors[:fulfillment_provider]).to be_present+ end++ it 'rejects physical methods on a digital profile' do+ profile = create(:digital_delivery_profile, store: store)+ method = build(:delivery_method, store: store, delivery_profile: profile)++ expect(method).not_to be_valid+ expect(method.errors[:fulfillment_provider]).to be_present+ end+ end+enddiff --git a/spree/core/spec/models/spree/fulfillment_provider/base_spec.rb b/spree/core/spec/models/spree/fulfillment_provider/base_spec.rbindex 17da991886..d25c8c3060 100644--- a/spree/core/spec/models/spree/fulfillment_provider/base_spec.rb+++ b/spree/core/spec/models/spree/fulfillment_provider/base_spec.rb@@ -18,18 +18,17 @@ describe Spree::FulfillmentProvider::Base, type: :model doenddescribe 'registry' do- it 'exposes the built-in providers and fulfillment types' do+ it 'exposes the built-in providers and their class predicates' doexpect(Spree.fulfillment_providers).to include(Spree::FulfillmentProvider::Manual,Spree::FulfillmentProvider::Digital,Spree::FulfillmentProvider::Pickup,Spree::FulfillmentProvider::PickupPoint)- expect(Spree.fulfillment_types).to include('shipping', 'pickup', 'digital')- # Deferred to 6.1: pickup_point (provider ships, type unregistered) and- # local_delivery (no implementation — a shipping method with a- # postal-code zone covers the use case today).- expect(Spree.fulfillment_types).not_to include('pickup_point', 'local_delivery')+ expect(Spree::FulfillmentProvider::Digital).to be_digital+ expect(Spree::FulfillmentProvider::Pickup).to be_pickup+ expect(Spree::FulfillmentProvider::PickupPoint).to be_pickup_point+ expect(Spree::FulfillmentProvider::Manual).not_to be_digitalendenddiff --git a/spree/core/spec/models/spree/line_item_spec.rb b/spree/core/spec/models/spree/line_item_spec.rbindex 3d5c320e3f..5f12f07592 100644--- a/spree/core/spec/models/spree/line_item_spec.rb+++ b/spree/core/spec/models/spree/line_item_spec.rb@@ -129,8 +129,10 @@ describe Spree::LineItem, type: :model do# issues one link per fulfillment unit. Tracking is decided per variant by# should_track_inventory?, never by the order being all-digital.describe 'inventory verification on a digital order' do- let(:digital_type) { create(:product_type, name: 'Licence', fulfillment_types: ['digital'], store: store) }- let(:licence_product) { create(:product, product_type: digital_type, store: store) }+ let(:digital_profile) do+ Spree::DeliveryProfiles::Digital.find_by(store: store) || create(:digital_delivery_profile, store: store)+ end+ let(:licence_product) { create(:product, delivery_profile: digital_profile, store: store) }let(:licence_variant) dolicence_product.default_variant.tap do |variant|variant.update!(track_inventory: true)@@ -154,7 +156,7 @@ describe Spree::LineItem, type: :model doendit 'builds fulfillment items for a stock-limited digital variant' do- second_licence = create(:product, product_type: digital_type, store: store).default_variant+ second_licence = create(:product, delivery_profile: digital_profile, store: store).default_variantsecond_licence.update!(track_inventory: true)line_item = create(:line_item, order: order, variant: second_licence, quantity: 2)@@ -163,7 +165,7 @@ describe Spree::LineItem, type: :model doendit 'decrements stock for a tracked digital variant' do- second_licence = create(:product, product_type: digital_type, store: store).default_variant+ second_licence = create(:product, delivery_profile: digital_profile, store: store).default_variantsecond_licence.update!(track_inventory: true)stock_item = second_licence.stock_items.firststock_item.set_count_on_hand(5)diff --git a/spree/core/spec/models/spree/market_country_spec.rb b/spree/core/spec/models/spree/market_country_spec.rbindex 9ba983c470..e016a48401 100644--- a/spree/core/spec/models/spree/market_country_spec.rb+++ b/spree/core/spec/models/spree/market_country_spec.rb@@ -12,7 +12,7 @@ RSpec.describe Spree::MarketCountry, type: :model dobefore dozone.members.create!(member_type: 'country', country: country)- create(:shipping_method, delivery_zones: [zone])+ create(:shipping_method, delivery_zone: zone)endit 'is valid' do@@ -29,7 +29,7 @@ RSpec.describe Spree::MarketCountry, type: :model do# scope any worldwide methods (e.g. the market factory's) elsewhereelsewhere = create(:delivery_zone)elsewhere.members.create!(member_type: 'country', country: create(:country))- Spree::DeliveryMethod.find_each { |dm| dm.delivery_zones = [elsewhere] if dm.delivery_zones.empty? }+ Spree::DeliveryMethod.find_each { |dm| dm.update!(delivery_zone: elsewhere) if dm.delivery_zone.nil? }endit 'is invalid' do@@ -48,7 +48,7 @@ RSpec.describe Spree::MarketCountry, type: :model dozone.members.create!(member_type: 'country', country: country)elsewhere = create(:delivery_zone)elsewhere.members.create!(member_type: 'country', country: create(:country))- Spree::DeliveryMethod.find_each { |dm| dm.delivery_zones = [elsewhere] if dm.delivery_zones.empty? }+ Spree::DeliveryMethod.find_each { |dm| dm.update!(delivery_zone: elsewhere) if dm.delivery_zone.nil? }endit 'is invalid' do@@ -65,7 +65,7 @@ RSpec.describe Spree::MarketCountry, type: :model dobefore dozone.members.create!(member_type: 'state', state: state)- create(:shipping_method, delivery_zones: [zone])+ create(:shipping_method, delivery_zone: zone)endit 'is valid' dodiff --git a/spree/core/spec/models/spree/order_routing/strategy/parity_spec.rb b/spree/core/spec/models/spree/order_routing/strategy/parity_spec.rbindex 6f89cb569d..434987a7a9 100644--- a/spree/core/spec/models/spree/order_routing/strategy/parity_spec.rb+++ b/spree/core/spec/models/spree/order_routing/strategy/parity_spec.rb@@ -420,7 +420,7 @@ RSpec.describe 'OrderRouting strategy parity', type: :model do# Splitter chain: fulfillment-type split runs per-location# ---------------------------------------------------------------- context 'two variants with different fulfillment types at same location' do+ context 'two variants in different delivery profiles at same location' dolet(:variant_shipping) { create(:variant, product: create(:product)) }let(:variant_digital) { create(:variant, product: create(:digital_product, track_inventory: true)) }@@ -436,16 +436,16 @@ RSpec.describe 'OrderRouting strategy parity', type: :model donyc.stock_item_or_create(variant_digital).update!(count_on_hand: 10)end- # The FulfillmentType splitter is in the default Spree.stock_splitters+ # The DeliveryProfile splitter is in the default Spree.stock_splitters# chain — Coordinator and Rules both pass it to the Packer, so each- # location's allocation gets fanned out into one package per- # fulfillment-type set. Both pipelines should produce 2 NYC packages here.- it 'produces two NYC packages, one per fulfillment-type set' do+ # location's allocation gets fanned out into one package per profile.+ # Both pipelines should produce 2 NYC packages here.+ it 'produces two NYC packages, one per delivery profile' dopackages = strategy.for_allocationnyc_packages = packages.select { |p| p.stock_location.id == nyc.id }expect(nyc_packages.size).to eq(2)- type_sets = nyc_packages.map { |p| p.fulfillment_types.sort }- expect(type_sets).to contain_exactly(['digital'], ['shipping'])+ profiles = nyc_packages.map { |p| p.delivery_profile }+ expect(profiles.map(&:digital?)).to contain_exactly(true, false)expect(total_on_hand(packages)).to eq(2)expect(total_backordered(packages)).to eq(0)enddiff --git a/spree/core/spec/models/spree/product_spec.rb b/spree/core/spec/models/spree/product_spec.rbindex 37d4d20b90..1a41722db6 100644--- a/spree/core/spec/models/spree/product_spec.rb+++ b/spree/core/spec/models/spree/product_spec.rb@@ -36,13 +36,13 @@ describe Spree::Product, type: :model doenddescribe 'delivery eligibility' do- # ShippingCategory is retired from behavior in 6.0 — eligibility comes- # from ProductType#fulfillment_types, and a typeless product still ships.- it 'comes from the product type, defaulting to physical shipping' do- expect(build(:product, product_type: nil).fulfillment_types).to eq ['shipping']+ # Eligibility comes from the delivery profile; a product without one+ # falls back to the store's default (physical) profile.+ it 'comes from the delivery profile, defaulting to physical shipping' do+ expect(create(:product)).not_to be_digital- digital = build(:product, product_type: build(:product_type, fulfillment_types: ['digital']))- expect(digital.fulfillment_types).to eq ['digital']+ digital = create(:digital_product)+ expect(digital.delivery_profile).to be_a(Spree::DeliveryProfiles::Digital)expect(digital).to be_digitalendend@@ -1298,18 +1298,16 @@ describe Spree::Product, type: :model doenddescribe '#digital?' do- context 'when the product type is digital-only' do+ context 'when the product belongs to a digital profile' dolet(:product) { create(:digital_product) }it { expect(product.digital?).to eq(true) }- it { expect(product.fulfillment_types).to eq(['digital']) }end- context 'when the product has no type' do+ context 'when the product belongs to the default profile' dolet(:product) { create(:product) }it { expect(product.digital?).to eq(false) }- it { expect(product.fulfillment_types).to eq(['shipping']) }endendenddiff --git a/spree/core/spec/models/spree/product_type_spec.rb b/spree/core/spec/models/spree/product_type_spec.rbindex 820d21cc70..52228cbdba 100644--- a/spree/core/spec/models/spree/product_type_spec.rb+++ b/spree/core/spec/models/spree/product_type_spec.rb@@ -3,53 +3,17 @@ require 'spec_helper'describe Spree::ProductType, type: :model doit_behaves_like 'metadata'- describe 'fulfillment_types' do- it 'defaults to shipping' do- expect(described_class.new.fulfillment_types).to eq(['shipping'])+ describe 'delivery profile template' do+ it 'is optional — a type without one leaves products on the store default' do+ expect(build(:product_type).delivery_profile).to be_nilend- it 'persists an explicit value' do- product_type = create(:product_type, fulfillment_types: %w[shipping pickup])+ it 'stamps its profile onto products at creation' do+ profile = create(:delivery_profile)+ product_type = create(:product_type, delivery_profile: profile)+ product = create(:product, store: profile.store, product_type: product_type)- expect(product_type.reload.fulfillment_types).to eq(%w[shipping pickup])- end-- it 'rejects types outside the Spree.fulfillment_types registry' do- product_type = build(:product_type, fulfillment_types: %w[shipping freigt])-- expect(product_type).not_to be_valid- expect(product_type.errors[:fulfillment_types].first).to include('freigt')- end-- it 'accepts a custom type once registered' do- Spree.fulfillment_types << 'freight'-- expect(build(:product_type, fulfillment_types: ['freight'])).to be_valid- ensure- Spree.fulfillment_types.delete('freight')- end-- it 'leaves persisted rows with unregistered types savable when untouched' do- product_type = create(:product_type)- product_type.update_column(:fulfillment_types, ['legacy_freight'])-- product_type.reload.name = 'Renamed'- expect(product_type.save).to be true- end- end-- describe '#digital?' do- it 'is true only when digital is the sole fulfillment type' do- expect(build(:product_type, fulfillment_types: ['digital'])).to be_digital- expect(build(:product_type, fulfillment_types: %w[digital shipping])).not_to be_digital- expect(build(:product_type)).not_to be_digital- end- end-- describe '#requires_shipping?' do- it 'is true when shipping is among the fulfillment types' do- expect(build(:product_type)).to be_requires_shipping- expect(build(:product_type, fulfillment_types: ['digital'])).not_to be_requires_shipping+ expect(product.delivery_profile).to eq(profile)endenddiff --git a/spree/core/spec/models/spree/shipment_spec.rb b/spree/core/spec/models/spree/shipment_spec.rbindex ae037e35a9..b2861b8d5b 100644--- a/spree/core/spec/models/spree/shipment_spec.rb+++ b/spree/core/spec/models/spree/shipment_spec.rb@@ -36,7 +36,7 @@ describe Spree::Shipment, type: :model dodescribe '#digital?' doit 'returns true if the delivery method is digital' do- shipment.delivery_method.fulfillment_type = 'digital'+ shipment.delivery_method.fulfillment_provider = 'Spree::FulfillmentProvider::Digital'expect(shipment.digital?).to eq(true)enddiff --git a/spree/core/spec/models/spree/shipping_category_spec.rb b/spree/core/spec/models/spree/shipping_category_spec.rbdeleted file mode 100644index 55c0dbc4f0..0000000000--- a/spree/core/spec/models/spree/shipping_category_spec.rb+++ /dev/null@@ -1,19 +0,0 @@-require 'spec_helper'--describe Spree::ShippingCategory, type: :model do- context 'Validations' do- it 'has a valid factory' do- expect(FactoryBot.build(:shipping_category)).to be_valid- end-- it 'requires name' do- expect(FactoryBot.build(:shipping_category, name: '')).not_to be_valid- end-- it 'validates uniqueness' do- FactoryBot.create(:shipping_category, name: 'Test')- expect(FactoryBot.build(:shipping_category, name: 'Test')).not_to be_valid- end- end--enddiff --git a/spree/core/spec/models/spree/stock/coordinator_spec.rb b/spree/core/spec/models/spree/stock/coordinator_spec.rbindex 31c6a37af7..b8f3c0d895 100644--- a/spree/core/spec/models/spree/stock/coordinator_spec.rb+++ b/spree/core/spec/models/spree/stock/coordinator_spec.rb@@ -17,6 +17,51 @@ module Spreeendend+ # Allocation asks each profile (and the order's channel) about every+ # candidate location, so membership must be read from loaded rows —+ # re-querying per question multiplied with items × locations.+ describe 'query cost' do+ it 'does not re-query origin-group membership per unit and location' do+ 4.times do |index|+ create(:stock_location, store: store, name: "Warehouse #{index} #{SecureRandom.hex(3)}",+ propagate_all_variants: true, backorderable_default: true)+ end+ big_order = create(:order_with_line_items, store: store, line_items_count: 4)++ membership_queries = 0+ subscription = ActiveSupport::Notifications.subscribe('sql.active_record') do |*, payload|+ next if payload[:name].to_s.match?(/SCHEMA|TRANSACTION/)++ membership_queries += 1 if payload[:sql].include?('spree_delivery_origin_group_locations')+ end++ Coordinator.new(big_order.reload).packages+ ActiveSupport::Notifications.unsubscribe(subscription)++ # One read per profile is fine; per unit per location is the bug.+ expect(membership_queries).to be < 10+ end+ end++ describe 'channel-scoped allocation' do+ let!(:warehouse) { create(:stock_location, store: store, name: "Warehouse #{SecureRandom.hex(3)}", backorderable_default: true, propagate_all_variants: true) }+ let(:channel) { create(:channel, store: store) }++ it 'never allocates from a location the order channel is not served by' do+ channel.stock_locations = [create(:stock_location, store: store, name: "Other #{SecureRandom.hex(3)}")]+ order.update!(channel: channel)++ packages = subject.packages+ expect(packages.map { |package| package.stock_location.id }).not_to include(warehouse.id)+ end++ it 'allocates normally when the channel has no allowlist' do+ order.update!(channel: channel)++ expect(subject.packages).to be_present+ end+ end+describe '#shipments' dolet(:packages) { [build(:stock_package_fulfilled), build(:stock_package_fulfilled)] }diff --git a/spree/core/spec/models/spree/stock/estimator_spec.rb b/spree/core/spec/models/spree/stock/estimator_spec.rbindex 0ca785e649..77ba7eecc6 100644--- a/spree/core/spec/models/spree/stock/estimator_spec.rb+++ b/spree/core/spec/models/spree/stock/estimator_spec.rb@@ -16,6 +16,7 @@ module Spreeallow_any_instance_of(ShippingMethod).to receive_message_chain(:calculator, :available?).and_return(true)allow_any_instance_of(ShippingMethod).to receive_message_chain(:calculator, :compute).and_return(4.00)allow_any_instance_of(ShippingMethod).to receive_message_chain(:calculator, :preferences).and_return(currency: currency)+ allow_any_instance_of(ShippingMethod).to receive_message_chain(:calculator, :supports_currency?) { |quoted| currency.blank? || quoted == currency }allow_any_instance_of(ShippingMethod).to receive_message_chain(:calculator, :marked_for_destruction?)allow(package).to receive_messages(eligible_delivery_methods: [shipping_method])@@ -46,7 +47,7 @@ module Spreeother_country = create(:country, iso: 'XZ', iso3: 'XZZ', name: 'Elsewhere', iso_name: 'ELSEWHERE')zone = create(:delivery_zone)zone.members.create!(member_type: 'country', country: other_country)- shipping_method.delivery_zones = [zone]+ shipping_method.update!(delivery_zone: zone)endit_behaves_like "shipping rate doesn't match"@@ -239,6 +240,30 @@ module Spreeendend+ # Per-channel rates: one profile, one warehouse, different prices for+ # different buyers (docs/plans/6.0-channel-delivery.md).+ describe 'channel-restricted methods' do+ it 'quotes a channel-restricted method only to that channel' do+ wholesale = create(:channel, store: @default_store, name: "Wholesale #{SecureRandom.hex(3)}")+ retail = create(:channel, store: @default_store, name: "Retail #{SecureRandom.hex(3)}")++ wholesale_rate = create(:delivery_method, store: @default_store, name: 'Wholesale Rate')+ wholesale_rate.rules = [{ type: 'channel_rule', preferences: { channel_ids: [wholesale.id] } }]+ wholesale_rate.save!++ wholesale_order = create(:order_with_line_items, store: @default_store, channel: wholesale)+ retail_order = create(:order_with_line_items, store: @default_store, channel: retail)++ wholesale_names = Spree::Stock::Coordinator.new(wholesale_order).packages.+ flat_map { |package| package.delivery_rates.map(&:name) }+ retail_names = Spree::Stock::Coordinator.new(retail_order).packages.+ flat_map { |package| package.delivery_rates.map(&:name) }++ expect(wholesale_names).to include('Wholesale Rate')+ expect(retail_names).not_to include('Wholesale Rate')+ end+ end+# Host apps override the eligibility seam to add their own rules. The# 6.0 rename must not silently skip overrides written against the old# name — that would quote rates the host meant to filter out.diff --git a/spree/core/spec/models/spree/stock/package_spec.rb b/spree/core/spec/models/spree/stock/package_spec.rbindex 6e5df078aa..30f24f878c 100644--- a/spree/core/spec/models/spree/stock/package_spec.rb+++ b/spree/core/spec/models/spree/stock/package_spec.rb@@ -98,13 +98,13 @@ module Spreeexpect(item.quantity).to eq 1end- # Replaces the ShippingCategory intersection (#2804) with the 6.0- # fulfillment-type eligibility semantics.+ # Candidate methods are exactly the package's delivery profile's —+ # the profile splitter guarantees homogeneous packages.describe '#eligible_delivery_methods' dolet!(:shipping_dm) { create(:delivery_method) }let!(:digital_dm) { create(:digital_delivery_method) }- it 'returns methods whose fulfillment type every item supports' do+ it 'returns the methods of the items resolved profile' dovariant1 = create(:product).default_variantvariant2 = create(:product).default_variantcontents = [ContentItem.new(build(:inventory_unit, variant_id: variant1.id)),@@ -114,14 +114,12 @@ module Spreeexpect(package.eligible_delivery_methods).to eq([shipping_dm])end- it 'returns nothing when the items share no fulfillment type' do- physical = create(:product).default_variant+ it 'returns the digital profile methods for a digital package' dodigital = create(:digital_product).default_variant- contents = [ContentItem.new(build(:inventory_unit, variant_id: physical.id)),- ContentItem.new(build(:inventory_unit, variant_id: digital.id))]+ contents = [ContentItem.new(build(:inventory_unit, variant_id: digital.id))]package = Package.new(stock_location, contents)- expect(package.eligible_delivery_methods).to be_empty+ expect(package.eligible_delivery_methods).to eq([digital_dm])end# Per-product exclusions moved to DeliveryMethodRules::ExcludedProductsRule,diff --git a/spree/core/spec/models/spree/stock/splitter/fulfillment_type_spec.rb b/spree/core/spec/models/spree/stock/splitter/fulfillment_type_spec.rbdeleted file mode 100644index b406a6f594..0000000000--- a/spree/core/spec/models/spree/stock/splitter/fulfillment_type_spec.rb+++ /dev/null@@ -1,45 +0,0 @@-require 'spec_helper'--module Spree- module Stock- module Splitter- describe FulfillmentType, type: :model do- subject { described_class.new(packer) }-- let(:packer) { build(:stock_packer) }-- let(:digital_product) { create(:digital_product) }- let(:physical_product) { create(:product) }-- let(:item1) { create(:inventory_unit, variant: create(:variant, product: digital_product, digitals: [create(:digital)])) }- let(:item2) { create(:inventory_unit, variant: create(:variant, product: physical_product)) }- let(:item3) { create(:inventory_unit, variant: create(:variant, product: physical_product)) }- let(:item4) { create(:inventory_unit, variant: create(:variant, product: digital_product, digitals: [create(:digital)])) }-- it 'splits packages so fulfillment-type sets stay homogeneous' do- package = Package.new(packer.stock_location)- package.add item1, :on_hand- package.add item2, :on_hand- package.add item3, :on_hand- package.add item4, :on_hand-- packages = subject.split([package])-- expect(packages.size).to eq(2)- expect(packages.map { |p| p.fulfillment_types.sort }).to match_array([['digital'], ['shipping']])- expect(packages.sum { |p| p.contents.size }).to eq(4)- end-- it 'keeps a single package when every item shares the same types' do- package = Package.new(packer.stock_location)- package.add item2, :on_hand- package.add item3, :on_hand-- packages = subject.split([package])-- expect(packages.size).to eq(1)- end- end- end- end-enddiff --git a/spree/core/spec/models/spree/store_spec.rb b/spree/core/spec/models/spree/store_spec.rbindex aa156eddf4..b528486f77 100644--- a/spree/core/spec/models/spree/store_spec.rb+++ b/spree/core/spec/models/spree/store_spec.rb@@ -227,7 +227,7 @@ describe Spree::Store, type: :model, without_global_store: true dobefore dozone = create(:delivery_zone)zone.members.create!(member_type: 'country', country: country)- create(:shipping_method, delivery_zones: [zone])+ create(:shipping_method, delivery_zone: zone)store.default_country_iso = country.isoend@@ -771,7 +771,7 @@ describe Spree::Store, type: :model, without_global_store: true dobefore dozone.members.create!(member_type: 'country', country: country1)zone.members.create!(member_type: 'country', country: country2)- create(:shipping_method, delivery_zones: [zone])+ create(:shipping_method, delivery_zone: zone)endit 'returns countries from those zones' do@@ -787,7 +787,7 @@ describe Spree::Store, type: :model, without_global_store: true dobefore dozone.members.create!(member_type: 'state', state: state)- create(:shipping_method, delivery_zones: [zone])+ create(:shipping_method, delivery_zone: zone)endit 'returns countries inferred from state-type zones' do@@ -825,8 +825,8 @@ describe Spree::Store, type: :model, without_global_store: true dobefore dozone1.members.create!(member_type: 'country', country: country)zone2.members.create!(member_type: 'country', country: country)- create(:shipping_method, delivery_zones: [zone1])- create(:shipping_method, delivery_zones: [zone2])+ create(:shipping_method, delivery_zone: zone1)+ create(:shipping_method, delivery_zone: zone2)endit 'deduplicates countries' dodiff --git a/spree/core/spec/models/spree/variant_spec.rb b/spree/core/spec/models/spree/variant_spec.rbindex c2aed7d452..ee917ceb3e 100644--- a/spree/core/spec/models/spree/variant_spec.rb+++ b/spree/core/spec/models/spree/variant_spec.rb@@ -1554,23 +1554,4 @@ describe Spree::Variant, type: :model doendend- describe 'legacy shipping category bridge' do- let(:shipping_category) { create(:shipping_category, name: 'Legacy') }- let(:variant) { create(:variant) }-- before do- variant.product.update_column(:shipping_category_id, shipping_category.id)- variant.product.reload- end-- it 'still reads through to the product, with a deprecation warning' do- expect(Spree::Deprecation).to receive(:warn).at_least(:once)- expect(variant.shipping_category).to eq shipping_category- end-- it 'still reads the id through to the product, with a deprecation warning' do- expect(Spree::Deprecation).to receive(:warn).at_least(:once)- expect(variant.shipping_category_id).to eq shipping_category.id- end- endenddiff --git a/spree/core/spec/presenters/spree/csv/product_variant_presenter_spec.rb b/spree/core/spec/presenters/spree/csv/product_variant_presenter_spec.rbindex 7d3cd6db17..56f8ced318 100644--- a/spree/core/spec/presenters/spree/csv/product_variant_presenter_spec.rb+++ b/spree/core/spec/presenters/spree/csv/product_variant_presenter_spec.rb@@ -207,7 +207,7 @@ RSpec.describe Spree::CSV::ProductVariantPresenter dodescribe 'product_type' docontext 'when the product has a product type' do- let(:product_type) { create(:product_type, name: 'Digital', fulfillment_types: ['digital']) }+ let(:product_type) { create(:product_type, name: 'Digital') }let(:product) { create(:product, product_type: product_type) }it 'exports the product type name' dodiff --git a/spree/core/spec/services/spree/carts/update_spec.rb b/spree/core/spec/services/spree/carts/update_spec.rbindex e3c62a18fb..d61483b916 100644--- a/spree/core/spec/services/spree/carts/update_spec.rb+++ b/spree/core/spec/services/spree/carts/update_spec.rb@@ -117,9 +117,6 @@ module Spree# counter, so the warehouse-sourced package is collectable.pickup_location.update!(pickup_stock_policy: 'any')no_address_cart = create(:cart_with_line_items, customer: user, store: store, ship_address: nil)- # Pickup is only offered when every item's product type supports it.- pickup_capable_type = create(:product_type, fulfillment_types: %w[shipping pickup])- no_address_cart.line_items.each { |line_item| line_item.variant.product.update!(product_type: pickup_capable_type) }result = described_class.call(cart: no_address_cart,@@ -129,7 +126,7 @@ module Spreeexpect(result).to be_successfulfillments = result.value.reload.fulfillmentsexpect(fulfillments).to be_present- expect(fulfillments.flat_map(&:delivery_rates).map(&:delivery_method)).to all(have_attributes(fulfillment_type: 'pickup'))+ expect(fulfillments.flat_map(&:delivery_rates).map(&:delivery_method)).to all(be_pickup)endend@@ -775,11 +772,11 @@ module Spreephone: '555-0100'} }end- # no delivery method serves the pickup fulfillment type in this suite- let(:pickup_only_type) { create(:product_type, name: "Pickup #{SecureRandom.hex(4)}", fulfillment_types: ['pickup']) }+ # a profile with no delivery methods cannot fulfill anything+ let(:empty_profile) { create(:delivery_profile, store: store, name: "Empty #{SecureRandom.hex(4)}") }before do- cart.line_items.each { |line_item| line_item.variant.product.update!(product_type: pickup_only_type) }+ cart.line_items.each { |line_item| line_item.variant.product.update!(delivery_profile: empty_profile) }cart.reloadenddiff --git a/spree/core/spec/services/spree/checkout/advance_spec.rb b/spree/core/spec/services/spree/checkout/advance_spec.rbindex 797e7dec92..adb97d5b76 100644--- a/spree/core/spec/services/spree/checkout/advance_spec.rb+++ b/spree/core/spec/services/spree/checkout/advance_spec.rb@@ -23,11 +23,9 @@ module Spreeit 'proposes fulfillments for a pure-pickup cart with no shipping address' dopickup_location = create(:stock_location, pickup_enabled: true, pickup_stock_policy: 'any', store: store)create(:pickup_delivery_method, store: store)- pickup_capable_type = create(:product_type, fulfillment_types: %w[shipping pickup])cart.fulfillments.destroy_allcart.update!(ship_address: nil, preferred_stock_location_id: pickup_location.id)- cart.line_items.each { |line_item| line_item.variant.product.update!(product_type: pickup_capable_type) }cart.reloadexpect(subject).to be_successdiff --git a/spree/core/spec/services/spree/imports/row_processors/product_variant_spec.rb b/spree/core/spec/services/spree/imports/row_processors/product_variant_spec.rbindex 0f080ca8bf..6e044eeda2 100644--- a/spree/core/spec/services/spree/imports/row_processors/product_variant_spec.rb+++ b/spree/core/spec/services/spree/imports/row_processors/product_variant_spec.rb@@ -809,7 +809,8 @@ RSpec.describe Spree::Imports::RowProcessors::ProductVariant, type: :service dolet(:product) { subject.process! }context 'when the product type exists' do- let!(:digital_type) { create(:product_type, name: 'Digital', store: store, fulfillment_types: ['digital']) }+ let!(:digital_profile) { create(:digital_delivery_profile, store: store) }+ let!(:digital_type) { create(:product_type, name: 'Digital', store: store, delivery_profile: digital_profile) }let(:row_data) docsv_row_hash(@@ -822,9 +823,9 @@ RSpec.describe Spree::Imports::RowProcessors::ProductVariant, type: :service do)end- it 'assigns it and inherits its fulfillment types' do+ it 'assigns it and stamps its template delivery profile' doexpect(product.product_type).to eq digital_type- expect(product.fulfillment_types).to eq ['digital']+ expect(product.delivery_profile).to eq digital_profileendend@@ -840,16 +841,16 @@ RSpec.describe Spree::Imports::RowProcessors::ProductVariant, type: :service do)end- it 'creates it in the store, defaulting to physical shipping' do+ it 'creates it in the store, defaulting to the store default profile' doexpect(product.product_type.name).to eq 'Apparel'expect(product.product_type.store).to eq store- expect(product.fulfillment_types).to eq ['shipping']+ expect(product.delivery_profile).to eq store.default_delivery_profileendendcontext 'when updating a product with a different product_type' dolet!(:apparel_type) { create(:product_type, name: 'Apparel', store: store) }- let!(:digital_type) { create(:product_type, name: 'Digital', store: store, fulfillment_types: ['digital']) }+ let!(:digital_type) { create(:product_type, name: 'Digital', store: store) }let!(:existing_product) docreate(:product, slug: 'product-to-update', name: 'Product', store: store, product_type: apparel_type)end@@ -882,9 +883,9 @@ RSpec.describe Spree::Imports::RowProcessors::ProductVariant, type: :service do)end- it 'leaves it unset and rides the physical shipping default' do+ it 'leaves it unset and rides the store default profile' doexpect(product.product_type).to be_nil- expect(product.fulfillment_types).to eq ['shipping']+ expect(product.delivery_profile).to eq store.default_delivery_profileendendenddiff --git a/spree/core/spec/services/spree/seeds/all_spec.rb b/spree/core/spec/services/spree/seeds/all_spec.rbindex cb1969910e..cfcd3bed7e 100644--- a/spree/core/spec/services/spree/seeds/all_spec.rb+++ b/spree/core/spec/services/spree/seeds/all_spec.rb@@ -20,5 +20,24 @@ RSpec.describe Spree::Seeds::All doexpect(Spree::RefundReason.where(store: store)).to existexpect(Spree::ProductType.where(store: store)).to existend++ it 'gives the seeded store a digital profile holding the digital delivery method' do+ subject++ store = Spree::Store.find_by(default: true)+ profile = Spree::DeliveryProfiles::Digital.find_by(store: store)++ expect(profile).to be_present+ expect(profile.delivery_methods.map(&:fulfillment_provider)).to eq(['Spree::FulfillmentProvider::Digital'])+ end++ it 'gives the seeded store a pickup method with a collectable location' do+ subject++ store = Spree::Store.find_by(default: true)++ expect(store.delivery_methods.select(&:pickup?)).to be_present+ expect(store.stock_locations.where(pickup_enabled: true)).to exist+ endendenddiff --git a/spree/core/spec/services/spree/seeds/delivery_zones_spec.rb b/spree/core/spec/services/spree/seeds/delivery_zones_spec.rbindex 6728a67a65..b59b42c159 100644--- a/spree/core/spec/services/spree/seeds/delivery_zones_spec.rb+++ b/spree/core/spec/services/spree/seeds/delivery_zones_spec.rb@@ -21,11 +21,11 @@ RSpec.describe Spree::Seeds::DeliveryZones doexpect(international.members.map(&:country)).not_to include(store.default_country)standard = store.delivery_methods.find_by(name: 'Standard')- expect(standard.delivery_zones).to eq([domestic])+ expect(standard.delivery_zone).to eq(domestic)expect(standard.calculator.preferred_amount).to eq(5)international_method = store.delivery_methods.find_by(name: 'International Shipping')- expect(international_method.delivery_zones).to eq([international])+ expect(international_method.delivery_zone).to eq(international)endit 'is idempotent' dodiff --git a/spree/core/spec/services/spree/seeds/digital_delivery_spec.rb b/spree/core/spec/services/spree/seeds/digital_delivery_spec.rbindex 7ae9429d8c..14bb1e7ca2 100644--- a/spree/core/spec/services/spree/seeds/digital_delivery_spec.rb+++ b/spree/core/spec/services/spree/seeds/digital_delivery_spec.rb@@ -10,8 +10,8 @@ RSpec.describe Spree::Seeds::DigitalDelivery dodelivery_method = Spree::DeliveryMethod.find_by(name: Spree.t('digital.digital_delivery'))expect(delivery_method).to be_presentexpect(delivery_method.storefront_visible).to be true- expect(delivery_method.fulfillment_type).to eq('digital')expect(delivery_method).to be_digital+ expect(delivery_method.delivery_profile).to be_a(Spree::DeliveryProfiles::Digital)expect(delivery_method.calculator).to be_a(Spree::Calculator::Shipping::DigitalDelivery)end@@ -19,8 +19,11 @@ RSpec.describe Spree::Seeds::DigitalDelivery dobefore doSpree::DeliveryMethod.create!(name: Spree.t('digital.digital_delivery'),+ store: Spree::Store.default,storefront_visible: true,- fulfillment_type: 'digital',+ fulfillment_provider: 'Spree::FulfillmentProvider::Digital',+ delivery_profile: Spree::DeliveryProfiles::Digital.find_by(store: Spree::Store.default) ||+ Spree::DeliveryProfiles::Digital.create!(store: Spree::Store.default, name: 'Digital'),calculator: Spree::Calculator::Shipping::DigitalDelivery.create!)enddiff --git a/spree/core/spec/services/spree/seeds/pickup_delivery_spec.rb b/spree/core/spec/services/spree/seeds/pickup_delivery_spec.rbnew file mode 100644index 0000000000..14ae972fdb--- /dev/null+++ b/spree/core/spec/services/spree/seeds/pickup_delivery_spec.rb@@ -0,0 +1,44 @@+require 'spec_helper'++RSpec.describe Spree::Seeds::PickupDelivery do+ subject { described_class.call }++ let(:store) { @default_store }++ # The suite's shared store carries no locations, so the seed's subject —+ # a default counter to collect from — has to exist first.+ let!(:default_location) { create(:stock_location, store: store, default: true, pickup_enabled: false) }++ it 'creates a zoneless pickup method on the default profile' do+ subject++ delivery_method = store.delivery_methods.find_by(name: Spree.t('pickup.store_pickup'))++ expect(delivery_method).to be_present+ expect(delivery_method).to be_pickup+ expect(delivery_method.delivery_profile).to eq(store.default_delivery_profile)+ # Pickup has an origin, not a destination — a zone would wrongly filter it+ # against the customer's shipping address.+ expect(delivery_method.delivery_zone).to be_nil+ expect(delivery_method.requires_address?).to be false+ end++ it 'opens the default stock location for collection' do+ expect { subject }.to change { store.stock_locations.where(pickup_enabled: true).count }.from(0)+ end++ it 'leaves an existing pickup location choice alone' do+ counter = create(:stock_location, store: store, pickup_enabled: true, default: false)++ subject++ expect(store.stock_locations.where(pickup_enabled: true)).to eq([counter])+ expect(default_location.reload.pickup_enabled).to be false+ end++ it 'is idempotent' do+ described_class.call++ expect { subject }.not_to change(Spree::DeliveryMethod, :count)+ end+enddiff --git a/spree/core/spec/services/spree/seeds/product_types_spec.rb b/spree/core/spec/services/spree/seeds/product_types_spec.rbindex 5b2ee6d859..cd59e0c965 100644--- a/spree/core/spec/services/spree/seeds/product_types_spec.rb+++ b/spree/core/spec/services/spree/seeds/product_types_spec.rb@@ -7,8 +7,8 @@ RSpec.describe Spree::Seeds::ProductTypes dosubjecttypes = Spree::ProductType.where(store: @default_store)- expect(types.find_by(name: 'Default').fulfillment_types).to eq(['shipping'])- expect(types.find_by(name: 'Digital').fulfillment_types).to eq(['digital'])+ expect(types.find_by(name: 'Default').delivery_profile).to be_nil+ expect(types.find_by(name: 'Digital').delivery_profile).to be_a(Spree::DeliveryProfiles::Digital)endit 'is idempotent' dodiff --git a/spree/providers/easypost/Gemfile.lock b/spree/providers/easypost/Gemfile.lockdeleted file mode 100644index fb5852fdea..0000000000--- a/spree/providers/easypost/Gemfile.lock+++ /dev/null@@ -1,902 +0,0 @@-PATH- remote: ../..- specs:- spree (6.0.0.alpha)- spree_api (= 6.0.0.alpha)- spree_core (= 6.0.0.alpha)- spree_api (6.0.0.alpha)- alba (~> 3.0)- oj (~> 3.16)- spree_core (= 6.0.0.alpha)- typelizer (~> 0.11.0)- spree_core (6.0.0.alpha)- active_storage_validations (>= 1.3, < 4)- acts-as-taggable-on- acts_as_list (>= 0.8)- ar_lazy_preload (~> 2.0)- awesome_nested_set (~> 3.3, >= 3.3.1)- bcrypt (~> 3.1)- benchmark- cancancan (~> 3.2)- carmen (>= 1.0)- countries- friendly_id (~> 5.2, >= 5.2.1)- friendly_id-mobility (~> 1.0)- geocoder- highline (>= 2, < 4)- image_processing (~> 1.2)- jwt (~> 3.1)- mobility (~> 1.3, >= 1.3.2)- mobility-actiontext (~> 1.1)- mobility-ransack (~> 1.2)- monetize (~> 1.9)- money (~> 6.13)- name_of_person (~> 1.1)- nokogiri (~> 1.18)- ostruct- pagy (>= 43.3)- paranoia (>= 2.4)- phonelib (~> 0.10)- rails (>= 8.1, < 8.2)- rails-html-sanitizer (~> 1.6)- ransack (>= 4.1)- request_store (~> 1.5)- rexml- safely_block (>= 0.4, < 2.0)- sqids (~> 0.2)- ssrf_filter (~> 1.0)- state_machines-activemodel (~> 0.100)- state_machines-activerecord (~> 0.100)- stringex- tracking_number- validates_zipcode- wannabe_bool--PATH- remote: .- specs:- spree_easypost (6.0.0.alpha)- easypost (~> 7.0)- spree_core (>= 6.0.0.alpha)--GEM- remote: https://rubygems.org/- specs:- action_text-trix (2.1.19)- railties- actioncable (8.1.3.1)- actionpack (= 8.1.3.1)- activesupport (= 8.1.3.1)- nio4r (~> 2.0)- websocket-driver (>= 0.6.1)- zeitwerk (~> 2.6)- actionmailbox (8.1.3.1)- actionpack (= 8.1.3.1)- activejob (= 8.1.3.1)- activerecord (= 8.1.3.1)- activestorage (= 8.1.3.1)- activesupport (= 8.1.3.1)- mail (>= 2.8.0)- actionmailer (8.1.3.1)- actionpack (= 8.1.3.1)- actionview (= 8.1.3.1)- activejob (= 8.1.3.1)- activesupport (= 8.1.3.1)- mail (>= 2.8.0)- rails-dom-testing (~> 2.2)- actionpack (8.1.3.1)- actionview (= 8.1.3.1)- activesupport (= 8.1.3.1)- nokogiri (>= 1.8.5)- rack (>= 2.2.4)- rack-session (>= 1.0.1)- rack-test (>= 0.6.3)- rails-dom-testing (~> 2.2)- rails-html-sanitizer (~> 1.6)- useragent (~> 0.16)- actiontext (8.1.3.1)- action_text-trix (~> 2.1.15)- actionpack (= 8.1.3.1)- activerecord (= 8.1.3.1)- activestorage (= 8.1.3.1)- activesupport (= 8.1.3.1)- globalid (>= 0.6.0)- nokogiri (>= 1.8.5)- actionview (8.1.3.1)- activesupport (= 8.1.3.1)- builder (~> 3.1)- erubi (~> 1.11)- rails-dom-testing (~> 2.2)- rails-html-sanitizer (~> 1.6)- active_storage_validations (3.0.6)- activejob (>= 6.1.4)- activemodel (>= 6.1.4)- activestorage (>= 6.1.4)- activesupport (>= 6.1.4)- marcel (>= 1.0.3)- activejob (8.1.3.1)- activesupport (= 8.1.3.1)- globalid (>= 0.3.6)- activemodel (8.1.3.1)- activesupport (= 8.1.3.1)- activerecord (8.1.3.1)- activemodel (= 8.1.3.1)- activesupport (= 8.1.3.1)- timeout (>= 0.4.0)- activestorage (8.1.3.1)- actionpack (= 8.1.3.1)- activejob (= 8.1.3.1)- activerecord (= 8.1.3.1)- activesupport (= 8.1.3.1)- marcel (~> 1.0)- activesupport (8.1.3.1)- base64- bigdecimal- concurrent-ruby (~> 1.0, >= 1.3.1)- connection_pool (>= 2.2.5)- drb- i18n (>= 1.6, < 2)- json- logger (>= 1.4.2)- minitest (>= 5.1)- securerandom (>= 0.3)- tzinfo (~> 2.0, >= 2.0.5)- uri (>= 0.13.1)- acts-as-taggable-on (13.0.0)- activerecord (>= 7.1, < 8.2)- zeitwerk (>= 2.4, < 3.0)- acts_as_list (1.2.6)- activerecord (>= 6.1)- activesupport (>= 6.1)- addressable (2.9.0)- public_suffix (>= 2.0.2, < 8.0)- alba (3.11.0)- ar_lazy_preload (2.1.2)- ast (2.4.3)- awesome_nested_set (3.9.0)- activerecord (>= 4.0.0, < 8.2)- awesome_print (1.9.2)- backport (1.2.0)- base64 (0.3.0)- bcrypt (3.1.22)- benchmark (0.5.0)- bigdecimal (4.1.2)- brakeman (8.0.5)- racc- builder (3.3.0)- bundler-audit (0.9.3)- bundler (>= 1.2.0)- thor (~> 1.0)- byebug (13.0.0)- reline (>= 0.6.0)- cancancan (3.6.1)- carmen (1.1.3)- activesupport (>= 3.0.0)- childprocess (5.1.0)- logger (~> 1.5)- coderay (1.1.3)- commander (5.0.0)- highline (~> 3.0.0)- concurrent-ruby (1.3.8)- connection_pool (3.0.2)- countries (8.1.0)- unaccent (~> 0.3)- crack (1.0.1)- bigdecimal- rexml- crass (1.0.7)- csv (3.3.6)- database_cleaner-active_record (2.2.2)- activerecord (>= 5.a)- database_cleaner-core (~> 2.0)- database_cleaner-core (2.1.0)- date (3.5.1)- diff-lcs (1.6.2)- docile (1.4.1)- drb (2.2.3)- easypost (7.7.0)- base64 (~> 0.3)- email_spec (2.3.1)- htmlentities (~> 4.3)- launchy (>= 2.1, < 4.0)- mail (~> 2.7)- erb (6.0.7)- erubi (1.13.1)- factory_bot (6.2.1)- activesupport (>= 5.0.0)- factory_bot_rails (6.2.0)- factory_bot (~> 6.2.0)- railties (>= 5.0.0)- ffaker (2.25.0)- ffi (1.17.4-aarch64-linux-gnu)- ffi (1.17.4-aarch64-linux-musl)- ffi (1.17.4-arm-linux-gnu)- ffi (1.17.4-arm-linux-musl)- ffi (1.17.4-arm64-darwin)- ffi (1.17.4-x86_64-darwin)- ffi (1.17.4-x86_64-linux-gnu)- ffi (1.17.4-x86_64-linux-musl)- friendly_id (5.5.1)- activerecord (>= 4.0.0)- friendly_id-mobility (1.0.5)- friendly_id (>= 5.0.0, < 5.6)- mobility (>= 1.0.1, < 2.0)- gem-release (2.2.4)- geocoder (1.8.6)- base64 (>= 0.1.0)- csv (>= 3.0.0)- globalid (1.4.0)- activesupport (>= 6.1)- hashdiff (1.2.1)- highline (3.0.1)- htmlentities (4.4.2)- httparty (0.24.2)- csv- mini_mime (>= 1.0.0)- multi_xml (>= 0.5.2)- i18n (1.15.2)- concurrent-ruby (~> 1.0)- i18n-tasks (1.1.2)- activesupport (>= 4.0.2)- ast (>= 2.1.0)- erubi- highline (>= 3.0.0)- i18n- parser (>= 3.2.2.1)- prism- rails-i18n- rainbow (>= 2.2.2, < 4.0)- ruby-progressbar (~> 1.8, >= 1.8.1)- terminal-table (>= 1.5.1)- image_processing (1.14.0)- mini_magick (>= 4.9.5, < 6)- ruby-vips (>= 2.0.17, < 3)- io-console (0.8.2)- irb (1.18.0)- pp (>= 0.6.0)- prism (>= 1.3.0)- rdoc (>= 4.0.0)- reline (>= 0.4.2)- jaro_winkler (1.7.0)- json (2.21.2)- json-schema (6.2.0)- addressable (~> 2.8)- bigdecimal (>= 3.1, < 5)- jwt (3.2.0)- base64- kramdown (2.5.2)- rexml (>= 3.4.4)- kramdown-parser-gfm (1.1.0)- kramdown (~> 2.0)- language_server-protocol (3.17.0.6)- launchy (3.1.1)- addressable (~> 2.8)- childprocess (~> 5.0)- logger (~> 1.6)- license_finder (7.2.1)- bundler- csv (~> 3.2)- rubyzip (>= 1, < 3)- thor (~> 1.2)- tomlrb (>= 1.3, < 2.1)- with_env (= 1.1.0)- xml-simple (~> 1.1.9)- lint_roller (1.1.0)- logger (1.7.0)- loofah (2.25.2)- crass (~> 1.0.2)- nokogiri (>= 1.12.0)- mail (2.9.1)- logger- mini_mime (>= 0.1.1)- net-imap- net-pop- net-smtp- marcel (1.2.1)- meilisearch (0.33.0)- httparty (~> 0.24)- method_source (1.1.0)- mini_magick (5.3.3)- logger- mini_mime (1.1.5)- minitest (6.0.6)- drb (~> 2.0)- prism (~> 1.5)- mobility (1.3.2)- i18n (>= 0.6.10, < 2)- request_store (~> 1.0)- mobility-actiontext (1.1.1)- actiontext (>= 6.0)- mobility (~> 1.2)- mobility-ransack (1.2.2)- mobility (>= 1.0.1, < 2.0)- ransack (>= 1.8.0, < 5.0)- monetize (1.13.0)- money (~> 6.12)- money (6.19.0)- i18n (>= 0.6.4, <= 2)- multi_xml (0.9.1)- bigdecimal (>= 3.1, < 5)- name_of_person (1.1.3)- activesupport (>= 5.2.0)- net-imap (0.6.6)- date- net-protocol- net-pop (0.1.2)- net-protocol- net-protocol (0.2.2)- timeout- net-smtp (0.5.1)- net-protocol- nio4r (2.7.5)- nokogiri (1.19.4-aarch64-linux-gnu)- racc (~> 1.4)- nokogiri (1.19.4-aarch64-linux-musl)- racc (~> 1.4)- nokogiri (1.19.4-arm-linux-gnu)- racc (~> 1.4)- nokogiri (1.19.4-arm-linux-musl)- racc (~> 1.4)- nokogiri (1.19.4-arm64-darwin)- racc (~> 1.4)- nokogiri (1.19.4-x86_64-darwin)- racc (~> 1.4)- nokogiri (1.19.4-x86_64-linux-gnu)- racc (~> 1.4)- nokogiri (1.19.4-x86_64-linux-musl)- racc (~> 1.4)- observer (0.1.2)- oj (3.17.5)- bigdecimal (>= 3.0)- ostruct (>= 0.2)- open3 (0.2.1)- ostruct (0.6.3)- pagy (43.6.1)- json- uri- yaml- parallel (2.1.0)- parallel_tests (5.7.0)- parallel- paranoia (3.1.0)- activerecord (>= 7, < 8.2)- parlour (9.1.2)- commander (~> 5.0)- parser- rainbow (~> 3.0)- sorbet-runtime (>= 0.5)- parser (3.3.12.0)- ast (~> 2.4.1)- racc- phonelib (0.10.23)- pp (0.6.4)- prettyprint- prettyprint (0.2.0)- prism (1.9.0)- pry (0.16.0)- coderay (~> 1.1)- method_source (~> 1.0)- reline (>= 0.6.0)- pry-byebug (3.12.0)- byebug (~> 13.0)- pry (>= 0.13, < 0.17)- psych (5.4.0)- date- stringio- public_suffix (7.0.5)- puma (8.0.2)- nio4r (~> 2.0)- racc (1.8.1)- rack (3.2.6)- rack-session (2.1.2)- base64 (>= 0.1.0)- rack (>= 3.0.0)- rack-test (2.2.0)- rack (>= 1.3)- rackup (2.3.1)- rack (>= 3)- rails (8.1.3.1)- actioncable (= 8.1.3.1)- actionmailbox (= 8.1.3.1)- actionmailer (= 8.1.3.1)- actionpack (= 8.1.3.1)- actiontext (= 8.1.3.1)- actionview (= 8.1.3.1)- activejob (= 8.1.3.1)- activemodel (= 8.1.3.1)- activerecord (= 8.1.3.1)- activestorage (= 8.1.3.1)- activesupport (= 8.1.3.1)- bundler (>= 1.15.0)- railties (= 8.1.3.1)- rails-controller-testing (1.0.5)- actionpack (>= 5.0.1.rc1)- actionview (>= 5.0.1.rc1)- activesupport (>= 5.0.1.rc1)- rails-dom-testing (2.3.0)- activesupport (>= 5.0.0)- minitest- nokogiri (>= 1.6)- rails-html-sanitizer (1.7.1)- loofah (~> 2.25, >= 2.25.2)- nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)- rails-i18n (8.1.0)- i18n (>= 0.7, < 2)- railties (>= 8.0.0, < 9)- railties (8.1.3.1)- actionpack (= 8.1.3.1)- activesupport (= 8.1.3.1)- irb (~> 1.13)- rackup (>= 1.0.0)- rake (>= 12.2)- thor (~> 1.0, >= 1.2.2)- tsort (>= 0.2)- zeitwerk (~> 2.6)- rainbow (3.1.1)- rake (13.4.2)- ransack (4.4.1)- activerecord (>= 7.2)- activesupport (>= 7.2)- i18n- rbs (4.1.2)- logger- prism (>= 1.6.0)- tsort- rdoc (7.2.0)- erb- psych (>= 4.0.0)- tsort- regexp_parser (2.12.0)- reline (0.7.0)- io-console (~> 0.5)- request_store (1.7.0)- rack (>= 1.4)- reverse_markdown (3.0.2)- nokogiri- rexml (3.4.4)- rspec-core (3.13.6)- rspec-support (~> 3.13.0)- rspec-expectations (3.13.5)- diff-lcs (>= 1.2.0, < 2.0)- rspec-support (~> 3.13.0)- rspec-mocks (3.13.8)- diff-lcs (>= 1.2.0, < 2.0)- rspec-support (~> 3.13.0)- rspec-rails (8.0.4)- actionpack (>= 7.2)- activesupport (>= 7.2)- railties (>= 7.2)- rspec-core (>= 3.13.0, < 5.0.0)- rspec-expectations (>= 3.13.0, < 5.0.0)- rspec-mocks (>= 3.13.0, < 5.0.0)- rspec-support (>= 3.13.0, < 5.0.0)- rspec-retry (0.6.2)- rspec-core (> 3.3)- rspec-support (3.13.7)- rspec_junit_formatter (0.6.0)- rspec-core (>= 2, < 4, != 2.12.0)- rswag-specs (2.17.0)- activesupport (>= 5.2, < 8.2)- json-schema (>= 2.2, < 7.0)- railties (>= 5.2, < 8.2)- rspec-core (>= 2.14)- rubocop (1.89.0)- json (~> 2.3)- language_server-protocol (~> 3.17.0.2)- lint_roller (~> 1.1.0)- parallel (>= 1.10)- parser (>= 3.3.0.2)- rainbow (>= 2.2.2, < 4.0)- regexp_parser (>= 2.9.3, < 3.0)- rubocop-ast (>= 1.49.0, < 2.0)- ruby-progressbar (~> 1.7)- unicode-display_width (>= 2.4.0, < 4.0)- rubocop-ast (1.50.0)- parser (>= 3.3.7.2)- prism (~> 1.7)- rubocop-rspec (3.10.2)- lint_roller (~> 1.1)- regexp_parser (>= 2.0)- rubocop (~> 1.86, >= 1.86.2)- ruby-lsp (0.26.10)- language_server-protocol (~> 3.17.0)- prism (>= 1.2, < 2.0)- rbs (>= 3, < 5)- ruby-lsp-rails (0.4.8)- ruby-lsp (>= 0.26.0, < 0.27.0)- ruby-progressbar (1.13.0)- ruby-vips (2.3.0)- ffi (~> 1.12)- logger- rubyzip (2.4.1)- safely_block (1.0.0)- securerandom (0.4.1)- shoulda-matchers (6.5.0)- activesupport (>= 5.2.0)- simplecov (0.22.0)- docile (~> 1.1)- simplecov-html (~> 0.11)- simplecov_json_formatter (~> 0.1)- simplecov-cobertura (3.2.0)- rexml- simplecov (~> 0.19)- simplecov-html (0.13.2)- simplecov_json_formatter (0.1.4)- solargraph (0.60.3)- ast (~> 2.4.3)- backport (~> 1.2)- benchmark (~> 0.4)- bundler (>= 2.0)- diff-lcs (~> 1.4)- jaro_winkler (~> 1.6, >= 1.6.1)- kramdown (~> 2.3)- kramdown-parser-gfm (~> 1.1)- logger (~> 1.6)- observer (~> 0.1)- open3 (~> 0.2.1)- ostruct (~> 0.6)- parser (~> 3.0)- prism (~> 1.4)- rbs (>= 3.10.0)- rdoc (~> 7.0)- reverse_markdown (~> 3.0)- rubocop (~> 1.76)- sord (~> 7.0)- thor (~> 1.0)- tilt (~> 2.0)- yard (~> 0.9, >= 0.9.24)- yard-activesupport-concern (~> 0.0)- yard-solargraph (~> 0.1)- sorbet-runtime (0.6.13412)- sord (7.1.0)- commander (~> 5.0)- parlour (~> 9.1)- parser- rbs (>= 3.0, < 5)- sorbet-runtime- yard- sqids (0.2.2)- sqlite3 (2.9.5-aarch64-linux-gnu)- sqlite3 (2.9.5-aarch64-linux-musl)- sqlite3 (2.9.5-arm-linux-gnu)- sqlite3 (2.9.5-arm-linux-musl)- sqlite3 (2.9.5-arm64-darwin)- sqlite3 (2.9.5-x86_64-darwin)- sqlite3 (2.9.5-x86_64-linux-gnu)- sqlite3 (2.9.5-x86_64-linux-musl)- ssrf_filter (1.5.0)- state_machines (0.202.0)- state_machines-activemodel (0.200.0)- activemodel (>= 7.2)- state_machines (>= 0.200.0)- state_machines-activerecord (0.200.0)- activerecord (>= 7.2)- state_machines-activemodel (>= 0.200.0)- stringex (2.8.6)- stringio (3.2.0)- terminal-table (4.0.0)- unicode-display_width (>= 1.1.1, < 4)- thor (1.5.0)- tilt (2.8.0)- timecop (0.9.11)- timeout (0.6.1)- tomlrb (2.0.4)- tracking_number (2.4.0)- activesupport (>= 4.2.5)- json (>= 1.8.3)- tsort (0.2.0)- typelizer (0.11.0)- benchmark- railties (>= 6.0.0)- tzinfo (2.0.6)- concurrent-ruby (~> 1.0)- unaccent (0.4.0)- unicode-display_width (3.2.0)- unicode-emoji (~> 4.1)- unicode-emoji (4.2.0)- uri (1.1.1)- useragent (0.16.11)- validates_zipcode (0.6.0)- activemodel (>= 4.2.0)- vcr (6.4.0)- wannabe_bool (0.7.1)- webmock (3.26.2)- addressable (>= 2.8.0)- crack (>= 0.3.2)- hashdiff (>= 0.4.0, < 2.0.0)- websocket-driver (0.8.2)- base64- websocket-extensions (>= 0.1.0)- websocket-extensions (0.1.5)- with_env (1.1.0)- xml-simple (1.1.9)- rexml- yaml (0.4.0)- yard (0.9.45)- yard-activesupport-concern (0.0.1)- yard (>= 0.8)- yard-solargraph (0.1.0)- yard (~> 0.9)- zeitwerk (2.8.3)--PLATFORMS- aarch64-linux-gnu- aarch64-linux-musl- arm-linux-gnu- arm-linux-musl- arm64-darwin- x86_64-darwin- x86_64-linux-gnu- x86_64-linux-musl--DEPENDENCIES- awesome_print- brakeman- bundler-audit- database_cleaner-active_record- email_spec- factory_bot_rails (~> 6.2.0)- ffaker- gem-release- i18n-tasks- jruby-openssl- license_finder- meilisearch (>= 0.28)- observer- parallel_tests- pry-byebug- puma- rails (~> 8.1.0)- rails-controller-testing- rspec-rails- rspec-retry- rspec_junit_formatter- rswag-specs- rubocop (~> 1.0)- rubocop-rspec- ruby-lsp- ruby-lsp-rails- shoulda-matchers (~> 6.0)- simplecov (~> 0.22.0)- simplecov-cobertura- solargraph- spree!- spree_easypost!- sqlite3 (>= 2.0)- timecop- tzinfo-data- vcr- webmock--CHECKSUMS- action_text-trix (2.1.19) sha256=7012f59421009cf284aa651294896414d653a61a2417c9b8714c8476d2f74009- actioncable (8.1.3.1) sha256=e318528295c878a3efdfe25f0f2267c80cb7a76eba41bb5f64d44aa380a3d91b- actionmailbox (8.1.3.1) sha256=5f704972097d843ade8e435e93694a1dac732b926df1717aceba1f3840082b1c- actionmailer (8.1.3.1) sha256=88ea441b28ff02a0c6c006468892642a3d9942affce9d294e81a74504aa5c43c- actionpack (8.1.3.1) sha256=974cb7154548e81f470b1b0f247b99cb38e87825899dca58610596e2817723d0- actiontext (8.1.3.1) sha256=5da729d833d1a29cddb1eee938878e55e503d2613e00e735f5daf58c2ba98af2- actionview (8.1.3.1) sha256=2da68b8414c47b43bfbed1ce69c5afe1c04f78c267aacb5660a4cab5ca12cfb6- active_storage_validations (3.0.6) sha256=07ec758b75b68f8a906bcb96f6135c2f9a03ef8b82dbd8ce8ba52fde60c90531- activejob (8.1.3.1) sha256=1c8dd275df930df40deecffec63d913a550a33fd94bd298f69721dd96939954a- activemodel (8.1.3.1) sha256=99cc02ce2faec371d14440949d85787ebd23a907c9baef0a9d4bcd4d21888f88- activerecord (8.1.3.1) sha256=0a2fb6c28f4938f6b013a3a549bec0a7e37d535f3dc8990e804bcc3258c0403b- activestorage (8.1.3.1) sha256=f555254f387b1cffa499d2fd3115d12635eadc5b15206a8534316a67036163ef- activesupport (8.1.3.1) sha256=85458765f25ea48b9019c46b6bb3fa5683197bf4280d9f06710a6e8d7a831376- acts-as-taggable-on (13.0.0) sha256=dca776c6ddebc458d175b57554ad692488e283f27047117e01ed871f1cba6135- acts_as_list (1.2.6) sha256=8345380900b7bee620c07ad00991ccee59af3d8c9e8574f426e321da2865fdc8- addressable (2.9.0) sha256=7fdf6ac3660f7f4e867a0838be3f6cf722ace541dd97767fa42bc6cfa980c7af- alba (3.11.0) sha256=a9e7ad2db045490955b2d58cc5a2eeb0db7462ce3c32ec6de1f536e7fe506769- ar_lazy_preload (2.1.2) sha256=43bb0140ada85c1d605d4430db4d9af40e8e3c5e0aed774eeaefaa95256677c2- ast (2.4.3) sha256=954615157c1d6a382bc27d690d973195e79db7f55e9765ac7c481c60bdb4d383- awesome_nested_set (3.9.0) sha256=3ce99e816550f97f4de118e621630070aacf24928b920fe4a68846578a8daaed- awesome_print (1.9.2) sha256=e99b32b704acff16d768b3468680793ced40bfdc4537eb07e06a4be11133786e- backport (1.2.0) sha256=912c7dfdd9ee4625d013ddfccb6205c3f92da69a8990f65c440e40f5b2fc7f75- base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b- bcrypt (3.1.22) sha256=1f0072e88c2d705d94aff7f2c5cb02eb3f1ec4b8368671e19112527489f29032- benchmark (0.5.0) sha256=465df122341aedcb81a2a24b4d3bd19b6c67c1530713fd533f3ff034e419236c- bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd- brakeman (8.0.5) sha256=03735f9690d3fd4b32d66aacbf0a6d15a84266bdd06b32c05c8ecc8f6021d2be- builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f- bundler-audit (0.9.3) sha256=81c8766c71e47d0d28a0f98c7eed028539f21a6ea3cd8f685eb6f42333c9b4e9- byebug (13.0.0) sha256=d2263efe751941ca520fa29744b71972d39cbc41839496706f5d9b22e92ae05d- cancancan (3.6.1) sha256=975c1d5cbf58d5df48a9452a7f61ae3d254608cd87570402f5925a8864c56b62- carmen (1.1.3) sha256=970dbcb6a1743f0c7d765ebf4f0e5b59e99c4f96460baaa22e7306d5a2952e68- childprocess (5.1.0) sha256=9a8d484be2fd4096a0e90a0cd3e449a05bc3aa33f8ac9e4d6dcef6ac1455b6ec- coderay (1.1.3) sha256=dc530018a4684512f8f38143cd2a096c9f02a1fc2459edcfe534787a7fc77d4b- commander (5.0.0) sha256=22ca42866ce5ed1a7f3e9a9c831a23d03b75b3743c7ad0302c3cbcd9eb5f257d- concurrent-ruby (1.3.8) sha256=b2f1be836e968ccc78ccfce277ea79c72a88633f22306782c16ff23fb415d1e1- connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a- countries (8.1.0) sha256=4d6b318b8e906f1f769d5c021c13a418d33e917dc96ceb625a91d8e7ab2d192e- crack (1.0.1) sha256=ff4a10390cd31d66440b7524eb1841874db86201d5b70032028553130b6d4c7e- crass (1.0.7) sha256=94868719948664c89ddcaf0a37c65048413dfcb1c869470a5f7a7ceb5390b295- csv (3.3.6) sha256=aba61e7e507a66f03d45cb1f3c4b6359861c3504038b422962875dce099e4456- database_cleaner-active_record (2.2.2) sha256=88296b9f3088c31f7c0d4fcec10f68e4b71c96698043916de59b04debec10388- database_cleaner-core (2.1.0) sha256=b2875266d9b26b716e8b669c883e01c5250839f6f2ec56422b5e79aa97fb6927- date (3.5.1) sha256=750d06384d7b9c15d562c76291407d89e368dda4d4fff957eb94962d325a0dc0- diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962- docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e- drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373- easypost (7.7.0) sha256=6eaf69ecc6fcfbee97beec841e485b0592d95abfba82ff98ca0194a449236ea6- email_spec (2.3.1) sha256=5e8891319427fd6de0f3883dffe3c2ac4f5434359a33ed9c48e6d68e9f712f1b- erb (6.0.7) sha256=c5ca6dc25b0ef974a44dc8f59fe847577122483b1968a38dec305c60bf91ee92- erubi (1.13.1) sha256=a082103b0885dbc5ecf1172fede897f9ebdb745a4b97a5e8dc63953db1ee4ad9- factory_bot (6.2.1) sha256=f863e5a7873ef1c6446fdcef8dbb87dc4c3b893d5f75184ae09063d30449d3dd- factory_bot_rails (6.2.0) sha256=278b969666b078e76e1c972c501da9b1fac15e5b0ff328cc7ce400366164d0a1- ffaker (2.25.0) sha256=e485c5adf8195aac55662875b7f515469bca46d77b60d0e7d08db6861bcbec40- ffi (1.17.4-aarch64-linux-gnu) sha256=b208f06f91ffd8f5e1193da3cae3d2ccfc27fc36fba577baf698d26d91c080df- ffi (1.17.4-aarch64-linux-musl) sha256=9286b7a615f2676245283aef0a0a3b475ae3aae2bb5448baace630bb77b91f39- ffi (1.17.4-arm-linux-gnu) sha256=d6dbddf7cb77bf955411af5f187a65b8cd378cb003c15c05697f5feee1cb1564- ffi (1.17.4-arm-linux-musl) sha256=9d4838ded0465bef6e2426935f6bcc93134b6616785a84ffd2a3d82bc3cf6f95- ffi (1.17.4-arm64-darwin) sha256=19071aaf1419251b0a46852abf960e77330a3b334d13a4ab51d58b31a937001b- ffi (1.17.4-x86_64-darwin) sha256=aa70390523cf3235096cf64962b709b4cfbd5c082a2cb2ae714eb0fe2ccda496- ffi (1.17.4-x86_64-linux-gnu) sha256=9d3db14c2eae074b382fa9c083fe95aec6e0a1451da249eab096c34002bc752d- ffi (1.17.4-x86_64-linux-musl) sha256=3fdf9888483de005f8ef8d1cf2d3b20d86626af206cbf780f6a6a12439a9c49e- friendly_id (5.5.1) sha256=e018f2b89bfc143276fee6d378a64792385cd4fddd3d4fce501f59ec19c06207- friendly_id-mobility (1.0.5) sha256=8c0cf4d0a1358311db1b2dcc0e4c33077ae929c7e34749485268d066adbaf2e4- gem-release (2.2.4) sha256=2f11124c1580c811507c3b47e875e420cf3ed792a98105b49df11971e6e94db3- geocoder (1.8.6) sha256=e0ca1554b499f466de9b003f7dff70f89a5888761c2ca68ed9f86b6e5e24e74c- globalid (1.4.0) sha256=037f12fbf1d9d7a014d501c2d5c77356fd4ddd96d7a7991d6700bba96706f427- hashdiff (1.2.1) sha256=9c079dbc513dfc8833ab59c0c2d8f230fa28499cc5efb4b8dd276cf931457cd1- highline (3.0.1) sha256=ca18b218fd581b1fae832f89bfeaf2b34d3a93429c44fd4411042ffce286f009- htmlentities (4.4.2) sha256=bbafbdf69f2eca9262be4efef7e43e6a1de54c95eb600f26984f71d2fe96c5c3- httparty (0.24.2) sha256=8fca6a54aa0c4aa4303a0fd33e5e2156175d6a5334f714263b458abd7fda9c38- i18n (1.15.2) sha256=00f9eb62412fe593b2a65a97daa75300d37abb8f7202ec748e94b6d46a9dd1b5- i18n-tasks (1.1.2) sha256=4dcfba49e52a623f30661cb316cb80d84fbba5cb8c6d88ef5e02545fffa3637a- image_processing (1.14.0) sha256=754cc169c9c262980889bec6bfd325ed1dafad34f85242b5a07b60af004742fb- io-console (0.8.2) sha256=d6e3ae7a7cc7574f4b8893b4fca2162e57a825b223a177b7afa236c5ef9814cc- irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3- jaro_winkler (1.7.0) sha256=8daa05a5cd05bf7d27c1c65caa8ab0d47c05419d80210feaa17126db24044ada- json (2.21.2) sha256=1f1d3b7cf2b3ba1a69beca0bb6db13d5438b80bff3cd54cdaaa620b9b07c1c6a- json-schema (6.2.0) sha256=e8bff46ed845a22c1ab2bd0d7eccf831c01fe23bb3920caa4c74db4306813666- jwt (3.2.0) sha256=5419b1fe37b1da0982bd07051f573a8b8789ab724c2aa7e785e4784a3ed217d7- kramdown (2.5.2) sha256=1ba542204c66b6f9111ff00dcc26075b95b220b07f2905d8261740c82f7f02fa- kramdown-parser-gfm (1.1.0) sha256=fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729- language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0- launchy (3.1.1) sha256=72b847b5cc961589dde2c395af0108c86ff0119f42d4648d25b5440ebb10059e- license_finder (7.2.1) sha256=179ead19b64b170638b72fd16024233813673ac9d20d5ba75ae0b4444887ef14- lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87- logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203- loofah (2.25.2) sha256=2007f746959ac65552456e04b433e83deb22759ab38c838b4445c70e43425918- mail (2.9.1) sha256=06574eca475253d6c18145dd70af80d0eb970182d55053497c5f4d797ea160e8- marcel (1.2.1) sha256=1678e9360e32f9eafa917c80029e2f6d10b2715c66a4b87b6d0da9b9cd1f859f- meilisearch (0.33.0) sha256=a5d3c3f28cdc4394ee4f0f390efe158650f99cfb390fd073f44fc780a2aa41e2- method_source (1.1.0) sha256=181301c9c45b731b4769bc81e8860e72f9161ad7d66dd99103c9ab84f560f5c5- mini_magick (5.3.3) sha256=b3beed8a8cef36bd03666365f14b89cd344da0ecd373af53e617c71bfd426aab- mini_mime (1.1.5) sha256=8681b7e2e4215f2a159f9400b5816d85e9d8c6c6b491e96a12797e798f8bccef- minitest (6.0.6) sha256=153ea36d1d987a62942382b61075745042a2b3123b1cd48f4c3675af9cc7d6f1- mobility (1.3.2) sha256=32fbbb0e53118ef42de20daa6ac94dbb758c628874092eba311b968a1e1d757b- mobility-actiontext (1.1.1) sha256=98f8fb9f2d8aa49fce1814eefb2ad8060efdfb89167bc5bd864da0bdd858127d- mobility-ransack (1.2.2) sha256=8b480ce5bc4937abc37c17b9922d7e41b8a7064a3207b3a64e5aa71e0cb3332b- monetize (1.13.0) sha256=0c1f8ae28aa21bbf1a6d014138d9bb0a5ce756c1a99b8b7f7d409c258b01d3b3- money (6.19.0) sha256=ec936fa1e42f2783719241ed9fd52725d0efa628f928feea1eb5c37d5de7daf3- multi_xml (0.9.1) sha256=7ce766b59c17241ed62976caeae1fae9b2431b263398c35396239a68c4a64e57- name_of_person (1.1.3) sha256=e12291250987ef79c413314f698f15d53e7a602c42231de99c276ef9585bc18c- net-imap (0.6.6) sha256=96aa4ee50df3060203e649efc341f53480b791d49e150f2fdebf68beb141a8df- net-pop (0.1.2) sha256=848b4e982013c15b2f0382792268763b748cce91c9e91e36b0f27ed26420dff3- net-protocol (0.2.2) sha256=aa73e0cba6a125369de9837b8d8ef82a61849360eba0521900e2c3713aa162a8- net-smtp (0.5.1) sha256=ed96a0af63c524fceb4b29b0d352195c30d82dd916a42f03c62a3a70e5b70736- nio4r (2.7.5) sha256=6c90168e48fb5f8e768419c93abb94ba2b892a1d0602cb06eef16d8b7df1dca1- nokogiri (1.19.4-aarch64-linux-gnu) sha256=1269fb644a6de405057a53dd5c762b1209b43ca7424f839454d3dbc677c31a8f- nokogiri (1.19.4-aarch64-linux-musl) sha256=35c65b9ce72b3bb03207bdbe7067915019dc18c1b9b59139684bd6690fdd01af- nokogiri (1.19.4-arm-linux-gnu) sha256=a301313e38bb065d68239e79734bcd6f56fb6efaacebde29e9abf2a4735340ca- nokogiri (1.19.4-arm-linux-musl) sha256=588923c101bcfa78869734d247d25b598674323e7f22474fc468f6e5647311eb- nokogiri (1.19.4-arm64-darwin) sha256=a46db9853286e6597b36ebc6953817d15acf3a299583eb3f89fdc6f91dd63527- nokogiri (1.19.4-x86_64-darwin) sha256=7fd17057d3e1f00e9954a74b3cd76595d3d4a5ef233b7ed9599047c204f70551- nokogiri (1.19.4-x86_64-linux-gnu) sha256=379fae440b28915e3f19d752ce2dcf8465ed2b2fbefd2a7ca0dd497bc981a06a- nokogiri (1.19.4-x86_64-linux-musl) sha256=17dfb7c1fa194ae02fbf7c51a7afc8d278045ab3fdacfd86f91d02d7b274470b- observer (0.1.2) sha256=d8a3107131ba661138d748e7be3dbafc0d82e732fffba9fccb3d7829880950ac- oj (3.17.5) sha256=2f2150c335f53d19350394bcbb3d3d5de1a65f19963908d10c969cb27477efa2- open3 (0.2.1) sha256=8e2d7d2113526351201438c1aa35c8139f0141c9e8913baa007c898973bf3952- ostruct (0.6.3) sha256=95a2ed4a4bd1d190784e666b47b2d3f078e4a9efda2fccf18f84ddc6538ed912- pagy (43.6.1) sha256=59fb6a58ea956480094a167b43a86796638ceb3a3917a25ae67973b584ace2eb- parallel (2.1.0) sha256=b35258865c2e31134c5ecb708beaaf6772adf9d5efae28e93e99260877b09356- parallel_tests (5.7.0) sha256=3f1762c46ca2c223b8af8ef877217f9d76974e191bfa934f2580b58bcf1d005c- paranoia (3.1.0) sha256=36574a46e8df663d0da7d9008e987b72a6a9eccee13c058b7094acc810e39f52- parlour (9.1.2) sha256=446ce24243e125f0e8c4f9b5722c3b86063d42d8b106c847a7d73a8cc693c382- parser (3.3.12.0) sha256=21a6d7f755d5a24dfbdc6e6b772e4e879a52e7631a88bc5a3a134606052c9828- phonelib (0.10.23) sha256=a3bb88e3e5b1e51d7f6d7e58e3d97aebb792df8c2e174565770561eed50d340f- pp (0.6.4) sha256=dfcb0fce700c41456265922884f9fe195d7fbb0674a3578e6c0f69588e82b570- prettyprint (0.2.0) sha256=2bc9e15581a94742064a3cc8b0fb9d45aae3d03a1baa6ef80922627a0766f193- prism (1.9.0) sha256=7b530c6a9f92c24300014919c9dcbc055bf4cdf51ec30aed099b06cd6674ef85- pry (0.16.0) sha256=d76c69065698ed1f85e717bd33d7942c38a50868f6b0673c636192b3d1b6054e- pry-byebug (3.12.0) sha256=594e094ae8a8390a7ad4c7b36ae36e13304ed02664c67417d108dc5f7213d1b7- psych (5.4.0) sha256=14f72d69a611af663d7d70e4a7b67d9eb1f3ae9f8d916b478961d5a0075ba5b7- public_suffix (7.0.5) sha256=1a8bb08f1bbea19228d3bed6e5ed908d1cb4f7c2726d18bd9cadf60bc676f623- puma (8.0.2) sha256=c8ed871dfbbe66448ea9ffd46692342d9804d4071522b52b5331b7b6e7b686fb- racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f- rack (3.2.6) sha256=5ed78e1f73b2e25679bec7d45ee2d4483cc4146eb1be0264fc4d94cb5ef212c2- rack-session (2.1.2) sha256=595434f8c0c3473ae7d7ac56ecda6cc6dfd9d37c0b2b5255330aa1576967ffe8- rack-test (2.2.0) sha256=005a36692c306ac0b4a9350355ee080fd09ddef1148a5f8b2ac636c720f5c463- rackup (2.3.1) sha256=6c79c26753778e90983761d677a48937ee3192b3ffef6bc963c0950f94688868- rails (8.1.3.1) sha256=ccd11a36bfc171bf9c66d585d14c0ece91c0c9dde840aae60c0118d6f5c9c52a- rails-controller-testing (1.0.5) sha256=741448db59366073e86fc965ba403f881c636b79a2c39a48d0486f2607182e94- rails-dom-testing (2.3.0) sha256=8acc7953a7b911ca44588bf08737bc16719f431a1cc3091a292bca7317925c1d- rails-html-sanitizer (1.7.1) sha256=e797a7c9b01e567307e317c576b49ab4168017e63eea4dba9ce3cb587e2f22c2- rails-i18n (8.1.0) sha256=52d5fd6c0abef28d84223cc05647f6ae0fd552637a1ede92deee9545755b6cf3- railties (8.1.3.1) sha256=2388a232579a00cefea4487de66c8553c3408c1300abdc6cf1799d86ffb04487- rainbow (3.1.1) sha256=039491aa3a89f42efa1d6dec2fc4e62ede96eb6acd95e52f1ad581182b79bc6a- rake (13.4.2) sha256=cb825b2bd5f1f8e91ca37bddb4b9aaf345551b4731da62949be002fa89283701- ransack (4.4.1) sha256=6aeaac36fc19088570e10da1044e6cfd88c740e20f871b84566fd30e32b7a63d- rbs (4.1.2) sha256=050eb1d8b508f1233bed929c0f2c7052302f7adf295230d9cb314e9024078f48- rdoc (7.2.0) sha256=8650f76cd4009c3b54955eb5d7e3a075c60a57276766ebf36f9085e8c9f23192- regexp_parser (2.12.0) sha256=35a916a1d63190ab5c9009457136ae5f3c0c7512d60291d0d1378ba18ce08ebb- reline (0.7.0) sha256=5b012d8e55dbf9d450f12bde2cf7d15ff546ae80b3f8f3b30e570d431815583d- request_store (1.7.0) sha256=e1b75d5346a315f452242a68c937ef8e48b215b9453a77a6c0acdca2934c88cb- reverse_markdown (3.0.2) sha256=818ebb92ce39dbb1a291690dd1ec9a6d62530d4725296b17e9c8f668f9a5b8af- rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142- rspec-core (3.13.6) sha256=a8823c6411667b60a8bca135364351dda34cd55e44ff94c4be4633b37d828b2d- rspec-expectations (3.13.5) sha256=33a4d3a1d95060aea4c94e9f237030a8f9eae5615e9bd85718fe3a09e4b58836- rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47- rspec-rails (8.0.4) sha256=06235692fc0892683d3d34977e081db867434b3a24ae0dd0c6f3516bad4e22df- rspec-retry (0.6.2) sha256=6101ba23a38809811ae3484acde4ab481c54d846ac66d5037ccb40131a60d858- rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c- rspec_junit_formatter (0.6.0) sha256=40dde674e6ae4e6cc0ff560da25497677e34fefd2338cc467a8972f602b62b15- rswag-specs (2.17.0) sha256=a3b2bdf6df89f8741fe4a4ee47ceb1e77dc13e1c96bbe07352117d6e61afa9e3- rubocop (1.89.0) sha256=4dee8e3ee9c45e474834efd9e8d6fd031e8331c8dacdff0de4ad65ae0a6faae7- rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db- rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2- ruby-lsp (0.26.10) sha256=e67284af94423531f6b9a583350596421b5a6a4dd93083f1c2ba03da7c23bbed- ruby-lsp-rails (0.4.8) sha256=f09d1f926d4063deeb2f3049311925c20dfe6c912371e3bcd04a265a865c44ae- ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33- ruby-vips (2.3.0) sha256=e685ec02c13969912debbd98019e50492e12989282da5f37d05f5471442f5374- rubyzip (2.4.1) sha256=8577c88edc1fde8935eb91064c5cb1aef9ad5494b940cf19c775ee833e075615- safely_block (1.0.0) sha256=bea80e084e620adeada62fd98cf461bbb9888d40dc0f06d337df9d01e1a658e5- securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1- shoulda-matchers (6.5.0) sha256=ef6b572b2bed1ac4aba6ab2c5ff345a24b6d055a93a3d1c3bfc86d9d499e3f44- simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5- simplecov-cobertura (3.2.0) sha256=70d702658677fcb20e5aceb6915ccf8bc62ff2ccd38b62b3ad5c9db5c0888740- simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246- simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428- solargraph (0.60.3) sha256=3f2252faa27cc628a16a4aac1ba0bc0b06b0250194a8713da0ff42adb20bb19d- sorbet-runtime (0.6.13412) sha256=587ef79b31364b88efd3e809e1b30c72935f1793c735053094a40ff9fa70c91f- sord (7.1.0) sha256=e02fd59294da520e50cea80a07fb9bc93db709c552d055871379ae8d8e87601f- spree (6.0.0.alpha)- spree_api (6.0.0.alpha)- spree_core (6.0.0.alpha)- spree_easypost (6.0.0.alpha)- sqids (0.2.2) sha256=c2d31e0dfb6c32d17c10b59df059a299af93bef716d700ff70d77156df702d36- sqlite3 (2.9.5-aarch64-linux-gnu) sha256=78075b6337d3d182c6d2b4691049ed45cd220826160c9ea18946bf6a1de200dc- sqlite3 (2.9.5-aarch64-linux-musl) sha256=18c801185deb4adc01ddb281e8f672a39e3d1729979ca91e39439cd3eac0402d- sqlite3 (2.9.5-arm-linux-gnu) sha256=1bdfca0c7d63998c60b0f4a8e3c8df2d33800ccc4abd2d612eddbbbc92a4c48b- sqlite3 (2.9.5-arm-linux-musl) sha256=bae1109d12b2e9f588455967729b008e1ff4feb7761749df695019c9079913c6- sqlite3 (2.9.5-arm64-darwin) sha256=d0cf444a70fc9395d513cfbcc1e6719e224aa645314e3824cb0474c721425aa2- sqlite3 (2.9.5-x86_64-darwin) sha256=8e9caae38bd7ebb29cbeee3e7ab1d12dc2327d9a1b92c7fcf0dda05589627a81- sqlite3 (2.9.5-x86_64-linux-gnu) sha256=233dbcb6714148dd23bc5aeb33e8efd6eac974969564ddd5794c23d5f52b231e- sqlite3 (2.9.5-x86_64-linux-musl) sha256=e7d3a7474e8af0f96150c21abc203fbab5437206bfcdf11deab7741c0ca516f2- ssrf_filter (1.5.0) sha256=e03dcdb9d1730d7f6710532a606b3543df2a448a0293ce04a2d995523c5a97f6- state_machines (0.202.0) sha256=20db5367b4541155fc6d764f8ba54182ba6d49ceac7d917598709a61143a16e1- state_machines-activemodel (0.200.0) sha256=c0216f5730b00ee240a6370d59138e8d5d966752089a749ae015410185ec953e- state_machines-activerecord (0.200.0) sha256=a53a1c09b478f05be9385af59e09a7a84a818c6a66651e432bfa4650d5917d85- stringex (2.8.6) sha256=c7b382d2b2a47a1e1646f256df201c48d487d6296fbb289d76802f67f5e929c4- stringio (3.2.0) sha256=c37cb2e58b4ffbd33fe5cd948c05934af997b36e0b6ca6fdf43afa234cf222e1- terminal-table (4.0.0) sha256=f504793203f8251b2ea7c7068333053f0beeea26093ec9962e62ea79f94301d2- thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73- tilt (2.8.0) sha256=ba472eb2716fe1e04112d6d219a9dae938ec09a6a1e2ad3ecc7922e79bde3721- timecop (0.9.11) sha256=41284dc6e5041f2184f781ace766f942108c842f8d8c1386a26e6343decc7542- timeout (0.6.1) sha256=78f57368a7e7bbadec56971f78a3f5ecbcfb59b7fcbb0a3ed6ddc08a5094accb- tomlrb (2.0.4) sha256=262f77947ac3ac9b3366a0a5940ecd238300c553e2e14f22009e2afcd2181b99- tracking_number (2.4.0) sha256=2a4c6b39cbdfc8326c234626556da1e269c8dfe33478786bea93461331c247ff- tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f- typelizer (0.11.0) sha256=6f4bc70c4d4110bae8055d5fe88175f61e2da910c87fc70110f9c9fff5b5c587- tzinfo (2.0.6) sha256=8daf828cc77bcf7d63b0e3bdb6caa47e2272dcfaf4fbfe46f8c3a9df087a829b- unaccent (0.4.0) sha256=d9278230016edc5317c053f8e84c1e1dea6827dec028e5481e2294a4e11e7333- unicode-display_width (3.2.0) sha256=0cdd96b5681a5949cdbc2c55e7b420facae74c4aaf9a9815eee1087cb1853c42- unicode-emoji (4.2.0) sha256=519e69150f75652e40bf736106cfbc8f0f73aa3fb6a65afe62fefa7f80b0f80f- uri (1.1.1) sha256=379fa58d27ffb1387eaada68c749d1426738bd0f654d812fcc07e7568f5c57c6- useragent (0.16.11) sha256=700e6413ad4bb954bb63547fa098dddf7b0ebe75b40cc6f93b8d54255b173844- validates_zipcode (0.6.0) sha256=9f9c10a9c75a14411cea2f65f04fb0089b9f284ebf59faa3e75a9e3d20d1a236- vcr (6.4.0) sha256=077ac92cc16efc5904eb90492a18153b5e6ca5398046d8a249a7c96a9ea24ae6- wannabe_bool (0.7.1) sha256=838ef671066868424de888fb22eeae57c7012709aabd5d17141ea6fea964c61f- webmock (3.26.2) sha256=774556f2ea6371846cca68c01769b2eac0d134492d21f6d0ab5dd643965a4c90- websocket-driver (0.8.2) sha256=97c556b019bf3410b4961002ac501621e9322d3f8a7bc02161a09301cc4c4146- websocket-extensions (0.1.5) sha256=1c6ba63092cda343eb53fc657110c71c754c56484aad42578495227d717a8241- with_env (1.1.0) sha256=50b3e4f0a6cda8f90d8a6bd87a6261f6c381429abafb161c4c69ad4a0cd0b6e4- xml-simple (1.1.9) sha256=d21131e519c86f1a5bc2b6d2d57d46e6998e47f18ed249b25cad86433dbd695d- yaml (0.4.0) sha256=240e69d1e6ce3584d6085978719a0faa6218ae426e034d8f9b02fb54d3471942- yard (0.9.45) sha256=52e211493f7cb8a3ebf7e104a25a1e73937a3103092545d34cb88fafebb3dc51- yard-activesupport-concern (0.0.1) sha256=be790cb0efc23e2e87677063598ac8b743586154657bbd9655a7f03ce78390ef- yard-solargraph (0.1.0) sha256=a19a4619c942181a618fb9458970a9d2534cf7fda69fc43949629a7948a5930e- zeitwerk (2.8.3) sha256=2c85125a8467ce069e20123d1e709a08955c9d29c118c25b46b7b7fafdbb92e5--BUNDLED WITH- 4.0.3diff --git a/spree/providers/easypost/app/models/spree_easypost/delivery_rate_provider.rb b/spree/providers/easypost/app/models/spree_easypost/delivery_rate_provider.rbindex dc3ff845ee..60e6532895 100644--- a/spree/providers/easypost/app/models/spree_easypost/delivery_rate_provider.rb+++ b/spree/providers/easypost/app/models/spree_easypost/delivery_rate_provider.rb@@ -13,9 +13,10 @@ module SpreeEasyPostSpreeEasyPost::PROVIDER_NAMEend- # EasyPost quotes parcel carriers only.- def self.fulfillment_types- ['shipping']+ # EasyPost quotes real parcel shipments, so it only prices methods that+ # ship to an address.+ def self.requires_address?+ trueend# Domestic destination + nominal parcel for the service-listing probe@@ -79,6 +80,7 @@ module SpreeEasyPostrates.map do |rate|Spree::DeliveryRateProvider::Estimate.new(cost: rate.rate,+ currency: rate.currency,carrier: rate.carrier,service_level: rate.service,estimated_delivery_date: rate.delivery_date,diff --git a/spree/providers/easypost/app/models/spree_easypost/fulfillment_provider.rb b/spree/providers/easypost/app/models/spree_easypost/fulfillment_provider.rbindex a55d4f671e..60b4c47ea5 100644--- a/spree/providers/easypost/app/models/spree_easypost/fulfillment_provider.rb+++ b/spree/providers/easypost/app/models/spree_easypost/fulfillment_provider.rb@@ -5,10 +5,6 @@ module SpreeEasyPost# without a label (the admin buys one manually, exactly as with the# Manual provider).class FulfillmentProvider < Spree::FulfillmentProvider::Base- def self.fulfillment_types- ['shipping']- end-def self.integration_class'SpreeEasyPost::Integration'end@@ -101,7 +97,7 @@ module SpreeEasyPostdef remember_purchase(fulfillment, shipment)fulfillment.update_columns(- private_metadata: fulfillment.private_metadata.merge(+ metadata: fulfillment.metadata.merge('easypost_purchased_shipment_id' => shipment.id,'easypost_label_url' => shipment.postage_label&.label_url,'easypost_tracker_url' => shipment.tracker&.public_urldiff --git a/spree/providers/easypost/spec/models/spree_easypost/delivery_rate_provider_spec.rb b/spree/providers/easypost/spec/models/spree_easypost/delivery_rate_provider_spec.rbindex e37c725d07..7f83968317 100644--- a/spree/providers/easypost/spec/models/spree_easypost/delivery_rate_provider_spec.rb+++ b/spree/providers/easypost/spec/models/spree_easypost/delivery_rate_provider_spec.rb@@ -35,11 +35,11 @@ RSpec.describe SpreeEasyPost::DeliveryRateProvider dosubject(:provider) { described_class.new(delivery_method) }let(:ground_rate) do- double(carrier: 'UPS', service: 'Ground', rate: '8.99',+ double(carrier: 'UPS', service: 'Ground', rate: '8.99', currency: 'USD',delivery_date: '2026-08-12', id: 'rate_1', shipment_id: 'shp_1')endlet(:express_rate) do- double(carrier: 'UPS', service: 'Express', rate: '24.99',+ double(carrier: 'UPS', service: 'Express', rate: '24.99', currency: 'USD',delivery_date: '2026-08-08', id: 'rate_2', shipment_id: 'shp_1')endlet(:easypost_shipment) { double(rates: [ground_rate, express_rate]) }diff --git a/spree/providers/easypost/spec/models/spree_easypost/fulfillment_provider_spec.rb b/spree/providers/easypost/spec/models/spree_easypost/fulfillment_provider_spec.rbindex 96b9564435..2d0e40d6ca 100644--- a/spree/providers/easypost/spec/models/spree_easypost/fulfillment_provider_spec.rb+++ b/spree/providers/easypost/spec/models/spree_easypost/fulfillment_provider_spec.rb@@ -37,7 +37,9 @@ RSpec.describe SpreeEasyPost::FulfillmentProvider doit 'registers as a shipping fulfillment provider' doexpect(Spree.fulfillment_providers).to include(described_class)- expect(described_class.fulfillment_types).to eq(['shipping'])+ expect(described_class.digital?).to be false+ expect(described_class.pickup?).to be false+ expect(described_class.new.requires_address?).to be trueexpect(described_class.provider_name).to eq('EasyPost')end@@ -62,7 +64,9 @@ RSpec.describe SpreeEasyPost::FulfillmentProvider doresult = provider.create_fulfillment(fulfillment)expect(result[:tracking_number]).to eq('9405500207552012345678')- expect(fulfillment.metadata['easypost_purchased_shipment_id']).to eq('shp_recorded1')+ # update_columns silently no-ops on an unknown column, so a rename+ # upstream would leave the label details unwritten rather than raise.+ expect(fulfillment.reload.metadata['easypost_purchased_shipment_id']).to eq('shp_recorded1')expect(fulfillment.metadata['easypost_label_url']).to eq('https://example.com/label.png')expect(provider.documents(fulfillment)).to eq([{ kind: 'label', url: 'https://example.com/label.png' }])expect(provider.tracking_url(fulfillment)).to eq('https://track.easypost.com/abc')@@ -125,7 +129,7 @@ RSpec.describe SpreeEasyPost::FulfillmentProvider dobefore { allow_any_instance_of(SpreeEasyPost::Integration).to receive(:client).and_return(client) }it 'refunds the purchased label' do- fulfillment.update_columns(private_metadata: { 'easypost_purchased_shipment_id' => 'shp_recorded1' })+ fulfillment.update_columns(metadata: { 'easypost_purchased_shipment_id' => 'shp_recorded1' })allow(shipment_service).to receive(:refund).with('shp_recorded1').and_return(double)expect(provider.cancel_fulfillment(fulfillment)).to be(true)@@ -137,7 +141,7 @@ RSpec.describe SpreeEasyPost::FulfillmentProvider doendit 'never blocks cancellation on a refund failure' do- fulfillment.update_columns(private_metadata: { 'easypost_purchased_shipment_id' => 'shp_recorded1' })+ fulfillment.update_columns(metadata: { 'easypost_purchased_shipment_id' => 'shp_recorded1' })allow(shipment_service).to receive(:refund).and_raise(StandardError.new('boom'))allow(Rails.error).to receive(:report)@@ -179,7 +183,7 @@ RSpec.describe SpreeEasyPost::FulfillmentProvider doit 'refunds end to end' dofulfillment.update_columns(- private_metadata: { 'easypost_purchased_shipment_id' => recorded_rate['shipment_id'] }+ metadata: { 'easypost_purchased_shipment_id' => recorded_rate['shipment_id'] })VCR.use_cassette('refund_shipment') do